3 # copyright Thomas Lange 2001-2015, lange@debian.org
5 error
=0; trap 'error=$(($?>$error?$?:$error))' ERR
# save maximum error code
7 if [ "$FAI_ACTION" = "dirinstall" ] ; then
10 # check if mdadm has been forgotten
11 if grep -q active
/proc
/mdstat
2>/dev
/null
; then
12 if [ ! -d $target/etc
/mdadm
]; then
13 echo ERROR
: Found Software RAID
, but the mdadm package was not installed
18 usedm
=$
(dmsetup
ls |
egrep -v '^live-rw|^live-base|^No devices found' |
wc -l)
19 if [ $usedm -ne 0 ]; then
20 if [ ! -d $target/etc
/lvm
]; then
21 echo ERROR
: Found lvm devices
, but the lvm2 package was not installed
27 # remove backup files from cfengine, but only if cfengine is installed
28 if [ -x /usr
/sbin
/cfagent
] ||
[ -x $target/usr
/sbin
/cfagent
] ; then
31 find $target/$path -maxdepth 20 -name \
*.cfedited
-o -name \
*.cfsaved |
xargs -r rm
35 [ "$FAI_DEBMIRROR" ] &&
36 ainsl
/etc
/fstab
"#$FAI_DEBMIRROR $MNTPOINT nfs ro 0 0"
39 if [ $do_init_tasks -eq 1 ] ; then
41 no|
"") hwopt
="--localtime" ;;
44 hwclock $hwopt --systohc || true
47 # Make sure everything is configured properly
48 if ifclass DEBIAN
; then
49 echo "Running \"apt-get -f install\" for the last time."
50 $ROOTCMD apt-get
-f install
53 if [ $FAI_ACTION = "install" ]; then
54 lskernels
=$
(echo $target/boot
/vmlinu
*)
55 [ -f ${lskernels%% *} ] ||
echo "ERROR: No kernel was installed. Have a look at shell.log" >&2
59 fcopy
-iM /etc
/apt
/sources.list