BlissOSx86 - Unpacking & Repacking ISO
Every ISO modification begins with a clean extraction. Whether you're replacing the kernel or applying a low-level patch to the system image.
This is a quick guide to the full round trip:
- extract a bootable ISO
- unpack compressed system image
- apply modifications
- repack it back into a bootable ISO.
1. Prerequisites
Make sure you have the following packages installed:
p7zip- extracting isosquashfs-tools/erofs-utils- unpacking system imagegenisoimage- creating iso
2. Extract ISO contents
7z x <ISO_PATH>.iso -oextracted
3. Unpack system image
Depending on the build, you'll find either system.sfs (SquashFS) or system.efs (EROFS) inside the extracted folder.
3.1. Case A - system.sfs
3.1.1. Prerequisites
- Make sure you have the
squashfs-toolspackage installed.
3.1.2. Extract system image
mkdir -p system-root
sudo unsquashfs -d system-root extracted/system.sfs
3.2. Case B - system.efs
3.2.1 Prerequisites
- Make sure you have the
erofs-utilspackage installed.
3.2.2. Extract system image
mkdir -p system-root
sudo fsck.erofs --extract=system-root --preserve extracted/system.efs
4. Mount system image
Whatever case you dealt with will finally give you a system.img which we all were waiting for from the beginning.
mkdir -p system_mnt/
sudo mount -o loop system-root/system.img system_mnt/
5. Unmount system image
Now that you are done modifying your system image, you need to unmount it to proceed further.
sudo umount system_mnt/
rm -rfd system_mnt/
6. Repack system image
Just like we faced two cases during unpacking, steps differ here also
6.1. Case A - system.sfs
- Create the
SquashFSfile
sudo mksquashfs system-root extracted/system.sfs -comp zstd -noappend
6.2. Case B - system.efs
- Create the
EROFSfile
sudo mkfs.erofs -z zlz4hc -C 65536 extracted/system.efs system-root
7. ISO Creation
The final step before creating the bootable ISO file of your own modified system!
7.1. Prerequisites
- Make sure you have the
genisoimagepackage installed.
7.2. Create ISO
mkisofs \
-V "BlissOS-Custom" \
-o BlissOS-Custom.iso \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-boot-info-table \
-boot-load-size 4 \
-joliet-long \
-no-emul-boot \
-J \
-l \
-R \
extracted/
About the author
- Building solutions of my daily life problems with code.
Comments
Join the discussionNo comments yet. Be the first to comment.
BlissOS x86
A beginner friendly tutorial series of BlissOS x86 modification. Keeping usable after the project was halted.