configured for DHCP and local preseed.cfg

This commit is contained in:
Ubuntu 2020-11-22 10:04:11 +00:00
parent 4357bb406a
commit d445a64bd0
3 changed files with 30 additions and 21 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
grub.backup
ubuntu-*
*.iso
config
preseed.cfg

View File

@ -61,21 +61,22 @@ cp -rT /mnt/ubuntu-overssh-iso $PROJECTPATH/ubuntu-overssh-iso
cp $PROJECTPATH/preseed.cfg.template $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
# replace vairables
sed -i 's/timeout 0/timeout 300/g' $PROJECTPATH/ubuntu-overssh-iso/prompt.cfg
sed -i 's/timeout 0/timeout 300/g' $PROJECTPATH/ubuntu-overssh-iso/isolinux.cfg
sed -i 's/timeout 0/timeout 150/g' $PROJECTPATH/ubuntu-overssh-iso/prompt.cfg
sed -i 's/timeout 0/timeout 150/g' $PROJECTPATH/ubuntu-overssh-iso/isolinux.cfg
sed -i "s/INTERFACE_DEV/$INTERFACE_DEV/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/INTERFACE_IP/$INTERFACE_IP/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/INTERFACE_NAMESERVERS/$INTERFACE_NAMESERVERS/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/INTERFACE_NETMASK/$INTERFACE_NETMASK/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/INTERFACE_GATEWAY/$INTERFACE_GATEWAY/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/INTERFACE_DEV/$INTERFACE_DEV/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/INTERFACE_IP/$INTERFACE_IP/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/INTERFACE_NAMESERVERS/$INTERFACE_NAMESERVERS/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/INTERFACE_NETMASK/$INTERFACE_NETMASK/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/INTERFACE_GATEWAY/$INTERFACE_GATEWAY/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/COUNTRY_LOWER/$COUNTRY_LOWER/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/COUNTRY/$COUNTRY/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/HOSTNAME/$HOSTNAME/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/DOMAIN/$DOMAIN/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/HOSTNAME/$HOSTNAME/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
#sed -i "s/DOMAIN/$DOMAIN/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s/PASSWORD/$PASSWORD/g" $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg
sed -i "s#append #append priority=critical auto=true preseed/url=$PRESEED_URL netcfg/hostname=$HOSTNAME netcfg/domain=$DOMAIN interface=$INTERFACE_DEV netcfg/disable_dhcp=true netcfg/get_ipaddress=$INTERFACE_IP netcfg/get_netmask=$INTERFACE_NETMASK netcfg/get_gateway=$INTERFACE_GATEWAY netcfg/get_nameservers=$INTERFACE_NAMESERVERS #g" $PROJECTPATH/ubuntu-overssh-iso/txt.cfg
sed -i "s#append #append priority=critical auto=true #g" $PROJECTPATH/ubuntu-overssh-iso/txt.cfg
#sed -i "s#append #append priority=critical auto=true preseed/url=$PRESEED_URL netcfg/hostname=$HOSTNAME netcfg/domain=$DOMAIN interface=$INTERFACE_DEV netcfg/disable_dhcp=true netcfg/get_ipaddress=$INTERFACE_IP netcfg/get_netmask=$INTERFACE_NETMASK netcfg/get_gateway=$INTERFACE_GATEWAY netcfg/get_nameservers=$INTERFACE_NAMESERVERS #g" $PROJECTPATH/ubuntu-overssh-iso/txt.cfg
cp $PROJECTPATH/ubuntu-overssh-iso/preseed.cfg $PROJECTPATH/preseed.cfg

View File

@ -2,18 +2,18 @@ d-i debian-installer/locale string en_US
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 netcfg/choose_interface select INTERFACE_DEV
d-i netcfg/choose_interface select auto
d-i netcfg/link_wait_timeout string 1
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string INTERFACE_IP
d-i netcfg/get_netmask string INTERFACE_NETMASK
d-i netcfg/get_gateway string INTERFACE_GATEWAY
d-i netcfg/get_nameservers string INTERFACE_NAMESERVERS
d-i netcfg/confirm_static boolean true
d-i netcfg/hostname string HOSTNAME
d-i netcfg/domain string DOMAIN
#d-i netcfg/disable_autoconfig boolean true
#d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select Configure network manually
#d-i netcfg/get_ipaddress string INTERFACE_IP
#d-i netcfg/get_netmask string INTERFACE_NETMASK
#d-i netcfg/get_gateway string INTERFACE_GATEWAY
#d-i netcfg/get_nameservers string INTERFACE_NAMESERVERS
#d-i netcfg/confirm_static boolean true
#d-i netcfg/hostname string HOSTNAME
#d-i netcfg/domain string DOMAIN
d-i netcfg/wireless_wep string
d-i hw-detect/load_firmware boolean true
d-i anna/choose_modules string network-console