X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FFAIBASE%2F10-misc;h=fbf85c1efeb23e1acce1d1346adc8d64c3369d96;hb=ee37d990c89bb3bab1b54e3b3fb43e9f79ed039b;hp=6394ad2fbb00c79135afab20408bd9e4e398a466;hpb=3bd65f0ca635f1349626c2393a4dd8a50df64f54;p=automated-distro-installer diff --git a/fai/config/scripts/FAIBASE/10-misc b/fai/config/scripts/FAIBASE/10-misc index 6394ad2..fbf85c1 100755 --- a/fai/config/scripts/FAIBASE/10-misc +++ b/fai/config/scripts/FAIBASE/10-misc @@ -5,7 +5,11 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code echo $TIMEZONE > $target/etc/timezone -cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime +if [ -L $target/etc/localtime ]; then + ln -sf /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime +else + cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime +fi if [ -n "$IPADDR" ]; then ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME" @@ -13,6 +17,9 @@ else ifclass DHCPC && ainsl -s /etc/hosts "127.0.0.1 $HOSTNAME" fi +if [ -f $target/etc/hosts.orig ]; then + mv $target/etc/hosts.orig $target/etc/hosts +fi fcopy -iM /etc/hosts /etc/motd # make /root accessible only by root @@ -21,6 +28,8 @@ chown -c root:root $target/root # copy default dotfiles for root account fcopy -ir /root +# use tmpfs for /tmp +ainsl /etc/fstab "tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0" chmod -c 1777 ${target}/tmp chown -c 0:0 ${target}/tmp