summaryrefslogtreecommitdiff
path: root/initramfs-tools
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-06-19 16:54:41 -0400
committerAndrew Cady <d@jerkface.net>2019-06-19 16:54:41 -0400
commitacf9c115b437fc07a3520b4d2542c03f95f57767 (patch)
tree5cffd1a7cf872721457322d754d8c106311f4209 /initramfs-tools
parenteed073df5aa1401f4fd149b2fb951ee77151f151 (diff)
initramfs: make sure we get $ROOTSERVER propagated
Diffstat (limited to 'initramfs-tools')
-rw-r--r--initramfs-tools/scripts/samizdat20
1 files changed, 16 insertions, 4 deletions
diff --git a/initramfs-tools/scripts/samizdat b/initramfs-tools/scripts/samizdat
index 5acf266..4f93a7f 100644
--- a/initramfs-tools/scripts/samizdat
+++ b/initramfs-tools/scripts/samizdat
@@ -3,6 +3,18 @@ klogd -c1 # TODO: This should be even earlier. Can it go on the kernel command
3. common.sh 3. common.sh
4debug_log samizdat.init 4debug_log samizdat.init
5 5
6my_configure_networking()
7{
8 configure_networking
9 if [ -e /run/net-"$DEVICE".conf ]
10 then
11 . /run/net-"$DEVICE".conf
12 printf 'Note: configure_networking: ROOTSERVER=%s\n', "$ROOTSERVER" >&2
13 else
14 false
15 fi
16}
17
6mountroot() 18mountroot()
7{ 19{
8 openvt -c 13 sh 20 openvt -c 13 sh
@@ -11,7 +23,7 @@ mountroot()
11 samizdat_install_udev_rules 23 samizdat_install_udev_rules
12 24
13 if [ "$nbdroot" ]; then 25 if [ "$nbdroot" ]; then
14 configure_networking 26 my_configure_networking
15 27
16 (debug_log samizdat.nbd 28 (debug_log samizdat.nbd
17 . /scripts/local-top/nbd 29 . /scripts/local-top/nbd
@@ -24,10 +36,9 @@ mountroot()
24 bootmenu 36 bootmenu
25 bootwait root-mounted 37 bootwait root-mounted
26 38
27 if [ "$IPV4DNS0" ]; then 39 if [ "$IPV4DNS0" != '0.0.0.0' ]; then
28 printf '%s\n' "$IPV4DNS0" "$IPV4DNS1" | 40 printf '%s\n' "$IPV4DNS0" "$IPV4DNS1" |
29 grep -v 0.0.0.0 | 41 sed -e '/^0.0.0.0$/d; s/^/nameserver /' > /root/etc/resolv.conf
30 sed 's/^/nameserver /' > /root/etc/resolv.conf
31 fi 42 fi
32 chvt 1 43 chvt 1
33} 44}
@@ -43,6 +54,7 @@ wait_for_gnupghome_tar()
43{ 54{
44 [ -e /gnupghome.tar ] && return 55 [ -e /gnupghome.tar ] && return
45 echo -n Waiting to receive GPG keys through the network... 56 echo -n Waiting to receive GPG keys through the network...
57 my_configure_networking
46 (while ! tftp -g -r gnupghome.tar -l /gnupghome.tar.$$ "$ROOTSERVER" 2>/run/initramfs/samizdat/log/tftp.$$.log; do 58 (while ! tftp -g -r gnupghome.tar -l /gnupghome.tar.$$ "$ROOTSERVER" 2>/run/initramfs/samizdat/log/tftp.$$.log; do
47 sleep 1; 59 sleep 1;
48 echo -n . 60 echo -n .