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

Help with issues regarding installation of Debian

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

Postby sandwich » 2018-12-03 20:16

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.
sandwich
 
Posts: 2
Joined: 2018-12-03 18:18

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

Postby Head_on_a_Stick » 2018-12-03 21:06

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.
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8324
Joined: 2014-06-01 17:46
Location: /dev/chair

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

Postby sandwich » 2018-12-04 01:09

Thanks, I'll try the function first. For my purposes it's probably less practical but more fun.
sandwich
 
Posts: 2
Joined: 2018-12-03 18:18


Return to Installation

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable