Commit f5cdd5ac by Christian Brauner Committed by GitHub

Merge pull request #1724 from GamerSource/opensuse-template-improvements-v2

Opensuse template improvements
parents d1f811d5 46a892d5
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# Frederic Crozat <fcrozat@suse.com> # Frederic Crozat <fcrozat@suse.com>
# Michael H. Warfield <mhw@WittsEnd.com> # Michael H. Warfield <mhw@WittsEnd.com>
# Johannes Kastl <mail@ojkastl.de> # Johannes Kastl <mail@ojkastl.de>
# Thomas Lamprecht <t.lamprecht@proxmox.com>
# This library is free software; you can redistribute it and/or # This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public # modify it under the terms of the GNU Lesser General Public
...@@ -101,8 +102,10 @@ EOF ...@@ -101,8 +102,10 @@ EOF
ln -s /dev/null $rootfs/etc/systemd/system/proc-sys-fs-binfmt_misc.automount ln -s /dev/null $rootfs/etc/systemd/system/proc-sys-fs-binfmt_misc.automount
ln -s /dev/null $rootfs/etc/systemd/system/console-shell.service ln -s /dev/null $rootfs/etc/systemd/system/console-shell.service
ln -s /dev/null $rootfs/etc/systemd/system/systemd-vconsole-setup.service ln -s /dev/null $rootfs/etc/systemd/system/systemd-vconsole-setup.service
# enable getty and console services
sed -e 's/ConditionPathExists=.*//' $rootfs/usr/lib/systemd/system/getty@.service > $rootfs/etc/systemd/system/getty@.service sed -e 's/ConditionPathExists=.*//' $rootfs/usr/lib/systemd/system/getty@.service > $rootfs/etc/systemd/system/getty@.service
ln -s getty@.service $rootfs/etc/systemd/system/getty@tty1.service ln -s getty@.service $rootfs/etc/systemd/system/getty@tty1.service
mkdir -p $rootfs/etc/systemd/system/getty.target.wants/
ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@console.service ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@console.service
ln -s -f ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty1.service ln -s -f ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty1.service
ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty2.service ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty2.service
...@@ -138,26 +141,33 @@ download_opensuse() ...@@ -138,26 +141,33 @@ download_opensuse()
# download a mini opensuse into a cache # download a mini opensuse into a cache
echo "Downloading opensuse minimal ..." echo "Downloading opensuse minimal ..."
mkdir -p "$cache/partial-$arch-packages" mkdir -p "$cache/partial-$arch-packages"
oss_repo_url="http://download.opensuse.org/distribution/$DISTRO/repo/oss/"
if [[ $DISTRO == "tumbleweed" ]]; then if [[ $DISTRO == "tumbleweed" ]]; then
zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/$DISTRO/repo/oss/ repo-oss || return 1 oss_repo_url="http://download.opensuse.org/$DISTRO/repo/oss/"
else
zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/distribution/$DISTRO/repo/oss/ repo-oss || return 1
fi fi
zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar "$oss_repo_url" repo-oss || return 1
update_repo_url="http://download.opensuse.org/update/$DISTRO/repo/oss"
# Leap update repos were rearranged # Leap update repos were rearranged
if [[ $DISTRO == "leap/4"* ]]; then if [[ $DISTRO == "leap/4"* ]]; then
zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/update/$DISTRO/oss/ update || return 1 update_repo_url="http://download.opensuse.org/update/$DISTRO/oss/"
else fi
zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/update/$DISTRO/ update || return 1 # tumbleweed has no update repo
if [[ $DISTRO != "tumbleweed" ]]; then
zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar "$update_repo_url" update || return 1
fi fi
zypper --quiet --root $cache/partial-$arch-packages --non-interactive --gpg-auto-import-keys update || return 1 zypper --quiet --root $cache/partial-$arch-packages --non-interactive --gpg-auto-import-keys update || return 1
zypper --root $cache/partial-$arch-packages --non-interactive in --auto-agree-with-licenses --download-only zypper lxc patterns-openSUSE-base bash iputils sed tar rsyslog || return 1 zypper --root $cache/partial-$arch-packages --non-interactive in --auto-agree-with-licenses --download-only zypper lxc patterns-openSUSE-base bash iputils sed tar rsyslog || return 1
cat > $cache/partial-$arch-packages/opensuse.conf << EOF cat > $cache/partial-$arch-packages/opensuse.conf << EOF
Preinstall: aaa_base bash coreutils diffutils Preinstall: aaa_base bash coreutils diffutils
Preinstall: filesystem fillup glibc grep insserv-compat perl-base Preinstall: filesystem fillup glibc grep insserv-compat perl-base
Preinstall: libbz2-1 libncurses5 pam Preinstall: libbz2-1 pam
Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1 Preinstall: permissions rpm sed tar libz1 libselinux1
Preinstall: liblzma5 libcap2 libacl1 libattr1 Preinstall: liblzma5 libcap2 libacl1 libattr1
Preinstall: libpopt0 libelf1 liblua5_1 Preinstall: libpopt0 libelf1
Preinstall: libpcre1 Preinstall: libpcre1
RunScripts: aaa_base RunScripts: aaa_base
...@@ -170,7 +180,7 @@ Support: iputils ...@@ -170,7 +180,7 @@ Support: iputils
Support: udev Support: udev
Support: netcfg Support: netcfg
Support: hwinfo insserv-compat module-init-tools openSUSE-release openssh Support: hwinfo insserv-compat module-init-tools openSUSE-release openssh
Support: pwdutils rpcbind sysconfig Support: pwdutils sysconfig
Ignore: rpm:suse-build-key,build-key Ignore: rpm:suse-build-key,build-key
Ignore: systemd:systemd-presets-branding Ignore: systemd:systemd-presets-branding
...@@ -181,15 +191,20 @@ EOF ...@@ -181,15 +191,20 @@ EOF
echo "Support: python3-base" >> $cache/partial-$arch-packages/opensuse.conf echo "Support: python3-base" >> $cache/partial-$arch-packages/opensuse.conf
fi fi
# dhcpcd is not in the default repos since Leap 42.1 if [[ $DISTRO == "tumbleweed" ]]; then
if [[ $DISTRO != "leap/4"* ]] echo "Preinstall: liblua5_3 libncurses6 libreadline7" >> $cache/partial-$arch-packages/opensuse.conf
then else
echo "Preinstall: liblua5_1 libncurses5 libreadline6" >> $cache/partial-$arch-packages/opensuse.conf
echo "Support: rpcbind" >> $cache/partial-$arch-packages/opensuse.conf
fi
# dhcpcd is not in the default repos since Leap 42.1, neither in tumbleweed
if [[ $DISTRO != "leap/4"* ]] && [[ $DISTRO != "tumbleweed" ]]; then
echo "Support: dhcpcd" >> $cache/partial-$arch-packages/opensuse.conf echo "Support: dhcpcd" >> $cache/partial-$arch-packages/opensuse.conf
fi fi
# Leap doesn't seem to have iproute2 utils installed # Leap and tumbleweed doesn't seem to have iproute2 utils installed
if [[ $DISTRO == "leap/4"* ]] if [[ $DISTRO == "leap/4"* ]] || [[ $DISTRO == "tumbleweed" ]]; then
then
echo "Support: net-tools iproute2" >> $cache/partial-$arch-packages/opensuse.conf echo "Support: net-tools iproute2" >> $cache/partial-$arch-packages/opensuse.conf
fi fi
...@@ -207,13 +222,16 @@ EOF ...@@ -207,13 +222,16 @@ EOF
# openSUSE 13.2 has no noarch directory in update # openSUSE 13.2 has no noarch directory in update
[ -d $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch ] || mkdir -p $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch [ -d $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch ] || mkdir -p $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch
CLEAN_BUILD=1 BUILD_ARCH="$arch" BUILD_ROOT="$cache/partial-$arch" BUILD_DIST="$cache/partial-$arch-packages/opensuse.conf" PATH="$PATH:$BUILD_DIR" $BUILD_DIR/init_buildsystem --clean --configdir $BUILD_DIR/configs --cachedir $cache/partial-$arch-cache --repository $cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/$arch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/noarch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/$arch --repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch || return 1 repos=("--repository" "$cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/$arch" "--repository" "$cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/noarch")
chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar http://download.opensuse.org/distribution/$DISTRO/repo/oss repo-oss || return 1 if [[ $DISTRO != "tumbleweed" ]]; then # tumbleweed has no update repo
repos+=("--repository" "$cache/partial-$arch-packages/var/cache/zypp/packages/update/$arch" "--repository" "$cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch")
fi
if [[ $DISTRO == "leap/4"* ]]; then CLEAN_BUILD=1 BUILD_ARCH="$arch" BUILD_ROOT="$cache/partial-$arch" BUILD_DIST="$cache/partial-$arch-packages/opensuse.conf" PATH="$PATH:$BUILD_DIR" $BUILD_DIR/init_buildsystem --clean --configdir $BUILD_DIR/configs --cachedir $cache/partial-$arch-cache ${repos[*]} || return 1
chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar http://download.opensuse.org/update/$DISTRO/oss update || return 1
else chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar "$oss_repo_url" repo-oss || return 1
chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar http://download.opensuse.org/update/$DISTRO/ update || return 1 if [[ $DISTRO != "tumbleweed" ]]; then
chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar "$update_repo_url" update || return 1
fi fi
# really clean the image # really clean the image
...@@ -483,6 +501,10 @@ else ...@@ -483,6 +501,10 @@ else
echo "Selected openSUSE Leap 42.2" echo "Selected openSUSE Leap 42.2"
DISTRO="leap/42.2" DISTRO="leap/42.2"
;; ;;
42.3|leap/42.3|423)
echo "Selected openSUSE Leap 42.3"
DISTRO="leap/42.3"
;;
tumbleweed|factory) tumbleweed|factory)
echo "Selected openSUSE Leap Tumbleweed" echo "Selected openSUSE Leap Tumbleweed"
DISTRO="tumbleweed" DISTRO="tumbleweed"
......
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