mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 06:26:15 +00:00
Re-add upgrade option
This commit is contained in:
@@ -22,6 +22,7 @@ sudo sh -c "$(wget -O - https://github.com/brentybh/debian-netboot/raw/master/ne
|
|||||||
- `-p <PASSWORD>` Password of the account. If not specified, it will be asked interactively.
|
- `-p <PASSWORD>` Password of the account. If not specified, it will be asked interactively.
|
||||||
- `-z <TIMEZONE>` [Time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). Default is `UTC`.
|
- `-z <TIMEZONE>` [Time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). Default is `UTC`.
|
||||||
- `-t <NTPSERVER>` NTP server. Default is `pool.ntp.org`.
|
- `-t <NTPSERVER>` NTP server. Default is `pool.ntp.org`.
|
||||||
|
- `-g <UPGRADE>` Whether to upgrade packages after debootstrap. Default is `full-upgrade`. `none` and `safe-upgrade` is also available.
|
||||||
- `-s <SECURITY>` Custom URL for security repository mirror. Default is `http://security.debian.org/debian-security`.
|
- `-s <SECURITY>` Custom URL for security repository mirror. Default is `http://security.debian.org/debian-security`.
|
||||||
- `-l` Security mirror linking. If the option present, security repository will be setup as same as the archive mirror instead of `security.debian.org`.
|
- `-l` Security mirror linking. If the option present, security repository will be setup as same as the archive mirror instead of `security.debian.org`.
|
||||||
|
|
||||||
|
|||||||
+9
-2
@@ -67,6 +67,10 @@ while [ $# -gt 0 ]; do
|
|||||||
-l)
|
-l)
|
||||||
LINKED=true
|
LINKED=true
|
||||||
;;
|
;;
|
||||||
|
-g)
|
||||||
|
UPGRADE=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Illegal option $1"
|
echo "Illegal option $1"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -93,6 +97,7 @@ SUITE=${SUITE:-stretch}
|
|||||||
USERNAME=${USERNAME:-debian}
|
USERNAME=${USERNAME:-debian}
|
||||||
TIMEZONE=${TIMEZONE:-UTC}
|
TIMEZONE=${TIMEZONE:-UTC}
|
||||||
NTPSERVER=${NTPSERVER:-pool.ntp.org}
|
NTPSERVER=${NTPSERVER:-pool.ntp.org}
|
||||||
|
UPGRADE=${UPGRADE:-full-upgrade}
|
||||||
LINKED=${LINKED:-false}
|
LINKED=${LINKED:-false}
|
||||||
|
|
||||||
if [ -z "$PASSWORD" ]; then
|
if [ -z "$PASSWORD" ]; then
|
||||||
@@ -129,6 +134,7 @@ cat >> preseed.cfg << EOF
|
|||||||
# TIMEZONE: 5
|
# TIMEZONE: 5
|
||||||
# NTPSERVER: 5
|
# NTPSERVER: 5
|
||||||
# SECURITY: 8
|
# SECURITY: 8
|
||||||
|
# UPGRADE: 9
|
||||||
|
|
||||||
# 1. Localization: COUNTRY
|
# 1. Localization: COUNTRY
|
||||||
|
|
||||||
@@ -196,10 +202,10 @@ d-i apt-setup/services-select multiselect updates
|
|||||||
d-i apt-setup/local0/repository string {{-SECURITY-}} {{-SUITE-}}/updates main
|
d-i apt-setup/local0/repository string {{-SECURITY-}} {{-SUITE-}}/updates main
|
||||||
d-i apt-setup/local0/source boolean true
|
d-i apt-setup/local0/source boolean true
|
||||||
|
|
||||||
# 9. Package selection: TASKS
|
# 9. Package selection: TASKS, UPGRADE
|
||||||
|
|
||||||
tasksel tasksel/first multiselect ssh-server
|
tasksel tasksel/first multiselect ssh-server
|
||||||
d-i pkgsel/upgrade select none
|
d-i pkgsel/upgrade select {{-UPGRADE-}}
|
||||||
popularity-contest popularity-contest/participate boolean false
|
popularity-contest popularity-contest/participate boolean false
|
||||||
|
|
||||||
# 10. Boot loader installation
|
# 10. Boot loader installation
|
||||||
@@ -219,6 +225,7 @@ sed -i 's/{{-PASSWORD-}}/'$(echo "$PASSWORD" | sed 's/\//\\\//g')'/g' preseed.cf
|
|||||||
sed -i 's/{{-TIMEZONE-}}/'$(echo "$TIMEZONE" | sed 's/\//\\\//g')'/g' preseed.cfg
|
sed -i 's/{{-TIMEZONE-}}/'$(echo "$TIMEZONE" | sed 's/\//\\\//g')'/g' preseed.cfg
|
||||||
sed -i 's/{{-NTPSERVER-}}/'"$NTPSERVER"'/g' preseed.cfg
|
sed -i 's/{{-NTPSERVER-}}/'"$NTPSERVER"'/g' preseed.cfg
|
||||||
sed -i 's/{{-SECURITY-}}/'$(echo "$SECURITY" | sed 's/\//\\\//g')'/g' preseed.cfg
|
sed -i 's/{{-SECURITY-}}/'$(echo "$SECURITY" | sed 's/\//\\\//g')'/g' preseed.cfg
|
||||||
|
sed -i 's/{{-UPGRADE-}}/'"$UPGRADE"'/g' preseed.cfg
|
||||||
|
|
||||||
wget "$URL/linux" "$URL/initrd.gz"
|
wget "$URL/linux" "$URL/initrd.gz"
|
||||||
gunzip initrd.gz
|
gunzip initrd.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user