#!/bin/sh klogd -c1 # TODO: This should be even earlier. Can it go on the kernel command line? . common.sh debug_log samizdat.init my_configure_networking() { configure_networking > /dev/tty1 if [ -e /run/net-"$DEVICE".conf ] then . /run/net-"$DEVICE".conf printf 'Note: configure_networking: ROOTSERVER=%s\n', "$ROOTSERVER" >&2 else false fi } mountroot() { openvt -c 13 sh mkfifo "$MENUFIFO" if [ "$nbdroot" ]; then my_configure_networking (debug_log samizdat.nbd . /scripts/local-top/nbd bootdone nbd-script) wait_for_gnupghome_tar fi bootmenu samizdat_install_udev_rules bootwait samizdat-gpg bootwait root-mounted if [ "$IPV4DNS0" != '0.0.0.0' ]; then printf '%s\n' "$IPV4DNS0" "$IPV4DNS1" | sed -e '/^0.0.0.0$/d; s/^/nameserver /' > /root/etc/resolv.conf fi chvt 1 } cdrom_has_keys() { [ ! "$BOOTIF" ] || return bootwait samizdat-cdrom [ -d /cdrom/gnupghome ] } wait_for_gnupghome_tar() { [ -e /gnupghome.tar ] && return echo -n Waiting to receive GPG keys through the network... > /dev/tty1 my_configure_networking (while ! tftp -g -r gnupghome.tar -l /gnupghome.tar.$$ "$ROOTSERVER" 2>/run/initramfs/samizdat/log/tftp.$$.log; do sleep 1; echo -n . > /dev/tty1 done mv /gnupghome.tar.$$ /gnupghome.tar) echo ' done.' > /dev/tty1 (sleep 5; echo ) & (. common.sh && . btrfs-create.sh && init_gpg) } samizdat_restart_udev() { local LOG_DIR=/run/initramfs/samizdat/log mkdir -p "$LOG_DIR" killall systemd-udevd 2>/dev/null /lib/systemd/systemd-udevd --resolve-names=never --debug >$LOG_DIR/udevd-systemd.log 2>&1 & udevadm hwdb --update # rule is not executed by 'udevadm trigger' otherwise. not sure why }