From 3d14e785e7c8fb3366f59d9edc229f1e0afdcd87 Mon Sep 17 00:00:00 2001 From: Mohamed Larabi Date: Fri, 1 Feb 2013 16:46:40 +0100 Subject: [PATCH] manage f18 hostname setting in vbuild-init-lxc.sh --- vbuild-init-lxc.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) 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() { -- 2.47.0