- sudo mkdir /var/tmp/zzol9
- sudo rpm --root=/var/tmp/zzol9/ --import -D '_db_backend sqlite' /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
- #tree zzol9/
- // do the business install a minimal install, enough to run the dnf installer
- sudo dnf --releasever=9 --installroot=/var/tmp/zzol9 install oraclelinux-release-el9 dnf rpm nano dnf-plugins-core glibc-langpack-en --nogpgcheck \
- --nodocs --setopt=module_platform_id=platform:el9 --repofrompath=mga8rel,https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/x86_64/ \
- --disablerepo=* --enablerepo=mga8rel --exclude=gnome*
- cd
- mkdir tmpstrap && cd $_
- cat >> schroot.sh<<EOL
- #!/bin/sh
- PATH=$PATH:/sbin:/usr/sbin
- # /var/cache/pbuilder
- RT=/var/tmp/${1-"zzol9"}
- echo "rt=$RT"
- # below for partitioned block device
- #mount $VM $RT -o offset=1048576
- ## --------- end control -------
- # bindmount
- #BM=home/mockbuild/pbdeps
- for i in dev dev/pts proc sys run ; do
- mount -o bind /$i $RT/$i
- echo "mount $i"
- done
- LC_ALL=C chroot $RT /bin/bash
- for i in run dev/pts dev proc sys ; do
- umount $RT/$i
- echo "umount $i"
- done
- EOL
- chmod +x schroot.sh
- // enter chroot, add a nameserver to /etc/resolv.conf, clean all
- sudo ./schroot.sh
- cd /var/tmp/zzol9/
- sudo tar -Ipzstd -cf ~/ol9-min.tar.zst ./