update to upstream 5.3.4
authorIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:44:28 +0000 (22:44 -0800)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:44:28 +0000 (22:44 -0800)
47 files changed:
fai/config/basefiles/mk-basefile
fai/config/class/01-classes [new file with mode: 0755]
fai/config/class/10-base-classes
fai/config/class/20-hwdetect.sh
fai/config/class/41-warning.sh [new file with mode: 0755]
fai/config/class/55-classes [new file with mode: 0755]
fai/config/class/60-misc
fai/config/class/GCE.var [new file with mode: 0644]
fai/config/class/example.profile
fai/config/debconf/CLOUD [new file with mode: 0644]
fai/config/debconf/GCE [new file with mode: 0644]
fai/config/disk_config/CLOUD [new file with mode: 0644]
fai/config/files/etc/apt/sources.list/GCE [new file with mode: 0644]
fai/config/files/etc/apt/sources.list/preinst [new file with mode: 0755]
fai/config/files/etc/fai/apt/sources.list/FAISERVER
fai/config/files/etc/init.d/expand-root/GCE [new file with mode: 0755]
fai/config/files/etc/rc.local/CLOUD [new file with mode: 0755]
fai/config/files/etc/rc.local/FAISERVER
fai/config/files/etc/selinux/config/CENTOS
fai/config/hooks/instsoft.DEBIAN
fai/config/hooks/savelog.LAST.sh
fai/config/hooks/setup.DEFAULT.sh
fai/config/hooks/updatebase.CENTOS
fai/config/package_config/DEBIAN
fai/config/package_config/DEMO
fai/config/package_config/FAIBASE
fai/config/package_config/FAISERVER
fai/config/package_config/GCE [new file with mode: 0644]
fai/config/package_config/GCE.asc [new file with mode: 0644]
fai/config/package_config/GERMAN
fai/config/package_config/GNOME
fai/config/package_config/UBUNTU
fai/config/package_config/XFCE
fai/config/package_config/XORG
fai/config/scripts/CLOUD/99-cleanup [new file with mode: 0755]
fai/config/scripts/DEBIAN/10-rootpw
fai/config/scripts/DEBIAN/20-capabilities
fai/config/scripts/DEBIAN/30-interface
fai/config/scripts/DEBIAN/40-misc
fai/config/scripts/FAIBASE/10-misc
fai/config/scripts/FAISERVER/10-conffiles
fai/config/scripts/GCE/10-misc [new file with mode: 0755]
fai/config/scripts/GRUB_EFI/10-setup [new file with mode: 0755]
fai/config/scripts/GRUB_PC/05-gce-grub [new file with mode: 0755]
fai/config/scripts/GRUB_PC/10-setup
fai/config/scripts/LAST/50-misc
fai/config/scripts/UBUNTU/90-apt

index 591a87836cce9293b5fd47ec9cd38c94efe2e2ed..6d6cfca3700791aa69ea37c7f89d627196800411 100755 (executable)
@@ -2,11 +2,8 @@
 
 # mk-basefile, create basefiles for some distributions
 #
-# Thomas Lange, Uni Koeln, 2011-2015
+# Thomas Lange, Uni Koeln, 2011-2016
 # based on the Makefile implementation of Michael Goetze
-#
-# Usage example:  fai-mk-basefile -J SQUEEZE64
-# This will create a SQUEEZE64.tar.xz basefile.
 
 # Supported distributions (each i386/amd64):
 # Debian GNU/Linux
 # Define your local mirros here
 # For the first stage, set the CentOS/SLC mirror in /etc/rinse/rinse.conf
 MIRROR_DEBIAN=http://httpredir.debian.org/debian/
-MIRROR_DEBIAN=http://localmirror/debian/
 MIRROR_UBUNTU=http://mirror.netcologne.de/ubuntu/
 MIRROR_CENTOS=http://mirror.netcologne.de/
-#MIRROR_CENTOS=http://localmirror
-#MIRROR_SLC=http://localmirror
 
 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_WHEEZY=info,tasksel,tasksel-data
+EXCLUDE_JESSIE=tasksel,tasksel-data
+EXCLUDE_STRETCH=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
+EXCLUDE_XENIAL=tasksel,tasksel-data
 
 INCLUDE_DEBIAN=aptitude
 
@@ -124,7 +120,7 @@ cleanup-rinse() {
 
 tarit() {
 
-    tar --xattrs --selinux --acl --one-file-system -C $xtmp -cf - . | $zip > $target.$ext
+    tar $attributes --one-file-system -C $xtmp -cf - . | $zip > $target.$ext
 }
 
 
@@ -158,60 +154,30 @@ slc() {
 }
 
 
-squeeze() {
-
-    local arch=$1
-
-    check
-    debootstrap --arch $arch --exclude=${EXCLUDE_SQUEEZE} squeeze $xtmp ${MIRROR_DEBIAN}
-    cleanup-deb
-    tarit
-}
-
-wheezy() {
-
-    local arch=$1
-
-    check
-    debootstrap --arch $arch --exclude=${EXCLUDE_WHEEZY} wheezy $xtmp ${MIRROR_DEBIAN}
-    cleanup-deb
-    tarit
-}
+debgeneric() {
 
-jessie() {
+    local DIST=$1
+    shift
+    local mirror=$1
 
-    local arch=$1
-
-    check
-    debootstrap --arch $arch --exclude=${EXCLUDE_JESSIE} --include=${INCLUDE_DEBIAN} jessie $xtmp ${MIRROR_DEBIAN}
-    cleanup-deb
-    tarit
-}
-
-trusty() {
+    if [[ $DIST =~ 64 ]]; then
+        arch=amd64
+    else
+        arch=i386
+    fi
 
-    local arch=$1
+    DIST=${DIST%%??}
+    dist=${DIST,,}
 
+    local exc="EXCLUDE_$DIST"
     check
-    debootstrap --arch $arch --exclude=${EXCLUDE_TRUSTY} --include=${INCLUDE_DEBIAN} trusty $xtmp ${MIRROR_UBUNTU}
+    debootstrap --arch $arch --exclude=${!exc} --include=${INCLUDE_DEBIAN} $dist $xtmp $mirror
     cleanup-deb
     tarit
 }
 
-xenial() {
-
-    local arch=$1
-
-    check
-    debootstrap --arch $arch --exclude=${EXCLUDE_XENIAL} --include=${INCLUDE_DEBIAN} xenial $xtmp ${MIRROR_UBUNTU}
-    cleanup-deb
-    tarit
-}
+prtdists() {
 
-
-unknown() {
-
-    echo "Unknown distribution. Aborting."
     echo "Available:
 
     CENTOS5_32   CENTOS5_64
@@ -225,27 +191,56 @@ unknown() {
     SQUEEZE32    SQUEEZE64
     WHEEZY32     WHEEZY64
     JESSIE32     JESSIE64
+    STRETCH32    STRETCH64
 "
-    exit 99
 }
 
+usage() {
+
+    cat <<EOF
+mk-basefile, create minimal base files for a Linux distritubtion
+
+   Copyright (C) 2011-2016 by Thomas Lange
+
+Usage: mk-basefile [OPTION] ... DISTRIBUTION
+
+   -s                   Show list of supported linux distributions
+   -a                   Add xtattrs, acl and selinux properties to the tar file.
+   -d DIR               Use DIR for creating the temporary subtree structure.
+   -z                   Use gzip for compressing the tar file.
+   -J                   Use xz for compressing the tar file.
+   -k                   Keep the temporary subtree structure, do not remove it.
+   -h                   Print help.
+
+ Usage example: mk-basefile -J STRETCH64
+ This will create a STRETCH64.tar.xz basefile.
+
+EOF
+    exit 0
+}
 
 # main routine
 
 ext=tar
 zip=cat
-tmpdir=/var/tmp
+attributes=
+cleanup=1
 
-while getopts zJd: opt ; do
+while getopts ashzJd:k opt ; do
     case "$opt" in
-        d) tmpdir=$OPTARG ;;
+        a) attributes="--xattrs --selinux --acl" ;;
+        d) export TMPDIR=$OPTARG ;;
         z) zip="gzip -9"; ext=tar.gz ;;
         J) zip="xz -8" ext=tar.xz ;;
+        k) cleanup=0 ;;
+        h) usage ;;
+        s) prtdists ; exit 0;;
+        ?) exit 3 ;; # error in option parsing
     esac
 done
 shift $(($OPTIND - 1))
 
-xtmp=$(mktemp -d $tmpdir/basefiles.XXXXXXXX)
+xtmp=$(mktemp --tmpdir -d basefiles.XXXXXXXX)
 if [ $? -eq 1 ]; then
     echo "mktemp failed. Aborting."
     exit 2
@@ -265,18 +260,16 @@ case "$target" in
     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 ;;
-    WHEEZY64) wheezy amd64 ;;
-    JESSIE32) jessie i386 ;;
-    JESSIE64) jessie amd64 ;;
-    *) unknown ;;
+    TRUSTY*|XENIAL*)
+        debgeneric $target $MIRROR_UBUNTU ;;
+    SQUEEZE*|WHEEZY*|JESSIE*|STRETCH*)
+        debgeneric $target $MIRROR_DEBIAN ;;
+    *) echo "Unknown distribution. Aborting."
+       prtdists
+       exit 99 ;;
 esac
 
 # cleanup
-rm -rf $xtmp
+if [ $cleanup -eq 1 ]; then
+   rm -rf $xtmp
+fi
diff --git a/fai/config/class/01-classes b/fai/config/class/01-classes
new file mode 100755 (executable)
index 0000000..159af3b
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+[ "$cmdlineclasses" ] || exit 0
+
+# define the classes given on the cmdline (suing -c) very early
+echo $cmdlineclasses
+
+exit 0
index eed0846e2e8f47971a78361847abc0f6280cc1d6..3d03c8f54a5e0274edfd4f2be241a70a0a8413ab 100755 (executable)
@@ -1,5 +1,10 @@
 #! /bin/bash
 
+# do only execute if this is called on the client being installed. Do not use during fai-diskimage
+if [ X$FAI_ACTION = Xinstall -a $do_init_tasks -eq 0 ]; then
+    exit 0
+fi
+
 # Echo architecture and OS name in uppercase. Do NOT remove these two lines.
 uname -s | tr '[:lower:]' '[:upper:]'
 [ -x "`which dpkg`" ] && dpkg --print-architecture | tr a-z A-Z
index b42f9865bb0157549c1782a839f0932626db55c7..a928b54458b0171df65dcdb73ec948cd76d76eb1 100755 (executable)
@@ -17,7 +17,7 @@ case $(uname -r) in
 esac
 
 for mod in $kernelmodules; do
-    [ "$verbose" ] && echo Loading kernel module $mod
+    [ X$verbose = X1 ] && echo Loading kernel module $mod
     modprobe -a $mod 1>/dev/null 2>&1
 done
 
diff --git a/fai/config/class/41-warning.sh b/fai/config/class/41-warning.sh
new file mode 100755 (executable)
index 0000000..b3da9fe
--- /dev/null
@@ -0,0 +1,18 @@
+#! /bin/bash
+
+if [ X$FAI_ACTION = Xinstall -o X$FAI_ACTION = X ]; then
+    :
+else
+    return
+fi
+if [ X$action = Xdirinstall ]; then
+    return
+fi
+
+grep -q INSTALL $LOGDIR/FAI_CLASSES || return 0
+[ "$flag_menu" ] || return 0
+
+out=$(tty)
+
+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
diff --git a/fai/config/class/55-classes b/fai/config/class/55-classes
new file mode 100755 (executable)
index 0000000..f46bda8
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/bash
+
+ifclass GCE && echo AMD64 CLOUD
+exit 0
index 22a30c066338061dfd0853a900d6df38bdb9a670..9733dcbd08565cae3e351164f1e76f3774f670e4 100755 (executable)
@@ -1,4 +1,6 @@
 #! /bin/bash
 
 ifclass -o CENTOS SLC && exit 0
-ifclass -o I386 AMD64 && echo GRUB_PC
+if ifclass -o I386 AMD64 ; then
+    ifclass -o GRUB_PC GRUB_EFI ||echo GRUB_PC
+fi
diff --git a/fai/config/class/GCE.var b/fai/config/class/GCE.var
new file mode 100644 (file)
index 0000000..223f758
--- /dev/null
@@ -0,0 +1,4 @@
+release=jessie
+TIMEZONE=UTC
+NTPSRVS='metadata.google.internal'
+NIC1=eth0
index d8467fc839084ee87b3d86e556b71aeb1af58e3c..75ff37fe4d84f99b88301b32fb0bca0c957ea2ae 100644 (file)
@@ -52,14 +52,3 @@ Description: Show defailed system information
 Short: Show detailed hardware and system  information
 Long: Execute a lot of commands for collecting system information
 Classes: SYSINFO
-
-Name: dummy
-Description: A dummy profile
-Short: This is the short one liner text for the dummy menu, Shown at the bottom of the menu
-Long: Here you can add more lines to describe details of you
-profile. A profile is only a list of FAI classes. Those classes can
-then define the disk partitioning scheme, the list of packages to be
-installed, the variables to defined and other things.
-
-In the end, a profile is just a list of FAI classes combined with some description.
-Classes: A B C E
diff --git a/fai/config/debconf/CLOUD b/fai/config/debconf/CLOUD
new file mode 100644 (file)
index 0000000..4ecbdea
--- /dev/null
@@ -0,0 +1,2 @@
+# Linux command line:
+grub-pc grub2/linux_cmdline_default     string quiet elevator=noop
diff --git a/fai/config/debconf/GCE b/fai/config/debconf/GCE
new file mode 100644 (file)
index 0000000..512366f
--- /dev/null
@@ -0,0 +1,4 @@
+# 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/CLOUD b/fai/config/disk_config/CLOUD
new file mode 100644 (file)
index 0000000..afac4d2
--- /dev/null
@@ -0,0 +1,7 @@
+# config for a disk image for a VM
+#
+# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
+
+disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid align-at:1M
+
+primary /      300-      ext4  rw,nobarrier,noatime,errors=remount-ro 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
new file mode 100644 (file)
index 0000000..98533ab
--- /dev/null
@@ -0,0 +1,7 @@
+deb http://httpredir.debian.org/debian {release} main contrib non-free
+deb http://httpredir.debian.org/debian {release}-backports main
+deb http://security.debian.org/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/preinst b/fai/config/files/etc/apt/sources.list/preinst
new file mode 100755 (executable)
index 0000000..e9f0623
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+# replace {release} in a sources.list template with the value of $release
+
+
+# $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."
+   exit 0
+fi
+
+sed -i -e "s/{release}/$release/g" $2
index c7b1228cef48ede718eab1bfe8577a9b541516b1..d5d463dfb5e4a062ce24fff34b52cf1ad7f2dd39 100644 (file)
@@ -2,4 +2,4 @@ deb http://httpredir.debian.org/debian jessie main contrib non-free
 deb http://security.debian.org/debian-security jessie/updates main contrib non-free
 
 # repository that may contain newer fai packages for jessie
-deb http://fai-project.org/download jessie koeln
+deb [trusted=yes] http://fai-project.org/download jessie koeln
diff --git a/fai/config/files/etc/init.d/expand-root/GCE b/fai/config/files/etc/init.d/expand-root/GCE
new file mode 100755 (executable)
index 0000000..82480e7
--- /dev/null
@@ -0,0 +1,40 @@
+#!/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/CLOUD b/fai/config/files/etc/rc.local/CLOUD
new file mode 100755 (executable)
index 0000000..a80ac39
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+# regenerate ssh_host keys
+ls /etc/ssh/ssh_host_* > /dev/null
+if [ $? -ne 0 ]; then
+    dpkg-reconfigure -fnoninteractive openssh-server
+fi
+rm $0
index 6640ab14dda034414494a3bed6ad94c2b90db1fd..dffa360eb4d42bcbb0bddb1caabc8e14c735be1d 100755 (executable)
@@ -11,6 +11,11 @@ set -o pipefail
 
 # setup network
 ifup eth0
+# regenerate ssh_host keys
+ls /etc/ssh/ssh_host_* > /dev/null
+if [ $? -ne 0 ]; then
+    dpkg-reconfigure -fnoninteractive openssh-server
+fi
 sleep 8
 [ -x /etc/init.d/nscd ] && /etc/init.d/nscd restart
 
@@ -29,10 +34,6 @@ if [ ! -d "$FAI_CONFIGDIR/class" ]; then
     ainsl /srv/fai/config/class/FAIBASE.var "^LOGUSER=fai"
     myip=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
     echo "APTPROXY=http://$myip:3142" >> /srv/fai/config/class/DEBIAN.var
-    # determine a fast mirror for Ubuntu
-    list=$(curl -s http://mirrors.ubuntu.com/mirrors.txt)
-    mirror=$(netselect $list | awk '{print $2}')
-    sed -i -e "s#MIRRORURL#$mirror#" /srv/fai/config/files/etc/apt/sources.list/UBUNTU
 fi
 # set the LOGUSER, wo we get all the logs from our install clients
 ainsl /etc/fai/fai.conf "^LOGUSER=fai"
@@ -43,7 +44,11 @@ curl -fs 'http://127.0.0.1:3142/acng-report.html?doImport=Start+Import&calcSize=
 
 # setup the FAI server, including creating the nfsroot, use my own proxy
 export APTPROXY="http://127.0.0.1:3142"
-fai-setup -fvB /var/tmp/base.tar.xz 2>&1
+if [ -f /var/tmp/base.tar.xz ]; then
+    fai-setup -fvB /var/tmp/base.tar.xz 2>&1
+else
+    fai-setup -fv 2>&1
+fi
 if [ $? -eq 0 ]; then
     rm /var/tmp/base.tar.xz
     echo ""
@@ -87,4 +92,10 @@ fai-monitor > /var/log/fai/fai-monitor.log &
 
 # move me away
 mv $0 /var/tmp
+
+# create new rc.local for next reboot
+echo '#! /bin/bash' > /etc/rc.local
+echo 'fai-monitor > /var/log/fai/fai-monitor.log &' >> /etc/rc.local
+chmod a+rx /etc/rc.local
+
 exit 0
index b415aa8b377066539e53956c54d7ee3dc7fc5335..9878acbbdb66a706fc2d229be48d1ab6f3f8264f 100644 (file)
@@ -3,7 +3,7 @@
 #       enforcing - SELinux security policy is enforced.
 #       permissive - SELinux prints warnings instead of enforcing.
 #       disabled - No SELinux policy is loaded.
-SELINUX=enforcing
+SELINUX=disabled
 # SELINUXTYPE= can take one of these two values:
 #       targeted - Only targeted network daemons are protected.
 #       strict - Full SELinux protection.
index c503a047d76a9f47514d5ca3f1910b06a513308f..ebf7d8ac9ef28831efb4fbda4bd2793ddd884625 100755 (executable)
@@ -2,15 +2,25 @@
 
 # if package locales will be installed, then install it early, before
 #  other packages
-
-if [ $FAI_ACTION != "install" ]; then
+if [ $FAI_ACTION != "install" -a $FAI_ACTION != "dirinstall" ]; then
    exit 0
 fi
 
 fcopy -Bi /etc/apt/apt.conf.d/force_confdef
-ainsl -av /etc/ucf.conf "^conf_force_conffold=YES"
+ainsl -a  /etc/ucf.conf "^conf_force_conffold=YES"
+
+# in case the locales are already included inside the base file (Ubuntu)
+if [ -f $target/usr/sbin/locale-gen ]; then
+    $ROOTCMD dpkg-reconfigure -fnoninteractive locales
+    exit
+fi
 
+# if we want to install locales, install them now
 install_packages -l 2>/dev/null | egrep  -q  ' locales|locales '
 if [ $? -eq 0 ]; then
-   $ROOTCMD apt-get -y install locales
+    if [ X$verbose = X1 ]; then
+       $ROOTCMD apt-get -y install locales
+    else
+       $ROOTCMD apt-get -y install locales > /dev/null
+    fi
 fi
index 74aa116a609d5253924218f4f34133a3d252b52d..20d41b42aee52a858abc4b6a1af9e70101440a3a 100755 (executable)
@@ -24,6 +24,7 @@ not found
 couldn't
 can't
 E: Sorry, broken packages
+^E:
 operator expected
 ambiguous redirect
 No previous regular expression
@@ -53,6 +54,7 @@ kolab-webadmin
 kolabadmin
 gstreamer0.10-plugins-really-bad
 liberrors.so
+liberrors-samba
 gsambad
 libad
 libtest-nowarnings-perl
@@ -63,8 +65,7 @@ libroxen-errormessage
 liberror-perl
 libgpg-error-dev
 libgpg-error0
-^fstab.\+errors=remount
-Opts: errors=remount-ro
+Opts:.\+errors=remount
 [RT]X packets:
 WARNING: unexpected IO-APIC
 warned about = ( )
@@ -148,7 +149,11 @@ fail to add MMCONFIG information
 can't initialize iptables table
 can't initialize ip6tables table
 Authentication warning overridden
+41-warning.sh
 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
 update-rc.d: warning: start and stop actions are no longer supported"
 
 # add pattern on some conditions
@@ -176,7 +181,7 @@ if [ -s $errfile ]; then
 fi
 
 grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
-if [ "$verbose" ]; then
+if [ X$verbose = X1 ]; then
     egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
     mv $LOGDIR/tempfile $errfile
 fi
index bd9c3be892f27dea8c6aeeba99e662efff430e87..00a1df2467b336e46bfc9806aa891207477ebb05 100755 (executable)
@@ -2,10 +2,6 @@
 
 # use short hostname instead of FQDN
 export HOSTNAME=${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
+if [ $do_init_tasks -eq 1 ]; then
   echo $HOSTNAME > /proc/sys/kernel/hostname
 fi
index 6f5813aa7ef4069eabb31af5d70ee3da8b67056d..a315b96c4752f6330757402434e618b1c9224a96 100755 (executable)
@@ -4,9 +4,9 @@ if [ ! -f $target/etc/resolv.conf ]; then
     cp /etc/resolv.conf $target/etc
 fi
 
-if [ "$verbose" ]; then
+if [ X$verbose = X1 ]; then
        echo "Updating base"
-       $ROOTCMD yum -y update 2>&1 | tee -a $LOGDIR/software.log
+       $ROOTCMD yum -y update |& tee -a $LOGDIR/software.log
 else
        $ROOTCMD yum -y update >> $LOGDIR/software.log
 fi
index 253e89c19fff34a57ebe1f434df5932af1054aa4..bdec0d61b64c6c54b89a8ded58ec9c548f48475b 100644 (file)
@@ -14,7 +14,13 @@ PACKAGES install DHCPC
 isc-dhcp-client
 
 PACKAGES install GRUB_PC
-grub-pc grub-legacy- lilo-
+grub-pc
+
+PACKAGES install GRUB_EFI
+grub-efi
 
 PACKAGES install LVM
 lvm2
+
+PACKAGES install CLOUD
+locales-all
index ace8badfa3028f57a0e05a8e13f6d91bc3b8686f..255e0d4d2cba07ed82510799dfadc7d256f3230d 100644 (file)
@@ -1,10 +1,10 @@
 # some packages we need on a demo machine
 
-PACKAGES aptitude
+PACKAGES install-norec
 fortune-mod fortunes
 rstat-client #rstatd
 
 # only when also class XORG is defined
-PACKAGES aptitude XORG
+PACKAGES install-norec XORG
 bb xpenguins
 #frozen-bubble
index 591327b11b89b08573f8a260dc7d9ede89f6c3c3..e4851b16134994023732b7d80dfe515155e990aa 100644 (file)
@@ -1,6 +1,5 @@
-PACKAGES aptitude DEBIAN
+PACKAGES install-norec DEBIAN
 fai-client
-cron
 debconf-utils
 file
 less
@@ -8,7 +7,6 @@ linuxlogo
 rdate
 rsync
 openssh-client openssh-server
-strace
 time
 procinfo
 nullmailer
index ddcf4586cefa0f70c2310e02a5ce39d5463a967c..7343898fd7a867e721456ef4da0a6eb2fae34345 100644 (file)
@@ -1,4 +1,4 @@
-PACKAGES aptitude
+PACKAGES install-norec
 fai-quickstart
 
 isc-dhcp-client
diff --git a/fai/config/package_config/GCE b/fai/config/package_config/GCE
new file mode 100644 (file)
index 0000000..3620ab1
--- /dev/null
@@ -0,0 +1,28 @@
+PACKAGES install
+google-cloud-packages-archive-keyring
+cloud-initramfs-growroot
+cloud-utils/$release-backports
+google-cloud-sdk
+google-compute-engine-$release
+google-compute-engine-init-$release
+google-config-$release
+python-crcmod/$release-backports
+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
new file mode 100644 (file)
index 0000000..7663ce5
--- /dev/null
@@ -0,0 +1,21 @@
+# pub  2048R/A7317B0F 2015-04-03 Google Cloud Packages Automatic Signing Key <gc-team@google.com>
+
+-----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-----
index 6ef01fa32a11cc5fa8c684efff175d48c1b5b41a..3f8ba4e792f0619f3c132eb0b6623bea1eeb7012 100644 (file)
@@ -1,5 +1,5 @@
-PACKAGES aptitude
+PACKAGES install
 task-german
 
-PACKAGES aptitude GNOME
+PACKAGES install GNOME
 iceweasel-l10n-de icedove-l10n-de
index 429586e59c851d4c8c4e5ee7545d130f64eae6aa..375aac8a511efda3ce3cd997c95be9458189f85e 100644 (file)
@@ -1,4 +1,4 @@
-PACKAGES aptitude
+PACKAGES install-norec
 
 iceweasel
 #icedove
@@ -6,5 +6,5 @@ menu gdm3
 gnome-core
 gconf-editor
 gnome-screensaver gnome-system-monitor gnome-system-tools
-gnome-network-admin
 libgnomevfs2-bin
+network-manager-gnome
index 6028909e50848934a8a0b851b2bf705a5e783b19..afd01e721465ee42aaf20a63a10554c6413adec2 100644 (file)
@@ -15,7 +15,7 @@ isc-dhcp-client
 PACKAGES install GRUB_PC
 grub-pc
 
-PACKAGES aptitude-r XORG
+PACKAGES install XORG
 ubuntu-desktop
 ubuntu-standard
 ubuntu-minimal
index 965f5a01f85b4014a83022401391ca6eb484c737..4c32cd62841024408208161b3468ad16e92c39dc 100644 (file)
@@ -1,4 +1,4 @@
-PACKAGES aptitude
+PACKAGES install-norec
 xfce4 # base system
 xfce4-goodies # additional tools
 lightdm
index 084ef842de01c70d6661a30e14c63fa613725644..e9d68df88997927ec2fba3c329bc32e35295ca0f 100644 (file)
@@ -1,7 +1,10 @@
-PACKAGES aptitude DEBIAN
+PACKAGES install-norec DEBIAN
 xorg xserver-xorg-video-all xserver-xorg-input-all
 ttf-freefont
 xscreensaver
 xscreensaver-gl
 xterm
 desktop-base
+
+# add free and non-free firmware
+#firmware-linux
diff --git a/fai/config/scripts/CLOUD/99-cleanup b/fai/config/scripts/CLOUD/99-cleanup
new file mode 100755 (executable)
index 0000000..35a104c
--- /dev/null
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+fcopy /etc/init.d/expand-root
+if [ -f $target/files/etc/init.d/expand-root ]; then
+    $ROOTCMD insserv --default expand-root
+fi
+
+sed -i "s/PermitRootLogin yes/PermitRootLogin without-password/" $target/etc/ssh/sshd_config
+ainsl /etc/ssh/sshd_config 'ClientAliveInterval 120'
+
+ainsl -a /etc/modprobe.d/blacklist.conf 'blacklist pcspkr'
+ainsl -a /etc/modprobe.d/blacklist.conf 'blacklist floppy'
+
+rm -f $target/etc/resolv.conf $target/etc/udev/rules.d/70-persistent-net.rules $target/lib/udev/write_net_rules
+shred --remove $target/etc/ssh/ssh_host_*
+
+# FIXME: DHCP RFC3442 is used incorrect in Azure
+if [ -f $target/etc/dhcp/dhclient.conf ]; then
+    sed -ie 's,rfc3442-classless-static-routes,disabled-\0,' $target/etc/dhcp/dhclient.conf
+fi
index fe08f9d029d4813141a76691843d38a4a698244c..c1ee0b18f725043592835d9091eef6e53b60c7e5 100755 (executable)
@@ -3,6 +3,6 @@
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
 # set root password
-$ROOTCMD usermod -p $ROOTPW root
+$ROOTCMD usermod -p "$ROOTPW" root
 
 exit $error
index 6e63c92dade3f4cf0c054698eb1bf25c25247d71..ea650fa984a90231f58afccd6b056c0e05a761d8 100755 (executable)
@@ -11,7 +11,7 @@ if [ ! -x $target/sbin/setcap ] ; then
 fi
 
 for FILE in /bin/ping /bin/ping6 /usr/bin/fping /usr/bin/fping6; do
-    if [ -x $target/$FILE ] ; then
+    if [ -x $target/$FILE -a ! -h $target/$FILE ] ; then
         if $ROOTCMD /sbin/setcap cap_net_raw+ep $FILE; then
             echo "Setcap worked! $FILE is not suid!"
         fi
index 9883731fd90efbaa728267d099d3755e6ebc554e..924b2363ab7ff6ef4085b1146ee629b1b4902772 100755 (executable)
@@ -2,24 +2,50 @@
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
-then
+
+newnicnames() {
+
+    # determine predictable network names only for stretch and above
+
+    [ $do_init_tasks -eq 0 ] && return
+
+    ver=$($ROOTCMD dpkg-query --showformat='${Version}' --show udev)
+    if dpkg --compare-versions $ver lt 220-7; then
+       return
+    fi
+
+    [ -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
+       name=$(udevadm info /sys/class/net/$NIC1 | sed -rn "s/^E: $field=(.+)/\1/p")
+       if [[ $name ]]; then
+           NIC1=$name
+           break
+       fi
+    done
+    if [[ ! $name ]]; then
+       echo "$0: error: could not find systemd predictable network name. Using $NIC1."
+    fi
+}
+
+newnicnames
+CIDR=$(ip -o -f inet addr show $NIC1 | awk '{print $4}')
+if ifclass DHCPC && [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
+
     cat > $target/etc/network/interfaces <<-EOF
        # generated by FAI
        auto lo $NIC1
        iface lo inet loopback
        iface $NIC1 inet dhcp
 EOF
-elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]
-then
-      [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
+elif [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ]; then
+      [ -n "$CIDR" ] && cat > $target/etc/network/interfaces <<-EOF
        # generated by FAI
        auto lo $NIC1
        iface lo inet loopback
        iface $NIC1 inet static
-         address $IPADDR
-         netmask $NETMASK
-         broadcast $BROADCAST
+         address $CIDR
          gateway $GATEWAYS
 EOF
     [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
index f2a65785ebd4db627d1ca9ec37a9829199bae9a5..8308bbe33dae7b662437697b6d7959cfc11d5ce4 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/bash
 
-# (c) Thomas Lange, 2001-2015, lange@debian.org
+# (c) Thomas Lange, 2001-2016, lange@debian.org
 # (c) Michael Goetze, 2010-2011, mgoetze@mgoetze.net
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
@@ -11,9 +11,9 @@ for module in $MODULESLIST; do
 done
 
 fcopy -Mv /etc/hostname || echo $HOSTNAME > $target/etc/hostname
-ainsl -av /etc/mailname ${HOSTNAME}
+ainsl -a /etc/mailname ${HOSTNAME}
 if [ ! -e $target/etc/adjtime ]; then
-    printf "0.0 0 0.0\n0\nUTC" > $target/etc/adjtime
+    printf "0.0 0 0.0\n0\nUTC\n" > $target/etc/adjtime
 fi
 if [ "$UTC" = "yes" ]; then
     sed -i -e 's:^LOCAL$:UTC:' $target/etc/adjtime
@@ -34,11 +34,15 @@ fi
 
 ln -fs /proc/mounts $target/etc/mtab
 
-rm -f $target/etc/dpkg/dpkg.cfg.d/fai
+rm -f $target/etc/dpkg/dpkg.cfg.d/fai $target/etc/dpkg/dpkg.cfg.d/unsafe-io
 
-[ $FAI_ACTION = "install" -a -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf
-ainsl -av /etc/fai/fai.conf "FAI_CONFIG_SRC=$FAI_CONFIG_SRC"
+if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
+  [ -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/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
index 6394ad2fbb00c79135afab20408bd9e4e398a466..2df59448f2db1db403237580b54d62e74b96d25e 100755 (executable)
@@ -5,7 +5,11 @@
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
 echo $TIMEZONE    > $target/etc/timezone
-cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
+if [ -L $target/etc/localtime ]; then
+    ln -sf /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
+else
+    cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
+fi
 
 if [ -n "$IPADDR" ]; then
     ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
@@ -13,6 +17,9 @@ else
     ifclass DHCPC && ainsl -s /etc/hosts "127.0.0.1 $HOSTNAME"
 fi
 
+if [ -f $target/etc/hosts.orig ]; then
+    mv $target/etc/hosts.orig $target/etc/hosts
+fi
 fcopy -iM /etc/hosts /etc/motd
 
 # make /root accessible only by root
index 4bf2ed235583756b013a1fdd6aabb675281efe85..de17f53c407d7345494a4a53064402fa0e0b2752 100755 (executable)
@@ -2,9 +2,8 @@
 
 fcopy -Bvr /etc/fai
 fcopy -Bv /etc/fai/apt/sources.list /etc/dhcp/dhcpd.conf
-fcopy -v /etc/rc.local
 
-if [ $FAI_ACTION = "install" ]; then
+if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
 
     # use the same sources.list for the server itself and the clients
     cp -a $target/etc/fai/apt $target/etc/
@@ -30,7 +29,9 @@ if [ $FAI_ACTION = "install" ]; then
     ainsl -v /etc/apt-cacher-ng/acng.conf "ReuseConnections: 0"
 
     # copy base file for faster building of nfsroot
-    cp -p /var/tmp/base.tar.xz $target/var/tmp
+    if [ -f /var/tmp/base.tar.xz ]; then
+       cp -p /var/tmp/base.tar.xz $target/var/tmp
+    fi
 
     if [ -d /media/mirror/pool ]; then
        mkdir $target/var/cache/apt-cacher-ng/_import
@@ -41,6 +42,6 @@ if [ $FAI_ACTION = "install" ]; then
     # copy basefiles from CD to config space
     if [ -d $FAI/basefiles ]; then
        mkdir -p $target/srv/fai/config/basefiles
-       cp -vp $FAI/basefiles/*.tar.* $target/srv/fai/config/basefiles 2>/dev/null
+       cp -vp $FAI/basefiles/*.tar.* $target/srv/fai/config/basefiles 2>/dev/null || true
     fi
 fi
diff --git a/fai/config/scripts/GCE/10-misc b/fai/config/scripts/GCE/10-misc
new file mode 100755 (executable)
index 0000000..4088d14
--- /dev/null
@@ -0,0 +1,16 @@
+#! /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_EFI/10-setup b/fai/config/scripts/GRUB_EFI/10-setup
new file mode 100755 (executable)
index 0000000..2e39e2f
--- /dev/null
@@ -0,0 +1,67 @@
+#! /bin/bash
+# support for GRUB version 2
+
+error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
+
+# This script assumes that the disk has a GPT partition table and
+# that the extended system partition (ESP) is mounted on /boot/efi.
+# When building a disk image, we don't change the NVRAM to point at
+# the boot image we made available, because the disk image is likely
+# not installed on the current system.  As a result, we force
+# installation into the removable media paths as well as the standard
+# debian path.
+
+set -a
+
+# do not set up grub during dirinstall
+if [ "$FAI_ACTION" = "dirinstall" ] ; then
+    exit 0
+fi
+# during softupdate use this file
+[ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh
+
+if [ -z "$BOOT_DEVICE" ]; then
+    exit 189
+fi
+
+# disable os-prober because of #788062
+ainsl /etc/default/grub 'GRUB_DISABLE_OS_PROBER=true'
+
+# skip the rest, if not an initial installation
+if [ $FAI_ACTION != "install" ]; then
+    $ROOTCMD update-grub
+    exit $error
+fi
+
+$ROOTCMD grub-mkdevicemap --no-floppy
+GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
+
+
+# Check if RAID is used for the boot device
+if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
+    raiddev=${BOOT_DEVICE#/dev/}
+    # install grub on all members of RAID
+    for device in `LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
+       echo Install grub on /dev/$device
+       $ROOTCMD grub-install --no-floppy --force-extra-removable "/dev/$device"
+    done
+
+elif [[ $GROOT =~ 'hostdisk' ]]; then
+    cat > $target/boot/grub/device.map <<EOF
+(hd0)   $BOOT_DEVICE
+EOF
+    $ROOTCMD grub-install --no-floppy --force-extra-removable --modules=part_gpt --no-nvram $BOOT_DEVICE
+    if [ $? -eq 0 ]; then
+        echo "Grub installed on hostdisk $BOOT_DEVICE"
+    fi
+    rm $target/boot/grub/device.map
+
+else
+    $ROOTCMD grub-install --no-floppy --modules=part_gpt "$GROOT"
+    if [ $? -eq 0 ]; then
+        echo "Grub installed on $BOOT_DEVICE = $GROOT"
+    fi
+fi
+$ROOTCMD update-grub
+
+exit $error
diff --git a/fai/config/scripts/GRUB_PC/05-gce-grub b/fai/config/scripts/GRUB_PC/05-gce-grub
new file mode 100755 (executable)
index 0000000..0883c5e
--- /dev/null
@@ -0,0 +1,6 @@
+#! /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
index c945daf93ba16899476ea4c7335028e6b7648c99..7a0476081db7598e988f5823a4d6a90ffd3bc048 100755 (executable)
@@ -4,6 +4,11 @@
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
 set -a
+
+# do not set up grub during dirinstall
+if [ "$FAI_ACTION" = "dirinstall" ] ; then
+    exit 0
+fi
 # during softupdate use this file
 [ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh
 
@@ -23,6 +28,7 @@ fi
 $ROOTCMD grub-mkdevicemap --no-floppy
 GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
 
+
 # Check if RAID is used for the boot device
 if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
     raiddev=${BOOT_DEVICE#/dev/}
@@ -31,6 +37,17 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
        echo Install grub on /dev/$device
        $ROOTCMD grub-install --no-floppy "/dev/$device"
     done
+
+elif [[ $GROOT =~ 'hostdisk' ]]; then
+    cat > $target/boot/grub/device.map <<EOF
+(hd0)   $BOOT_DEVICE
+EOF
+    $ROOTCMD grub-install --no-floppy --modules=part_msdos $BOOT_DEVICE
+    if [ $? -eq 0 ]; then
+        echo "Grub installed on hostdisk $BOOT_DEVICE"
+    fi
+    rm $target/boot/grub/device.map
+
 else
     $ROOTCMD grub-install --no-floppy "$GROOT"
     if [ $? -eq 0 ]; then
index 25b6ce7e239bde45aa96af061dfcd133fe8fc919..a1cf1d1eaa4ef49e33b77f758b640fa3d9f4afac 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/bash
 
-# copyright Thomas Lange 2001-2015, lange@debian.org
+# copyright Thomas Lange 2001-2016, lange@debian.org
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-if [ "$FAI_ACTION" = "dirinstall" ] ; then
+if [ "$FAI_ACTION" = "dirinstall" -o $do_init_tasks -eq 0 ] ; then
   :
 else
   # check if mdadm has been forgotten
@@ -58,4 +58,36 @@ fi
 # copy sources.list
 fcopy -iM /etc/apt/sources.list
 
+
+setrel() {
+
+    # if release is not set, try to determine it
+
+    if [ -n "$release" ]; then
+       return
+    fi
+    if [ ! -f $target/etc/os-release ]; then
+       return
+    fi
+
+    dists="jessie stretch xenial trusty"
+    for d in $dists; do
+       if grep -iq $d $target/etc/os-release; then
+           release=$d
+           break
+       fi
+    done
+    echo "\$release set to $release"
+}
+
+# if installation was done from CD, replace useless sources.list
+setrel
+if [ -f $target/etc/apt/sources.list -a -n "$release" ]; then
+    grep -q 'file generated by fai-cd' $target/etc/apt/sources.list && cat <<EOF > $target/etc/apt/sources.list
+deb http://httpredir.debian.org/debian $release main contrib non-free
+deb http://httpredir.debian.org/debian-security $release/updates main contrib non-free
+deb [trusted=yes] http://fai-project.org/download $release koeln
+EOF
+fi
+
 exit $error
index b75555b6de01cdf85480e11c83f05c250a165083..f08a23dbab3686f28e736f5a71a169232bda705b 100755 (executable)
@@ -1,5 +1,14 @@
 #! /bin/bash
 
+if ifclass GERMAN; then
+    $ROOTCMD locale-gen    LANG=de_DE.UTF-8
+    $ROOTCMD update-locale LANG=de_DE.UTF-8
+else
+    ainsl -v /etc/locale.gen '^en_US.UTF-8 UTF-8'
+    $ROOTCMD locale-gen
+    $ROOTCMD update-locale LANG=en_US.UTF-8
+fi
+
 # check if we already use an external mirror
 grep -q "external mirror" $target/etc/apt/sources.list && exit 0