X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FFSF%2F11-iank;fp=fai%2Fconfig%2Fscripts%2FFSF%2F11-iank;h=93c227f584d7b3854aad7a3035e545d17cd85bd8;hp=7e94a409d2597ffb45c2eafbfb508460ec1f1b3b;hb=14f283f82afc48d6cec1bb7498ec34ac2b0da77c;hpb=bd3227e34e549257fee819cf6bd50fe202ca7996 diff --git a/fai/config/scripts/FSF/11-iank b/fai/config/scripts/FSF/11-iank index 7e94a40..93c227f 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 +else + ip=$(getent ahosts $HOSTNAME |grep ^209.*RAW| sed 's/ .*//') + ip6=$(getent ahosts $HOSTNAME |grep ^2001.*RAW| sed 's/ .*//') + gateway=209.51.188.1 + gateway6=2001:470:142::1 + cat > $target/etc/network/interfaces < /proc/sys/net/ipv6/conf/eth0/accept_dad + address $ip6 + netmask 48 + gateway $gateway6 EOF - fi fi -# I prefer to stick with ifup/down for now. a. networkd is not in its -# own package, so cant use in other init systems. b. it works fine. -chroot $FAI_ROOT bash </dev/null; then - usermod -aG $g iank - fi -done - -if getent group systemd-journal >/dev/null; then - usermod -aG systemd-journal iank -fi -EOFOUTER +##### end network setup ##### +# 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; 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