[lxc-devel] [lxc/master] Added ALTLinux distribution.

d4s on Github lxc-bot at linuxcontainers.org
Sat Mar 5 13:54:22 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 427 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160305/3b46ad72/attachment.bin>
-------------- next part --------------
From 5c60f9903768b49d329e20e3fdb333753f719502 Mon Sep 17 00:00:00 2001
From: Denis Pynkin <denis_pynkin at epam.com>
Date: Sat, 5 Mar 2016 16:40:17 +0300
Subject: [PATCH] Added ALTLinux distribution.

- Added ALTLinux distribution.
- Updated template for ALTLinux Sisyphus

Signed-off-by: Denis Pynkin <denis_pynkin at epam.com>
---
 configure.ac              |  7 ++++---
 templates/lxc-altlinux.in | 33 ++++++++++++++++++---------------
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4756493..7fdda70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,7 @@ AC_GNU_SOURCE
 # Detect the distribution. This is used for the default configuration and
 # for some distro-specific build options.
 AC_MSG_CHECKING([host distribution])
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux.]))
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux, altlinux.]))
 if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
 	with_distro=`lsb_release -is`
 fi
@@ -56,6 +56,7 @@ if test "z$with_distro" = "z"; then
 	AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
 	AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
 	AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
+	AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux")
 fi
 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
 
@@ -71,7 +72,7 @@ case $with_distro in
 		distroconf=default.conf.lxcbr
 		distrosysconf="$sysconfdir/default"
 		;;
-	redhat|centos|fedora|oracle|oracleserver|sparclinux|suse|opensuse*|plamo)
+	redhat|centos|fedora|oracle|oracleserver|sparclinux|altlinux|suse|opensuse*|plamo)
 		distroconf=default.conf.lxcbr
 		distrosysconf="$sysconfdir/sysconfig"
 		;;
@@ -95,7 +96,7 @@ AC_ARG_WITH([init-script],
 case "$with_init_script" in
 	distro)
 		case $with_distro in
-			fedora|opensuse*)
+			fedora|altlinux|opensuse*)
 				init_script=systemd
 				;;
 			redhat|centos|oracle|oracleserver|sparclinux|plamo)
diff --git a/templates/lxc-altlinux.in b/templates/lxc-altlinux.in
index 8b4168c..57c6274 100644
--- a/templates/lxc-altlinux.in
+++ b/templates/lxc-altlinux.in
@@ -57,33 +57,33 @@ configure_altlinux()
     mkdir -p $rootfs_path/selinux
     echo 0 > $rootfs_path/selinux/enforce
 
-    mkdir -p ${rootfs_path}/etc/net/ifaces/veth0
-    cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/options
+    mkdir -p ${rootfs_path}/etc/net/ifaces/eth0
+    cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/options
 BOOTPROTO=${BOOTPROTO}
 ONBOOT=yes
-NM_CONTROLLED=no
+NM_CONTROLLED=yes
 TYPE=eth
 EOF
 
 if [ ${BOOTPROTO} != "dhcp" ]; then
     # ip address
-    cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv4address
+    cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv4address
 ${ipv4}
 EOF
 
-    cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv4route
+    cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv4route
 ${gw}
 EOF
 
-    cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/resolv.conf
+    cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/resolv.conf
 nameserver ${dns}
 EOF
 
-    cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv6address
+    cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv6address
 ${ipv6}
 EOF
 
-    cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv6route
+    cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv6route
 ${gw6}
 EOF
 
@@ -109,14 +109,17 @@ EOF
     echo "console" >> ${rootfs_path}/etc/securetty
 
     # Enable services
-    for service in network syslogd random
+    for service in network syslogd random NetworkManager
     do
        chroot ${rootfs_path} chkconfig $service --list &>/dev/null && chroot ${rootfs_path} chkconfig $service on || true
+       # For systemd
+       chroot ${rootfs_path} systemctl -q enable $service &>/dev/null|| true
     done
     # Disable services
     for service in rawdevices fbsetfont
     do
        chroot ${rootfs_path} chkconfig $service --list &>/dev/null && chroot ${rootfs_path} chkconfig $service off || true
+       chroot ${rootfs_path} systemctl -q disable $service &>/dev/null || true
     done
 
     subst 's/^\([3-9]\+:[0-9]\+:respawn:\/sbin\/mingetty.*\)/#\1/' ${rootfs_path}/etc/inittab
@@ -175,7 +178,7 @@ download_altlinux()
     APT_GET="apt-get -o RPM::RootDir=$INSTALL_ROOT -y"
     PKG_LIST="$(grep -hs '^[^#]' "$profile_dir/$profile")"
     # 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"
+    [ -z "$PKG_LIST" ] && PKG_LIST="interactivesystem apt apt-conf-sisyphus etcnet-full openssh-server systemd-sysvinit systemd-units systemd NetworkManager-daemon"
 
     mkdir -p $INSTALL_ROOT/var/lib/rpm
     rpm --root $INSTALL_ROOT  --initdb
@@ -272,11 +275,11 @@ lxc.cap.drop = sys_module mac_admin mac_override sys_time
 #lxc.aa_profile = unconfined
 
 #networking
-lxc.network.type = $lxc_network_type
-lxc.network.flags = up
-lxc.network.link = $lxc_network_link
-lxc.network.name = veth0
-lxc.network.mtu = 1500
+#lxc.network.type = $lxc_network_type
+#lxc.network.flags = up
+#lxc.network.link = $lxc_network_link
+#lxc.network.name = veth0
+#lxc.network.mtu = 1500
 EOF
 if [ ! -z ${ipv4} ]; then
     cat <<EOF >> $config_path/config


More information about the lxc-devel mailing list