From: Ian Kelling Date: Mon, 16 Feb 2026 03:59:35 +0000 (-0500) Subject: minor improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=212d49c2673256690069f79c61998452efd4e322;p=automated-distro-installer minor improvements --- diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index fc5e521..34abf44 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -30,9 +30,10 @@ usage() { cat <<'EOF' Example of calling outside of FAI: +/a/bin/fai/fai/config/hooks/partition.DEFAULT +HOSTNAME=kd DISTRO=ecne /a/bin/fai/fai/config/hooks/partition.DEFAULT -s /dev/sdk -m -/a/bin/fai/fai/config/hooks/partition.DEFAULT Example use in a bootstrap distro: scp /b/fai/fai-wrapper /a/bin/fai/fai/config/{distro-install-common/devbyid,hooks/partition.DEFAULT} root@HOST: @@ -59,15 +60,13 @@ Options -c DISK_COUNT Meant for use with -s, the count of disks for doing swap size calculation. -d Create data partition instead of root partition. Meant for use with -s. + It creates a single lvm pv/vg/lv called "data". -m Create root/data partition with maximum size instead of the 1tb limit. Meant for use with -s. -s SPECIAL_DISK For use outside of fai. A base disk name like /dev/sdk. If set, we just cryptsetup and partition this one disk then -exit. It creates a single lvm pv/vg/lv called "data". If this is -partitioning intended to go into a root filesystem, you can modify the -script to change that, or run commands manually afterwards. This also -sets REPARTITION. +exit. This also sets REPARTITION. ARGS (only 0 or 1 is valid). All args are for use outside of fai. @@ -85,7 +84,7 @@ environment variables: HOSTNAME: if demohost, we set the luks password to just 'x'. Used in various other ways too. -DISTRO: if not set, derived from VOL_... variable in a switch. +DISTRO: Distro release codename. if not set, derived from VOL_... variable in a switch. Required except for mkroot2, mkroot2tab, or SPECIAL_DISK. classes: @@ -133,8 +132,8 @@ fi if ! type -t ifclass &>/dev/null; then - echo "$0: error: install ifclass" >&2 - exit 1 + /b/fai/faiserver-setup --pi-only + type -t ifclass >/dev/null fi @@ -336,7 +335,7 @@ luks-setup() { } mktab() { - fstabstd="x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s" + fstabstd="x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s" mkdir -p /tmp/fai dev=${boot_devs[0]} @@ -357,7 +356,7 @@ EOF if $data_part; then vg=${vgs[0]} cat >/tmp/fai/crypttab </tmp/fai/fstab <>/tmp/fai/crypttab <>/tmp/fai/crypttab <>/mnt/root/root2-crypttab <>/mnt/root/root2-fstab </dev/null; then apt-get install -y wget fi -armhf() { - [[ $(dpkg --print-architecture) == armhf ]] -} # fai on ubuntu only has official support using the universe repo, but newer # tends to have less bugs. wget -O - https://fai-project.org/download/fai-project.gpg | sudo dd of=/etc/apt/trusted.gpg.d/fai-project.gpg update=false -case $base in - stretch|buster|bullseye|bookworm) - if ! grep -qFx "deb https://fai-project.org/download $base koeln" /etc/apt/sources.list.d/fai.list; then - update=true - fi - cat >/etc/apt/sources.list.d/fai.list </etc/apt/sources.list.d/fai.list <&2 - exit 1 - ;; -esac f=/var/cache/apt/pkgcache.bin; if [[ -r $f ]]; then @@ -129,6 +126,7 @@ if $update; then apt-get update fi + # Relevant packages from fai-quickstart depends and fai-server recommends. # 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 @@ -149,6 +147,11 @@ e apt-get install -y ${pkgs[@]} # fai-client is already a fai-server dependency, but make sure it gets upgraded e apt-get install --no-install-recommends -y -o Dpkg::Options::=--no-force-confdef -o Dpkg::Options::=--force-confnew fai-server fai-client +if $pi_only; then + exit 0 +fi + + r=http://http.us.debian.org/debian # like default, but scrap httpredir, and nonfree. # All my systems should be able to get along without nonfree @@ -158,20 +161,9 @@ cat >/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/srv/fai/nfsroot/root/.ssh/known_hosts done