From bc3037fe2075e33b0035fc0689f44a60381638f9 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 2 Sep 2018 18:23:31 -0400 Subject: [PATCH] upstream 00f2ea2b8 as of 2018-09-02 --- fai/config/basefiles/mk-basefile | 40 +++++++++++-------- fai/config/class/41-warning.sh | 12 +++++- fai/config/class/55-classes | 4 -- fai/config/class/DEBIAN.var | 6 ++- fai/config/class/FAIBASE.var | 4 ++ fai/config/class/GCE.var | 4 -- fai/config/debconf/CLOUD | 2 +- fai/config/debconf/GCE | 4 -- fai/config/disk_config/CENTOS | 8 ++-- fai/config/disk_config/CLOUD | 2 +- fai/config/disk_config/FAIBASE | 7 ++-- fai/config/disk_config/LVM | 2 +- fai/config/disk_config/XENIAL | 5 +-- fai/config/files/etc/apt/sources.list/GCE | 7 ---- fai/config/files/etc/apt/sources.list/GNOME | 5 ++- fai/config/files/etc/apt/sources.list/preinst | 23 ----------- .../files/etc/fai/apt/sources.list/FAISERVER | 5 --- .../files/etc/fai/nfsroot.conf/FAISERVER | 2 +- fai/config/files/etc/init.d/expand-root/GCE | 40 ------------------- fai/config/files/etc/rc.local/FAISERVER | 2 +- fai/config/hooks/debconf.IMAGE | 2 +- fai/config/hooks/mountdisks.DEFAULT | 9 +++++ fai/config/hooks/savelog.LAST.sh | 7 +++- fai/config/package_config/DEBIAN | 31 +++++++++----- fai/config/package_config/DEMO | 3 +- fai/config/package_config/FAIBASE | 18 --------- fai/config/package_config/FAISERVER | 3 +- fai/config/package_config/GCE | 28 ------------- fai/config/package_config/GCE.asc | 21 ---------- fai/config/package_config/GERMAN | 2 +- fai/config/package_config/STANDARD | 31 ++++++++++++++ fai/config/package_config/UBUNTU | 7 +--- fai/config/package_config/XORG | 2 +- fai/config/scripts/CENTOS/80-misc | 10 +++-- fai/config/scripts/DEBIAN/10-rootpw | 6 ++- fai/config/scripts/DEBIAN/30-interface | 5 ++- fai/config/scripts/DEBIAN/40-misc | 9 ++--- fai/config/scripts/DEMO/10-misc | 31 ++++++++++---- fai/config/scripts/FAIBASE/10-misc | 2 + fai/config/scripts/FAISERVER/10-conffiles | 4 +- fai/config/scripts/GCE/10-misc | 16 -------- fai/config/scripts/GRUB_PC/05-gce-grub | 6 --- fai/config/scripts/LAST/50-misc | 10 +++-- 43 files changed, 186 insertions(+), 261 deletions(-) delete mode 100755 fai/config/class/55-classes delete mode 100644 fai/config/class/GCE.var delete mode 100644 fai/config/debconf/GCE delete mode 100644 fai/config/files/etc/apt/sources.list/GCE delete mode 100755 fai/config/files/etc/apt/sources.list/preinst delete mode 100644 fai/config/files/etc/fai/apt/sources.list/FAISERVER delete mode 100755 fai/config/files/etc/init.d/expand-root/GCE create mode 100755 fai/config/hooks/mountdisks.DEFAULT delete mode 100644 fai/config/package_config/FAIBASE delete mode 100644 fai/config/package_config/GCE delete mode 100644 fai/config/package_config/GCE.asc create mode 100644 fai/config/package_config/STANDARD delete mode 100755 fai/config/scripts/GCE/10-misc delete mode 100755 fai/config/scripts/GRUB_PC/05-gce-grub diff --git a/fai/config/basefiles/mk-basefile b/fai/config/basefiles/mk-basefile index b93831c..2fc0d2a 100755 --- a/fai/config/basefiles/mk-basefile +++ b/fai/config/basefiles/mk-basefile @@ -2,7 +2,7 @@ # mk-basefile, create basefiles for some distributions # -# Thomas Lange, Uni Koeln, 2011-2017 +# Thomas Lange, Uni Koeln, 2011-2018 # based on the Makefile implementation of Michael Goetze # # Usage example: mk-basefile -J STRETCH64 @@ -24,17 +24,19 @@ MIRROR_DEBIAN=http://deb.debian.org/debian/ MIRROR_UBUNTU=http://mirror.netcologne.de/ubuntu/ MIRROR_CENTOS=http://mirror.netcologne.de/ -EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info,tasksel,tasksel-data -EXCLUDE_WHEEZY=info,tasksel,tasksel-data -EXCLUDE_JESSIE=info,tasksel,tasksel-data -EXCLUDE_STRETCH=info,tasksel,tasksel-data -EXCLUDE_BUSTER=tasksel,tasksel-data +EXCLUDE_SQUEEZE=isc-dhcp-client,isc-dhcp-common,info +EXCLUDE_WHEEZY=info +EXCLUDE_JESSIE=info +EXCLUDE_STRETCH=info +EXCLUDE_BUSTER= +EXCLUDE_SID= EXCLUDE_TRUSTY=dhcp3-client,dhcp3-common,info -EXCLUDE_XENIAL=udhcpc,dibbler-client,info,tasksel,tasksel-data +EXCLUDE_XENIAL=udhcpc,dibbler-client,info +EXCLUDE_BIONIC=udhcpc,dibbler-client,info -# we need aptitude in the base file, since users may want to use it for installing packages -INCLUDE_DEBIAN=aptitude +# here you can add packages, that are needed very early +INCLUDE_DEBIAN= setarch() { @@ -175,8 +177,12 @@ debgeneric() { dist=${dist,,} check + if [ -n "$INCLUDE_DEBIAN" ]; then + local inc="--include=$INCLUDE_DEBIAN" + fi + if [ -n "$arch" ]; then - qemu-debootstrap --arch $arch --exclude=${!exc} --include=${INCLUDE_DEBIAN} $dist $xtmp $mirror + qemu-debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror target="${target}_${arch^^}" else if [[ $DIST =~ 64 ]]; then @@ -184,7 +190,7 @@ debgeneric() { else arch=i386 fi - debootstrap --arch $arch --exclude=${!exc} --include=${INCLUDE_DEBIAN} $dist $xtmp $mirror + debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror fi cleanup-deb tarit @@ -202,11 +208,13 @@ prtdists() { SLC7_64 TRUSTY32 TRUSTY64 XENIAL32 XENIAL64 + BIONIC64 SQUEEZE32 SQUEEZE64 WHEEZY32 WHEEZY64 JESSIE32 JESSIE64 STRETCH32 STRETCH64 BUSTER32 BUSTER64 + SID32 SID64 " } @@ -215,12 +223,11 @@ usage() { cat < $red -dialog --colors --clear --aspect 6 --title "FAI - Fully Automatic Installation" --trim \ +DIALOGRC=$red dialog --colors --clear --aspect 6 --title "FAI - Fully Automatic Installation" --trim \ --msgbox "\n\n If you continue, \n all your data on the disk \n \n|\Zr\Z1 WILL BE DESTROYED \Z0\Zn|\n\n" 0 0 1>$out + +# stop on any error, or if ESC was hit +if [ $? -ne 0 ]; then + task_error 999 +fi + +rm $red +unset red diff --git a/fai/config/class/55-classes b/fai/config/class/55-classes deleted file mode 100755 index f46bda8..0000000 --- a/fai/config/class/55-classes +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash - -ifclass GCE && echo AMD64 CLOUD -exit 0 diff --git a/fai/config/class/DEBIAN.var b/fai/config/class/DEBIAN.var index 8f00bb9..b7146a7 100644 --- a/fai/config/class/DEBIAN.var +++ b/fai/config/class/DEBIAN.var @@ -1,3 +1,7 @@ +release=stretch +apt_cdn=http://deb.debian.org +security_cdn=http://security.debian.org + CONSOLEFONT= KEYMAP=us-latin1 @@ -13,5 +17,3 @@ MODULESLIST="usbhid psmouse" # if you want to use the faiserver as APT proxy #APTPROXY=http://faiserver:3142 - -apt_cdn=http://deb.debian.org diff --git a/fai/config/class/FAIBASE.var b/fai/config/class/FAIBASE.var index 789cc7f..6f2f25e 100644 --- a/fai/config/class/FAIBASE.var +++ b/fai/config/class/FAIBASE.var @@ -16,3 +16,7 @@ STOP_ON_ERROR=700 # set parameter for install_packges(8) MAXPACKAGES=800 + +# a user account will be created +username=demo +USERPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1' diff --git a/fai/config/class/GCE.var b/fai/config/class/GCE.var deleted file mode 100644 index 805bb3d..0000000 --- a/fai/config/class/GCE.var +++ /dev/null @@ -1,4 +0,0 @@ -release=stretch -TIMEZONE=UTC -NTPSRVS='metadata.google.internal' -NIC1=eth0 diff --git a/fai/config/debconf/CLOUD b/fai/config/debconf/CLOUD index 4ecbdea..a5ab74d 100644 --- a/fai/config/debconf/CLOUD +++ b/fai/config/debconf/CLOUD @@ -1,2 +1,2 @@ # Linux command line: -grub-pc grub2/linux_cmdline_default string quiet elevator=noop +grub-pc grub2/linux_cmdline_default string elevator=noop quiet diff --git a/fai/config/debconf/GCE b/fai/config/debconf/GCE deleted file mode 100644 index 512366f..0000000 --- a/fai/config/debconf/GCE +++ /dev/null @@ -1,4 +0,0 @@ -# Linux command line: -grub-pc grub2/linux_cmdline_default string quiet elevator=noop console=ttyS0,38400n8 -# GRUB timeout; for internal use -grub-pc grub-pc/timeout string 0 diff --git a/fai/config/disk_config/CENTOS b/fai/config/disk_config/CENTOS index 99bf0b5..3b5ef36 100644 --- a/fai/config/disk_config/CENTOS +++ b/fai/config/disk_config/CENTOS @@ -10,8 +10,8 @@ disk_config disk1 disklabel:msdos bootable:1 fstabkey:label #primary / 350 ext3 rw,noatime,errors=remount-ro createopts="-L ROOT -I 128" # use following line for CentOS 7 -primary / 4G-10G ext4 rw,noatime,errors=remount-ro createopts="-L ROOT" +primary / 4G-50G ext4 rw,noatime,errors=remount-ro createopts="-L ROOT" -logical swap 200-1000 swap sw createopts="-L SWAP" -logical /tmp 100-1G ext4 rw,noatime,nosuid,nodev createopts="-L TMP -m 0" tuneopts="-c 0 -i 0" -logical /home 100-50% ext4 rw,noatime,nosuid,nodev createopts="-L HOME -m 1" tuneopts="-c 0 -i 0" +logical swap 200-10G swap sw createopts="-L SWAP" +logical /tmp 100-5G ext4 rw,noatime,nosuid,nodev createopts="-L TMP -m 0" tuneopts="-c 0 -i 0" +logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L HOME -m 1" tuneopts="-c 0 -i 0" diff --git a/fai/config/disk_config/CLOUD b/fai/config/disk_config/CLOUD index cd03652..0b76001 100644 --- a/fai/config/disk_config/CLOUD +++ b/fai/config/disk_config/CLOUD @@ -4,4 +4,4 @@ disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid align-at:1M -primary / 300- ext4 rw,barrier=0,noatime,errors=remount-ro tuneopts="-c 0 -i 0" +primary / 300- ext4 rw,discard,barrier=0,noatime,errors=remount-ro tuneopts="-c 0 -i 0" diff --git a/fai/config/disk_config/FAIBASE b/fai/config/disk_config/FAIBASE index c6d2d3e..0c66cbc 100644 --- a/fai/config/disk_config/FAIBASE +++ b/fai/config/disk_config/FAIBASE @@ -4,7 +4,6 @@ disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid -primary / 2G-15G ext4 rw,noatime,errors=remount-ro -logical swap 200-1G swap sw -logical /tmp 100-1G ext4 rw,noatime,nosuid,nodev createopts="-L tmp -m 0" tuneopts="-c 0 -i 0" -logical /home 100-50% ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1" tuneopts="-c 0 -i 0" +primary / 2G-50G ext4 rw,noatime,errors=remount-ro +logical swap 200-10G swap sw +logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1" tuneopts="-c 0 -i 0" diff --git a/fai/config/disk_config/LVM b/fai/config/disk_config/LVM index f1b43fc..868970a 100644 --- a/fai/config/disk_config/LVM +++ b/fai/config/disk_config/LVM @@ -10,6 +10,6 @@ primary - 4G- - - disk_config lvm vg vg1 disk1.2 -vg1-root / 3G-15G ext4 noatime,rw +vg1-root / 3G-50G ext4 noatime,rw vg1-swap swap 200-4G swap sw vg1-home /home 600- ext4 noatime,nosuid,nodev,rw diff --git a/fai/config/disk_config/XENIAL b/fai/config/disk_config/XENIAL index 13b5102..22ab65c 100644 --- a/fai/config/disk_config/XENIAL +++ b/fai/config/disk_config/XENIAL @@ -7,7 +7,6 @@ disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid -primary / 2G-15G ext4 rw,noatime,errors=remount-ro createopts="-O ^metadata_csum" +primary / 2G-50G ext4 rw,noatime,errors=remount-ro createopts="-O ^metadata_csum" logical swap 200-1G swap sw -logical /tmp 100-1G ext4 rw,noatime,nosuid,nodev createopts="-L tmp -m 0 -O ^metadata_csum" tuneopts="-c 0 -i 0" -logical /home 100-50% ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1 -O ^metadata_csum" tuneopts="-c 0 -i 0" +logical /home 100- ext4 rw,noatime,nosuid,nodev createopts="-L home -m 1 -O ^metadata_csum" tuneopts="-c 0 -i 0" diff --git a/fai/config/files/etc/apt/sources.list/GCE b/fai/config/files/etc/apt/sources.list/GCE deleted file mode 100644 index ce2f0db..0000000 --- a/fai/config/files/etc/apt/sources.list/GCE +++ /dev/null @@ -1,7 +0,0 @@ -deb {apt_cdn}/debian {release} main contrib non-free -deb {apt_cdn}/debian {release}-backports main -deb {apt_cdn}/debian-security {release}/updates main contrib non-free - -deb http://packages.cloud.google.com/apt cloud-sdk-{release} main -deb http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-{release} main -deb http://packages.cloud.google.com/apt google-cloud-compute-{release} main diff --git a/fai/config/files/etc/apt/sources.list/GNOME b/fai/config/files/etc/apt/sources.list/GNOME index 75e9537..f016a99 100644 --- a/fai/config/files/etc/apt/sources.list/GNOME +++ b/fai/config/files/etc/apt/sources.list/GNOME @@ -1,2 +1,3 @@ -deb {apt_cdn}/debian stretch main contrib non-free -deb {apt_cdn}/debian-security stretch/updates main contrib non-free +deb {%apt_cdn%}/debian {%release%} main +deb {%security_cdn%}/debian-security {%release%}/updates main +deb {%apt_cdn%}/debian {%release%}-updates main diff --git a/fai/config/files/etc/apt/sources.list/preinst b/fai/config/files/etc/apt/sources.list/preinst deleted file mode 100755 index f67d8d9..0000000 --- a/fai/config/files/etc/apt/sources.list/preinst +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/bash - -# replace {release} in a sources.list template with the value of $release -# replace {apt_cdn} with the value of $apt_cdn - -# $1 is the class name used -# $2 is the path to the file copied - -# check if a variable of the form {varname} was used at all -grep -q '{' $2 || exit 0 - -if [ -z "$release" ]; then - echo "\$release is undefined. No substitution performed in $2." -else - sed -i -e "s/{release}/$release/g" $2 -fi - -if [ -z "$apt_cdn" ]; then - echo "\$apt_cdn not defined. not substituting in $2." -else - sed -i -e "s#{apt_cdn}#$apt_cdn#g" $2 -fi - diff --git a/fai/config/files/etc/fai/apt/sources.list/FAISERVER b/fai/config/files/etc/fai/apt/sources.list/FAISERVER deleted file mode 100644 index 4f9f2c8..0000000 --- a/fai/config/files/etc/fai/apt/sources.list/FAISERVER +++ /dev/null @@ -1,5 +0,0 @@ -deb http://deb.debian.org/debian stretch main contrib non-free -deb http://deb.debian.org/debian-security stretch/updates main contrib non-free - -# repository that may contain newer fai packages for stretch -deb [trusted=yes] http://fai-project.org/download stretch koeln diff --git a/fai/config/files/etc/fai/nfsroot.conf/FAISERVER b/fai/config/files/etc/fai/nfsroot.conf/FAISERVER index 13c22fb..9e192c6 100644 --- a/fai/config/files/etc/fai/nfsroot.conf/FAISERVER +++ b/fai/config/files/etc/fai/nfsroot.conf/FAISERVER @@ -7,7 +7,7 @@ FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1' NFSROOT=/srv/fai/nfsroot TFTPROOT=/srv/tftp/fai NFSROOT_HOOKS=/etc/fai/nfsroot-hooks/ -FAI_DEBOOTSTRAP_OPTS="--exclude=info --include=aptitude" +FAI_DEBOOTSTRAP_OPTS="--exclude=info" # Configuration space FAI_CONFIGDIR=/srv/fai/config diff --git a/fai/config/files/etc/init.d/expand-root/GCE b/fai/config/files/etc/init.d/expand-root/GCE deleted file mode 100755 index 82480e7..0000000 --- a/fai/config/files/etc/init.d/expand-root/GCE +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -### BEGIN INIT INFO -# Provides: expand-root -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: -# Description: Expand the filesystem of the mounted root volume/partition to its maximum possible size -### END INIT INFO - -prog=$(basename $0) -logger="logger -t $prog" - -growpart="growpart" - -hash $growpart 2> /dev/null || { - $logger "$growpart was not found on PATH. Unable to expand size." - exit 1 -} - -root_device_path="/dev/sda" -root_index="1" - -# Growpart can fail if the partition is already resized. -$growpart $root_device_path $root_index || { - $logger "growpart failed. Unable to expand size." -} - -device_path="${root_device_path}${root_index}" -filesystem=$(blkid -s TYPE -o value ${device_path}) - -case $filesystem in - xfs) xfs_growfs / ;; - ext2) resize2fs $device_path ;; - ext3) resize2fs $device_path ;; - ext4) resize2fs $device_path ;; - *) $logger "The filesystem $filesystem was not recognized. Unable to expand size." ;; -esac diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER index 4b7b4a2..8710678 100755 --- a/fai/config/files/etc/rc.local/FAISERVER +++ b/fai/config/files/etc/rc.local/FAISERVER @@ -79,7 +79,7 @@ EOF fai-chboot -o default # create a template for booting the installation -fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config jessie.tmpl +fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config stretch.tmpl # Since we do not know the MAC address, our DHCP cannot provide the hostname. # Therefore we do explicitly set the hostname diff --git a/fai/config/hooks/debconf.IMAGE b/fai/config/hooks/debconf.IMAGE index 8c20112..c396636 100755 --- a/fai/config/hooks/debconf.IMAGE +++ b/fai/config/hooks/debconf.IMAGE @@ -8,7 +8,7 @@ # 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 --acl if needed (for CentOS 7) +# 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 diff --git a/fai/config/hooks/mountdisks.DEFAULT b/fai/config/hooks/mountdisks.DEFAULT new file mode 100755 index 0000000..95e6a2b --- /dev/null +++ b/fai/config/hooks/mountdisks.DEFAULT @@ -0,0 +1,9 @@ +#! /bin/bash + +# stop resync of soft raid +if [ $do_init_tasks -eq 1 ]; then + if grep -q active /proc/mdstat 2>/dev/null; then + echo "frozen" | tee /sys/block/md*/md/sync_action >/dev/null + fi +fi +exit 0 diff --git a/fai/config/hooks/savelog.LAST.sh b/fai/config/hooks/savelog.LAST.sh index 0867631..e77b9be 100755 --- a/fai/config/hooks/savelog.LAST.sh +++ b/fai/config/hooks/savelog.LAST.sh @@ -52,7 +52,7 @@ ibwebadmin kernel-patch-badram kolab-webadmin kolabadmin -gstreamer0.10-plugins-really-bad +gstreamer.\+-plugins-really-bad liberrors.so liberrors-samba gsambad @@ -80,7 +80,7 @@ deverror.out (floppy), sector 0 mount version older than kernel Can't locate module -Warning only 896MB will be used. +Warning only .\+MB will be used. hostname: Host name lookup failure I can't tell the difference. warning, not much extra random data, consider using the -rand option @@ -151,11 +151,14 @@ can't initialize iptables table can't initialize ip6tables table Authentication warning overridden 41-warning.sh +PCCT header not found Download is performed unsandboxed as root as file update-alternatives: warning: skip creation of loop: module verification failed: signature Warning: apt-key output should not be parsed WARNING: Failed to connect to lvmetad. Falling back to device scanning +Warning: The home dir /var/lib/usbmux you specified +diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory update-rc.d: warning: start and stop actions are no longer supported" # add pattern on some conditions diff --git a/fai/config/package_config/DEBIAN b/fai/config/package_config/DEBIAN index d8be34d..539b71f 100644 --- a/fai/config/package_config/DEBIAN +++ b/fai/config/package_config/DEBIAN @@ -1,10 +1,27 @@ -PACKAGES install +PACKAGES install-norec +apt-transport-https # is only needed for stretch +debconf-utils +file +less +linuxlogo +rsync +openssh-client openssh-server +time +procinfo +nullmailer +eject +locales +console-setup kbd +pciutils usbutils +unattended-upgrades + +PACKAGES install NONFREE # you may want these non-free kernel drivers -#firmware-bnx2 firmware-bnx2x firmware-realtek -#firmware-linux +firmware-bnx2 firmware-bnx2x firmware-realtek +firmware-linux-nonfree PACKAGES install I386 -linux-image-686-pae initramfs-tools +linux-image-686-pae memtest86+ PACKAGES install CHROOT @@ -12,16 +29,13 @@ linux-image-686-pae- linux-image-amd64- PACKAGES install AMD64 -linux-image-amd64 initramfs-tools +linux-image-amd64 memtest86+ PACKAGES install ARM64 grub-efi-arm64 linux-image-arm64 -PACKAGES install DHCPC -isc-dhcp-client - PACKAGES install GRUB_PC grub-pc @@ -32,5 +46,4 @@ PACKAGES install LVM lvm2 PACKAGES install CLOUD -locales-all unattended-upgrades diff --git a/fai/config/package_config/DEMO b/fai/config/package_config/DEMO index 255e0d4..8f76162 100644 --- a/fai/config/package_config/DEMO +++ b/fai/config/package_config/DEMO @@ -1,8 +1,7 @@ # some packages we need on a demo machine PACKAGES install-norec -fortune-mod fortunes -rstat-client #rstatd +htop iotop nmon # only when also class XORG is defined PACKAGES install-norec XORG diff --git a/fai/config/package_config/FAIBASE b/fai/config/package_config/FAIBASE deleted file mode 100644 index 5b1f9b8..0000000 --- a/fai/config/package_config/FAIBASE +++ /dev/null @@ -1,18 +0,0 @@ -PACKAGES install-norec DEBIAN -apt-transport-https -fai-client -debconf-utils -file -less -linuxlogo -rdate -rsync -openssh-client openssh-server -time -procinfo -nullmailer -eject -locales -console-setup kbd -pciutils usbutils -unattended-upgrades diff --git a/fai/config/package_config/FAISERVER b/fai/config/package_config/FAISERVER index 7343898..b26cdd9 100644 --- a/fai/config/package_config/FAISERVER +++ b/fai/config/package_config/FAISERVER @@ -1,7 +1,6 @@ PACKAGES install-norec fai-quickstart -isc-dhcp-client debmirror tcpdump xorriso grub-pc lftp curl @@ -11,4 +10,4 @@ apt-cacher-ng nscd psmisc bind9 dnsutils iptables-persistent -emacs24-nox +emacs25-nox diff --git a/fai/config/package_config/GCE b/fai/config/package_config/GCE deleted file mode 100644 index 14ca617..0000000 --- a/fai/config/package_config/GCE +++ /dev/null @@ -1,28 +0,0 @@ -PACKAGES install -google-cloud-packages-archive-keyring -cloud-initramfs-growroot -cloud-utils -google-cloud-sdk -google-compute-engine-$release -google-compute-engine-init-$release -google-config-$release -python-crcmod -screen -vim - -acpi-support-base -busybox -ca-certificates -curl -ethtool -gdisk -kpartx -isc-dhcp-client -lsb-release -ntp -parted -python -openssh-client -openssh-server -sudo -uuid-runtime diff --git a/fai/config/package_config/GCE.asc b/fai/config/package_config/GCE.asc deleted file mode 100644 index 7663ce5..0000000 --- a/fai/config/package_config/GCE.asc +++ /dev/null @@ -1,21 +0,0 @@ -# pub 2048R/A7317B0F 2015-04-03 Google Cloud Packages Automatic Signing Key - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQENBFUd6rIBCAD6mhKRHDn3UrCeLDp7U5IE7AhhrOCPpqGF7mfTemZYHf/5Jdjx -cOxoSFlK7zwmFr3lVqJ+tJ9L1wd1K6P7RrtaNwCiZyeNPf/Y86AJ5NJwBe0VD0xH -TXzPNTqRSByVYtdN94NoltXUYFAAPZYQls0x0nUD1hLMlOlC2HdTPrD1PMCnYq/N -uL/Vk8sWrcUt4DIS+0RDQ8tKKe5PSV0+PnmaJvdF5CKawhh0qGTklS2MXTyKFoqj -XgYDfY2EodI9ogT/LGr9Lm/+u4OFPvmN9VN6UG+s0DgJjWvpbmuHL/ZIRwMEn/tp -uneaLTO7h1dCrXC849PiJ8wSkGzBnuJQUbXnABEBAAG0QEdvb2dsZSBDbG91ZCBQ -YWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPGdjLXRlYW1AZ29vZ2xlLmNv -bT6JAT4EEwECACgFAlUd6rICGy8FCQWjmoAGCwkIBwMCBhUIAgkKCwQWAgMBAh4B -AheAAAoJEDdGwginMXsPcLcIAKi2yNhJMbu4zWQ2tM/rJFovazcY28MF2rDWGOnc -9giHXOH0/BoMBcd8rw0lgjmOosBdM2JT0HWZIxC/Gdt7NSRA0WOlJe04u82/o3OH -WDgTdm9MS42noSP0mvNzNALBbQnlZHU0kvt3sV1YsnrxljoIuvxKWLLwren/GVsh -FLPwONjw3f9Fan6GWxJyn/dkX3OSUGaduzcygw51vksBQiUZLCD2Tlxyr9NvkZYT -qiaWW78L6regvATsLc9L/dQUiSMQZIK6NglmHE+cuSaoK0H4ruNKeTiQUw/EGFaL -ecay6Qy/s3Hk7K0QLd+gl0hZ1w1VzIeXLo2BRlqnjOYFX4A= -=HVTm ------END PGP PUBLIC KEY BLOCK----- diff --git a/fai/config/package_config/GERMAN b/fai/config/package_config/GERMAN index 3f8ba4e..a9731eb 100644 --- a/fai/config/package_config/GERMAN +++ b/fai/config/package_config/GERMAN @@ -2,4 +2,4 @@ PACKAGES install task-german PACKAGES install GNOME -iceweasel-l10n-de icedove-l10n-de +firefox-esr-l10n-de thunderbird-l10n-de diff --git a/fai/config/package_config/STANDARD b/fai/config/package_config/STANDARD new file mode 100644 index 0000000..6760e7d --- /dev/null +++ b/fai/config/package_config/STANDARD @@ -0,0 +1,31 @@ +PACKAGES install-norec + +# the list of standard packages, without any libs and a few packages removed +apt-listchanges +bash-completion +bind9-host +dbus +dnsutils +doc-debian +file +gettext-base +groff-base +hdparm +less +locales +lsof +man-db +manpages +mime-support +ncurses-term +netcat-traditional +openssh-client +pciutils +perl +python +python-minimal +reportbug +telnet +traceroute +ucf +xz-utils diff --git a/fai/config/package_config/UBUNTU b/fai/config/package_config/UBUNTU index afd01e7..79a6b3c 100644 --- a/fai/config/package_config/UBUNTU +++ b/fai/config/package_config/UBUNTU @@ -1,17 +1,14 @@ PACKAGES install I386 -linux-image-generic initramfs-tools +linux-image-generic memtest86+ PACKAGES install CHROOT linux-image-generic- PACKAGES install AMD64 -linux-image-generic initramfs-tools +linux-image-generic memtest86+ -PACKAGES install DHCPC -isc-dhcp-client - PACKAGES install GRUB_PC grub-pc diff --git a/fai/config/package_config/XORG b/fai/config/package_config/XORG index 0dcc624..5859084 100644 --- a/fai/config/package_config/XORG +++ b/fai/config/package_config/XORG @@ -1,6 +1,6 @@ PACKAGES install-norec DEBIAN xorg xserver-xorg-video-all xserver-xorg-input-all -ttf-freefont +fonts-freefont-ttf xscreensaver xscreensaver-gl xterm diff --git a/fai/config/scripts/CENTOS/80-misc b/fai/config/scripts/CENTOS/80-misc index f4ab9ac..75f3c0f 100755 --- a/fai/config/scripts/CENTOS/80-misc +++ b/fai/config/scripts/CENTOS/80-misc @@ -2,10 +2,12 @@ error=0 ; trap "error=$((error|1))" ERR -# add a demo user account -if ! $ROOTCMD getent passwd demo ; then - $ROOTCMD adduser -c "fai demo user" demo - $ROOTCMD usermod -p "$ROOTPW" demo +# add a $username user account +if [ -n "$username" ]; then + if ! $ROOTCMD getent passwd $username ; then + $ROOTCMD adduser -c "$username user" $username + $ROOTCMD usermod -p "$USERPW" $username + fi fi # enable graphical login screen, make run level 5 as default diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index c1ee0b1..7a7f617 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -3,6 +3,10 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # set root password -$ROOTCMD usermod -p "$ROOTPW" root +if [ -n "$ROOTPW" ]; then + $ROOTCMD usermod -p "$ROOTPW" root +else + $ROOTCMD usermod -L root +fi exit $error diff --git a/fai/config/scripts/DEBIAN/30-interface b/fai/config/scripts/DEBIAN/30-interface index 924b236..c994ce9 100755 --- a/fai/config/scripts/DEBIAN/30-interface +++ b/fai/config/scripts/DEBIAN/30-interface @@ -14,7 +14,7 @@ newnicnames() { return fi - [ -z $NIC1 ] && return + [ -z "$NIC1" ] && return fields="ID_NET_NAME_FROM_DATABASE ID_NET_NAME_ONBOARD ID_NET_NAME_SLOT ID_NET_NAME_PATH" for field in $fields; do @@ -29,6 +29,9 @@ newnicnames() { fi } +if [ -z "$NIC1" ]; then + echo "ERROR: \$NIC1 is not defined. Cannot configure /etc/network/interfaces properly." +fi newnicnames CIDR=$(ip -o -f inet addr show $NIC1 | awk '{print $4}') if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then diff --git a/fai/config/scripts/DEBIAN/40-misc b/fai/config/scripts/DEBIAN/40-misc index 78773f3..4376ab4 100755 --- a/fai/config/scripts/DEBIAN/40-misc +++ b/fai/config/scripts/DEBIAN/40-misc @@ -41,13 +41,10 @@ ln -fs /proc/mounts $target/etc/mtab rm -f $target/etc/dpkg/dpkg.cfg.d/fai $target/etc/dpkg/dpkg.cfg.d/unsafe-io -if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then - [ -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf +if [ -d /etc/fai ]; then + ainsl -a /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC" + fcopy -Miv /etc/fai/fai.conf fi - -ainsl -a /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC" - -fcopy -Miv /etc/fai/fai.conf fcopy -iv /etc/rc.local exit $error diff --git a/fai/config/scripts/DEMO/10-misc b/fai/config/scripts/DEMO/10-misc index 45f0573..42f4749 100755 --- a/fai/config/scripts/DEMO/10-misc +++ b/fai/config/scripts/DEMO/10-misc @@ -1,6 +1,6 @@ #! /bin/bash -# (c) Thomas Lange, 2001-2013, lange@debian.org +# (c) Thomas Lange, 2001-2017, lange@debian.org error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code @@ -14,11 +14,26 @@ if ifclass UBUNTU; then $ROOTCMD addgroup --system sambashare || true fi -# add a demo user account -if ! $ROOTCMD getent passwd demo ; then - $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo - $ROOTCMD usermod -p "$ROOTPW" demo - for g in $groups; do - $ROOTCMD adduser demo $g - done +# add additional user account +if [ -n "$username" ]; then + if ! $ROOTCMD getent passwd $username ; then + $ROOTCMD adduser --disabled-login --gecos "$username user" $username + $ROOTCMD usermod -p "$USERPW" $username + userdir=$($ROOTCMD getent passwd "$username" | cut -d: -f6 ) + + # disable xfce question about default or empty panel + if [ -f $target/etc/xdg/xfce4/panel/default.xml ]; then + xfdir=$userdir/.config/xfce4/xfconf/xfce-perchannel-xml + if [ ! -d $target/xfdir ]; then + $ROOTCMD mkdir -p $xfdir + $ROOTCMD cp /etc/xdg/xfce4/panel/default.xml $xfdir/xfce4-panel.xml + # group name is the same as user name + $ROOTCMD chown -R $username.$username $userdir/.config + fi + fi + + for g in $groups; do + $ROOTCMD adduser $username $g + done + fi fi diff --git a/fai/config/scripts/FAIBASE/10-misc b/fai/config/scripts/FAIBASE/10-misc index 2df5944..fbf85c1 100755 --- a/fai/config/scripts/FAIBASE/10-misc +++ b/fai/config/scripts/FAIBASE/10-misc @@ -28,6 +28,8 @@ chown -c root:root $target/root # copy default dotfiles for root account fcopy -ir /root +# use tmpfs for /tmp +ainsl /etc/fstab "tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0" chmod -c 1777 ${target}/tmp chown -c 0:0 ${target}/tmp diff --git a/fai/config/scripts/FAISERVER/10-conffiles b/fai/config/scripts/FAISERVER/10-conffiles index de17f53..812003b 100755 --- a/fai/config/scripts/FAISERVER/10-conffiles +++ b/fai/config/scripts/FAISERVER/10-conffiles @@ -1,7 +1,7 @@ #! /bin/bash -fcopy -Bvr /etc/fai -fcopy -Bv /etc/fai/apt/sources.list /etc/dhcp/dhcpd.conf +fcopy -BvrS /etc/fai +fcopy -BvS /etc/dhcp/dhcpd.conf if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then diff --git a/fai/config/scripts/GCE/10-misc b/fai/config/scripts/GCE/10-misc deleted file mode 100755 index 4088d14..0000000 --- a/fai/config/scripts/GCE/10-misc +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/bash - -error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code - -# currently missing from bootstrap-vz: -# init.d/generate-ssh-hostkeys (currently done in rc.local/CLOUD) - -ainsl -av /etc/sysctl.d/70-disable-ipv6.conf 'net.ipv6.conf.all.disable_ipv6 = 1' -ainsl -av /etc/sysctl.d/70-disable-ipv6.conf 'net.ipv6.conf.lo.disable_ipv6 = 0' -$ROOTCMD shadowconfig on -sed -i -e 's/^#PasswordAuthentication yes/PasswordAuthentication no/' $target/etc/ssh/sshd_config -sed -i -e 's/^PermitRootLogin .*/PermitRootLogin no/' $target/etc/ssh/sshd_config -ainsl $target/etc/ssh/sshd_config 'ClientAliveInterval 420' - -rm -f $target/var/lib/apt/lists/* -rm -f $target/etc/resolv.conf diff --git a/fai/config/scripts/GRUB_PC/05-gce-grub b/fai/config/scripts/GRUB_PC/05-gce-grub deleted file mode 100755 index 0883c5e..0000000 --- a/fai/config/scripts/GRUB_PC/05-gce-grub +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash - -if ifclass GCE; then - ainsl /etc/default/grub 'GRUB_TERMINAL="serial"' - ainsl /etc/default/grub 'GRUB_SERIAL_COMMAND="serial --speed 38400 --unit=0 --word=0 --parity=no --stop=1"' -fi diff --git a/fai/config/scripts/LAST/50-misc b/fai/config/scripts/LAST/50-misc index 8ae015c..a85fd14 100755 --- a/fai/config/scripts/LAST/50-misc +++ b/fai/config/scripts/LAST/50-misc @@ -58,7 +58,7 @@ if [ $FAI_ACTION = "install" ]; then fi # copy sources.list -fcopy -iM /etc/apt/sources.list +fcopy -iSM /etc/apt/sources.list setrel() { @@ -87,13 +87,17 @@ if [ -f $target/etc/apt/sources.list -a -n "$release" ]; then grep -q 'file generated by fai-cd' $target/etc/apt/sources.list && cat < $target/etc/apt/sources.list deb $apt_cdn/debian $release main contrib non-free deb $apt_cdn/debian-security $release/updates main contrib non-free -deb [trusted=yes] http://fai-project.org/download $release koeln +#deb [trusted=yes] http://fai-project.org/download $release koeln EOF + # if the package fai-server was installed, enable the project's repository + if [ -f $target/var/lib/dpkg/info/fai-server.list ]; then + sed -i -e '/fai-project.org/s/^#//' $target/etc/apt/sources.list + fi fi # for ARM architecture, we may need the kernel and initrd to boot or flash the device if ifclass ARM64; then - cp -pv $target/boot/vmlinuz* $target/boot/initrd* $LOGDIR + cp -pv $target/boot/vmlinuz* $target/boot/initrd* $FAI_RUNDIR fi exit $error -- 2.30.2