RedHatQuickCourses / rhde-build

This course teaches how to create Red Hat Device Edge images for edge devices and kiosk computers.
https://redhatquickcourses.github.io/rhde-build/
4 stars 0 forks source link

Use the lorax package instead of tar + mkisofs #6

Open flozanorht opened 1 month ago

flozanorht commented 1 month ago

From Brian Lane bcl@redhat.com on tech-list

On Fri, Oct 18, 2024 at 03:23:54PM -0300, Fernando Lozano wrote:

Would anyone know why, when we loop mount an iso image, and want to manipulate its contents to generate a new iso, we must use tar instead of cp, such as:

sudo tar cf - -C temp-iso . | tar xf - -C new-iso

For example, to create a RHEL installer iso with a custom kickstart file

Why are you using tar? There's an easier way -- just use mkksiso:

https://weldr.io/lorax/mkksiso.html

flozanorht commented 1 month ago

Tested using --cdrom, it works and pass self-test (checksum)

$ virt-install --name edge-test-4 --os-variant rhel9.2 --memory 4096 --vcpus 2 --disk size=20 --cdrom /home/student/rhel9-httpd-v1-mkksiso.iso -v

Automatically changes the grub menu to use the name of the new kickstart It was necessary to change ownership of the output ISO to use with virt-installer

flozanorht commented 1 month ago

Also work using --location for text-mode boot

$ virt-install --name edge-test-4b --os-variant rhel9.2 --memory 4096 --vcpus 2 --disk size=20 --location /home/student/rhel9-httpd-v1-mkksiso.iso --graphics=none --extra-arg console=ttyS0 --extra-arg inst.ks=hd:LABEL=$LABEL:/rhel9-httpd-installer.ks -v