From ee5c5007f3426705012f2943c345b1194a988c62 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 18 Mar 2018 13:30:12 -0400 Subject: [PATCH] minor fixes --- README | 20 ++++++++++---------- fai-redep | 4 ++-- faiserver-setup | 14 +++++++++----- lk | 2 +- myfai-chboot | 11 +++++++---- wrt-setup | 8 +++++--- 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/README b/README index f77aa11..32cd829 100644 --- a/README +++ b/README @@ -106,28 +106,28 @@ reboot # dirinstall host=kw -distro=flidas +distro=trisquel t=/tmp/d -# be root: +myfai-chboot default sudo sed -i 's/^LOGUSER=/#LOGUSER=/' /etc/fai/fai.conf -# required after a failed run -umount /var/lib/fai/config ||: +# config umount required after a failed run, proc umount always required +sudo umount /var/lib/fai/config ||: ; sudo umount -R $t/proc ||: fai-redep faiserver $distro -rm -rf $t ; mkdir $t; fai -N -u $host dirinstall $t +sudo rm -rf $t ; mkdir $t; time sudo LANG= fai -N -u $host dirinstall $t # cleanup: sudo sed -i 's/^#LOGUSER=/LOGUSER=/' /etc/fai/fai.conf -s umount -R $t/proc +sudo umount -R $t/proc # Turning a dirinstall into a basefile. taken from mk-basefile -chroot $t apt-get clean -rm -f $t/etc/hostname $t/etc/resolv.conf \ +sudo chroot $t apt-get clean +sudo rm -f $t/etc/hostname $t/etc/resolv.conf \ $t/var/lib/apt/lists/*_* $t/usr/bin/qemu-*-static \ $t/etc/udev/rules.d/70-persistent-net.rules -> $t/etc/machine-id -tar --one-file-system -C $t -cf - . | gzip > /a/bin/fai-basefiles/basefiles/FLIDAS64X.tar.gz +echo | sudo dd of=$t/etc/machine-id +sudo tar --one-file-system -C $t -cf - . | gzip > /a/bin/fai-basefiles/basefiles/FLIDAS64X.tar.gz License stuff: The license for the project is GPLv2 or later, mostly because fai is and diff --git a/fai-redep b/fai-redep index 9938c3b..eafb1dc 100755 --- a/fai-redep +++ b/fai-redep @@ -32,7 +32,7 @@ case $1 in esac host=${1:-faiserver} - +distro=$2 # i use faiserver as a dns alias, but ssh key is associated with # a canonical hostname and we will have ssh warning spam unless we @@ -55,7 +55,7 @@ tar -cz /p/c/machine_specific/*/filesystem/etc/ssh | \ . /a/bin/distro-setup/pkgs -pall+=($(/a/bin/buildscripts/emacs -p; /a/bin/distro-setup/distro-pkgs $2)) +pall+=($(/a/bin/buildscripts/emacs -p; /a/bin/distro-setup/distro-pkgs $distro)) { echo PACKAGES install; echo "${pall[*]}"|sed 's/ /\n/g'; } | \ ssh root@$faiserver_host dd of=/srv/fai/config/package_config/DESKTOP 2>/dev/null ||: # broken pipe diff --git a/faiserver-setup b/faiserver-setup index f1ede11..bbc4f50 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2016 Ian Kelling +# Copyright (C) 2018 Ian Kelling # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -85,14 +85,14 @@ elif grep -xFq 'VERSION="8 (jessie)"' /etc/os-release; then cat >/etc/apt/sources.list.d/fai.list <<'EOF' deb http://fai-project.org/download jessie koeln EOF -elif grep -xFq 'VERSION="9 (stretch)"' /etc/os-release; then +elif grep -xFq 'VERSION="9 (stretch)"' /etc/os-release || grep -iE 'flidas|xenail' /etc/os-release ; then + # fai on ubuntu only has official support using the universe repo, but newer + # tends to have less bugs. gpg -a --recv-keys 2BF8D9FE074BCDE4; gpg -a --export 2BF8D9FE074BCDE4 | apt-key add - cat >/etc/apt/sources.list.d/fai.list <<'EOF' deb http://fai-project.org/download stretch koeln EOF -elif grep -iE 'flidas|xenail' /etc/os-release; then - add-apt-repository -y ppa:fai/ppa else rm -f /etc/apt/sources.list.d/fai.list fi @@ -103,7 +103,8 @@ apt-get update # I especially do not wait isc-dhcp-server or an inetd. Also excludes # nfs-kernel-server. On an android chroot, we don\'t have nfs in the # kernel, or the ability to install it. -pkgs=(fai-doc tftpd-hpa tar reprepro squashfs-tools binutils) +# xorriso is for running fai-cd -a, not strictly need for fai-server +pkgs=(fai-doc tftpd-hpa tar reprepro squashfs-tools binutils xorriso) if modprobe nfsd &>/dev/null; then pkgs+=(nfs-kernel-server) else @@ -164,6 +165,9 @@ s,^( *FAI_DEBOOTSTRAP=).*,\1"$base $r", EOF $sed 's/#LOGUSER/LOGUSER/' /etc/fai/fai.conf +$sed -i '/^FAI_FLAGS=/d' /etc/fai/fai.conf +echo "FAI_FLAGS=verbose" >>/etc/fai/fai.conf + # from man fai-make-nfsroot, # figured out after partitioning ignored my crypt partition diff --git a/lk b/lk index 5bd5833..51b91d9 100644 --- a/lk +++ b/lk @@ -42,7 +42,7 @@ if grep -q ID=ubuntu /etc/os-release; then # add universe, pxe-kexec is there sed -ri '/^\s*deb/{/universe/!s/$/ universe/}' /etc/apt/sources.list fi -if ! type -p pxe-kexec &>/dev/null; then +if ! type -p pxe-kexec >/dev/null 2>&1; then apt-get update apt-get install -y debconf debconf-set-selections <&2' ERR x=$(readlink -f "$BASH_SOURCE"); cd ${x%/*} usage() { - cat <