X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-debootstrap;h=d5c3f707b2d792b58f84d577f8875ad37d09349c;hb=7e1e9b8dbdcf2ad71aff50ffdb032eb9df8a9e64;hp=5dbe1a77ffd4e7155d810265816fc29e605f70dd;hpb=0b1d9821475753d8580982724b807cc8f2daa7e5;p=grml-debootstrap.git diff --git a/grml-debootstrap b/grml-debootstrap index 5dbe1a7..d5c3f70 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1728,6 +1728,16 @@ allow-hotplug eth0 iface eth0 inet dhcp " + # add dhcp setting for Predictable Network Interface Names + if [ -x /bin/udevadm ]; then + for interface in $(udevadm info -e | sed -n -e 's/E: ID_NET_NAME_PATH=\([^$*]\)/\1/p'); do + DEFAULT_INTERFACES="${DEFAULT_INTERFACES} +allow-hotplug ${interface} +iface ${interface} inet dhcp +" + done + fi + if [ -n "$NOINTERFACES" ] ; then einfo "Not installing /etc/network/interfaces as requested via --nointerfaces option" ; eend 0 elif [ -n "$USE_DEFAULT_INTERFACES" ] ; then @@ -1754,16 +1764,21 @@ iface eth0 inet dhcp fi if [ -n "${SSHCOPYID}" ] ; then - ssh-add -L > /dev/null 2>&1 ; RC=$? - if [ $RC -eq 0 ] ; then + if ssh-add -L >/dev/null 2>&1 ; then einfo "Use locally available public keys to authorise root login on the target system as requested via --sshcopyid option." - mkdir "${MNTPOINT}"/root/.ssh + mkdir -p "${MNTPOINT}"/root/.ssh chmod 0700 "${MNTPOINT}"/root/.ssh - ssh-add -L > "${MNTPOINT}"/root/.ssh/authorized_keys - eend 0 + if ssh-add -L >> "${MNTPOINT}"/root/.ssh/authorized_keys ; then + eend 0 + else + eerror "Error: executing 'ssh-add -L' failed." + eend 1 + bailout 1 + fi else - ewarn "Could not open a connection to your authentication agent or the agent has no identites." - eend $? + eerror "Could not open a connection to your authentication agent or the agent has no identites." + eend 1 + bailout 1 fi fi