v1 = start-dialog.sh
v2 = amazing-pet-gentoo-dialog.sh
(relies on "dialog" CLI program to make user friendly menu of image creation)
-
Start with a suitable Stage3 download, or make your own
-
make amazing partition image create partitions & fs (truncate sparse, losetup, sfdisk, mkfs) amazing-make-partition-truncate.sh
-
mount amazing partition image (mount /dev/loop0 /mnt/stage3_1) amazing-mount-fs-partitions.sh
-
extract Stage3 into /mnt/stage3_1 (tar xvf * --...) extract-stage3-all.sh
-
use my genr8-chroot.sh script to chroot into target /mnt/stage3_1 genr8-chroot.sh (equiv of arch-chroot by me, genr8)
(it binds /etc/resolv.conf, DISTDIR=/var/cache/distfiles, PORTDIR=/var/db/repos/gentoo)
-
Configure Further. Hostname, timezone, locale, users, passwd etc.
-
Exiting genr8-chroot.sh with Ctrl^D should cause auto-unmount of target /mnt/stage3_1
-
losetup -D to unmount .dd loop image. Saved .dd Image is Finished!
DD Image Contains an entire gentoo disk at this point, and what you do with it is up to your creativity! Some ideas, boot it as a VM, make it read only and immutable, use it as a backup recovery partition, make multiple of them for many different software variants contained per image file. VM+Containerlike but manual.
very basic explanation steps basic-idea.txt
- Downloads a gentoo stage3.
- Makes the disk & partition setup & formats the partitions, (EFI,Boot,SystemRoot)
- Mounts the partitions.
- Chroot in (you will want to set up gentoo, emerge, kernel, bootloader, other config, etc.)
- Disk Image .dd file is finalized once everything is unmounted and loop detached
Example Output - Full Process.txt click
STAGE3="${1:-stage3-amd64-hardened-nomultilib-selinux-openrc}"
NUM=1
download-gentoo-iso-latest-dl_Spawns.sh "${STAGE3}"
echo
echo "********************1****************************"
echo
amazing-make-partition-truncate.sh "${STAGE3}_${NUM}.dd"
echo
echo "********************2****************************"
echo
amazing-mount-fs-partitions.sh "${STAGE3}_${NUM}.dd"
echo
echo "********************3****************************"
echo
echo " Go ! Chroot in:"
echo " genr8-chroot.sh /mnt/${STAGE3}_${NUM}"
genr8-chroot.sh /mnt/"${STAGE3}_${NUM}"
echo "Unmounting. Loop device & Disk image remain."