3

I'm trying to create a custom Debian ISO with software that I have built and packaged to .deb. I have my system running on a virtual machine and have fully tested my packages. For the software to work I have customised the kernel to my needs, recompiled and installed.

Now I'm wondering how do I package this into an ISO with the custom kernels and my own packages. I've tried using simple-cdd and a few other methods with no success.

The must be a simple way to build an ISO from you current system setup?

Any advice on how to do this?

Zeedinstein
  • 31
  • 1
  • 3

2 Answers2

0

What you're looking for is called preseeding. Here is the official Debian documentation on the subject for reference.

I have used this project before which is for Ubuntu, but I guess it could easily be tweaked to work with Debian. It creates and unattended installation disk, but if you want your users to answer some of the questions that should be possible by changing the seed file.

Preseeding allows you to add your own packages to ISO's and run any script commands by using the late_command option, ie.

d-i preseed/late_command string cp -a /cdrom/pool/extras/packages/custom_script.sh /target/usr/local/bin/; in-target /usr/local/bin/custom_script.sh

Here is a gist with my local script (based on the link above). Line 76 in the bash script is where files are copied into the iso and the last line of the seed file is where it's copied into the final system and potentially executed.

Mikael Kjær
  • 1,513
  • 9
  • 14
  • What have you done here? Have you mounted an ISO, then editing the pool to added the current packages installed under /usr/local/bin? – Zeedinstein May 28 '18 at 09:20
  • The script in link 2 and 3 will download ISO files, mount them, do some changes and then write a new ISO file. The `late_command` option I added was just to show that it's also possible to run a script after end installation. – Mikael Kjær May 28 '18 at 09:23
  • Thanks, I'm taking a look at your script and I will give it a try manually. – Zeedinstein May 28 '18 at 09:42
  • Great and just ask question so I can update along the way. It's not a very complicated process but it requires some trial and error. – Mikael Kjær May 28 '18 at 09:49
  • You are using mkisofs, mkpasswd and isohybrid in your script which is not available to my OS (Debian Jessie 8.5) it seems. Also how does this line know what packages there are? `if [[ -d "packages" ]]; then` – Zeedinstein May 28 '18 at 12:55
  • On Ubuntu those tools are part of: genisoimage, whois and syslinux-utils in the same order as you put. That line check for a directory called `packages` and if it's there creates a subdirectory on the iso where it copies the files and folders from `packages` – Mikael Kjær May 28 '18 at 17:52
-1

Recreating bootable ISO on Linux is tough. If you have a Windows PC, this can be done easily with the free app ImgBurn. I have done it multiples for creating custom ISO for my VPS.

A few more good tools for this:

How to edit bootable ISO for free?

How I do to modify the contents of a ISO file?