/gentoo-image

Tools for making gentoo images

Primary LanguageShellGNU Affero General Public License v3.0AGPL-3.0

The best gentoo creation document!

by genr8eofl @gentoo IRC - 2023+2024 LICENSE - Creative Commons 4.0, Attribution

Gentoo Image Scripts - start-dialog.sh

LatestScreenshotv1 = start-dialog.sh PetGentooVersionv2 = amazing-pet-gentoo-dialog.sh

(relies on "dialog" CLI program to make user friendly menu of image creation)

building stage3s, chroots, disk images, and more! in depth

Stage3:

  1. Start with a suitable Stage3 download, or make your own

  2. make amazing partition image create partitions & fs (truncate sparse, losetup, sfdisk, mkfs) amazing-make-partition-truncate.sh

  3. mount amazing partition image (mount /dev/loop0 /mnt/stage3_1) amazing-mount-fs-partitions.sh

  4. extract Stage3 into /mnt/stage3_1 (tar xvf * --...) extract-stage3-all.sh

  5. 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)

  6. Configure Further. Hostname, timezone, locale, users, passwd etc.

  7. Exiting genr8-chroot.sh with Ctrl^D should cause auto-unmount of target /mnt/stage3_1

  8. 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

amazing-pet-gentoo.sh (example) :

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."