@@ -63,9 +63,9 @@ in
6363 copy_bin_and_libs ${pkgs.mkinitcpio-nfs-utils}/bin/ipconfig
6464 '';
6565
66− boot.initrd.preLVMCommands =
66+ boot.initrd.preLVMCommands = mkBefore (
6767 # Search for interface definitions in command line.
68− mkBefore ''
68+ ''
6969 for o in $(cat /proc/cmdline); do
7070 case $o in
7171 ip=*)
@@ -87,11 +87,16 @@ in
8787
8888 # Acquire a DHCP lease.
8989 echo "acquiring IP address via DHCP..."
90− udhcpc --quit --now --script ${udhcpcScript}
90+ udhcpc --quit --now --script ${udhcpcScript} && hasNetwork=1
9191 fi
9292 ''
9393
94− + cfg.postCommands;
94+ + ''
95+ if [ -n "$hasNetwork" ]; then
96+ echo "networking is up!"
97+ ${cfg.postCommands}
98+ fi
99+ '');
95100
96101 };
97102