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
-#!/bin/bash -l
+#!/bin/bash
# Copyright (C) 2016 Ian Kelling
# This program is free software; you can redistribute it and/or
usage() {
cat <<EOF
-usage: ${0##*/} [-h|--help] [HOST]
+usage: ${0##*/} [-h|--help] [HOST] [DISTRO]
Deploy fai config (the one in nfs) to HOST or default faiserver
+DISTRO is default this distro, or DISTRO for setting up DESKTOP packages.
EOF
exit $1
}
root@$faiserver_host:/srv/fai/config/files/root/.ssh/authorized_keys/GRUB_PC
# todo: automatically disable faiserver after a period so
# these files are not exposed.
-s scp -qr /q/root/luks /q/root/shadow \
+sudo scp -qr /q/root/luks /q/root/shadow \
root@$faiserver_host:/srv/fai/config/distro-install-common
# should tar ssh all the files, but these ones really justified it
ssh root@$faiserver_host tar -xz -C /srv/fai/config/distro-install-common
+. /a/bin/distro-setup/pkgs
+pall+=($(/a/bin/buildscripts/emacs -p; /a/bin/distro-setup/distro-pkgs $2))
+{ 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
+
+
# 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.
#! /bin/bash
-
+set -x
# mk-basefile, create basefiles for some distributions
#
# Thomas Lange, Uni Koeln, 2011-2017
# 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
#
# 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.
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.
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
+++ /dev/null
-#!/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 <<EOF
-Usage: ${0##*/} [-h|--help]
-fai kexec from upstream live cds, i.e. curl|bash
-
-You can copy this to a http server, then wget -O- url|sudo bash
-curl is sometimes not preinstalled on a live cd.
-
-This has been tested on trisquel belenos and ubuntu xenial.
-
-If the screen just sits in a weird color inverted, corrupted looking state,
-it's probably nothing wrong with the computer, but a problem
-with the fai server. If you can do this from a virtual terminal,
-it will print out more info (I know from running it on a vm).
-EOF
- exit $1
-}
-case $1 in
- -h|--help) usage ;;
-esac
-
-
-set -ex
-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
- apt-get update
- apt-get install -y debconf
- debconf-set-selections <<EOF
-kexec-tools kexec-tools/load_kexec boolean false
-EOF
- apt-get install -y pxe-kexec
-fi
-# running this piped to bash on belenos, the apt-get goes
-# into the background while it's still installing, and pxe-kexec
-# just exits right away. sleep calls are strangely ignored.
-# I don't know whats going on, but just running the same
-# command again once it finishes works, and this is only
-# rarely used and done manually anyways, so whatever.
-pxe-kexec -n --ignore-whitelist -l fai-generated faiserver
--- /dev/null
+lk
\ No newline at end of file
--- /dev/null
+#!/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 <<EOF
+Usage: ${0##*/} [-h|--help]
+fai kexec from upstream live cds, i.e. curl|bash
+
+You can copy this to a http server, then wget -O- url|sudo bash
+curl is sometimes not preinstalled on a live cd.
+
+This has been tested on trisquel belenos and ubuntu xenial.
+
+If the screen just sits in a weird color inverted, corrupted looking state,
+it's probably nothing wrong with the computer, but a problem
+with the fai server. If you can do this from a virtual terminal,
+it will print out more info (I know from running it on a vm).
+EOF
+ exit $1
+}
+case $1 in
+ -h|--help) usage ;;
+esac
+
+
+set -ex
+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
+ apt-get update
+ apt-get install -y debconf
+ debconf-set-selections <<EOF
+kexec-tools kexec-tools/load_kexec boolean false
+EOF
+ apt-get install -y pxe-kexec
+fi
+# running this piped to bash on belenos, the apt-get goes
+# into the background while it's still installing, and pxe-kexec
+# just exits right away. sleep calls are strangely ignored.
+# I don't know whats going on, but just running the same
+# command again once it finishes works, and this is only
+# rarely used and done manually anyways, so whatever.
+pxe-kexec -n --ignore-whitelist -l fai-generated faiserver
dhcp-host=f4:6d:04:02:ed:66,set:treetowl,192.168.1.2,treetowl
dhcp-host=00:26:18:97:bb:16,set:frodo,192.168.1.3,frodo
dhcp-host=10:78:d2:da:29:22,set:htpc,192.168.1.4,htpc
-dhcp-host=00:1f:16:16:39:24,set:fz,192.168.1.5,fz
+dhcp-host=00:1f:16:16:39:24,set:kw,192.168.1.5,x2
+#dhcp-host=00:1f:16:16:39:24,set:kw,192.168.1.10,kw
+#dhcp-host=00:c0:ca:27:e9:b2,set:kww,192.168.1.11,kww
# this is so fai can have an explicit name to use for testing,
# or else any random machine which did a pxe boot would get
# reformatted. The mac is from doing a virt-install, cancelling it,
# so might as well use it.
# hostname is the name it uses according to telnet
dhcp-host=b4:75:0e:94:29:ca,set:switch9429ca,192.168.1.251,switch9429ca
-dhcp-host=10:78:d2:da:28:4f,set:kw,192.168.1.10,kw
-dhcp-host=00:c0:ca:27:e9:b2,set:kww,192.168.1.11,kww
# template
# dhcp-host=,192.168.1.,