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
6038d1ea
Commit
6038d1ea
authored
Oct 08, 2018
by
Igor Pecovnik
Browse files
Better way of switching from stable to beta and back
parent
c87cedc8
Changes
2
Show whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
6038d1ea
...
...
@@ -16,6 +16,7 @@
# beta_disclaimer
# show_box
# description
# reload_bsp
# aval_kernel
# aval_dtbs
# get_a20modes
...
...
@@ -297,6 +298,42 @@ function kernel_desc ()
#
# reload kernel, bsp and armbian-config
#
function
reload_bsp
(){
debconf-apt-progress
--
apt-get update
# test install packages
TARGET_BRANCH
=
$BRANCH
exceptions
"
$INSTALL_KERNEL
"
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Test install ..."
5 36
apt-get
-s
-y
-qq
--no-install-recommends
install
linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\
linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
linux-u-boot-
${
BOARD
}
-
${
UBOOT_BRANCH
}
\
linux-
$(
lsb_release
-cs
)
-root
$TARGET_BRANCH
-
$BOARD
>
/dev/null 2>&1
# if test 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
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-dtb
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-headers
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-
$(
lsb_release
-cs
)
-root
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~narmbian-config
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
# install packages
INSTALL_DTB
=
""
[[
-n
$(
apt-cache search
--names-only
"^linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
)
]]
&&
\
INSTALL_DTB
=
"linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
debconf-apt-progress
--
apt-get
--reinstall
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
\
-y
-qq
--no-install-recommends
install
linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\
linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
linux-u-boot-
${
BOARD
}
-
${
UBOOT_BRANCH
}
\
linux-
$(
lsb_release
-cs
)
-root
$TARGET_BRANCH
-
$BOARD
armbian-config
$INSTALL_DTB
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
fi
}
#
# check if board has alternative kernels
...
...
debian-config-jobs
View file @
6038d1ea
...
...
@@ -1266,23 +1266,21 @@ function jobs ()
# Switch to daily builds
#
"Nightly"
)
if
!
is_package_manager_running
;
then
dialog
--colors
--title
"
\Z
1Warning
\Z
0 "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"Cancel"
--yesno
\
dialog
--colors
--title
"
\Z
1Warning
\Z
0 "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
\
--no-label
"Cancel"
--yesno
\
"
\n
You are switching to untested auto-build repository which might break your system.
\n\n
Are you fine with that?"
10 48
if
[[
$?
=
0
]]
;
then
sed
-i
's/apt.armbian.com/beta.armbian.com/'
/etc/apt/sources.list.d/armbian.list
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get
-y
upgrade
dialog
--title
"Switching to nightly"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
\
--no-label
"Cancel"
--yesno
"
\n
Reboot to apply new settings?"
7 34
if
[[
$?
=
0
]]
;
then
reboot
;
fi
reload_bsp
"nightly"
fi
fi
;;
# Switch to stable builds
and reinstall armbian packages
# Switch to stable builds
#
"Stable"
)
...
...
@@ -1290,35 +1288,10 @@ function jobs ()
dialog
--colors
--title
"
\Z
1Warning
\Z
0 "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
\
--no-label
"Cancel"
--yesno
\
"
\n
You are switching back to stable respository where you are going to get future updates. Are you fine with that?"
9 44
if
[[
$?
=
0
]]
;
then
sed
-i
's/beta.armbian.com/apt.armbian.com/'
/etc/apt/sources.list.d/armbian.list
debconf-apt-progress
--
apt-get update
# remove nighlty packages and install stable
TARGET_BRANCH
=
$BRANCH
exceptions
"
$INSTALL_KERNEL
"
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Removing current nightly kernel."
5 36
apt-get
-s
-y
-qq
--no-install-recommends
install
linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\
linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
linux-u-boot-
${
BOARD
}
-
${
UBOOT_BRANCH
}
\
linux-
$(
lsb_release
-cs
)
-root
$TARGET_BRANCH
-
$BOARD
>
/dev/null 2>&1
# if test download is ok, remove old kernel
if
[[
$?
=
0
]]
;
then
aptitude remove ~nlinux-image
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-dtb
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-headers
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
aptitude remove ~nlinux-
$(
lsb_release
-cs
)
-root
--quiet
=
100
-y
>>
/var/log/upgrade.log 2>&1
fi
# install new packages
INSTALL_DTB
=
""
[[
-n
$(
apt-cache search
--names-only
"^linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
)
]]
&&
\
INSTALL_DTB
=
"linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
debconf-apt-progress
--
apt-get
--reinstall
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
\
-y
-qq
--no-install-recommends
install
linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\
linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
linux-u-boot-
${
BOARD
}
-
${
UBOOT_BRANCH
}
\
linux-
$(
lsb_release
-cs
)
-root
$TARGET_BRANCH
-
$BOARD
$INSTALL_DTB
dialog
--title
"Switching to stable"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
--no-label
"Cancel"
--yesno
\
"
\n
Reboot to apply new settings?"
7 34
if
[[
$?
=
0
]]
;
then
reboot
;
fi
reload_bsp
"stable"
fi
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