Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
a6d6506e
Commit
a6d6506e
authored
Nov 02, 2019
by
Igor Pecovnik
Browse files
Changing u-boot and BSP when changing kernel
parent
d31f1fea
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
a6d6506e
...
@@ -436,7 +436,6 @@ function other_kernel_version ()
...
@@ -436,7 +436,6 @@ function other_kernel_version ()
# get current kernel information
# get current kernel information
CURRENT_VERSION_TEMP
=
$(
dpkg
-l
|
grep
'^ii'
|
grep
linux-image
)
CURRENT_VERSION_TEMP
=
$(
dpkg
-l
|
grep
'^ii'
|
grep
linux-image
)
CURRENT_VERSION
=
$(
echo
$CURRENT_VERSION_TEMP
|
awk
'{print $2}'
)
"="
$(
echo
$CURRENT_VERSION_TEMP
|
awk
'{print $3}'
)
CURRENT_VERSION
=
$(
echo
$CURRENT_VERSION_TEMP
|
awk
'{print $2}'
)
"="
$(
echo
$CURRENT_VERSION_TEMP
|
awk
'{print $3}'
)
# check what is available from the repository
# check what is available from the repository
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get update
LIST
=(
$(
apt-cache show linux-image
*${
LINUXFAMILY
}
|
grep
-E
"Package:|Version:|version:"
\
LIST
=(
$(
apt-cache show linux-image
*${
LINUXFAMILY
}
|
grep
-E
"Package:|Version:|version:"
\
...
@@ -475,6 +474,13 @@ function other_kernel_version ()
...
@@ -475,6 +474,13 @@ function other_kernel_version ()
exec
3>&-
exec
3>&-
if
[[
$exitstatus
=
0
]]
;
then
if
[[
$exitstatus
=
0
]]
;
then
IFS
=
" "
IFS
=
" "
# determine upgrade packages
UPGRADE_ROOT
=
"default"
UPGRADE_UBOOT
=
""
[[
$TARGET_VERSION
==
*
legacy
*
]]
&&
UPGRADE_ROOT
=
"-legacy"
&&
UPGRADE_UBOOT
=
"legacy"
[[
$TARGET_VERSION
==
*
next
*
]]
&&
UPGRADE_ROOT
=
"-next"
&&
UPGRADE_UBOOT
=
"next"
[[
$TARGET_VERSION
==
*
current
*
]]
&&
UPGRADE_ROOT
=
"-current"
&&
UPGRADE_UBOOT
=
"current"
[[
$TARGET_VERSION
==
*
dev
*
]]
&&
UPGRADE_ROOT
=
"-dev"
&&
UPGRADE_UBOOT
=
"dev"
# install packages
# install packages
PACKAGE_LIST
=
"
$TARGET_VERSION
"
PACKAGE_LIST
=
"
$TARGET_VERSION
"
TARGET_VERSION_DTB
=
${
TARGET_VERSION
/image/dtb
}
TARGET_VERSION_DTB
=
${
TARGET_VERSION
/image/dtb
}
...
@@ -483,11 +489,10 @@ function other_kernel_version ()
...
@@ -483,11 +489,10 @@ function other_kernel_version ()
[[
-n
$(
apt-cache madison
"
$TARGET_VERSION_PRE
"
|
grep
$TARGET_VERSION_SUB
)
]]
&&
\
[[
-n
$(
apt-cache madison
"
$TARGET_VERSION_PRE
"
|
grep
$TARGET_VERSION_SUB
)
]]
&&
\
PACKAGE_LIST
=
$PACKAGE_LIST
"
$TARGET_VERSION_DTB
"
PACKAGE_LIST
=
$PACKAGE_LIST
"
$TARGET_VERSION_DTB
"
echo
$PACKAGE_LIST
>
/tmp/switch_kernel.log 2>&1
echo
$PACKAGE_LIST
>
/tmp/switch_kernel.log 2>&1
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
\
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_LIST
--no-install-recommends
install
$PACKAGE_LIST
if
[[
$?
=
0
]]
;
then
if
[[
$?
=
0
]]
;
then
# remove old kernel
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Removing current kernel ..."
5 36
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Removing current kernel ..."
5 36
# remove old kernel
aptitude remove ~nlinux-image-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-next-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-next-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-dev-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-dev-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
...
@@ -499,7 +504,19 @@ function other_kernel_version ()
...
@@ -499,7 +504,19 @@ function other_kernel_version ()
find
"/boot/"
-name
"config*"
-type
f
-delete
find
"/boot/"
-name
"config*"
-type
f
-delete
find
"/boot/"
-name
"vmlinuz*"
-type
f
-delete
find
"/boot/"
-name
"vmlinuz*"
-type
f
-delete
find
"/boot/"
-name
"*nitrd*"
-type
f
-delete
find
"/boot/"
-name
"*nitrd*"
-type
f
-delete
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
install
$PACKAGE_LIST
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
install
$PACKAGE_LIST
# update u-boot and rootfs
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
linux-u-boot-
${
BOARD
}
-
${
UPGRADE_UBOOT
}
if
[[
$?
=
0
]]
;
then
aptitude remove ~n
$(
dpkg
-l
|
grep
'^ii'
|
grep
linux-u-boot |
awk
'{print $2}'
)
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
install
linux-u-boot-
${
BOARD
}
-
${
UPGRADE_UBOOT
}
fi
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
linux-
${
DISTROID
}
-root
${
UPGRADE_ROOT
}
-
${
BOARD
}
if
[[
$?
=
0
]]
;
then
aptitude remove ~n
$(
dpkg
-l
|
grep
'^ii'
|
grep
linux-
${
DISTROID
}
|
awk
'{print $2}'
)
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
install
linux-
${
DISTROID
}
-root
${
UPGRADE_ROOT
}
-
${
BOARD
}
fi
# clean apt cache
# clean apt cache
apt clean
apt clean
if
[[
$?
=
0
]]
;
then
reboot
;
fi
if
[[
$?
=
0
]]
;
then
reboot
;
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment