@@ -16,21 +16,29 @@ if command -v rpm > /dev/null; then
1616 suseImportBuildKey
1717fi
1818
19+
1920echo " Configure image: [$kiwi_iname ]..."
2021
21- # don't have multiple licenses of the same type
22+ # ======================================
23+ # Setup baseproduct link
24+ # --------------------------------------
25+ suseSetupProduct
26+
27+ # ======================================
28+ # Import repositories' keys
29+ # --------------------------------------
30+ suseImportBuildKey
31+
32+
33+ # don't have duplicate licenses of the same type
2234jdupes -1 -L -r /usr/share/licenses
2335
24- #
2536zypper --non-interactive rm -u jdupes
2637
2738# Not needed, but neither rpm nor libzypp handle rpmlib(X-CheckUnifiedSystemdir) yet
2839# which would avoid it being installed by filesystem package
2940rpm -e compat-usrmerge-tools
3041
31- # FIXME: stop hardcoding the url, use some external mechanism once available
32- zypper -n ar --gpgcheck --enable ' https://updates.suse.com/SUSE/Products/ALP-Dolomite/1.0/$basearch/product/' repo-basalt
33-
3442# ======================================
3543# Disable recommends
3644# --------------------------------------
@@ -41,16 +49,25 @@ sed -i 's/.*solver.onlyRequires.*/solver.onlyRequires = true/g' /etc/zypp/zypp.c
4149# --------------------------------------
4250sed -i ' s/.*rpm.install.excludedocs.*/rpm.install.excludedocs = yes/g' /etc/zypp/zypp.conf
4351
52+ # ======================================
53+ # Configure SLE BCI repositories
54+ # --------------------------------------
55+ zypper -n ar --refresh --gpgcheck --priority 100 --enable ' https://updates.suse.com/SUSE/Products/SLE-BCI/$releasever_major-SP$releasever_minor/$basearch/product/' SLE_BCI
56+ zypper -n ar --refresh --gpgcheck --priority 100 --disable ' https://updates.suse.com/SUSE/Products/SLE-BCI/$releasever_major-SP$releasever_minor/$basearch/product_debug/' SLE_BCI_debug
57+ zypper -n ar --refresh --gpgcheck --priority 100 --disable ' https://updates.suse.com/SUSE/Products/SLE-BCI/$releasever_major-SP$releasever_minor/$basearch/product_source/' SLE_BCI_source
58+
4459# ======================================
4560# Remove locale files
4661# --------------------------------------
4762shopt -s globstar
4863rm -f /usr/share/locale/** /* .mo
4964
65+ # ======================================
5066# Remove zypp uuid (bsc#1098535)
67+ # --------------------------------------
5168rm -f /var/lib/zypp/AnonymousUniqueId
5269
53- # Remove various log files. While it's possible to just rm -rf /var/log/*, that
70+ # Remove various log files. Although possible to just rm -rf /var/log/*, that
5471# would also remove some package owned directories (not %ghost) and some files
5572# are actually wanted, like lastlog in the !docker case.
5673# For those wondering about YaST2 here: Kiwi writes /etc/hosts, so the version
@@ -62,14 +79,20 @@ rm -rf /var/log/{zypper.log,zypp/history,YaST2}
6279# Remove the entire zypper cache content (not the dir itself, owned by libzypp)
6380rm -rf /var/cache/zypp/*
6481
65- # Assign a fixed architecture in zypp.conf, to use the container's arch even if
66- # the host arch differs (e.g. docker with --platform doesn't affect uname)
67- arch=$( rpm -q --qf %{arch} glibc)
68- if [ " $arch " = " i586" ] || [ " $arch " = " i686" ]; then
69- sed -i " s/^# arch =.*\$ /arch = i686/" /etc/zypp/zypp.conf
70- # Verify that it's applied
71- grep -q ' ^arch =' /etc/zypp/zypp.conf
72- fi
82+ # ==========================================
83+ # Hack! The go container management tools can't handle sparse files:
84+ # https://github.com/golang/go/issues/13548
85+ # If lastlog doesn't exist, useradd doesn't attempt to reserve space,
86+ # also in derived containers.
87+ # ------------------------------------------
88+ rm -f /var/log/lastlog
89+
90+ # ======================================
91+ # Remove locale files
92+ # --------------------------------------
93+ find /usr/share/locale -name ' *.mo' -delete
94+
95+ exit 0
7396
7497
7598# =======================================
0 commit comments