From: Thierry Parmentelat Date: Thu, 25 Apr 2013 14:33:57 +0000 (+0200) Subject: or f12, don't mess with systemd in gues if not installed X-Git-Tag: 5.2.2~20 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8011a9aca567bdf310b52b6944b9a82e69d089dd;p=build.git or f12, don't mess with systemd in gues if not installed --- diff --git a/vbuild-init-lxc.sh b/vbuild-init-lxc.sh index f972e2d4..22f68222 100755 --- a/vbuild-init-lxc.sh +++ b/vbuild-init-lxc.sh @@ -65,7 +65,7 @@ function bridge_init () { address=$(/sbin/ip addr show $INTERFACE_LAN | grep -v inet6 | grep inet | head --lines=1 | awk '{print $2;}') [ -z "$address" ] && { echo "ERROR: Could not determine IP address for $INTERFACE_LAN" ; exit 1 ; } -broadcast=$(/sbin/ip addr show $INTERFACE_LAN | grep -v inet6 | grep inet | head --lines=1 | awk '{print $4;}') + broadcast=$(/sbin/ip addr show $INTERFACE_LAN | grep -v inet6 | grep inet | head --lines=1 | awk '{print $4;}') [ -z "$broadcast" ] && echo "WARNING: Could not determine broadcast address for $INTERFACE_LAN" gateway=$(netstat -rn | grep '^0.0.0.0' | awk '{print $2;}') @@ -246,8 +246,11 @@ function configure_fedora_init() { chroot ${rootfs_path} /sbin/chkconfig network on } - +# this code of course is for guests that do run on systemd function configure_fedora_systemd() { + # so ignore if we can't find /etc/systemd at all + [ -d ${rootfs_path}/etc/systemd ] || return 0 + # otherwise let's proceed unlink ${rootfs_path}/etc/systemd/system/default.target ln -s /lib/systemd/system/multi-user.target ${rootfs_path}/etc/systemd/system/default.target touch ${rootfs_path}/etc/fstab