Skip to content

De-duplicate files in LiveOS Iso images. #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

gmileka
Copy link
Contributor

@gmileka gmileka commented Apr 26, 2025

  • Smaller initrd
    • Stop embedding kernel+shim+bootloader into initrd
      • This was a work around to be able to use isomaker as-is. The fix is stop using isomaker and create the boot image and call mkisofs directly.
  • Smaller rootfs
    • Remove the re-created initrd from the squashfs.
      • The initrd is always generated under chroot and is created within the customized rootfs. It was then copied to the iso media. The fix is to delete (move) it from the customized rootfs as it is not needed to be there.
    • Remove the boot folder entirely.
      • When the input image with all its partitions is mounted, we ended up copying all the contents including the files at /boot. However, those files are already on the iso media and do not need to remain in the squashfs image. The fix is to delete that folder entirely.

The size gains are:

old new
initrd.img 47MB 32MB removal of kernel+shim+bootloader
rootfs.img 173MB 138MB removal of /boot and initrd.img
Test iso 250MB 200MB

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • Code conforms to style guidelines

- Smaller initrd
  - Stop embedding kernel+shim+bootloader into initrd
    - This was a work around to be able to use isomaker as-is. The fix is stop
      using isomaker and create the boot image and call mkisofs directly.
- Smaller rootfs
  - Remove the re-created initrd from the squashfs.
    - The initrd is always generated under chroot and is created within the
      customized rootfs. It was then copied to the iso media.
      The fix is to delete (move) it from the customized rootfs as it is not
      needed to be there.
  - Remove the boot folder entirely.
    - When the input image with all its partitions is mounted, we ended up
      copying all the contents including the files at /boot. However, those
      files are already on the iso media and do not need to remain in the
      squashfs image. The fix is to delete that folder entirely.
@gmileka gmileka force-pushed the user/gmileka/clean-iso branch from 5ec6433 to 26e0088 Compare April 26, 2025 01:09
@gmileka gmileka marked this pull request as ready for review April 29, 2025 17:00
@gmileka gmileka requested a review from a team as a code owner April 29, 2025 17:00
@gmileka gmileka closed this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant