From 05e47f6734e5a9354a3243686ae55fe4ab2b72c7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 7 Mar 2018 15:25:56 -0500 Subject: [PATCH] various fixes --- README | 25 +++++++++++++ fai-redep | 13 +++++-- fai/config/basefiles/mk-basefile | 2 +- fai/config/class/50-host-classes | 11 ++++-- fai/config/scripts/GRUB_PC/11-iank | 28 +++++++++----- live-kexec | 60 +----------------------------- lk | 59 +++++++++++++++++++++++++++++ wrt-setup | 6 +-- 8 files changed, 125 insertions(+), 79 deletions(-) mode change 100644 => 120000 live-kexec create mode 100644 lk diff --git a/README b/README index 9899ed3..f77aa11 100644 --- a/README +++ b/README @@ -103,6 +103,31 @@ exit reboot +# dirinstall + +host=kw +distro=flidas +t=/tmp/d +# be root: +sudo sed -i 's/^LOGUSER=/#LOGUSER=/' /etc/fai/fai.conf +# required after a failed run +umount /var/lib/fai/config ||: +fai-redep faiserver $distro +rm -rf $t ; mkdir $t; fai -N -u $host dirinstall $t + +# cleanup: +sudo sed -i 's/^#LOGUSER=/LOGUSER=/' /etc/fai/fai.conf +s 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 \ + $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 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 7dc0d09..9938c3b 100755 --- a/fai-redep +++ b/fai-redep @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/bash # Copyright (C) 2016 Ian Kelling # This program is free software; you can redistribute it and/or @@ -21,8 +21,9 @@ x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*} usage() { cat </dev/null ||: # broken pipe + + # built BELENOS basefile with mk-basefile -J BELENOS64. it's stored in # it's own repo which is published alongside this one called # fai-basefiles due to being a large binary file. diff --git a/fai/config/basefiles/mk-basefile b/fai/config/basefiles/mk-basefile index 36bacba..5e8a87b 100755 --- a/fai/config/basefiles/mk-basefile +++ b/fai/config/basefiles/mk-basefile @@ -1,5 +1,5 @@ #! /bin/bash - +set -x # mk-basefile, create basefiles for some distributions # # Thomas Lange, Uni Koeln, 2011-2017 diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes index a6d8bc2..adb8789 100755 --- a/fai/config/class/50-host-classes +++ b/fai/config/class/50-host-classes @@ -19,9 +19,11 @@ # The base distro: # UBUNTU, DEBIAN # -# The base disto version, which is also the basefile name if it exists. -# Debian stable basefile gets built by faisetup and gets used otherwise,: -# STRETCH64, XENIAL64, BELENOS64, FLIDAS64 +# The base disto version, only use so far is the basefile name if it exists. +# Debian stable basefile gets built by faisetup and gets used otherwise. +# With X suffix, means it has gone through the dirinstall process and has eXtra +# things installed, to speed up installation. +# STRETCH64, XENIAL64, BELENOS64, FLIDAS64, FLIDAS64X # # The distro subvol name, we can add as many of these as we want: # VOL_TESTING, VOL_STRETCH, VOL_XENIAL, VOL_BELENOS, VOL_FLIDAS, VOL_STRETCH_BOOTSTRAP @@ -39,6 +41,9 @@ # # Other notable classes: # +# DESKTOP: install a bunch of extra packages. For creating X suffix +# basefiles. See README. +# # REPARTITION: we try to reuse partitions/filesystems to install a new # os into a multi-os system, if we see some basic hueristics, like the # right amount of them. This overrides that. diff --git a/fai/config/scripts/GRUB_PC/11-iank b/fai/config/scripts/GRUB_PC/11-iank index 12d5182..0df904b 100755 --- a/fai/config/scripts/GRUB_PC/11-iank +++ b/fai/config/scripts/GRUB_PC/11-iank @@ -88,16 +88,7 @@ usermod -aG adm,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev iank if getent group systemd-journal >/dev/null; then usermod -aG systemd-journal iank fi -# https://askubuntu.com/questions/33416/how-do-i-disable-the-boot-splash-screen-and-only-show-kernel-and-boot-text-inst -# it suggests not having plymouth-theme-ubuntu-text, but -# making it not installed then kills plymouth, then makes -# the system not boot. -sed -ri 's/(^ *GRUB_CMDLINE_LINUX.*)quiet splash/\1/' /etc/default/grub -# on xenial, no grub is displayed at all. fix that. -# found just by noticing this in the config file, and a -# warning about it in error.log -sed -i '/^ *GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub -update-grub2 + # this is usefull. Only thing reason I see this being disabled by default is # that a normal user can disrupt the system, eg cause a reboot. @@ -106,6 +97,23 @@ sed -i '$a kernel.sysrq=1 EOF +if [[ $FAI_ACTION != dirinstall ]]; then + chroot $FAI_ROOT bash <<'EOF' + # https://askubuntu.com/questions/33416/how-do-i-disable-the-boot-splash-screen-and-only-show-kernel-and-boot-text-inst + # it suggests not having plymouth-theme-ubuntu-text, but + # making it not installed then kills plymouth, then makes + # the system not boot. + sed -ri 's/(^ *GRUB_CMDLINE_LINUX.*)quiet splash/\1/' /etc/default/grub + # on xenial, no grub is displayed at all. fix that. + # found just by noticing this in the config file, and a + # warning about it in error.log + sed -i '/^ *GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub + + update-grub2 +EOF +fi + + # reading through the groups that iank is in but traci isn't, for g in plugdev audio video cdrom; do $ROOTCMD usermod -a -G $g traci diff --git a/live-kexec b/live-kexec deleted file mode 100644 index 5bd5833..0000000 --- a/live-kexec +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Copyright (C) 2016 Ian Kelling - -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -usage() { - cat </dev/null; then - apt-get update - apt-get install -y debconf - debconf-set-selections </dev/null; then + apt-get update + apt-get install -y debconf + debconf-set-selections <