#!/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 } read_nbd_variables() { NBDCLIENT=: . /scripts/local-top/nbd unset NBDCLIENT } run_nbd_client() { (debug_log samizdat.nbd read_nbd_variables for DEVNAME in /dev/nbd0 /dev/nbd1 do case "$DEVNAME" in /dev/nbd0) nbdpath=samizdat.btrfs ;; /dev/nbd1) nbdpath=samizdat.patch.btrfs ;; esac nbd-client $nbdsrv -N $nbdpath $nbdport $DEVNAME -swap -persist -systemd-mark done bootdone nbd-script) } write_resolv_dot_conf() { 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 } get_os_name() { [ -r /root/etc/os-release ] && . /root/etc/os-release echo -n ${PRETTY_NAME:-Debian GNU/Linux} } mountroot() { openvt -c 13 sh mkfifo "$MENUFIFO" if [ "$nbdroot" ]; then my_configure_networking run_nbd_client (. common.sh && . btrfs-create.sh) fi bootmenu samizdat_install_udev_rules bootwait root-mounted osname=$(get_os_name) write_resolv_dot_conf chvt 1 cat >/dev/tty1 </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 }