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
b4d4bd82
Commit
b4d4bd82
authored
Apr 08, 2020
by
Igor Pecovnik
Browse files
Improvements on kernel switching
parent
523ce78e
Changes
1
Show whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
b4d4bd82
...
@@ -361,32 +361,53 @@ function reload_bsp(){
...
@@ -361,32 +361,53 @@ function reload_bsp(){
# switch to defined branch
# switch to defined branch
[[
-n
"
$1
"
]]
&&
BRANCH
=
$1
[[
-n
"
$1
"
]]
&&
BRANCH
=
$1
# deal with exceptions
if
[[
$BRANCH
==
current
||
$BRANCH
==
dev
]]
;
then
[[
${
LINUXFAMILY
}
==
rk3399
]]
&&
LINUXFAMILY
=
rockchip64
fi
clear
clear
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get update
# must exits
# must exits
PACKAGE_LIST
=
"linux-dtb-
${
BRANCH
}
-
${
LINUXFAMILY
}
linux-image-
${
BRANCH
}
-
${
LINUXFAMILY
}
"
PACKAGE_INSTALL
=
"linux-image-
${
BRANCH
}
-
${
LINUXFAMILY
}
linux-dtb-
${
BRANCH
}
-
${
LINUXFAMILY
}
"
PACKAGE_PURGE
=
"linux-image* linux-dtb*"
# create install and remove logic
if
[[
-n
$(
apt-cache search
--names-only
"^linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
)
]]
;
then
PACKAGE_INSTALL+
=
" linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
PACKAGE_PURGE+
=
" linux-
${
DISTROID
}
-root*"
fi
if
[[
-n
$(
apt-cache search
--names-only
"^linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
)
]]
;
then
PACKAGE_INSTALL+
=
" linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
PACKAGE_PURGE+
=
" linux-u-boot-
${
BOARD
}
-*"
fi
# optional
if
check_if_installed armbian-
${
DISTROID
}
-desktop
;
then
[[
-n
$(
apt-cache search
--names-only
"^linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
)
]]
&&
PACKAGE_LIST+
=
" linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
PACKAGE_INSTALL+
=
" armbian-
${
DISTROID
}
-desktop"
[[
-n
$(
apt-cache search
--names-only
"^linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
)
]]
&&
PACKAGE_LIST+
=
" linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
PACKAGE_PURGE+
=
" armbian-
${
DISTROID
}
-desktop*"
check_if_installed armbian-
${
DISTROID
}
-desktop
&&
PACKAGE_LIST+
=
" armbian-
${
DISTROID
}
-desktop"
fi
check_if_installed linux-headers-
${
BRANCH
}
-
${
FAMILY
}
&&
PACKAGE_LIST+
=
" linux-headers-
${
BRANCH
}
-
${
FAMILY
}
"
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_LIST
armbian-config
if
check_if_installed linux-headers-
${
BRANCH
}
-
${
FAMILY
}
;
then
PACKAGE_INSTALL+
=
" linux-headers-
${
BRANCH
}
-
${
FAMILY
}
"
PACKAGE_PURGE+
=
" linux-headers*"
fi
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_INSTALL
# if download is ok, remove old packages
# if download is ok, remove old packages
if
[[
$?
=
0
]]
;
then
if
[[
$?
=
0
]]
;
then
debconf-apt-progress
--
apt
-y
-qq
purge
linux-u-boot
*
linux-image
*
linux-dtb
*
linux-headers
*
linux-
${
DISTROID
}
-root
*
armbian-
${
DISTROID
}
-desktop
*
armbian-config
debconf-apt-progress
--
apt
-y
-qq
purge
$PACKAGE_PURGE
find
"/boot/"
-name
"System.map*"
-type
f
-delete
find
"/boot/"
-name
"System.map*"
-type
f
-delete
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
# install packages
# install packages
echo
$PACKAGE_
LIST
>>
/var/log/upgrade.log
echo
$PACKAGE_
INSTALL
>>
/var/log/upgrade.log
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
--reinstall
\
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
--reinstall
\
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
install
$PACKAGE_
LIST
armbian-config
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
install
$PACKAGE_
INSTALL
if
[[
$?
-eq
1
]]
;
then
if
[[
$?
-eq
1
]]
;
then
echo
"Something went wrong ... check logs."
;
exit
;
echo
"Something went wrong ... check logs."
;
exit
;
...
...
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