Skip to content

Instantly share code, notes, and snippets.

@Unbreak4ble
Created August 6, 2024 16:54
Show Gist options
  • Save Unbreak4ble/d0389755b25764fe0420d7c2a8e1627d to your computer and use it in GitHub Desktop.
Save Unbreak4ble/d0389755b25764fe0420d7c2a8e1627d to your computer and use it in GitHub Desktop.
how to modify linux distro installer .iso files

needed commands

  • 7z: used to unpack iso file;
  • unsquashfs: unpack squashfs file. Ex: rootfs, desktopfs, etc...;
  • mksquashfs: pack folder into squashfs file;
  • grub-mkrescue: used to repack folder into bootable iso file by reading files in "grub" folder and others boot files.

unpack iso file

mkdir -v iso_root
cd iso_root
7z x [location to the distro iso file]

look up for squashfs files

find . -name "*.sfs"

unpack squashfs

choose your squashfs file to modify and unpack it

mkdir -v lab_sfs
unsquashfs -d lab_sfs [location to the .sfs file]

repack into squashfs

after done modifying squashfs file(s), repack it

mksquashfs [location to the unpacked squashfs folder] [output filename]

NOTE: name it with the original squashfs filename. And then move or copy it to the original directory.

repack into iso file

grub-mkrescue -o [output filename] iso_root

After all done, enjoy your modifield iso installer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment