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