diff --git a/README b/README index 180533ca1..a81005565 100644 --- a/README +++ b/README @@ -53,4 +53,4 @@ Institut fuer Informatik mailto:lange@informatik.Uni-Koeln.DE 4096R/074BCDE4 B11E E327 3F6B 2DEB 528C 93DA 2BF8 D9FE 074B CDE4 ---------------------------------------------------------------------- -Copyright (c) 1999-2015 Thomas Lange. All rights reserved. +Copyright (c) 1999-2016 Thomas Lange. All rights reserved. diff --git a/bin/dhcp-edit b/bin/dhcp-edit index 5af1cfa95..a80b89fa7 100755 --- a/bin/dhcp-edit +++ b/bin/dhcp-edit @@ -58,7 +58,7 @@ if ($opt_r) { # grep all lines if the entry already exists foreach (@dhcpd) { next if /^\s*#/; # do not change comments - merror(7,"$hostname already exists in dhcpd.conf") if m/host\s+$hostname\b/; + merror(7,"$hostname already exists in dhcpd.conf") if m/host\s+$hostname\s/; merror(7,"MAC address $mac already exists in dhcpd.conf") if m/hardware\s+ethernet\s+$mac[\s+;]/i; } } diff --git a/bin/fai b/bin/fai index 6d9357152..43f87b24f 100755 --- a/bin/fai +++ b/bin/fai @@ -5,7 +5,7 @@ # fai -- main installation script executed after booting # # This script is part of FAI (Fully Automatic Installation) -# (c) 1999-2015 by Thomas Lange, lange@informatik.uni-koeln.de +# (c) 1999-2016 by Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # (c) 2001-2005 by Henning Glawe, glaweh@physik.fu-berlin.de # Freie Universitaet Berlin @@ -99,6 +99,7 @@ fai_init() { if [ $do_init_tasks -eq 1 ]; then eval_cmdline + define_fai_flags [ -d /sys/kernel ] || mount -t sysfs sysfs /sys # we really need to start udev if [ -x /etc/init.d/udev ]; then @@ -108,7 +109,7 @@ fai_init() { test -f /etc/init/udevtrigger.conf && udevadm trigger --action=add && udevadm settle fi fi - mkdir -p /var/run/network /dev/shm/network # when using initrd kernels + mkdir -p /var/run/sshd /var/run/network /dev/shm/network # when using initrd kernels ifup lo [ -x /sbin/portmap ] && /sbin/portmap if [ -x /sbin/rpcbind ]; then @@ -146,7 +147,7 @@ fai_init() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - usage() { cat <<-EOF - fai $FAI_VERSION. Copyright (C) 1999-2015 Thomas Lange + fai $FAI_VERSION. Copyright (C) 1999-2016 Thomas Lange Usage: $0 [options] [action] Options: diff --git a/bin/fai-chboot b/bin/fai-chboot index e2e5d27a6..f58ceef25 100755 --- a/bin/fai-chboot +++ b/bin/fai-chboot @@ -5,7 +5,7 @@ # fai-chboot -- manage configuration for network boot # # This script is part of FAI (Fully Automatic Installation) -# Copyright (C) 2003-2015 Thomas Lange, lange@informatik.uni-koeln.de +# Copyright (C) 2003-2016 Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # #********************************************************************* @@ -467,7 +467,8 @@ if ($opt_i || $opt_s) { if ($opt_i) { my $bopt; - $bopt="aufs"; + -d "$nfsroot/lib/modules/$kernelsuffix/kernel/fs/aufs" and $bopt="aufs"; + -d "$nfsroot/lib/modules/$kernelsuffix/kernel/fs/overlayfs" and $bopt="rootovl"; # create config so host will boot the install kernel $kernelname = "kernel ${opt_U}vmlinuz-$kernelsuffix"; diff --git a/bin/fai-deps b/bin/fai-deps index 29dfe2c1c..bde261cc6 100755 --- a/bin/fai-deps +++ b/bin/fai-deps @@ -16,7 +16,7 @@ fai-deps uses files $FAI/class/*.deps to sort the classes in $LOGDIR/FAI_CLASSES and define additional ones. While doing so, it retains the original order as much as possible. -*.deps files may contain class names, seperated by whitespace. Comments ( after # or ; ) are ignored +*.deps files may contain class names, separated by whitespace. Comments ( after # or ; ) are ignored e.g. you have a class WORDPRESS that depends on the classes VHOST and POSTGRES . VHOST again may depend on WEBSERVER. So if you want to install the blogging software wordpress, you add a file @@ -48,7 +48,7 @@ One non-standard perl module is required: Graph::Directed; On debian install libgraph-perl -The following enviroment variables are used: +The following environment variables are used: $LOGDIR : path to fai temporary files $FAI : path to fai config space diff --git a/bin/fai-make-nfsroot b/bin/fai-make-nfsroot index 80f0416e6..d2de243be 100755 --- a/bin/fai-make-nfsroot +++ b/bin/fai-make-nfsroot @@ -5,7 +5,7 @@ # fai-make-nfsroot -- create nfsroot directory and add additional packages # # This script is part of FAI (Fully Automatic Installation) -# (c) 2000-2015 by Thomas Lange, lange@informatik.uni-koeln.de +# (c) 2000-2016 by Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # (c) 2004 by Henning Glawe, glaweh@physik.fu-berlin.de # Freie Universitaet Berlin @@ -32,7 +32,7 @@ usage() { cat <<-EOF - Copyright (C) 1999-2015 Thomas Lange + Copyright (C) 1999-2016 Thomas Lange Usage: fai-make-nfsroot [OPTIONS] Create an NFSROOT for FAI. @@ -384,7 +384,7 @@ EOF echo 'hostonly="no"' > $NFSROOT/etc/dracut.conf.d/20-generic-image.conf cat < $NFSROOT/etc/dracut.conf.d/01-omit.conf omit_dracutmodules+=" btrfs lvm resume usrmount mdraid shutdown dracut-systemd systemd systemd-initrd systemd-networkd systemd-initrd " -filesystems="aufs nfs lockd ext4" +filesystems="nfs lockd ext4" EOF local fname=$(readlink -f $cfdir/apt/sources.list) @@ -409,8 +409,8 @@ EOF set_root_pw # set timezone in nfsroot - cp -H /etc/timezone etc/timezone - cp -H /etc/localtime etc/localtime + cp -fH /etc/timezone etc/timezone + cp -a /etc/localtime etc/localtime ln -sf /proc/mounts etc/mtab [ -f etc/init/tty1.conf ] || ln -s /usr/sbin/fai etc/init.d/rcS @@ -498,6 +498,7 @@ umount_dirs() { if [ -n "$FAI_DEBMIRROR" ]; then test -d $NFSROOT/$MNTPOINT && umount $NFSROOT/$MNTPOINT || true + rmdir $MNTPOINT || true fi # show directories still mounted on nfsroot mount | grep " on $NFSROOT " || true diff --git a/bin/ftar b/bin/ftar index 2832caeb9..a8e0c480e 100755 --- a/bin/ftar +++ b/bin/ftar @@ -5,7 +5,7 @@ # ftar -- extract tar files using FAI classes # # This script is part of FAI (Fully Automatic Installation) -# Copyright (C) 2001-2015 Thomas Lange, lange@informatik.uni-koeln.de +# Copyright (C) 2001-2016 Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # #********************************************************************* @@ -65,7 +65,7 @@ usage() { cat < @@ -79,6 +79,7 @@ our @commands = qw/y2i y2r zypper zypper-rm yast rpmr urpmi urpme yumgroup yumi "clean-internal" => "apt-get clean", "aptitude" => "aptitude -R $aptopt install", "aptitude-r" => "aptitude -r $aptopt install", + "apt" => "apt $aptopt install", "cupt" => "cupt -R $aptopt install", "cupt-r" => "cupt $aptopt install", "unpack" => "cd $downloaddir; aptitude download", @@ -133,7 +134,7 @@ foreach (@classes) { } # check if any Debian related commands/types are used in package_config -my @debiantypes= qw/taskinst cupt cupt-r aptitude aptitude-r install remove dselect-upgrade smarti/; +my @debiantypes= qw/taskinst cupt cupt-r apt aptitude aptitude-r install remove dselect-upgrade smarti/; foreach my $dt (@debiantypes) { $types{$dt} and $hasdebian=1; } @@ -191,7 +192,7 @@ foreach $atype (@commands) { next; } - if ($atype eq "install" || $atype eq "smarti" || $atype eq "cupt"|| $atype eq "cupt-r"|| $atype eq "aptitude" || $atype eq "aptitude-r" || $atype eq "unpack" || $opt_l || $opt_L) { + if ($atype eq "install" || $atype eq "smarti" || $atype eq "cupt"|| $atype eq "cupt-r"|| $atype eq "apt" || $atype eq "aptitude" || $atype eq "aptitude-r" || $atype eq "unpack" || $opt_l || $opt_L) { mkpackagelist(@{$list{$atype}}); # create lists of known and unknown packages getsources(); # retrieve sources @@ -522,6 +523,7 @@ $maxpl=9999; %command = ( "install" => "apt-get $qopt -d $ENV{aptoptions} -y --fix-missing install", "taskinst" => "aptitude -d $ENV{aptoptions} -y install $devnull", + "apt" => "apt -d $ENV{aptoptions} -y install $devnull", "aptitude" => "aptitude -R -d $ENV{aptoptions} -y install $devnull", "aptitude-r" => "aptitude -r -d $ENV{aptoptions} -y install $devnull", "cupt" => "cupt -R --download-only $ENV{aptoptions} -y install $devnull", diff --git a/bin/setup-storage b/bin/setup-storage index 8fd9c9ba9..02f4ed9d5 100755 --- a/bin/setup-storage +++ b/bin/setup-storage @@ -116,6 +116,7 @@ if ($FAI::debug) { print "disklist: "; print "$_\n" foreach(@FAI::disks); } +die "No disks defined in \$disklist\n" unless (@FAI::disks); # the config source file my $config_file = undef; diff --git a/conf/NFSROOT b/conf/NFSROOT index 6956e7a6d..29240d533 100644 --- a/conf/NFSROOT +++ b/conf/NFSROOT @@ -2,7 +2,7 @@ PACKAGES install -nfs-common fai-nfsroot module-init-tools ssh rdate lshw rpcbind +nfs-common fai-nfsroot ssh rdate lshw rpcbind rsync lftp less dump reiserfsprogs e2fsprogs usbutils hwinfo psmisc pciutils hdparm smartmontools parted mdadm lvm2 dnsutils ntpdate dosfstools xfsprogs xfsdump btrfs-tools @@ -10,9 +10,9 @@ procinfo numactl dialog console-common kbd iproute2 netselect moreutils udev subversion xz-utils -cupt pxelinux syslinux-common # in jessie we need both -curl wget- libpsl0- libicu52- +curl wget- libpsl0- +libicu52- # jessie only nmap emacs24-nox @@ -21,7 +21,7 @@ firmware-bnx2 firmware-bnx2x firmware-realtek #firmware-linux-nonfree # dracut replaces live-boot and initramfs-tools -dracut-network live-boot- initramfs-tools- +dracut-network dracut live-boot- initramfs-tools- dracut-config-generic # this is not available in plain Debian jessie @@ -30,7 +30,6 @@ dracut-config-generic # this is not available in plain Debian jessie #git # git consumes a lot of disk space on the FAI CD -PACKAGES install DEBIAN_8 sysvinit-core systemd-sysv- PACKAGES install I386 diff --git a/conf/grub.cfg b/conf/grub.cfg index 092b4f453..9178ccf24 100644 --- a/conf/grub.cfg +++ b/conf/grub.cfg @@ -59,28 +59,28 @@ menuentry " Username/password to start the installation: fai/install " - menuentry "" --unrestricted { set gfxpayload=$resolution } -menuentry "FAI client standalone installation - select installation type from menu " --users "fai" { +menuentry "Client standalone installation - select installation type from menu " --users "fai" { set gfxpayload=$resolution - linux /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp + linux /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp quiet initrd /boot/initrd.img } menuentry "FAI server installation - using external DHCP" --users "fai" { set gfxpayload=$resolution - linux /boot/vmlinuz FAI_FLAGS="verbose,createvt" FAI_ACTION=install hostname=faiserver FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp + linux /boot/vmlinuz FAI_FLAGS="verbose,createvt" FAI_ACTION=install hostname=faiserver FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp quiet initrd /boot/initrd.img } menuentry "FAI server installation - using a fixed IP" { set gfxpayload=$resolution - linux /boot/vmlinuz FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.33.250::192.168.33.1:255.255.255.0:faiserver:eth0:off FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD + linux /boot/vmlinuz FAI_FLAGS="verbose,createvt" FAI_ACTION=install ip=192.168.33.250::192.168.33.1:255.255.255.0:faiserver:eth0:off FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD quiet initrd /boot/initrd.img } -menuentry "FAI rescue system, no installation" --unrestricted { +menuentry "Rescue system, no installation" --unrestricted { set gfxpayload=$resolution - linux /boot/vmlinuz FAI_FLAGS="verbose,createvt" FAI_ACTION=sysinfo FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD + linux /boot/vmlinuz FAI_FLAGS="verbose,createvt" FAI_ACTION=sysinfo FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD quiet initrd /boot/initrd.img } diff --git a/conf/grub.cfg.autodiscover b/conf/grub.cfg.autodiscover index f6bfb3cb3..a1bfec68f 100644 --- a/conf/grub.cfg.autodiscover +++ b/conf/grub.cfg.autodiscover @@ -57,7 +57,7 @@ menuentry "" --unrestricted { menuentry "Autodiscover the FAI server" { set gfxpayload=$resolution - linux /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" fai.discover aufs root=/dev/nfs ip=dhcp quiet + linux /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" fai.discover aufs rootovl root=/dev/nfs ip=dhcp quiet initrd /boot/initrd.img } diff --git a/debian/changelog b/debian/changelog index ea283ddc5..8c93ab1da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,36 @@ +fai (5.1) unstable; urgency=low + + [ Thomas Lange ] + * add support for 4.x kernel using overlayfs and dracut >= 044+150-1 + * dhcp-edit: fix regex + * NFSROOT: add dracut-core, remove cupt, module-init-tools + * fai-mount-disk: use glob instead of backtick + * fai-make-nfsroot: force some cp calls, adding aufs is not needed in + config + * fai-chboot: automatic test if aufs or overlayfs is needed + * grub.cfg.autodiscover: use aufs and rootovl + * add support for sftp, scp, https to get-config-dir + * install_packages: ad support for apt + * start sshd if flag is defined early + * ftar: syntax fix, do not use FAI_CLASSES if -c is used + * subroutines: remove unsuded code in task_faiend() + * get-boot-info: match new network device names, remove unneeded code + * add lvm support to CentOS 7, improve CentOS 6 + * control: new package name in Suggests + * grub.cfg: add queit to cmdline + + [ Andrew bezella ] + * instsoft.DEBIAN: fix regex + * do not change hostname during dirinstall, ignore md/lvm during + dirinstall + * write /etc/network/interfaces also on dirinstal + * DEBIAN.var: fix syntax error + + [ remy.d1@gmail.com ] + * mk-basefile: add xenial support + + -- Thomas Lange Tue, 28 Jun 2016 10:31:25 +0200 + fai (5.0.3) unstable; urgency=low [ Thomas Lange ] diff --git a/debian/control b/debian/control index 68c610e83..df6b2fbc0 100644 --- a/debian/control +++ b/debian/control @@ -41,7 +41,7 @@ Package: fai-server Architecture: all Depends: fai-client, debootstrap, xz-utils, ${misc:Depends} Recommends: nfs-kernel-server, isc-dhcp-server, tftpd-hpa | atftpd, openssh-server, openssh-client, openbsd-inetd | inet-superserver, libproc-daemon-perl -Suggests: debmirror, reprepro, xorriso, squashfs-tools, binutils, grub, aptitude, perl-tk +Suggests: debmirror, reprepro, xorriso, squashfs-tools, binutils, grub2, aptitude, perl-tk Description: Fully Automatic Installation server package FAI is a non-interactive system to install, customize and manage Linux systems and software configurations on computers as well as diff --git a/doc/fai-guide.txt b/doc/fai-guide.txt index 8d8f7bc4c..c40c00277 100644 --- a/doc/fai-guide.txt +++ b/doc/fai-guide.txt @@ -5,7 +5,7 @@ FAI Guide (Fully Automatic Installation) ======================================== Thomas Lange -Sun, 22 Nov 2015 +Sun, 23 Jun 2016 :Date: a date :Revision: 5.0 @@ -2205,10 +2205,11 @@ name of your package to /etc/fai/NFSROOT. Then call - Can I use a 4.X kernel? + -Currently FAI has no support for a 4.x kernel, because aufs file -system support was replaced by overlayfs. But overlayfs is not -working when using NFS. FAI will switch to overlayfs if the NFS -problems are solved. +Yes. Have a look at +https://lists.uni-koeln.de/pipermail/linux-fai/2016-March/011283.html + +FAI will switch to overlayfs in the near future, since the NFS +problems are now solved. - How to use the nfsrooot as system for diskless clients? + diff --git a/examples/simple/basefiles/mk-basefile b/examples/simple/basefiles/mk-basefile index 6eb29dbf4..591a87836 100755 --- a/examples/simple/basefiles/mk-basefile +++ b/examples/simple/basefiles/mk-basefile @@ -10,7 +10,7 @@ # Supported distributions (each i386/amd64): # Debian GNU/Linux -# Ubuntu 14.04 +# Ubuntu 14.04/16.04 # CentOS 5/6/7 # Scientific Linux Cern 5/6 # @@ -31,6 +31,7 @@ EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data EXCLUDE_WHEEZY=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data EXCLUDE_JESSIE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data EXCLUDE_TRUSTY=dhcp3-client,dhcp3-common,info +EXCLUDE_XENIAL=isc-dhcp-client,isc-dhcp-common,udhcpc,dibbler-client,dhcpcd5,info,tasksel,tasksel-data INCLUDE_DEBIAN=aptitude @@ -197,6 +198,16 @@ trusty() { tarit } +xenial() { + + local arch=$1 + + check + debootstrap --arch $arch --exclude=${EXCLUDE_XENIAL} --include=${INCLUDE_DEBIAN} xenial $xtmp ${MIRROR_UBUNTU} + cleanup-deb + tarit +} + unknown() { @@ -208,7 +219,9 @@ unknown() { CENTOS7_32 CENTOS7_64 SLC5_32 SLC5_64 SLC6_32 SLC6_64 + SLC7_64 TRUSTY32 TRUSTY64 + XENIAL32 XENIAL64 SQUEEZE32 SQUEEZE64 WHEEZY32 WHEEZY64 JESSIE32 JESSIE64 @@ -251,8 +264,11 @@ case "$target" in SLC5_64) slc amd64 5 ;; SLC6_32) slc i386 6 ;; SLC6_64) slc amd64 6 ;; + SLC7_64) slc amd64 7 ;; TRUSTY32) trusty i386 ;; TRUSTY64) trusty amd64 ;; + XENIAL32) xenial i386 ;; + XENIAL64) xenial amd64 ;; SQUEEZE32) squeeze i386 ;; SQUEEZE64) squeeze amd64 ;; WHEEZY32) wheezy i386 ;; diff --git a/examples/simple/class/DEBIAN.var b/examples/simple/class/DEBIAN.var index 37cbe7a15..a6fb66b6b 100644 --- a/examples/simple/class/DEBIAN.var +++ b/examples/simple/class/DEBIAN.var @@ -9,7 +9,7 @@ MODULESLIST="usbhid psmouse" # if you have enough RAM (>2GB) you may want to enable this line. It # also puts /var/cache into a ramdisk. -#FAI_RAMDISKS:="$target/var/lib/dpkg $target/var/cache" +#FAI_RAMDISKS="$target/var/lib/dpkg $target/var/cache" # if you want to use the faiserver as APT proxy #APTPROXY=http://faiserver:3142 diff --git a/examples/simple/hooks/instsoft.DEBIAN b/examples/simple/hooks/instsoft.DEBIAN index f036e2adc..c503a047d 100755 --- a/examples/simple/hooks/instsoft.DEBIAN +++ b/examples/simple/hooks/instsoft.DEBIAN @@ -8,7 +8,7 @@ if [ $FAI_ACTION != "install" ]; then fi fcopy -Bi /etc/apt/apt.conf.d/force_confdef -ainsl -av /etc/ucf.conf "conf_force_conffold=YES" +ainsl -av /etc/ucf.conf "^conf_force_conffold=YES" install_packages -l 2>/dev/null | egrep -q ' locales|locales ' if [ $? -eq 0 ]; then diff --git a/examples/simple/hooks/setup.DEFAULT.sh b/examples/simple/hooks/setup.DEFAULT.sh index 711fa7f76..bd9c3be89 100755 --- a/examples/simple/hooks/setup.DEFAULT.sh +++ b/examples/simple/hooks/setup.DEFAULT.sh @@ -2,4 +2,10 @@ # use short hostname instead of FQDN export HOSTNAME=${HOSTNAME%%.*} -echo $HOSTNAME > /proc/sys/kernel/hostname +# n.b. use $action instead of $FAI_ACTION +# as the latter is apparently unset at this point in dirinstall +if [ "$action" = "dirinstall" ] ; then + : +else + echo $HOSTNAME > /proc/sys/kernel/hostname +fi diff --git a/examples/simple/package_config/CENTOS b/examples/simple/package_config/CENTOS index 96f871988..a4ea3e04d 100644 --- a/examples/simple/package_config/CENTOS +++ b/examples/simple/package_config/CENTOS @@ -9,7 +9,7 @@ gnome-desktop # CentOS 7 PACKAGES yumi authconfig kernel -# grub # CentOS 5 and 6 +# sysvinit-tools grub # CentOS 5 and 6 grub2 # CentOS 7 less openssh @@ -26,3 +26,6 @@ pakchois ncurses-base # currently missing in the base file #sendmail # only for C5 and C6 + +PACKAGES yumi LVM +lvm2 diff --git a/examples/simple/scripts/CENTOS/30-mkinitrd b/examples/simple/scripts/CENTOS/30-mkinitrd index 89357b91f..cd114f9c1 100755 --- a/examples/simple/scripts/CENTOS/30-mkinitrd +++ b/examples/simple/scripts/CENTOS/30-mkinitrd @@ -42,6 +42,11 @@ if [ -f $target/sbin/mkinitrd ]; then use_mkinitrd fi +if [ -f $target/etc/lvm/lvm.conf ]; then + sed -i -e 's/use_lvmetad = 1/use_lvmetad = 0/' $target/etc/lvm/lvm.conf + ainsl -av /etc/dracut.conf.d/fai.conf 'add_dracutmodules+=" lvm "' +fi + # call dracut for CentOS 7 if [ -f $target/usr/sbin/dracut ]; then # add filesystem driver into initrd @@ -49,6 +54,11 @@ if [ -f $target/usr/sbin/dracut ]; then $ROOTCMD dracut -v --kver $version --force fi -# for CentOS 6 we do not need to call dracut +# call dracut for CentOS 6 +if [ -f $target/sbin/dracut ]; then + # add filesystem driver into initrd + ainsl -av /etc/dracut.conf.d/fai.conf 'filesystems+="ext4"' + $ROOTCMD dracut -v $version +fi exit $error diff --git a/examples/simple/scripts/DEBIAN/30-interface b/examples/simple/scripts/DEBIAN/30-interface index c3fbeaabe..9883731fd 100755 --- a/examples/simple/scripts/DEBIAN/30-interface +++ b/examples/simple/scripts/DEBIAN/30-interface @@ -2,7 +2,7 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code -if ifclass DHCPC && [ $FAI_ACTION = "install" ] +if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] then cat > $target/etc/network/interfaces <<-EOF # generated by FAI @@ -10,7 +10,7 @@ then iface lo inet loopback iface $NIC1 inet dhcp EOF -elif [ $FAI_ACTION = "install" ] +elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] then [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF # generated by FAI diff --git a/examples/simple/scripts/LAST/50-misc b/examples/simple/scripts/LAST/50-misc index 62c31db7b..25b6ce7e2 100755 --- a/examples/simple/scripts/LAST/50-misc +++ b/examples/simple/scripts/LAST/50-misc @@ -4,20 +4,24 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code -# check if mdadm has been forgotten -if grep -q active /proc/mdstat 2>/dev/null; then +if [ "$FAI_ACTION" = "dirinstall" ] ; then + : +else + # check if mdadm has been forgotten + if grep -q active /proc/mdstat 2>/dev/null; then if [ ! -d $target/etc/mdadm ]; then echo ERROR: Found Software RAID, but the mdadm package was not installed error=1 fi -fi + fi -usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l) -if [ $usedm -ne 0 ]; then + usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l) + if [ $usedm -ne 0 ]; then if [ ! -d $target/etc/lvm ]; then echo ERROR: Found lvm devices, but the lvm2 package was not installed error=1 fi + fi fi # remove backup files from cfengine, but only if cfengine is installed diff --git a/lib/fai-mount-disk b/lib/fai-mount-disk index 620aa9181..d9c45ef6c 100755 --- a/lib/fai-mount-disk +++ b/lib/fai-mount-disk @@ -24,7 +24,7 @@ mount_local_disks() { fstabcount=0 [ "$1" = "rw" ] && mountoption=$1 - for disk in `ls /dev/disk/by-uuid/*`; do + for disk in /dev/disk/by-uuid/*; do type=$(blkid -sTYPE $disk) [[ "$type" =~ "swap" ]] && continue dev=$(readlink -e $disk) diff --git a/lib/get-boot-info b/lib/get-boot-info index 81d48100c..e8f63498d 100755 --- a/lib/get-boot-info +++ b/lib/get-boot-info @@ -5,7 +5,7 @@ # bootinfo -- get boot information via DHCP protocol # # This script is part of FAI (Fully Automatic Installation) -# (c) 2003-2014 by Thomas Lange, lange@informatik.uni-koeln.de +# (c) 2003-2016 by Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # #********************************************************************* @@ -39,10 +39,7 @@ netdevice_info() { # if not defined, use boot messages to determine network devices [ -n "$netdevices" ] || netdevices=$netdevices_up - # some network driver do not echo eth0,..; they are not detected - netdevices_all=$(dmesg| perl -ne 'print $&,"\n" if m/\beth[0-9]+\b/') - tmp=$(ip link | grep "^[1-9]" | cut -d : -f 2 | cut -d ' ' -f 2 | grep "^eth") - netdevices_all="$netdevices_all $tmp" + netdevices_all=$(ip link | grep "^[1-9]" | cut -d : -f 2 | cut -d ' ' -f 2 | egrep "^eth|^en") netdevices_all=$(for dev in $netdevices_all; do echo $dev; done| sort | uniq| tr '\n' ' ') } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/get-config-dir-https b/lib/get-config-dir-https new file mode 120000 index 000000000..e87bf4b2b --- /dev/null +++ b/lib/get-config-dir-https @@ -0,0 +1 @@ +get-config-dir-http \ No newline at end of file diff --git a/lib/get-config-dir-scp b/lib/get-config-dir-scp new file mode 120000 index 000000000..e87bf4b2b --- /dev/null +++ b/lib/get-config-dir-scp @@ -0,0 +1 @@ +get-config-dir-http \ No newline at end of file diff --git a/lib/get-config-dir-sftp b/lib/get-config-dir-sftp new file mode 120000 index 000000000..e87bf4b2b --- /dev/null +++ b/lib/get-config-dir-sftp @@ -0,0 +1 @@ +get-config-dir-http \ No newline at end of file diff --git a/lib/prcopyleft b/lib/prcopyleft index 64c11e905..4681ca736 100755 --- a/lib/prcopyleft +++ b/lib/prcopyleft @@ -3,7 +3,7 @@ #********************************************************************* # # This script is part of FAI (Fully Automatic Installation) -# (c) 2003-2015 by Thomas Lange, lange@informatik.uni-koeln.de +# (c) 2003-2016 by Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # #********************************************************************* @@ -17,7 +17,7 @@ _prcopyleft() { ------------------------------------------------- Fully Automatic Installation - FAI - $FAI_VERSION (c) 1999-2015 + $FAI_VERSION (c) 1999-2016 Thomas Lange ------------------------------------------------- EOF diff --git a/lib/subroutines b/lib/subroutines index db63be78c..4b8e12eb5 100755 --- a/lib/subroutines +++ b/lib/subroutines @@ -320,7 +320,6 @@ task_setup() { } # start secure shell daemon for remote access - mkdir -p /var/run/sshd # ubuntu fix for 9.10 if [ "$flag_sshd" -a -x /usr/sbin/sshd ]; then pgrep -x sshd >/dev/null || /usr/sbin/sshd fi @@ -567,40 +566,6 @@ task_faiend() { mount -o remount,ro $dir done - # if we run from CD or USB stick and did not any installation - if [ -d /lib/live/mount/medium -a X$FAI_ACTION = Xsysinfo ]; then - reboot -dfi - fi - - # check if we are running from CD, live-boot - cddev=$(mount |grep /lib/live/mount/medium | awk '{print $1}') - if [[ $cddev =~ '/dev/sr' ]]; then - echo 1 > /proc/sys/dev/cdrom/autoeject - cat > /tmp/rebootCD <<'EOF' -#! /bin/bash - device=$1 -eject -m /dev/$device 2>/dev/null >/dev/null -echo "Remove CDROM and press to continue reboot" -read -eject -t /dev/$device 2>/dev/null >/dev/null -EOF - - #reboot or halt? - if [ "$flag_halt" -gt "0" ]; then - echo "exec halt -dfp" >> /tmp/rebootCD - else - echo "exec reboot -df" >> /tmp/rebootCD - fi - chmod +x /tmp/rebootCD - [ -d $target/tmp ] && mv /tmp/rebootCD $target/tmp/rebootCD - - sync - cdromdevice=$(awk '/ name:/ {print $3}' /proc/sys/dev/cdrom/info) - - chroot $target /tmp/rebootCD $cdromdevice - # never reached, because chroot will reboot the machine - die "Internal error when calling /tmp/rebootCD." >&2 - fi umount $FAI_ROOT/proc $FAI_ROOT/sys $FAI_ROOT/dev/pts 2>/dev/null umount -arf 2>/dev/null @@ -610,7 +575,6 @@ EOF else exec reboot -df fi - } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - task_install() { diff --git a/man/ainsl.1 b/man/ainsl.1 index f5b2445ce..579126fc2 100644 --- a/man/ainsl.1 +++ b/man/ainsl.1 @@ -26,7 +26,7 @@ Since ainsl is written in Perl, you can use Perl's regular expressions in PATTERN. If PATTERN is not given, LINE is used instead for matching a line in FILE. Then LINE may also contain the anchors '^' and '$' which are only treated specialy at the beginning or end of the pattern and -are used for matching, not when adding the line. Additionaly, +are used for matching, not when adding the line. Additionally, the following characters are escaped in LINE: ( ) + The exit code returned by ainsl is 0 on success and non-zero @@ -72,7 +72,7 @@ prefix for the filename. This is used in FAI for changing files in ainsl \-v /etc/fstab '/dev/fd0 /floppy auto users,noauto 0 0' Append the entry for the floppy device to /etc/fstab, if this line -isn't already inlcuded. +isn't already included. ainsl \-s /etc/exports '/srv/www @linuxhosts(async,rw) backup(async,ro)' diff --git a/man/fai-chboot.8 b/man/fai-chboot.8 index 058e54d83..daaad9902 100644 --- a/man/fai-chboot.8 +++ b/man/fai-chboot.8 @@ -66,7 +66,7 @@ Disable the PXE configuration for the specific HOST. This renames the config fil the suffix .disable to it, making PXE boot fall back to the default. .TP .B \-e -Reenable network booting for HOST. This renames the config file removing +Re-enable network booting for HOST. This renames the config file removing the suffix .disable from it, so the next time it uses its own PXE configuration. .TP .B \-E diff --git a/man/fai-class.1 b/man/fai-class.1 index 1ffa9d653..0b699e87b 100644 --- a/man/fai-class.1 +++ b/man/fai-class.1 @@ -52,7 +52,7 @@ kernel command line. Finally, the class with the hostname and LAST are defined. -It's important that each line in a file containg a class name ends +It's important that each line in a file containing a class name ends with a newline. If the newline is missing on the last line of a file, this class can't be added. diff --git a/man/fai-debconf.1 b/man/fai-debconf.1 index 8f6e63e08..256dfb157 100644 --- a/man/fai-debconf.1 +++ b/man/fai-debconf.1 @@ -40,7 +40,7 @@ Skip reconfiguration of packages. Only set values in debconf database. Create verbose output. .TP .B \-d -Add additional debuging output. Implies the -v option. +Add additional debugging output. Implies the -v option. .TP .B \-f Run dpkg\-reconfigure for all packages FAI has information on, not only for diff --git a/man/fai-monitor.8 b/man/fai-monitor.8 index ff45db635..1213f8618 100644 --- a/man/fai-monitor.8 +++ b/man/fai-monitor.8 @@ -47,7 +47,7 @@ format) and replies to request from clients if they have the format: VARIABLE . For e.g. if the clients sends "VARIABLE FAI_VERSION", fai-monitor will reply with OK and the value of this variable (e.g. "OK 4.5.6") if this variable is defined, otherwise it will reply -with UNKNOW and repeats the VARNAME (e.g. "UNKNOWN FAI_VERSION"). +with UNKNOWN and repeats the VARNAME (e.g. "UNKNOWN FAI_VERSION"). .SH SEE ALSO .br This program is part of FAI (Fully Automatic Installation). See the FAI manual diff --git a/man/fai.conf.5 b/man/fai.conf.5 index baab4c0ea..def3f57be 100644 --- a/man/fai.conf.5 +++ b/man/fai.conf.5 @@ -78,16 +78,12 @@ git repository, host can be empty. Also supported is git+http. .IP \(bu Mercurial: hg+(http|https):// .IP \(bu -HTTP: http:/// -where is a (compressed) tar archive. For verification purposes, also -an -.BR md5sum (1) -generated hash must exist at the same location as .md5. - -The config space will be downloaded from the given location via HTTP. -Furthermore +path/tarfile.md5+ will be downloaded and the md5sum will be -checked. +tarfile+ will be extracted by ftar(8), and thus needs to have -a recognized suffix, such as .tar.gz or tar.xz. +HTTP: (http|https|scp|sftp):/// +where is a (compressed) tar archive. + +The config space will be downloaded from the given location via the +specified protocol. will be extracted by ftar(8), and thus +needs to have a recognized suffix, such as .tar.gz or tar.xz. .TP diff --git a/man/setup-storage.8 b/man/setup-storage.8 index 7f03af0d9..ead76e8c9 100644 --- a/man/setup-storage.8 +++ b/man/setup-storage.8 @@ -1,4 +1,4 @@ -.TH setup-storage 8 "October 23, 2011" "Debian/GNU Linux" +.TH setup-storage 8 "October 23, 2011" "Debian GNU/Linux" .SH NAME \fBsetup-storage\fP \- automatically prepare storage devices @@ -379,7 +379,7 @@ entirety are used to create the / RAID. The third and fourth disks are used to create the /home RAID. .IP \(bu Note that each BTRFS RAID must contain an initial subvolume. This is -necessary to use advanced BTRFS features such as snapshots. The intial +necessary to use advanced BTRFS features such as snapshots. The initial subvolume name is taken from the subvol mountoption. In the above example those would be @/ and @home. Subvolume names begin with an @ by convention.