X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FFAIBASE%2F10-misc;h=926b5f0275c50c223b2b55e84fa41a2abdc9603d;hb=a69dd442e7381deaec866989a4944efa4f73a8c3;hp=2df59448f2db1db403237580b54d62e74b96d25e;hpb=056eb4e90e13b2d8f7cbb8c3b875f35bf0fa207e;p=automated-distro-installer diff --git a/fai/config/scripts/FAIBASE/10-misc b/fai/config/scripts/FAIBASE/10-misc index 2df5944..926b5f0 100755 --- a/fai/config/scripts/FAIBASE/10-misc +++ b/fai/config/scripts/FAIBASE/10-misc @@ -6,20 +6,19 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code echo $TIMEZONE > $target/etc/timezone if [ -L $target/etc/localtime ]; then - ln -sf /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime + fai-link /etc/localtime /usr/share/zoneinfo/${TIMEZONE} else cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime fi +if [ -f $target/etc/hosts.orig ]; then + mv $target/etc/hosts.orig $target/etc/hosts +fi if [ -n "$IPADDR" ]; then ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME" 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 @@ -28,6 +27,10 @@ chown -c root:root $target/root # copy default dotfiles for root account fcopy -ir /root +# use tmpfs for /tmp if not defined in disk_config +if ! grep -Pq '\s/tmp\s' $target/etc/fstab; then + ainsl /etc/fstab "tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0" +fi chmod -c 1777 ${target}/tmp chown -c 0:0 ${target}/tmp