Browse Source

configured for DHCP and local preseed.cfg

master
Ubuntu 10 months ago
parent
commit
d445a64bd0
3 changed files with 31 additions and 22 deletions
  1. +8
    -0
      .gitignore
  2. +12
    -11
      create-iso.sh
  3. +11
    -11
      preseed.cfg.template

+ 8
- 0
.gitignore View File

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

+ 12
- 11
create-iso.sh 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/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/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/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

+ 11
- 11
preseed.cfg.template 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

Loading…
Cancel
Save