From 1728af7e3060c8608c622f210d6e16f7d085d8f9 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 4 Jan 2017 12:47:34 -0800 Subject: [PATCH] small updates --- arch-init | 7 +++---- fai/config/distro-install-common/end | 8 +++++--- fai/config/hooks/instsoft.DEFAULT | 2 ++ myfai-chboot-local | 2 +- wrt-setup | 14 ++++++++++---- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/arch-init b/arch-init index e22b37a..37fa90b 100755 --- a/arch-init +++ b/arch-init @@ -48,7 +48,7 @@ export PARTITION_PROMPT=true # to be idempotent if we fail after partitioning already_partitioned=true mount_out=$(mount) -for dir in /mnt{,/home,/boot,/q}; do +for dir in /mnt{,/home,/boot,/a}; do regex=" on $dir " if [[ ! $mount_out =~ $regex ]]; then already_partitioned=false @@ -73,8 +73,8 @@ sed -ri --follow-symlinks "/^crypt_dev_\S+$rootn /d" /tmp/fai/crypttab if ! $already_partitioned; then mount -o subvol=root_$DISTRO $ROOT_PARTITION /mnt - mkdir -p /mnt/{q,home,boot} - mount -o subvol=q $ROOT_PARTITION /mnt/q + mkdir -p /mnt/{a,home,boot} + mount -o subvol=a $ROOT_PARTITION /mnt/a mount -o subvol=boot_$DISTRO $BOOT_PARTITION /mnt/boot fi @@ -101,7 +101,6 @@ bindmount() { mkdir -p $mountpoint mount -o bind $source $mountpoint } -bindmount /a /mnt/a bindmount /root/shadow /mnt/q/root/shadow mkdir -p /mnt/etc/ssh diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end index 3735142..bc4e816 100755 --- a/fai/config/distro-install-common/end +++ b/fai/config/distro-install-common/end @@ -30,9 +30,9 @@ chpw() { echo "$0: warning: no pw set for $user" >&2 fi } -au() { - if ! $ROOTCMD getent passwd $1; then - $ROOTCMD useradd -m -s /bin/bash $1 || [[ $? == 9 ]] +au() { # add user + if ! $ROOTCMD getent passwd ${@: -1}; then + $ROOTCMD useradd -m -s /bin/bash $@ fi } @@ -81,3 +81,5 @@ while true; do dir=$(dirname $dir) if [[ $dir == /p ]]; then break; fi done + +au -s /bin/false --home-dir /var/lib/bitcoind bitcoin diff --git a/fai/config/hooks/instsoft.DEFAULT b/fai/config/hooks/instsoft.DEFAULT index de47766..36c0caf 100755 --- a/fai/config/hooks/instsoft.DEFAULT +++ b/fai/config/hooks/instsoft.DEFAULT @@ -29,6 +29,8 @@ EOF chmod +x $f +# for hosts which don't have these data volumes, copy the specific +# files we need. if ifclass demohost; then files=(/var/lib/fai/config/distro-install-common/luks/host-demohost) elif ifclass tp; then diff --git a/myfai-chboot-local b/myfai-chboot-local index 8d4e1ce..9eac43f 100755 --- a/myfai-chboot-local +++ b/myfai-chboot-local @@ -19,7 +19,7 @@ kernel=$(fai-chboot -L '^default$' | awk '{print $3}') # man page doesn't explain this, but this deletes & thus disables # all chboot systems. type -t host &>/dev/null || apt-get -y install dnsutils -gateway_ip=$(route -n | sed -rn 's/^(0\.){3}0\s+(\S+).*/\2/p') +gateway_ip=$(route -n | sed -rn 's/^0\.0\.0\.0\s+(\S+).*/\1/p') my_ip=$(host faiserver $gateway_ip | sed -rn 's/^\S+ has address //p') k_args=$(fai-chboot -L '^default$' | \ sed -r "s/^(\S+\s+){3}(.*root=)(.*)/\2$my_ip:\3/") diff --git a/wrt-setup b/wrt-setup index b244bca..82f7193 100755 --- a/wrt-setup +++ b/wrt-setup @@ -172,6 +172,13 @@ v /etc/init.d/nfsd enable # EOF +v cedit /etc/config/network <<'EOF' || v /etc/init.d/network reload +config 'route' 'transmission' + option 'interface' 'lan' + option 'target' '10.173.0.0' + option 'netmask' '255.255.0.0' + option 'gateway' '192.168.1.2' +EOF v cedit /etc/config/firewall <<'EOF' || firewall_restart=true config redirect @@ -238,10 +245,9 @@ v cedit /etc/hosts <