X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FFSF%2F11-iank;h=8a33d6f70edd1c614089bcdb88844d755d8d01d7;hb=137ffae7de84a51c4b438ccf2fb50f5571f522a6;hp=7e94a409d2597ffb45c2eafbfb508460ec1f1b3b;hpb=4abbc67ed68213ec94fcf5970d3e34661967a87c;p=automated-distro-installer diff --git a/fai/config/scripts/FSF/11-iank b/fai/config/scripts/FSF/11-iank index 7e94a40..8a33d6f 100755 --- a/fai/config/scripts/FSF/11-iank +++ b/fai/config/scripts/FSF/11-iank @@ -9,106 +9,11 @@ if [[ $EUID != 0 ]]; then fi -# -r = recursive -# -i = ignore non-matching class warnings, always exit 0 -# -B = no backup files -fcopy -riBM /boot +sed 's/^/root:/' $FAI/distro-install-common/shadow/community0p | $ROOTCMD chpasswd -e - - -chpw() { - # generating a hashed password: - # under debian, you can do - # mkpasswd -m sha-512 -s >/q/root/shadow/standard - # On arch, best seems to be copy your shadow file to a temp location, - # then passwd, get out the new pass, then copy the shadow file back. - - user=$1 - pwfile=$2 - if [[ $pwfile && -e $pwfile ]]; then - printf "$user:" | cat - "$pwfile" | $ROOTCMD chpasswd -e - else - echo "$0: warning: no pw set for $user" >&2 - fi -} - -chpw root $FAI/distro-install-common/shadow/community0p - - -#### misc configurations -chroot $FAI_ROOT bash <<'EOFOUTER' -if getent group systemd-journal >/dev/null; then - # makes the journal be saved to disk. - mkdir -p /var/log/journal - chmod 755 /var/log/journal -fi -debconf-set-selections <$FAI_ROOT/etc/grub.d/40_custom </dev/null; then - update-grub2 -else - update-grub -fi - -EOF - - - cat > $target/etc/network/interfaces <<-EOF +# todo, need to set static ip here +if ifclass demohost; then + cat > $target/etc/network/interfaces <$target/etc/initramfs-tools/conf.d/mine < $target/etc/network/interfaces <<-EOF -# generated by FAI -auto lo eth0 + if ip l show dev bond0 &>/dev/null; then + cat >$target/etc/network/interfaces <>$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/bond0/accept_dad + address $ip6 + netmask 48 + gateway $gateway6 EOF + fi -##### end network setup ##### - - -if ifclass VOL_BULLSEYE_BOOTSTRAP; then - fcopy /etc/systemd/system/faicheck.service - chroot $FAI_ROOT bash <<'EOFOUTER' -systemctl enable faicheck.service -EOFOUTER - exit 0 # avoid unnecessary stuff in bootstrap vol -fi + else + cat > $target/etc/network/interfaces <>$target/etc/network/interfaces < /proc/sys/net/ipv6/conf/eth0/accept_dad +address $ip6 +netmask 48 +gateway $gateway6 +EOF + fi fi - chown -R 1000:1000 /home/iank/.ssh - chmod -R u=Xrw,og= /home/iank/.ssh - rm -rf /root/.ssh - # remove broken symlinks or the following cp will fail - find /home/iank/.ssh -xtype l -exec rm '{}' \; - cp -rL /home/iank/.ssh /root - chown -R root:root /root/.ssh - chmod 700 /root/.ssh fi -# old link from -# # https://ticktockhouse.svbtle.com/my-obligatory-ubuntu-ssh-agent-post -# but that made a service that started too soon and didn't pick up our -# x env vars. instead, copy from the root ssh-agent just the -# appropriate things into a new service. -rm -f /home/iank/.config/systemd/user/default.target.wants/ssh-agent.service - -rm -f /home/iank/.local/share/systemd/user/sshaiank.service \ - /home/iank/.config/systemd/user/default.target.wants/sshaiank.service - -#### end .ssh setup ### +# previously had an else condition after +#elif ifclass VM || ifclass LINODE; then +# iface $NIC1 inet manual +# iface br0 inet dhcp +# bridge_ports $NIC1 +# bridge_stp off +# bridge_maxwait 0 +# however, on t9, on startup, br0, became +# rename1 and didn't come up. i dunno why, +# but the bridge is for vms that I rarely use, +# so not bothering to figure it out. -## duplicated in ssh-emacs-setup -# done here so its setup earlier for convenience -line='AcceptEnv INSIDE_EMACS BRC COLUMNS' -f=/etc/ssh/sshd_config -grep -xFq "$line" $f || tee -a $f <<<"$line" +##### end network setup ##### -# default debian groups (jessie through buster) + adm, root, admin -for g in cdrom floppy audio dip video plugdev netdev adm sudo admin; do - if getent group $g >/dev/null; then - usermod -aG $g iank - fi -done - -if getent group systemd-journal >/dev/null; then - usermod -aG systemd-journal iank -fi -EOFOUTER - +# note: systemd-resolved + ifupdown causes networking.service to fail in t11, +# https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1907878 +systemctl disable systemd-resolved +# rm first to remove any symlink rm -f $target/etc/resolv.conf -ln -s ../run/systemd/resolve/stub-resolv.conf $target/etc/resolv.conf -# needed for bitfolk image -if [[ -e /a/bin/fai/fai-wrapper ]]; then - systemctl enable systemd-resolved - systemctl start systemd-resolved -fi - - -# reading through the groups that iank is in but user2 isn't, -for g in plugdev audio video cdrom; do - $ROOTCMD usermod -a -G $g user2 -done +if ifclass demohost || [[ $GATEWAYS != 209.51.188.* ]]; then + cat >$target/etc/resolv.conf <<'EOF' +nameserver 8.8.8.8 +EOF +else + cat >$target/etc/resolv.conf <<'EOF' +domain fsf.org +search fsf.org +nameserver 209.51.188.16 +nameserver 209.51.188.27 +EOF +fi