X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=debian-preseed;h=e3df0dc0af1c9acecac87db9da24e1c147b30d4d;hp=86b4ffd6c212f58aee289036eeb24d6b914a1f54;hb=1b08e82a978c8db76e1ebc67f3b4ae875ba27537;hpb=a43d3eec943c5f0491b300214a3c744d31a6e542 diff --git a/debian-preseed b/debian-preseed index 86b4ffd..e3df0dc 100755 --- a/debian-preseed +++ b/debian-preseed @@ -1,7 +1,8 @@ #!/bin/bash +# Copyright (C) 2016 Ian Kelling set -eE -o pipefail -trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR usage() { cat <>$preseed ;; debian-jessie) @@ -86,23 +87,24 @@ tar xzf netboot.tar.gz # keymap=us is only needed for debian. pxe_cfg=${distro%-*}-installer/amd64/boot-screens/txt.cfg -sed -ri "s#^[[:space:]]*append[[:space:]]#\0auto priority=critical locale=en_US.UTF-8 netcfg/choose_interface=auto url=tftp://$ip/example-preseed.txt keymap=us#" $pxe_cfg +sed="sed -ri --follow-symlinks" +$sed "s#^[[:space:]]*append[[:space:]]#\0auto priority=critical locale=en_US.UTF-8 netcfg/choose_interface=auto url=tftp://$ip/example-preseed.txt keymap=us#" $pxe_cfg # various google results say timeout x will result in doing the default thing, # but that doesn't happen. no idea why. Maybe it needed to be part of the label. echo 'totaltimeout 1' | tee -a $pxe_cfg if $interactive_partition; then - sed -ri 's/^d-i[[:space:]]partman.*/#\0/' $preseed + $sed 's/^d-i[[:space:]]partman.*/#\0/' $preseed # at least in ubuntu, this does automatic selection of boot device, # and on a server where we setup raid, it choose sda, and failed # and the whole installation could not be salvaged. - sed -ri 's/^d-i[[:space:]]grub-installer.*/#\0/' $preseed + $sed 's/^d-i[[:space:]]grub-installer.*/#\0/' $preseed fi -sed -ri "s#(^d-i time/zone string US/).*#\1Pacific#" $preseed -sed -ri '/^xserver-xorg/,/[^\\$]/ s/.*/#\0/' $preseed +$sed "s#(^d-i time/zone string US/).*#\1Pacific#" $preseed +$sed '/^xserver-xorg/,/[^\\$]/ s/.*/#\0/' $preseed # we set the locale in kernel args. maybe we don't need to. this overrides it. -sed -ri 's!^d-i[[:space:]]debian-installer/locale[[:space:]].*!#\0!' $preseed +$sed 's!^d-i[[:space:]]debian-installer/locale[[:space:]].*!#\0!' $preseed # for secure pass, set the shadow option with mkpasswd -s -m sha-512 < passfile @@ -134,7 +136,7 @@ d-i pkgsel/update-policy select unattended-upgrades d-i preseed/late_command string \ in-target sed -i 's/^%sudo.*$/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' /etc/sudoers; \ in-target mkdir -p /home/$user/.ssh; \ -in-target /bin/sh -c "echo '$(cat ~/.ssh/id_rsa.pub)' >> /home/$user/.ssh/authorized_keys"; \ +in-target /bin/sh -c "echo '$(cat ~/.ssh/home.pub)' >> /home/$user/.ssh/authorized_keys"; \ in-target chown -R $user:$user /home/$user; \ in-target chmod -R go-rwx /home/$user/.ssh/authorized_keys; \ in-target cp -r /home/$user/.ssh /root; \