mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 06:26:15 +00:00
Update
This commit is contained in:
@@ -26,7 +26,7 @@ sudo sh -c "$(wget -qO- https://github.com/brentybh/debian-netboot/raw/master/ne
|
|||||||
|
|
||||||
### All Options
|
### All Options
|
||||||
|
|
||||||
- `-c US` Debian Installer Country
|
- `-c CN` ~~Debian Installer Country~~ Only useful for the *Chinese Special* settings
|
||||||
- `-fqdn debian` FQDN including hostname and domain. Priority: `-fqdn` option > rDNS > `debian` as default.
|
- `-fqdn debian` FQDN including hostname and domain. Priority: `-fqdn` option > rDNS > `debian` as default.
|
||||||
- `-proto http` Transport protocol for archive mirror only but not security repository (`http`, `https`, `ftp`)
|
- `-proto http` Transport protocol for archive mirror only but not security repository (`http`, `https`, `ftp`)
|
||||||
- `-host deb.debian.org` Host for archive mirror only but not security repository
|
- `-host deb.debian.org` Host for archive mirror only but not security repository
|
||||||
@@ -47,6 +47,9 @@ sudo sh -c "$(wget -qO- https://github.com/brentybh/debian-netboot/raw/master/ne
|
|||||||
- `-add "ca-certificates curl fail2ban openssl whois"` Include individual additional packages to install
|
- `-add "ca-certificates curl fail2ban openssl whois"` Include individual additional packages to install
|
||||||
- `-ssh secret` Enable network console and specify **password for SSH access during install process**. You can login with `installer` user and check system logs.
|
- `-ssh secret` Enable network console and specify **password for SSH access during install process**. You can login with `installer` user and check system logs.
|
||||||
- `-dry-run` Generate `preseed.cfg` and save to current dir but don't actually do anything
|
- `-dry-run` Generate `preseed.cfg` and save to current dir but don't actually do anything
|
||||||
|
- `-manually` Manually configure user account and disk partition, etc. (Network, repository mirror & time related settings will be auto-configured)
|
||||||
|
- `-arch amd64` Specify architecture (useful under CentOS)
|
||||||
|
- `-lvm` Use `/` as the boot root path for the `grub.cfg` instead of `/boot`, useful under LVM partition disks
|
||||||
|
|
||||||
### Chinese Special
|
### Chinese Special
|
||||||
|
|
||||||
|
|||||||
+30
-27
@@ -89,9 +89,15 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-ssh)
|
-ssh)
|
||||||
|
DEBNETB_SSH=true
|
||||||
DEBNETB_SSH_PASSWD=$2
|
DEBNETB_SSH_PASSWD=$2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-ssh-pubkey)
|
||||||
|
DEBNETB_SSH=true
|
||||||
|
DEBNETB_SSH_PUBKEY=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-fs)
|
-fs)
|
||||||
DEBNETB_FILESYS=$2
|
DEBNETB_FILESYS=$2
|
||||||
shift
|
shift
|
||||||
@@ -155,13 +161,12 @@ fi
|
|||||||
|
|
||||||
if [ "$DEBNETB_MANUALLY" != true ]; then
|
if [ "$DEBNETB_MANUALLY" != true ]; then
|
||||||
if [ -z "$DEBNETB_PASSWD" ]; then
|
if [ -z "$DEBNETB_PASSWD" ]; then
|
||||||
DEBNETB_PASSWD=$(mkpasswd -m sha-512)
|
DEBNETB_PASSWD=$(mkpasswd -m sha-512)
|
||||||
else
|
else
|
||||||
DEBNETB_PASSWD=$(mkpasswd -m sha-512 "$DEBNETB_PASSWD")
|
DEBNETB_PASSWD=$(mkpasswd -m sha-512 "$DEBNETB_PASSWD")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$DEBNETB_DRYRUN" != true ]; then
|
if [ "$DEBNETB_DRYRUN" != true ]; then
|
||||||
DEBNETB_BOOTNAME="debian-$DEBNETB_SUITE"
|
DEBNETB_BOOTNAME="debian-$DEBNETB_SUITE"
|
||||||
if [ "$DEBNETB_ISLVM" = true ]; then
|
if [ "$DEBNETB_ISLVM" = true ]; then
|
||||||
@@ -185,7 +190,6 @@ cd "$DEBNETB_BOOT"
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cat >> preseed.cfg << EOF
|
cat >> preseed.cfg << EOF
|
||||||
# COUNTRY: 1
|
|
||||||
# IP_ADDR: 2
|
# IP_ADDR: 2
|
||||||
# NETMASK: 2
|
# NETMASK: 2
|
||||||
# GATEWAY: 2
|
# GATEWAY: 2
|
||||||
@@ -196,20 +200,18 @@ cat >> preseed.cfg << EOF
|
|||||||
# HOST: 3
|
# HOST: 3
|
||||||
# DIR: 3
|
# DIR: 3
|
||||||
# SUITE: 3, 8
|
# SUITE: 3, 8
|
||||||
# ADMIN: 4
|
# TIME_ZONE: 4
|
||||||
# PASSWD: 4
|
# NTP: 4
|
||||||
# TIME_ZONE: 5
|
# ADMIN: 5
|
||||||
# NTP: 5
|
# PASSWD: 5
|
||||||
# FILESYS: 6
|
# FILESYS: 6
|
||||||
# DISKCRYPTO: 6
|
# DISKCRYPTO: 6
|
||||||
# SECURITY: 8
|
# SECURITY: 8
|
||||||
# INCLUDE: 9
|
# INCLUDE: 9
|
||||||
# UPGRADE: 9
|
# UPGRADE: 9
|
||||||
|
|
||||||
# 1. Localization:
|
# 1. Localization
|
||||||
|
|
||||||
d-i debian-installer/language string en
|
|
||||||
d-i debian-installer/country string {{-COUNTRY-}}
|
|
||||||
d-i debian-installer/locale string en_US.UTF-8
|
d-i debian-installer/locale string en_US.UTF-8
|
||||||
d-i keyboard-configuration/xkb-keymap select us
|
d-i keyboard-configuration/xkb-keymap select us
|
||||||
|
|
||||||
@@ -246,11 +248,16 @@ cat >> preseed.cfg << EOF
|
|||||||
d-i hw-detect/load_firmware boolean true
|
d-i hw-detect/load_firmware boolean true
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -n "$DEBNETB_SSH_PASSWD" ]; then
|
if [ "$DEBNETB_SSH" = true ]; then
|
||||||
echo "d-i anna/choose_modules string network-console" >> preseed.cfg
|
echo "d-i anna/choose_modules string network-console" >> preseed.cfg
|
||||||
echo "d-i preseed/early_command string anna-install network-console" >> preseed.cfg
|
echo "d-i preseed/early_command string anna-install network-console" >> preseed.cfg
|
||||||
echo "d-i network-console/password password $DEBNETB_SSH_PASSWD" >> preseed.cfg
|
if [ -n "$DEBNETB_SSH_PASSWD" ]; then
|
||||||
echo "d-i network-console/password-again password $DEBNETB_SSH_PASSWD" >> preseed.cfg
|
echo "d-i network-console/password password $DEBNETB_SSH_PASSWD" >> preseed.cfg
|
||||||
|
echo "d-i network-console/password-again password $DEBNETB_SSH_PASSWD" >> preseed.cfg
|
||||||
|
fi
|
||||||
|
if [ -n "$DEBNETB_SSH_PUBKEY" ]; then
|
||||||
|
echo "d-i network-console/authorized_keys_url string $DEBNETB_SSH_PUBKEY" >> preseed.cfg
|
||||||
|
fi
|
||||||
echo "d-i network-console/start select Continue" >> preseed.cfg
|
echo "d-i network-console/start select Continue" >> preseed.cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -265,19 +272,8 @@ d-i mirror/{{-PROTO-}}/directory string {{-DIR-}}
|
|||||||
d-i mirror/{{-PROTO-}}/proxy string
|
d-i mirror/{{-PROTO-}}/proxy string
|
||||||
d-i mirror/suite string {{-SUITE-}}
|
d-i mirror/suite string {{-SUITE-}}
|
||||||
d-i mirror/udeb/suite string {{-SUITE-}}
|
d-i mirror/udeb/suite string {{-SUITE-}}
|
||||||
EOF
|
|
||||||
|
|
||||||
if [ "$DEBNETB_MANUALLY" != true ]; then
|
# 4. Clock and time zone setup: TIME_ZONE, NTP
|
||||||
cat >> preseed.cfg << EOF
|
|
||||||
|
|
||||||
# 4. Account setup: ADMIN, PASSWD
|
|
||||||
|
|
||||||
d-i passwd/root-login boolean false
|
|
||||||
d-i passwd/user-fullname string
|
|
||||||
d-i passwd/username string {{-ADMIN-}}
|
|
||||||
d-i passwd/user-password-crypted password {{-PASSWD-}}
|
|
||||||
|
|
||||||
# 5. Clock and time zone setup: TIME_ZONE, NTP
|
|
||||||
|
|
||||||
d-i clock-setup/utc boolean true
|
d-i clock-setup/utc boolean true
|
||||||
d-i time/zone string {{-TIME_ZONE-}}
|
d-i time/zone string {{-TIME_ZONE-}}
|
||||||
@@ -285,8 +281,16 @@ d-i clock-setup/ntp boolean true
|
|||||||
d-i clock-setup/ntp-server string {{-NTP-}}
|
d-i clock-setup/ntp-server string {{-NTP-}}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ "$DEBNETB_MANUALLY" != true ]; then
|
||||||
cat >> preseed.cfg << EOF
|
cat >> preseed.cfg << EOF
|
||||||
|
|
||||||
|
# 5. Account setup: ADMIN, PASSWD
|
||||||
|
|
||||||
|
d-i passwd/root-login boolean false
|
||||||
|
d-i passwd/user-fullname string
|
||||||
|
d-i passwd/username string {{-ADMIN-}}
|
||||||
|
d-i passwd/user-password-crypted password {{-PASSWD-}}
|
||||||
|
|
||||||
# 6. Partitioning: FILESYS
|
# 6. Partitioning: FILESYS
|
||||||
|
|
||||||
d-i partman-basicfilesystems/no_swap boolean false
|
d-i partman-basicfilesystems/no_swap boolean false
|
||||||
@@ -349,7 +353,6 @@ d-i finish-install/reboot_in_progress note
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i 's/{{-COUNTRY-}}/'"$DEBNETB_COUNTRY"'/g' preseed.cfg
|
|
||||||
sed -i 's/{{-PROTO-}}/'"$DEBNETB_PROTO"'/g' preseed.cfg
|
sed -i 's/{{-PROTO-}}/'"$DEBNETB_PROTO"'/g' preseed.cfg
|
||||||
sed -i 's/{{-HOST-}}/'"$DEBNETB_HOST"'/g' preseed.cfg
|
sed -i 's/{{-HOST-}}/'"$DEBNETB_HOST"'/g' preseed.cfg
|
||||||
sed -i 's/{{-DIR-}}/'$(echo "$DEBNETB_DIR" | sed 's/\//\\\//g')'/g' preseed.cfg
|
sed -i 's/{{-DIR-}}/'$(echo "$DEBNETB_DIR" | sed 's/\//\\\//g')'/g' preseed.cfg
|
||||||
|
|||||||
Reference in New Issue
Block a user