From: Denis Pynkin Date: Fri, 15 Aug 2014 19:06:10 +0000 (+0300) Subject: Updated template for ALTLinux. X-Git-Tag: lxc-1.1.0.alpha2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9ae28a05a65f2bd0dc6695ab5cdfb723ee8b226;p=thirdparty%2Flxc.git Updated template for ALTLinux. - Added predefined package list if /etc/lxc/profiles/default is absent. - Fixed syntax mistake in options list. Signed-off-by: Denis Pynkin Acked-by: Stéphne Graber --- diff --git a/templates/lxc-altlinux.in b/templates/lxc-altlinux.in index 8694eb6f3..828c68c10 100644 --- a/templates/lxc-altlinux.in +++ b/templates/lxc-altlinux.in @@ -119,10 +119,6 @@ EOF echo "c1:2345:respawn:/sbin/mingetty --noclear console" >> ${rootfs_path}/etc/inittab subst 's,\/dev\/tty12,/var/log/syslog/console,' ${rootfs_path}/etc/syslog.conf -# touch file for fastboot - touch ${rootfs_path}/fastboot - chattr +i ${rootfs_path}/fastboot - dev_path="${rootfs_path}/dev" rm -rf ${dev_path} mkdir -p ${dev_path} @@ -172,10 +168,19 @@ download_altlinux() echo "Downloading altlinux minimal ..." APT_GET="apt-get -o RPM::RootDir=$INSTALL_ROOT -y" PKG_LIST="$(grep -hs '^[^#]' "$profile_dir/$profile")" -# PKG_LIST="basesystem apt apt-conf-sisyphus etcnet openssh-server passwd sysklogd net-tools e2fsprogs" + # if no configuration file $profile -- fall back to default list of packages + [ -z "$PKG_LIST" ] && PKG_LIST="interactivesystem apt apt-conf-sisyphus etcnet openssh-server systemd systemd-units systemd-sysvinit" mkdir -p $INSTALL_ROOT/var/lib/rpm rpm --root $INSTALL_ROOT --initdb + + # some scripts want to have /dev/null at least + dev_path="$INSTALL_ROOT/dev" + if [ ! -c "${dev_path}/null" ]; then + mkdir -p "${dev_path}" + mknod -m 666 "${dev_path}/null" c 1 3 + fi + $APT_GET install $PKG_LIST if [ $? -ne 0 ]; then @@ -372,7 +377,7 @@ EOF return 0 } -options=$(getopt -o hp:n:P:cR:4:6:g:d: -l help,rootfs:,path:,name:,profile:,clean,release:ipv4:ipv6:gw:dns: -- "$@") +options=$(getopt -o hp:n:P:cR:4:6:g:d: -l help,rootfs:,path:,name:,profile:,clean,release:,ipv4:,ipv6:,gw:,dns: -- "$@") if [ $? -ne 0 ]; then usage $(basename $0) exit 1 @@ -449,11 +454,6 @@ fi config_path=$default_path/$name cache=$cache_base/$release/$profile -if [ -f $config_path/config ]; then - echo "A container with that name exists, chose a different name" - exit 1 -fi - install_altlinux if [ $? -ne 0 ]; then echo "failed to install altlinux"