Archived
1
0
This repository has been archived on 2023-11-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
linux/ISO-Repack.md
2022-11-16 12:21:32 +01:00

33 lines
1.1 KiB
Markdown

# Repack linux ISO
Commands expect to be in a root shell
## Install needed tools
mkisofs xorriso isohybrid
## Editing ISO image
create workspace
`mkdir /tmp/custom_iso`
Mount image and extract it since it is read only
`mount -t iso9660 -o loop ~/original.iso /mnt/`
`tar cf - /mnt/. | (cd /tmp/custom_iso; tar xfp -)`
You can now modify the files for editing the bootloader config for example!
## Back into an iso
### Legacy only
Rebuild iso with mkisofs
`mkisofs -o output.iso -b syslinux/isolinux.bin -c syslinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -R -V "Custom ISO" /tmp/custom_iso`
Bless it with isohybrid
`isohybrid output.iso`
### EFI and Legacy
Rebuild iso with mkisofs
`mkisofs -o output.iso -b syslinux/isolinux.bin -J -R -l -c syslinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -graft-points -V "Custom ISO" /tmp/custom_iso`
Bless it with isohybrid
`isohybrid --uefi output.iso`
### Sources
https://gist.github.com/AkdM/2cd3766236582ed0263920d42c359e0f
https://tuxfixer.com/mount-modify-edit-repack-create-uefi-iso-including-kickstart-file/