update to upstream 5.3.4
[automated-distro-installer] / fai / config / scripts / FAIBASE / 10-misc
index 6394ad2fbb00c79135afab20408bd9e4e398a466..2df59448f2db1db403237580b54d62e74b96d25e 100755 (executable)
@@ -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