From effbf509eea4f37a1a8660242769ed1746b67ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 30 Jan 2021 23:53:31 +0100 Subject: RPM: update build scripts for Fedora 33 / CentOS 8 --- redhat/docker/pclinuxos.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'redhat/docker/pclinuxos.sh') diff --git a/redhat/docker/pclinuxos.sh b/redhat/docker/pclinuxos.sh index 837e4c86f..52f858357 100755 --- a/redhat/docker/pclinuxos.sh +++ b/redhat/docker/pclinuxos.sh @@ -1,7 +1,7 @@ #!/bin/bash -ex NAME="pclinuxos" -VERSION="${1:-2020}" # E.g: '26' +VERSION="${1:-2020}" # E.g: '2020' IMAGE="${NAME}:${VERSION}" INSTALLROOT="/dev/shm/${IMAGE}" @@ -17,7 +17,8 @@ curl "${MIRROR}/RPMS.x86_64/" | sed -n "/a href/ s|.*href=\"\(.*\)\.rpm\".*|\1.r mkdir -p "/dev/shm/packages" while read pkg; do - file="$(grep "^${pkg}[0-9]*-[0-9]" /dev/shm/pkg.list | sort | tail -n 1)" + file="$(grep "^${pkg}-[0-9]" /dev/shm/pkg.list | sort | tail -n 1)" + [ -z "${file}" ] && file="$(grep "^${pkg}[0-9]*-[0-9]" /dev/shm/pkg.list | sort | tail -n 1)" [ -z "${file}" ] && exit 1 wget -nv -c "${MIRROR}/RPMS.x86_64/${file}" -O "/dev/shm/packages/${file}" || exit 2 done < "pclinuxos.pkg" @@ -39,6 +40,7 @@ sudo rm -rf "${INSTALLROOT}/var/lib/rpm" sudo chroot "${INSTALLROOT}" rpmdb --initdb sudo chroot "${INSTALLROOT}" rpm -Uvh "/dev/shm/packages/"*".rpm" +sudo cp "/etc/resolv.conf" "${INSTALLROOT}/etc/resolv.conf" sudo chroot "${INSTALLROOT}" apt-get -y update sudo chroot "${INSTALLROOT}" apt-get -y upgrade @@ -46,7 +48,10 @@ sudo umount "${INSTALLROOT}/dev/shm" sudo umount "${INSTALLROOT}/dev" sudo tar -C "${INSTALLROOT}" -c . >"${IMAGE}.tar" -#sudo rm -rf "${INSTALLROOT}" +sudo rm -rf "${INSTALLROOT}" -docker rmi -f "${IMAGE}" -docker import "${IMAGE}.tar" "${IMAGE}" +docker rmi -f "${IMAGE}" || : +cat "${IMAGE}.tar" | docker import - "${IMAGE}" +rm -f "${IMAGE}.tar.gz" +pigz -9 "${IMAGE}.tar" +mv -vf "${IMAGE}.tar.gz" "${HOME}/tde/obs" -- cgit v1.2.1