|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
#!/bin/bash -ex
|
|
|
|
|
|
|
|
|
|
NAME="pclinuxos"
|
|
|
|
|
VERSION="${1:-2021}" # E.g: '2020'
|
|
|
|
|
VERSION="${1:-2023}" # E.g: '2020'
|
|
|
|
|
IMAGE="${NAME}:${VERSION}"
|
|
|
|
|
INSTALLROOT="/dev/shm/${IMAGE}"
|
|
|
|
|
|
|
|
|
@ -29,19 +29,17 @@ sudo mount --bind "/dev" "${INSTALLROOT}/dev"
|
|
|
|
|
sudo mkdir -p "${INSTALLROOT}/var/lib/rpm"
|
|
|
|
|
sudo rpmdb --initdb --root="${INSTALLROOT}"
|
|
|
|
|
|
|
|
|
|
sudo rpm -Uvh --noscripts --root="${INSTALLROOT}" "/dev/shm/packages/"*".rpm"
|
|
|
|
|
|
|
|
|
|
# Fix lzma library location
|
|
|
|
|
sudo mv "${INSTALLROOT}/lib/liblzma."* "${INSTALLROOT}/lib64"
|
|
|
|
|
sudo rpm -Uvh --noscripts --nodeps --root="${INSTALLROOT}" "/dev/shm/packages/"*".rpm"
|
|
|
|
|
|
|
|
|
|
# Réinstall distro from inside chroot
|
|
|
|
|
sudo mount --bind "/dev/shm" "${INSTALLROOT}/dev/shm"
|
|
|
|
|
sudo rm -rf "${INSTALLROOT}/var/lib/rpm"
|
|
|
|
|
sudo chroot "${INSTALLROOT}" rpmdb --initdb
|
|
|
|
|
sudo chroot "${INSTALLROOT}" rpm -Uvh "/dev/shm/packages/"*".rpm"
|
|
|
|
|
sudo chroot "${INSTALLROOT}" rpm -Uvh --nodeps "/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 --fix-broken install
|
|
|
|
|
sudo chroot "${INSTALLROOT}" apt-get -y upgrade
|
|
|
|
|
|
|
|
|
|
sudo umount "${INSTALLROOT}/dev/shm"
|
|
|
|
@ -52,7 +50,4 @@ sudo tar -C "${INSTALLROOT}" -c . | docker import - "${IMAGE}"
|
|
|
|
|
docker run -ti --rm "${IMAGE}" ls -l
|
|
|
|
|
sudo rm -rf "${INSTALLROOT}"
|
|
|
|
|
|
|
|
|
|
docker image save "${IMAGE}" >"${IMAGE}.tar"
|
|
|
|
|
rm -f "${IMAGE}.tar.gz"
|
|
|
|
|
pigz -9 "${IMAGE}.tar"
|
|
|
|
|
mv -vf "${IMAGE}.tar.gz" "${HOME}/tde/obs"
|
|
|
|
|
docker image save "${IMAGE}" | pigz -9 >"${HOME}/tde/docker/${IMAGE}.tar.gz"
|
|
|
|
|