Update InstallNET.sh

This commit is contained in:
Molly Lau 2018-10-10 16:03:36 +08:00 committed by GitHub
parent 4f7371bc2d
commit 8a4de67dd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,11 @@
## Suitable for using by GRUB.
## Default root password: Vicer
## Blog: https://zhuanlan.zhihu.com/originaltechnic
## Written By Vicer, modifiedby Molly
## Written By Vicer, modified by MollyLau
export name_server='1.1.1.1'
export tm_zone='Asia/Shanghai'
export tmpVER=''
export tmpDIST=''
export tmpURL=''
@ -595,11 +598,13 @@ $UNCOMP < /tmp/$NewIMG | cpio --extract --verbose --make-directories --no-absolu
if [[ "$linuxdists" == 'debian' ]] || [[ "$linuxdists" == 'ubuntu' ]]; then
cat >/tmp/boot/preseed.cfg<<EOF
# Localization
d-i debian-installer/locale string en_US
d-i console-setup/layoutcode string us
d-i keyboard-configuration/xkb-keymap string us
# Network configuration
d-i netcfg/choose_interface select $IFETH
d-i netcfg/disable_autoconfig boolean true
@ -608,26 +613,30 @@ d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string $IPv4
d-i netcfg/get_netmask string $MASK
d-i netcfg/get_gateway string $GATE
d-i netcfg/get_nameservers string 8.8.8.8
d-i netcfg/get_nameservers string $name_server
d-i netcfg/no_default_route boolean true
d-i netcfg/confirm_static boolean true
d-i hw-detect/load_firmware boolean true
# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string $MirrorHost
d-i mirror/http/directory string $MirrorFolder
d-i mirror/http/proxy string
# Account setup
d-i passwd/root-login boolean ture
d-i passwd/make-user boolean false
d-i passwd/root-password-crypted password $myPASSWORD
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
# Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i time/zone string $tm_zone
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string 0.pool.ntp.org
d-i preseed/early_command string anna-install libfuse2-udeb fuse-udeb ntfs-3g-udeb fuse-modules-${vKernel_udeb}-amd64-di
d-i partman/early_command string \
@ -641,6 +650,7 @@ cp -f '/net.bat' './net.bat'; \
debconf-set grub-installer/bootdev string "\$(list-devices disk |head -n1)"; \
umount /media || true; \
# Partitioning
d-i partman/mount_style select uuid
d-i partman-auto/init_automatically_partition select Guided - use entire disk
d-i partman-auto/method string regular
@ -656,6 +666,7 @@ d-i partman/confirm_nooverwrite boolean true
d-i debian-installer/allow_unauthenticated boolean true
# Package selection
tasksel tasksel/first multiselect minimal
d-i pkgsel/update-policy select none
d-i pkgsel/include string openssh-server
@ -663,13 +674,14 @@ d-i pkgsel/upgrade select none
popularity-contest popularity-contest/participate boolean false
# Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/bootdev string default
d-i finish-install/reboot_in_progress note
d-i debian-installer/exit/reboot boolean true
d-i preseed/late_command string \
sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config; \
sed -ri 's/^#?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config;
sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config; \
EOF
[[ "$setNet" == '0' ]] && [[ "$AutoNet" == '1' ]] && {
@ -755,9 +767,9 @@ text
unsupported_hardware
vnc
skipx
timezone --isUtc Asia/Hong_Kong
timedatectl set-timezone $tm_zone
#ONDHCP network --bootproto=dhcp --onboot=on
#NODHCP network --bootproto=static --ip=$IPv4 --netmask=$MASK --gateway=$GATE --nameserver=8.8.8.8 --onboot=on
#NODHCP network --bootproto=static --ip=$IPv4 --netmask=$MASK --gateway=$GATE --nameserver=$name_server --onboot=on
bootloader --location=mbr --append="rhgb quiet crashkernel=auto"
zerombr
clearpart --all --initlabel