From 5374bef630025b10478f0c234b4e37fc29b3be93 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sat, 5 Oct 2019 07:15:42 +0200 Subject: Mini-version for CronJobs based on kiwi image (first try) --- kiwi/Makefile | 19 +++++++++ kiwi/adei/Dicefile | 3 ++ kiwi/adei/config.sh | 105 ++++++++++++++++++++++++++++++++++++++++++++++ kiwi/adei/config.xml | 54 ++++++++++++++++++++++++ kiwi/adei/config.xml.save | 41 ++++++++++++++++++ 5 files changed, 222 insertions(+) create mode 100644 kiwi/Makefile create mode 100644 kiwi/adei/Dicefile create mode 100644 kiwi/adei/config.sh create mode 100644 kiwi/adei/config.xml create mode 100644 kiwi/adei/config.xml.save (limited to 'kiwi') diff --git a/kiwi/Makefile b/kiwi/Makefile new file mode 100644 index 0000000..f8f7497 --- /dev/null +++ b/kiwi/Makefile @@ -0,0 +1,19 @@ +all: build/microadei.x86_64-0.10.1.docker.tar.xz +install: push + +build/microadei.x86_64-0.10.1.docker.tar.xz: adei/config.xml adei/config.sh + rm -rf build/* + kiwi --type docker system build --description adei/ --target-dir ./build/ + du -sm build/build + +import: build/microadei.x86_64-0.10.1.docker.tar.xz + docker load < build/microadei.x86_64-0.10.1.docker.tar.xz + +push: import + docker push chsa/microadei:latest + +clean: + rm -rf build/* + +run: + docker run -it chsa/microadei:latest /bin/bash diff --git a/kiwi/adei/Dicefile b/kiwi/adei/Dicefile new file mode 100644 index 0000000..d335c88 --- /dev/null +++ b/kiwi/adei/Dicefile @@ -0,0 +1,3 @@ +Dice.configure do |config| + config.buildhost = :DOCKER +end diff --git a/kiwi/adei/config.sh b/kiwi/adei/config.sh new file mode 100644 index 0000000..57075fc --- /dev/null +++ b/kiwi/adei/config.sh @@ -0,0 +1,105 @@ +#!/bin/bash +#================ +# FILE : config.sh +#---------------- +# PROJECT : OpenSuSE KIWI Image System +# COPYRIGHT : (c) 2013 SUSE LLC +# : +# AUTHOR : Robert Schweikert +# : +# BELONGS TO : Operating System images +# : +# DESCRIPTION : configuration script for SUSE based +# : operating systems +# : +# : +# STATUS : BETA +#---------------- +#====================================== +# Functions... +#-------------------------------------- +test -f /.kconfig && . /.kconfig +test -f /.profile && . /.profile + +#====================================== +# Greeting... +#-------------------------------------- +echo "Configure image: [$kiwi_iname]..." + +#====================================== +# Setup baseproduct link +#-------------------------------------- +suseSetupProduct + +#====================================== +# SuSEconfig +#-------------------------------------- +suseConfig + +#====================================== +# Import repositories' keys +#-------------------------------------- +suseImportBuildKey + +#====================================== +# Umount kernel filesystems +#-------------------------------------- +baseCleanMount + +#====================================== +# Add repositories +#-------------------------------------- +case $( arch ) in + x86_64 ) echo "Adding repos for x86_64" + zypper ar --refresh -K \ + http://download.opensuse.org/distribution/leap/42.3/repo/oss/suse/ "OSS" + zypper ar --refresh -K \ + http://download.opensuse.org/update/leap/42.3/oss/ "OSS Update" + zypper ar --refresh -K \ + http://download.opensuse.org/distribution/leap/42.3/repo/non-oss/suse/ "NON OSS" + zypper ar --refresh -K \ + http://download.opensuse.org/update/leap/42.3/non-oss/ "NON OSS Update" + ;; + aarch64 ) echo "Adding repo for aarch64" + zypper ar --refresh -K \ + http://download.opensuse.org/ports/aarch64/distribution/leap/42.3/repo/oss/ "OSS" + zypper ar --refresh -K \ + http://download.opensuse.org/ports/aarch64/distribution/leap/42.3/repo/oss/ "OSS Update" + ;; + ppc64le ) echo "Adding repo for ppc64le" + zypper ar --refresh -K \ + http://download.opensuse.org/ports/ppc/distribution/leap/42.3/repo/oss/ "OSS" + zypper ar --refresh -K \ + http://download.opensuse.org/ports/update/42.3/oss/ "OSS Update" + ;; + * ) echo "No repos for $arch" + ;; +esac + +#====================================== +# Disable recommends +#-------------------------------------- +sed -i 's/.*solver.onlyRequires.*/solver.onlyRequires = true/g' /etc/zypp/zypp.conf + +#====================================== +# Remove locale files +#-------------------------------------- +(cd /usr/share/locale && find -name '*.mo' | xargs rm) + +# Remove zypp uuid (bsc#1098535) +rm -f /var/lib/zypp/AnonymousUniqueId +# Systemd generates this in %post, remove it +rm -f /etc/machine-id + +# DS, this is called before 'delete' configured in 'config.xml'. So, we can't clean if removing from there +rpm -e --nodeps dbus-1 dracut fipscheck libfipscheck1 kbd kmod kmod-compat pinentry pkg-config exim \ + udev systemd systemd-sysvinit logrotate device-mapper libcryptsetup4 libdb-4_8 \ + cracklib cracklib-dict-full libcrack2 pam pam-config shadow util-linux aaa_base netcfg \ + ca-certificates openSUSE-build-key dirmngr perl-base insserv-compat \ + gpg2 openssl libncurses6 file file-magic libmagic1 libsolv-tools suse-module-tools \ + libzypp zypper rpm + +find . -name *.rpmsave -delete +rm -rf /var/lib/rpm + +exit 0 diff --git a/kiwi/adei/config.xml b/kiwi/adei/config.xml new file mode 100644 index 0000000..6122ab0 --- /dev/null +++ b/kiwi/adei/config.xml @@ -0,0 +1,54 @@ + + + + + Suren A. Chilingaryan + csa@suren.me + Minimal ADEI container + + + + + + 0.10.1 + zypper + false + true + true + en_US + us.map.gz + utc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kiwi/adei/config.xml.save b/kiwi/adei/config.xml.save new file mode 100644 index 0000000..a55ba45 --- /dev/null +++ b/kiwi/adei/config.xml.save @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1