3 # hook for installing a file system image (tar file)
4 # this works for Ubuntu 14.04
6 # Copyright (C) 2015 Thomas Lange, lange@cs.uni-koeln.de
9 # I use this tar command to create the image of an already running and configured machine
10 # tar -cf /tmp/IMAGE.tar --exclude /tmp/\* --exclude /run/\* --exclude /proc/\* --exclude /sys/\* --exclude /dev/\* /
11 # add --xattrs --selinux --acls if needed (for CentOS 7)
12 # Then copy this image to /srv/fai/config/basefiles/IMAGE.tar and make sure your client belongs to the class IMAGE
14 skiptask extrbase debconf repository updatebase instsoft
15 skiptask configure
# do not run the usual configure scripts
17 # we assume, that the new host will get its hostname and IP via DHCP
19 fgrep
-v 127.0.1.1 $target/etc
/hosts
>> /tmp
/fai
/hosts
20 mv /tmp
/fai
/hosts
$target/etc
/hosts
21 rm $target/etc
/hostname
24 mount
-t proc proc
$FAI_ROOT/proc
25 mount
-t sysfs sysfs
$FAI_ROOT/sys
26 mount
--bind /dev
$FAI_ROOT/dev
28 if [ -f $target/etc
/debian_version
]; then
29 $ROOTCMD grub-install
$BOOT_DEVICE
32 if [ -f $target/etc
/centos-release
]; then
33 rm $target/etc
/grub
2/device.map
34 $FAI/scripts
/ROCKY
/40-install-grub
35 $FAI/scripts
/ROCKY
/30-mkinitrd
36 $ROOTCMD fixfiles onboot
# this fixes the SELinux security contexts during the first boot
40 # things that may be adjusted:
42 # MAC address ?? (not needed for Ubuntu, it uses iftab(5)
43 # /etc/hosts may contain the IP and name of the original host
44 # /etc/hostname (for Ubuntu just remove it)
45 # /var/lib/NetworkManager/dhclient-eth0.conf?