Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Is it possible to add files to stretch netinst.iso?

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
sandwich
Posts: 16
Joined: 2018-12-03 18:18

Is it possible to add files to stretch netinst.iso?

#1 Post by sandwich »

Hi -

I would like to create a custom debian stretch (9) installation image by adding a few non-free firmware files to the netinst.iso . If possible I would like the custom image to be useful on both uefi and bios systems, just like the current netinst.iso is.

I can easily copy the contents of the iso to some directory on my harddisk and then add the firmware files to hopefully the correct directory:

Code: Select all

sudo mount -o loop  <path_where_I_put_iso_file/>debian-9.6.0-amd64-netinst.iso <some_directory_to_access_iso_contents/> # read only
cp -ar <some_directory_to_access_iso_contents/> <directory_for_modified_iso_contents/>
mkdir <directory_for_modified_iso_contents/>firmware/ # shouldn't hurt if it already exists
cp <path_where_I_put_firmware/>firmware_files <directory_for_modified_iso_contents/>firmware/
But I have no idea how to create an image file with the same structure as the current netinst.iso (or any other for that matter) from my copied/modified contents directory. I have tried isomaster and looked into xorriso, but basically I don't know enough to even evaluate whether any of those are appropriate tools for the task.

If anyone could tell me how to create this type of an image file or could point me to some sources of information on the subject, I would be most appreciative.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Is it possible to add files to stretch netinst.iso?

#2 Post by Head_on_a_Stick »

sandwich wrote:I would like to create a custom debian stretch (9) installation image by adding a few non-free firmware files to the netinst.iso
Debian already provide such a thing, search for "unoffficial non-free debian iso image".

To alter the ISO, mount the image, copy the contents to a local directory then unsquash live/filesystem.squashfs, add the files (or whatever) then resquash the root filesystem and rebuild the ISO image.

Here is a shell function I use to repack Debian images:

Code: Select all

function mkiso {
 xorriso -as mkisofs \
 -iso-level 3 \
 -full-iso9660-filenames \
 -volid SharpBang-stretch \
 -eltorito-boot isolinux/isolinux.bin \
 -eltorito-catalog isolinux/boot.cat \
 -no-emul-boot -boot-load-size 4 -boot-info-table \
 -isohybrid-mbr isolinux/isohdpfx.bin \
 -eltorito-alt-boot \
 -e boot/grub/efi.img \
 -no-emul-boot -isohybrid-gpt-basdat \
 -output ../"$1" ./
}
^ In that case the function is called from the ISO root directory (the one "above" live) and the first argument of the function gives the name of the .img that will be created.

IIRC, I needed to add isolinux/isohdpfx.bin, that can be found in the isolinux package.

In my example the volume is called "SharpBang-stretch" (it's a lame #! clone), change that line to whatever you want.
deadbang

sandwich
Posts: 16
Joined: 2018-12-03 18:18

Re: Is it possible to add files to stretch netinst.iso?

#3 Post by sandwich »

Thanks, I'll try the function first. For my purposes it's probably less practical but more fun.

Post Reply