From: Mohamed Larabi Date: Fri, 1 Feb 2013 15:46:40 +0000 (+0100) Subject: manage f18 hostname setting in vbuild-init-lxc.sh X-Git-Tag: 5.2.1~78^2~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3d14e785e7c8fb3366f59d9edc229f1e0afdcd87;p=build.git manage f18 hostname setting in vbuild-init-lxc.sh --- diff --git a/vbuild-init-lxc.sh b/vbuild-init-lxc.sh index ed140217..911ea5d6 100755 --- a/vbuild-init-lxc.sh +++ b/vbuild-init-lxc.sh @@ -208,10 +208,16 @@ MTU=1500 EOF # set the hostname +if [ "fcdistro" == "f18"]; then + cat < ${rootfs_path}/etc/hostname +$HOSTNAME +EOF +else cat < ${rootfs_path}/etc/sysconfig/network NETWORKING=yes HOSTNAME=$HOSTNAME EOF +fi # set minimal hosts # cat < $rootfs_path/etc/hosts @@ -251,6 +257,8 @@ function configure_fedora_init() { sed -i 's|.sbin.start_udev||' ${rootfs_path}/etc/rc.d/rc.sysinit chroot ${rootfs_path} chkconfig udev-post off chroot ${rootfs_path} chkconfig network on + if [ "fcdistro" == "f18"]; then + chroot ${rootfs_path} hostnamectl set-hostname $HOSTNAME } @@ -263,6 +271,9 @@ function configure_fedora_systemd() { #dependency on a device unit fails it specially that we disabled udev sed -i 's/After=dev-%i.device/After=/' ${rootfs_path}/lib/systemd/system/getty\@.service chroot ${rootfs_path} chkconfig network on + if [ "fcdistro" == "f18"]; then + chroot ${rootfs_path} hostnamectl set-hostname $HOSTNAME + fi } function download_fedora() {