Commit 6a814f48 by Stéphane Graber

Merge pull request #876 from d4s/upstream

Added ALTLinux distribution.
parents a8a0f65d 5c60f990
...@@ -36,7 +36,7 @@ AC_GNU_SOURCE ...@@ -36,7 +36,7 @@ AC_GNU_SOURCE
# Detect the distribution. This is used for the default configuration and # Detect the distribution. This is used for the default configuration and
# for some distro-specific build options. # for some distro-specific build options.
AC_MSG_CHECKING([host distribution]) 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 if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
with_distro=`lsb_release -is` with_distro=`lsb_release -is`
fi fi
...@@ -56,6 +56,7 @@ if test "z$with_distro" = "z"; then ...@@ -56,6 +56,7 @@ if test "z$with_distro" = "z"; then
AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva") AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
AC_CHECK_FILE(/etc/mandriva-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/pardus-release,with_distro="pardus")
AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux")
fi fi
with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'` with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
...@@ -71,7 +72,7 @@ case $with_distro in ...@@ -71,7 +72,7 @@ case $with_distro in
distroconf=default.conf.lxcbr distroconf=default.conf.lxcbr
distrosysconf="$sysconfdir/default" 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 distroconf=default.conf.lxcbr
distrosysconf="$sysconfdir/sysconfig" distrosysconf="$sysconfdir/sysconfig"
;; ;;
...@@ -95,7 +96,7 @@ AC_ARG_WITH([init-script], ...@@ -95,7 +96,7 @@ AC_ARG_WITH([init-script],
case "$with_init_script" in case "$with_init_script" in
distro) distro)
case $with_distro in case $with_distro in
fedora|opensuse*) fedora|altlinux|opensuse*)
init_script=systemd init_script=systemd
;; ;;
redhat|centos|oracle|oracleserver|sparclinux|plamo) redhat|centos|oracle|oracleserver|sparclinux|plamo)
......
...@@ -57,33 +57,33 @@ configure_altlinux() ...@@ -57,33 +57,33 @@ configure_altlinux()
mkdir -p $rootfs_path/selinux mkdir -p $rootfs_path/selinux
echo 0 > $rootfs_path/selinux/enforce echo 0 > $rootfs_path/selinux/enforce
mkdir -p ${rootfs_path}/etc/net/ifaces/veth0 mkdir -p ${rootfs_path}/etc/net/ifaces/eth0
cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/options cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/options
BOOTPROTO=${BOOTPROTO} BOOTPROTO=${BOOTPROTO}
ONBOOT=yes ONBOOT=yes
NM_CONTROLLED=no NM_CONTROLLED=yes
TYPE=eth TYPE=eth
EOF EOF
if [ ${BOOTPROTO} != "dhcp" ]; then if [ ${BOOTPROTO} != "dhcp" ]; then
# ip address # ip address
cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv4address cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv4address
${ipv4} ${ipv4}
EOF EOF
cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv4route cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv4route
${gw} ${gw}
EOF EOF
cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/resolv.conf cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/resolv.conf
nameserver ${dns} nameserver ${dns}
EOF EOF
cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv6address cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv6address
${ipv6} ${ipv6}
EOF EOF
cat <<EOF > ${rootfs_path}/etc/net/ifaces/veth0/ipv6route cat <<EOF > ${rootfs_path}/etc/net/ifaces/eth0/ipv6route
${gw6} ${gw6}
EOF EOF
...@@ -109,14 +109,17 @@ EOF ...@@ -109,14 +109,17 @@ EOF
echo "console" >> ${rootfs_path}/etc/securetty echo "console" >> ${rootfs_path}/etc/securetty
# Enable services # Enable services
for service in network syslogd random for service in network syslogd random NetworkManager
do do
chroot ${rootfs_path} chkconfig $service --list &>/dev/null && chroot ${rootfs_path} chkconfig $service on || true 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 done
# Disable services # Disable services
for service in rawdevices fbsetfont for service in rawdevices fbsetfont
do do
chroot ${rootfs_path} chkconfig $service --list &>/dev/null && chroot ${rootfs_path} chkconfig $service off || true 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 done
subst 's/^\([3-9]\+:[0-9]\+:respawn:\/sbin\/mingetty.*\)/#\1/' ${rootfs_path}/etc/inittab subst 's/^\([3-9]\+:[0-9]\+:respawn:\/sbin\/mingetty.*\)/#\1/' ${rootfs_path}/etc/inittab
...@@ -175,7 +178,7 @@ download_altlinux() ...@@ -175,7 +178,7 @@ download_altlinux()
APT_GET="apt-get -o RPM::RootDir=$INSTALL_ROOT -y" APT_GET="apt-get -o RPM::RootDir=$INSTALL_ROOT -y"
PKG_LIST="$(grep -hs '^[^#]' "$profile_dir/$profile")" PKG_LIST="$(grep -hs '^[^#]' "$profile_dir/$profile")"
# if no configuration file $profile -- fall back to default list of packages # 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 mkdir -p $INSTALL_ROOT/var/lib/rpm
rpm --root $INSTALL_ROOT --initdb rpm --root $INSTALL_ROOT --initdb
...@@ -272,11 +275,11 @@ lxc.cap.drop = sys_module mac_admin mac_override sys_time ...@@ -272,11 +275,11 @@ lxc.cap.drop = sys_module mac_admin mac_override sys_time
#lxc.aa_profile = unconfined #lxc.aa_profile = unconfined
#networking #networking
lxc.network.type = $lxc_network_type #lxc.network.type = $lxc_network_type
lxc.network.flags = up #lxc.network.flags = up
lxc.network.link = $lxc_network_link #lxc.network.link = $lxc_network_link
lxc.network.name = veth0 #lxc.network.name = veth0
lxc.network.mtu = 1500 #lxc.network.mtu = 1500
EOF EOF
if [ ! -z ${ipv4} ]; then if [ ! -z ${ipv4} ]; then
cat <<EOF >> $config_path/config cat <<EOF >> $config_path/config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment