3 # (c) Thomas Lange, 2001-2012, lange@debian.org
5 error
=0; trap 'error=$(($?>$error?$?:$error))' ERR
# save maximum error code
7 echo $TIMEZONE > $target/etc
/timezone
8 if [ -L $target/etc
/localtime
]; then
9 fai-link
/etc
/localtime
/usr
/share
/zoneinfo
/${TIMEZONE}
11 cp -f /usr
/share
/zoneinfo
/${TIMEZONE} $target/etc
/localtime
14 if [ -f $target/etc
/hosts.orig
]; then
15 mv $target/etc
/hosts.orig
$target/etc
/hosts
17 if [ -n "$IPADDR" ]; then
18 ifclass DHCPC || ainsl
-s /etc
/hosts
"$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
20 ifclass DHCPC
&& ainsl
-s /etc
/hosts
"127.0.0.1 $HOSTNAME"
22 fcopy
-iM /etc
/hosts
/etc
/motd
24 # make /root accessible only by root
25 chmod -c 0700 $target/root
26 chown
-c root
:root
$target/root
27 # copy default dotfiles for root account
30 # use tmpfs for /tmp if not defined in disk_config
31 if ! grep -Pq '\s/tmp\s' $target/etc
/fstab
; then
32 ainsl
/etc
/fstab
"tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0"
34 chmod -c 1777 ${target}/tmp
35 chown
-c 0:0 ${target}/tmp