diff -Nru fai-5.3/bin/fai-diskimage fai-5.3.2/bin/fai-diskimage --- fai-5.3/bin/fai-diskimage 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/bin/fai-diskimage 2016-12-15 04:36:27.000000000 +0000 @@ -71,7 +71,7 @@ local error=0 if ! type qemu-img > /dev/null 2>&1; then - echo "qmeu-img not found. Install the package qemu-utils." + echo "qemu-img not found. Install the package qemu-utils." error=1 fi if ! type setup-storage > /dev/null 2>&1; then @@ -176,8 +176,8 @@ # currently fai-diskimage can't be used if the host contains logical volumes set +e -if [ -f /sbin/lvs ]; then - lvs 2>&1 | grep -q 'No volume groups found' +if [ -f /sbin/dmsetup ]; then + dmsetup ls 2>&1 | grep -q 'No devices found' if [ $? -eq 1 ]; then die 9 "Currently fai-diskimage can't be run if the host uses logical volumes." fi diff -Nru fai-5.3/bin/fai-make-nfsroot fai-5.3.2/bin/fai-make-nfsroot --- fai-5.3/bin/fai-make-nfsroot 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/bin/fai-make-nfsroot 2016-12-15 04:36:27.000000000 +0000 @@ -187,7 +187,9 @@ iarch=$($ROOTCMD dpkg --print-architecture|tr /a-z/ /A-Z/) distro=$(. $NFSROOT/etc/os-release; echo ${ID} ${ID}_${VERSION_ID} | tr '[:lower:].' '[:upper:]_') export classes="NFSROOT $iarch $distro" - [ X$verbose = X1 ] && echo Classes are set to $classes + if [ X$verbose = X1 ] ; then + echo Classes are set to $classes + fi } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - setup_ssh() { @@ -472,6 +474,7 @@ local err setclasses + $ROOTCMD apt-cache dumpavail > $NFSROOT/var/lib/dpkg/available install_packages -l -p$cfdir > $NFSROOT/var/tmp/packages.nfsroot echo "Adding additional packages to $NFSROOT:" cat $NFSROOT/var/tmp/packages.nfsroot @@ -481,6 +484,7 @@ if [ $err -ne 0 ]; then die 12 "install_packages had exit code: $err" fi + rm $NFSROOT/var/lib/dpkg/available set -e } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru fai-5.3/bin/fai-mirror fai-5.3.2/bin/fai-mirror --- fai-5.3/bin/fai-mirror 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/bin/fai-mirror 2016-12-15 04:36:27.000000000 +0000 @@ -263,7 +263,7 @@ set-classes [ $add -eq 1 ] && add_base_packages echo "Downloading packages for classes:" $classes -FAI=$FAI_CONFIGDIR install_packages -d $vflag +FAI=$FAI_CONFIGDIR install_packages -N -d $vflag umount_dirs trap "" EXIT ERR [ $add -eq 0 ] && delete_base_packages diff -Nru fai-5.3/bin/fai-monitor-gui fai-5.3.2/bin/fai-monitor-gui --- fai-5.3/bin/fai-monitor-gui 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/bin/fai-monitor-gui 2016-12-15 04:36:27.000000000 +0000 @@ -5,7 +5,7 @@ # fai-monitor-gui: graphical FAI monitor daemon # # This script is part of FAI (Fully Automatic Installation) -# Copyright (C) 2007-2015 Thomas Lange, lange@informatik.uni-koeln.de +# Copyright (C) 2007-2016 Thomas Lange, lange@informatik.uni-koeln.de # Universitaet zu Koeln # #********************************************************************* @@ -56,6 +56,7 @@ my $line = <$input>; return 0 if $line =~/^FAI monitoring daemon start/; # ignore start up messages from fai-monitor return 0 if $line =~/Disabling pxelinux configuration/; + return 0 if $line =~/^VARIABLE /; warn "INPUT received $line" if $debug; hostentry($line); return 0; @@ -150,7 +151,7 @@ print << "EOF"; fai-monitor-gui, graphical FAI monitor daemon - Copyright (C) 2007-2012 by Thomas Lange + Copyright (C) 2007-2016 by Thomas Lange Usage: fai-monitor | fai-monitor-gui - diff -Nru fai-5.3/bin/install_packages fai-5.3.2/bin/install_packages --- fai-5.3/bin/install_packages 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/bin/install_packages 2016-12-15 04:36:27.000000000 +0000 @@ -34,8 +34,9 @@ use strict; use Getopt::Std; +my $debug=0; # global variables -our ($opt_d,$opt_l,$opt_L,$opt_v,$opt_h,$opt_H,$opt_m,$opt_n,$opt_p,$opt_s); +our ($opt_d,$opt_l,$opt_L,$opt_v,$opt_h,$opt_H,$opt_m,$opt_n,$opt_N,$opt_p,$opt_s); my $listonly; # flag, that indicates that only a list of packages will be printed our %command; our $atype; # type of action (for apt-get, aptitude,..) that will be performed @@ -61,6 +62,10 @@ my $downloaddir="/var/cache/apt/archives/partial/"; # where to download packages that gets only unpacked my $debsourcesdir='/var/lib/fai/packages'; my @ls; +my %pname; # hash of all available packages +my %install; # key is package names, value says if we want to install it +my %pmap; # map package name from the list (including +-/=) to real package names +my @newlist; # list of packages, but unknown packages removed $| = 1; @@ -154,6 +159,8 @@ } } +-f "$FAI_ROOT/var/lib/dpkg/available" && create_debian_pkg_list(); + # - - - - - - - - - - - - - - - - - - - - - - - - - - - # begin of the big foreach loop # - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -368,15 +375,18 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - sub mkpackagelist { - # CURRENTLY no packages are removed from the list of known packages, @unknown is removed + # CURRENTLY no packages are removed from the list of known packages my @complete = @_; # copy original list - - # create two list of packages - # @unknown contains the unknown packages # @known contains the known packages - @known = @complete; + # on Debian system, clean list of packages + if ( ! $opt_N && -f "$FAI_ROOT/var/lib/dpkg/available" ) { + @known = clean_pkg_list(@complete); + } else { + @known = @complete; + } + writepackages(); return; } @@ -472,3 +482,86 @@ exit 0; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - +sub create_debian_pkg_list { + # build a hash of all known package names + open(IN,"egrep '^Package: ' $FAI_ROOT/var/lib/dpkg/available |") || die; + while () { + m/^Package: (\S+)/; + $pname{$1} = 1; + } + close(IN); +} +# - - - - - - - - - - - - - - - - - - - - - - - - - - - +sub insert_pkg { + + # if package name is known, insert package into data structure, return success + # insert orig package name and modified name into %pmap + # %pmap maps orig name (including +-=) to real package names + # save status install/remove of each package in %install + + my ($orig, $pack, $install, $msg) = @_; + + if ($pname{$pack}) { + print "$msg\n" if $debug; + push @newlist, $orig; + $pmap{$orig} = "$pack"; + $install{$pack} = $install; + return 1; + } + return 0; +} +# - - - - - - - - - - - - - - - - - - - - - - - - - - - +sub clean_pkg_list { + + # clean up the list of packages, remove unknown packages, + # "merge" things like: pkgA pkgA- + + my @inlist = @_; + my $pack; + my @unknown; + my @final; # final list of packages + + foreach my $n (@inlist) { + $pack = $n; + + # plain package name is known, this also matches g++, memtest86+, ... + insert_pkg($n, $pack, 1, "$n found") && next; + + # handle packagename- + if ( $pack =~ s/-$//) { + insert_pkg($n, $pack, 0, "$pack - removed") && next; + } + + # handle packagename+, where packagename itself does not include a + + if ( $pack =~ s/\+$//) { + insert_pkg($n, $pack, 1, "$pack + added") && next; + } + + # remove /distribution or =version from package name + if ( $pack =~ s#[/=].+##) { + insert_pkg($n, $pack, 1, "$n using $pack found") && next; + } + + # else package is unknown + push @unknown, $n; + } + + warn "WARNING: These unknown packages are removed from the installation list: " . join(' ', @unknown) . "\n" if @unknown; + + print "-"x30,"\n" if $debug; + print join ' ' ,"ORIG:", @inlist, "\n" if $debug; + print join ' ' ,"INSTALL:", @newlist, "\n" if $debug; + + + # create new list of packages (incl. +-/=) that should be installed or removed + foreach (@newlist) { + + push @final, $_ if ($install{$pmap{$_}} == 0 && $_ =~/-$/); # pkg names with - that should be not installed + next if ($install{$pmap{$_}} == 1 && $_ =~/-$/); + next unless $install{$pmap{$_}}; # do not include package that are marked as do not install + push @final, $_; + } + + print join ' ' ,"DO INST:", @final, "\n" if $debug; + return @final; +} diff -Nru fai-5.3/debian/bzr-builder.manifest fai-5.3.2/debian/bzr-builder.manifest --- fai-5.3/debian/bzr-builder.manifest 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/debian/bzr-builder.manifest 2016-12-15 04:36:48.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~6668 -lp:~fai/fai/fai-release revid:git-v1:c77dcde535ccd1b972a270f3af28707bcc6ec49e +# bzr-builder format 0.3 deb-version {debupstream}-0~6669 +lp:~fai/fai/fai-release revid:git-v1:aa48e729e38b1be4fc89e24edf9a2493a4b6ebc2 diff -Nru fai-5.3/debian/changelog fai-5.3.2/debian/changelog --- fai-5.3/debian/changelog 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/debian/changelog 2016-12-15 04:36:52.000000000 +0000 @@ -1,8 +1,39 @@ -fai (5.3-0~6668~ubuntu14.04.1) trusty; urgency=low +fai (5.3.2-0~6669~ubuntu14.04.1) trusty; urgency=low * Auto build. - -- Ubuntu FAI Developers Mon, 21 Nov 2016 16:16:53 +0000 + -- Ubuntu FAI Developers Thu, 15 Dec 2016 04:36:51 +0000 + +fai (5.3.2) unstable; urgency=low + + [ Thomas Lange ] + * install_packages: readd -N, new code for removing unknown package + names and handling multiple occurrences of a package with suffix + - + * fai-make-nfsroot: create /var/lib/dpkg/available during package + installation + * fai-mirror: call install_packages with -N + + [ Emmanuel Kasper ] + * fai-diskimage: improve LVM test + + -- Thomas Lange Mon, 12 Dec 2016 15:01:47 +0100 + +fai (5.3.1) unstable; urgency=low + + [ Thomas Lange ] + * fai-monitor-gui: ignore lines matching ^VARIABLE + * CENTOS: disable selinux + * savelog.LAST.sh: add ignore pattern + * remove unsafe-io config at the end + * UBUNTU/90-apt: fix setting locale + + [ Andrew bezella ] + * fai-make-nfsroot: improve test + + [ dpoon ] + * fai-disk-info + + -- Thomas Lange Tue, 06 Dec 2016 16:06:00 +0100 fai (5.3) unstable; urgency=high diff -Nru fai-5.3/doc/fai-guide.txt fai-5.3.2/doc/fai-guide.txt --- fai-5.3/doc/fai-guide.txt 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/doc/fai-guide.txt 2016-12-15 04:36:27.000000000 +0000 @@ -1670,7 +1670,7 @@ ---- faiserver# export FAI_BASEFILEURL=http://fai-project.org/download/basefiles/ - faiserver# fai-diskimage -u cloud3 -S 2G -cDEBIAN,JESSIE64,AMD64,FAIBASE,GRUB_PC,CLOUD,GCE disk + faiserver# fai-diskimage -u cloud3 -S 2G -cDEBIAN,JESSIE64,AMD64,FAIBASE,GRUB_PC,CLOUD,GCE disk.raw ---- Creates the file disk.raw for a host called cloud3, with a small set of software packages. @@ -1678,7 +1678,7 @@ ---- # export FAI_BASEFILEURL=http://fai-project.org/download/basefiles/ # cl=DEFAULT,DHCPC,DEBIAN,AMD64,FAIBASE,GRUB_PC,UBUNTU,XENIAL,XENIAL64,XORG - # fai-diskimage -v -C -u foobar -S5G -c$cl ubuntu + # fai-diskimage -v -u foobar -S5G -c$cl ubuntu.qcow2 ---- Creates a disk image called ubuntu.qcow2 for a Ubuntu 16.04 desktop with hostname set to foobar. diff -Nru fai-5.3/examples/simple/class/10-base-classes fai-5.3.2/examples/simple/class/10-base-classes --- fai-5.3/examples/simple/class/10-base-classes 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/class/10-base-classes 2016-12-15 04:36:27.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/bash # do only execute if this is called on the client being installed. Do not use during fai-diskimage -if [ $FAI_ACTION = "install" -a $do_init_tasks -eq 0 ]; then +if [ X$FAI_ACTION = Xinstall -a $do_init_tasks -eq 0 ]; then exit 0 fi diff -Nru fai-5.3/examples/simple/files/etc/selinux/config/CENTOS fai-5.3.2/examples/simple/files/etc/selinux/config/CENTOS --- fai-5.3/examples/simple/files/etc/selinux/config/CENTOS 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/files/etc/selinux/config/CENTOS 2016-12-15 04:36:27.000000000 +0000 @@ -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. diff -Nru fai-5.3/examples/simple/hooks/instsoft.DEBIAN fai-5.3.2/examples/simple/hooks/instsoft.DEBIAN --- fai-5.3/examples/simple/hooks/instsoft.DEBIAN 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/hooks/instsoft.DEBIAN 2016-12-15 04:36:27.000000000 +0000 @@ -11,7 +11,6 @@ # in case the locales are already included inside the base file (Ubuntu) if [ -f $target/usr/sbin/locale-gen ]; then - rm $target/etc/locale.gen $ROOTCMD dpkg-reconfigure -fnoninteractive locales exit fi diff -Nru fai-5.3/examples/simple/hooks/savelog.LAST.sh fai-5.3.2/examples/simple/hooks/savelog.LAST.sh --- fai-5.3/examples/simple/hooks/savelog.LAST.sh 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/hooks/savelog.LAST.sh 2016-12-15 04:36:27.000000000 +0000 @@ -24,6 +24,7 @@ couldn't can't E: Sorry, broken packages +^E: operator expected ambiguous redirect No previous regular expression diff -Nru fai-5.3/examples/simple/package_config/GNOME fai-5.3.2/examples/simple/package_config/GNOME --- fai-5.3/examples/simple/package_config/GNOME 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/package_config/GNOME 2016-12-15 04:36:27.000000000 +0000 @@ -6,6 +6,5 @@ gnome-core gconf-editor gnome-screensaver gnome-system-monitor gnome-system-tools -gnome-network-admin libgnomevfs2-bin network-manager-gnome diff -Nru fai-5.3/examples/simple/scripts/DEBIAN/40-misc fai-5.3.2/examples/simple/scripts/DEBIAN/40-misc --- fai-5.3/examples/simple/scripts/DEBIAN/40-misc 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/scripts/DEBIAN/40-misc 2016-12-15 04:36:27.000000000 +0000 @@ -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 @@ -34,7 +34,7 @@ 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 if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then [ -f /etc/fai/fai.conf ] && cp /etc/fai/fai.conf $target/etc/fai/fai.conf diff -Nru fai-5.3/examples/simple/scripts/UBUNTU/90-apt fai-5.3.2/examples/simple/scripts/UBUNTU/90-apt --- fai-5.3/examples/simple/scripts/UBUNTU/90-apt 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/examples/simple/scripts/UBUNTU/90-apt 2016-12-15 04:36:27.000000000 +0000 @@ -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 diff -Nru fai-5.3/lib/fai-disk-info fai-5.3.2/lib/fai-disk-info --- fai-5.3/lib/fai-disk-info 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/lib/fai-disk-info 2016-12-15 04:36:27.000000000 +0000 @@ -19,4 +19,4 @@ } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # echo a space separated list of devices and their block size -( egrep 'md[0-9]{3,}$' /proc/partitions; egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.+\b| cciss/c.+d.+\b| ida/c.+d.+\b| rd/c.+d.+\b| fio.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b| xvd.\b| nvme[[:digit:]]n1$' /proc/partitions ) | checkdisk +( egrep 'md[0-9]{3,}$' /proc/partitions; egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.+\b| cciss/c[[:digit:]]+d[[:digit:]]+\b| ida/c[[:digit:]]+d[[:digit:]]+\b| rd/c[[:digit:]]+d[[:digit:]]+\b| fio.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b| xvd.\b| nvme[[:digit:]]n1$' /proc/partitions ) | checkdisk diff -Nru fai-5.3/man/install_packages.8 fai-5.3.2/man/install_packages.8 --- fai-5.3/man/install_packages.8 2016-11-21 16:16:53.000000000 +0000 +++ fai-5.3.2/man/install_packages.8 2016-12-15 04:36:27.000000000 +0000 @@ -1,7 +1,7 @@ .\" Hey, EMACS: -*- nroff -*- .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH install_packages 8 "November 2016" "FAI 5.3" +.TH install_packages 8 "December 2016" "FAI 5.3" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -72,6 +72,9 @@ .BI "\-n " Dry run. Do not execute installation commands, just print them. .TP +.B \-N +Do not check package names whether they are valid. +.TP .BI "\-p " DIRECTORY Read the configuration files from DIRECTORY instead of $FAI/packages_config. .TP