summaryrefslogtreecommitdiffstats
path: root/redhat/docker/opensuse32.sh
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2021-01-30 14:34:02 +0100
committerFrançois Andriot <albator78@libertysurf.fr>2021-01-30 22:29:41 +0100
commit6581dc50b83f203d65eac61c00a159ab2a6ddb5d (patch)
tree85c02d38ca9dcedc28798ee41c4b16ec7260e9bc /redhat/docker/opensuse32.sh
parent87e57a1a070839a44db16a0410ef57902db2df3e (diff)
downloadtde-packaging-6581dc50b83f203d65eac61c00a159ab2a6ddb5d.tar.gz
tde-packaging-6581dc50b83f203d65eac61c00a159ab2a6ddb5d.zip
RPM: massive update and cleanup
Diffstat (limited to 'redhat/docker/opensuse32.sh')
-rwxr-xr-xredhat/docker/opensuse32.sh43
1 files changed, 31 insertions, 12 deletions
diff --git a/redhat/docker/opensuse32.sh b/redhat/docker/opensuse32.sh
index a3b888c75..f2d686df5 100755
--- a/redhat/docker/opensuse32.sh
+++ b/redhat/docker/opensuse32.sh
@@ -1,19 +1,21 @@
-#!/bin/bash
+#!/bin/bash -e
-NAME="opensuse32"
VERSION="$1" # E.g: '42.3'
-IMAGE="${NAME}:${VERSION}"
-INSTALLROOT="/dev/shm/${IMAGE}"
-
-sudo rm -rf "${INSTALLROOT}"
-sudo mkdir -p "${INSTALLROOT}"
if [ "${VERSION}" = "tumbleweed" ]; then
URL="http://download.opensuse.org/tumbleweed"
+ NAME="opensuse32/tumbleweed"
else
URL="http://download.opensuse.org/distribution/leap/${VERSION}"
+ NAME="opensuse32/leap"
fi
+IMAGE="${NAME}:latest"
+INSTALLROOT="/dev/shm/${IMAGE}"
+
+sudo rm -rf "${INSTALLROOT}"
+sudo mkdir -p "${INSTALLROOT}"
+
sudo zypper --root "${INSTALLROOT}" \
ar "${URL}/repo/oss/" "oss"
sudo zypper --root "${INSTALLROOT}" \
@@ -25,13 +27,30 @@ if [ "${VERSION}" != "tumbleweed" ]; then
sudo zypper --root "${INSTALLROOT}" \
ar "http://download.opensuse.org/update/leap/${VERSION}/non-oss/" "update-non-oss"
fi
-setarch i686 sudo zypper --root "${INSTALLROOT}" \
+sudo zypper --root "${INSTALLROOT}" \
--gpg-auto-import-keys ref
-setarch i686 sudo zypper --root "${INSTALLROOT}" \
- install -y bash vim zypper openSUSE-release
+sudo setarch i686 zypper --root "${INSTALLROOT}" \
+ install --download-only -y \
+ bash \
+ filesystem \
+ glibc \
+ glibc-extra \
+ libpcre1 \
+ libselinux1 \
+ openSUSE-release \
+ system-user-root \
+ util-linux vim \
+ zypper
+sudo rpm -Uvh --root "${INSTALLROOT}" "${INSTALLROOT}/var/cache/zypp/packages/oss/"*"/"*".rpm"
+
+sudo chroot "${INSTALLROOT}" rpmdb --rebuilddb
-sudo tar -C "${INSTALLROOT}" -c . >"${IMAGE}.tar"
+FILE="${IMAGE//\//_}.tar"
+sudo tar -C "${INSTALLROOT}" -c . >"${FILE}"
sudo rm -rf "${INSTALLROOT}"
docker rmi -f "${IMAGE}"
-docker import "${IMAGE}.tar" "${IMAGE}"
+docker import "${FILE}" "${IMAGE}"
+
+pigz "${FILE}"
+mv -fv "${FILE}.gz" "${HOME}/tde/docker"