Hi tdarst
Welcome to the forum.
You can't edit core.gz directly. You need to unpack it, edit the file
of interest, then repack it:
# Pack/unpack core.gz
# To unpack
tc@E310:~$ mkdir tempdir
tc@E310:~$ cd tempdir
tc@E310:~/tempdir$ zcat /path/to/existing/core.gz | sudo cpio -i
# Make changes to ~/tempdir/opt/bootlocal.sh
# To repack
tc@E310:~$ cd ~/tempdir
tc@E310:~/tempdir$ sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/core_modified.gz
# Point the boot loader to core_modified.gz instead of core.gz
What polikuo suggests is probably simpler:
tc@E310:~$ mkdir -p tempdir/opt
tc@E310:~$ cd tempdir/opt
tc@E310:~$ touch bootlocal.sh
tc@E310:~$ chown tc:staff bootlocal.sh
tc@E310:~$ chmod 775 bootlocal.sh
# Edit ~/tempdir/opt/bootlocal.sh so it contains the contents you want
# To pack
tc@E310:~$ cd ~/tempdir
tc@E310:~/tempdir$ sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/custom.gz
Note: Do not edit Linux files using Windows.
Update the boot loader to include custom.gz after core.gz.
Cool, this is really helpful, thanks for the guidance! I have so far tried method one here. Sorry to bother you for more info but what method do you use to re-pack the iso file? I had a method that was working and I'm not sure if there's something that I'm now doing differently that I'm not realizing, but I'm getting errors now when booting into the re-made iso file about not being able to find /proc/cmdline and mount: you must be root, even if I haven't changed anything after un-packing the iso.
For information my command I'm using is:
mkisofs -l -J -R -V "CoreCustom" \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o CoreCustom.iso ~/isop/ison/