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
fdcf5417
Commit
fdcf5417
authored
May 07, 2019
by
Igor Pecovnik
Browse files
Further improvements when changing kernel and switching beta/stable
parent
a9eea65f
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
fdcf5417
...
...
@@ -348,29 +348,23 @@ function reload_bsp(){
# test install packages
TARGET_BRANCH
=
$BRANCH
exceptions
"
$INSTALL_KERNEL
"
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Probing test install ..."
5 28
unset
PACKAGE_LIST
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
LINUXFAMILY
}
$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
LINUXFAMILY
}
"
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
BOARD
}
$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
BOARD
}
"
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
DISTROID
}
$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
DISTROID
}
"
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
DISTROID
}
-desktop-xfce$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
DISTROID
}
-desktop-xfce"
# if new packages are absent, reinstall old ones
if
[[
-z
$PACKAGE_LIST
]]
;
then
PACKAGE_LIST
=
"linux-
${
DISTROID
}
-root
$TARGET_BRANCH
-
$BOARD
"
check_if_installed armbian-
${
DISTROID
}
-desktop
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
DISTROID
}
-desktop"
fi
# reinstall headers only if they are already installed
check_if_installed linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
"
IFS
=
" "
[[
-n
$(
apt-cache search
--names-only
"^linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
PACKAGE_LIST
=
$PACKAGE_LIST
" linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
"
apt-get
-s
-y
--no-install-recommends
install
$PACKAGE_LIST
>
/tmp/reload_bsp.log 2>&1
# if test download is ok, remove old packages
unset
PACKAGE_LIST
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
LINUXFAMILY
}
$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
LINUXFAMILY
}
"
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
BOARD
}
$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
BOARD
}
"
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
DISTROID
}
$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
DISTROID
}
"
[[
-n
$(
apt-cache search
--names-only
"^armbian-
${
DISTROID
}
-desktop-xfce$"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
DISTROID
}
-desktop-xfce"
# if new packages are absent, reinstall old ones
if
[[
-z
$PACKAGE_LIST
]]
;
then
PACKAGE_LIST
=
"linux-
${
DISTROID
}
-root
$TARGET_BRANCH
-
$BOARD
"
check_if_installed armbian-
${
DISTROID
}
-desktop
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" armbian-
${
DISTROID
}
-desktop"
fi
# reinstall headers only if they are already installed
check_if_installed linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
"
IFS
=
" "
[[
-n
$(
apt-cache search
--names-only
"^linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
" linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
PACKAGE_LIST
=
$PACKAGE_LIST
" linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
"
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_LIST
armbian-config
# if download is ok, remove old packages
if
[[
$?
=
0
]]
;
then
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Removing current kernel ..."
5 36
aptitude remove ~nlinux-image
*${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
...
...
@@ -378,21 +372,19 @@ function reload_bsp(){
aptitude remove ~nlinux-headers
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-
${
DISTROID
}
-root
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-config
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
BOARD
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
DISTROID
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
DISTROID
}
-desktop
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
DISTROID
}
-desktop-xfce
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
LINUXFAMILY
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
BOARD
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
DISTROID
}
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
DISTROID
}
-desktop
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-
${
DISTROID
}
-desktop-xfce
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
# install packages
echo
$PACKAGE_LIST
>>
/var/log/upgrade.log
debconf-apt-progress
--
apt-get
--reinstall
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
\
-y
-qq
--no-install-recommends
install
$PACKAGE_LIST
armbian-config
if
[[
$?
=
1
]]
;
then
echo
"Something went wrong ... check logs."
;
exit
;
fi
dialog
--title
"Switching to
$1
"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
\
--no-label
"Cancel"
--yesno
"
\n
Reboot to apply new settings?"
7 34
if
[[
$?
=
0
]]
;
then
reboot
;
fi
echo
$PACKAGE_LIST
>>
/var/log/upgrade.log
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
if
[[
$?
=
1
]]
;
then
echo
"Something went wrong ... check logs."
;
exit
;
else
dialog
--backtitle
"
$BACKTITLE
"
--title
"Warning"
--msgbox
"
\n
Test install failed. Can't change firmware
\n\n
Check /tmp/reload_bsp.log"
9 48
reboot
fi
fi
}
...
...
@@ -451,7 +443,7 @@ function other_kernel_version ()
TARGET_VERSION_SUB
=
$(
echo
$TARGET_VERSION_DTB
|
cut
-f2
-d
"="
)
[[
-n
$(
apt-cache madison
"
$TARGET_VERSION_PRE
"
|
grep
$TARGET_VERSION_SUB
)
]]
&&
PACKAGE_LIST
=
$PACKAGE_LIST
"
$TARGET_VERSION_DTB
"
echo
$PACKAGE_LIST
>
/tmp/switch_kernel.log 2>&1
apt-get
-s
-
y
--allow-downgrades
--no-install-recommends
install
$PACKAGE_LIST
>>
/tmp/switch_kernel.log 2>&1
debconf-apt-progress
--
apt
--download-onl
y
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_LIST
if
[[
$?
=
0
]]
;
then
# remove old kernel
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Removing current kernel ..."
5 36
...
...
@@ -466,7 +458,7 @@ function other_kernel_version ()
find
"/boot/"
-name
"config*"
-type
f
-delete
find
"/boot/"
-name
"vmlinuz*"
-type
f
-delete
find
"/boot/"
-name
"*nitrd*"
-type
f
-delete
debconf-apt-progress
--
apt
-get
-y
-qq
--allow-downgrades
--no-install-recommends
install
$PACKAGE_LIST
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
install
$PACKAGE_LIST
if
[[
$?
=
0
]]
;
then
reboot
;
fi
else
dialog
--backtitle
"
$BACKTITLE
"
--title
"Warning"
--msgbox
"
\n
Test install failed. Can't change firmware
\n\n
Check /tmp/switch_kernel.log"
9 48
...
...
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