File: debconf.IMAGE

package info (click to toggle)
fai 6.5.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,080 kB
  • sloc: sh: 6,721; perl: 5,625; makefile: 138
file content (45 lines) | stat: -rwxr-xr-x 1,597 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/bash

# hook for installing a file system image (tar file)
# this works for Ubuntu 14.04
#
# Copyright (C) 2015 Thomas Lange, lange@cs.uni-koeln.de


# I use this tar command to create the image of an already running and configured machine
# tar -cf /tmp/IMAGE.tar --exclude /tmp/\* --exclude /run/\* --exclude /proc/\* --exclude /sys/\* --exclude /dev/\* /
# add --xattrs --selinux --acls if needed (for CentOS 7)
# Then copy this image to /srv/fai/config/basefiles/IMAGE.tar and make sure your client belongs to the class IMAGE

skiptask extrbase debconf repository updatebase instsoft
skiptask configure  # do not run the usual configure scripts

# we assume, that the new host will get its hostname and IP via DHCP
# remove old hostname
fgrep -v 127.0.1.1 $target/etc/hosts >> /tmp/fai/hosts
mv /tmp/fai/hosts $target/etc/hosts
rm $target/etc/hostname

#install grub
mount -t proc   proc   $FAI_ROOT/proc
mount -t sysfs  sysfs  $FAI_ROOT/sys
mount --bind    /dev   $FAI_ROOT/dev

if [ -f $target/etc/debian_version ]; then
    $ROOTCMD grub-install $BOOT_DEVICE
    $ROOTCMD update-grub
fi
if [ -f $target/etc/centos-release ]; then
    rm $target/etc/grub2/device.map
    $FAI/scripts/ROCKY/40-install-grub
    $FAI/scripts/ROCKY/30-mkinitrd
    $ROOTCMD fixfiles onboot # this fixes the SELinux security contexts during the first boot
fi


# things that may be adjusted:
#
# MAC address ?? (not needed for Ubuntu, it uses iftab(5)
# /etc/hosts may contain the IP and name of the original host
# /etc/hostname (for Ubuntu just remove it)
# /var/lib/NetworkManager/dhclient-eth0.conf?