So I'm installing a version of Linux Mint. I would like to edit the programs and files that are included in the ISO, because there is not always internet access. For example, a very specific wallpaper, as well as Mine-craft, and Java (there's more, but this is where I'm leaving this). If this is impossible, how would I make a similar changes with a Distro builder?
1 Answer
DISCLAIMER: I haven't actually done this with Mint. I have an old book from 2006 ("Knoppix Hacks" by Kyle Rankin) which describes how to do it with Knoppix Linux, one of the first bootable live Linux distros. The basic steps are probably still the same, but Your Mileage May Vary. Good luck.
- Start with a UEFI-Bootable Linux Mint USB Drive. You can create this from a Linux Mint ISO image in a variety of ways, depending on your host OS. The docs are out there. Use Google.
- Boot from the Linux Mint USB drive. If you plan on installing any new packages, make sure the Internet connection is up and running.
- Remastering will require the use of your hard drive. You do not need to use a completely blank, unformatted partition, but you'll need several GB of free space, and the partition must be formatted with a Linux filesystem.
From a root shell, mount the partition with read/write permissions:
mount -0 rw /dev/sda1 /mnt/sda1
Replace
sda1
with the partition and mount point you are using.To remaster the Mint ISO, you must copy the complete filesystem to the disk so that you can edit it. The instructions for Knoppix were:
mkdir -p source/KNOPPIX
cp -Rp /KNOPPIX/* source/KNOPPIX
I'm not sure that the Mint LiveCD will have a root-level
/MINT
directory, but a similar command should suffice. The remaining instructions assume that you have copied/MINT/*
intosource/MINT
.The next step is to use the
chroot
command to turn thesource/
directory into the effective root filesystem. You may need to copy theresolv.conf
file from the LiveCD into the chroot environment with a command like this:cp /etc/dhcpc/resolv.conf source/MINT/etc/dhcpc/resolv.conf
Then
chroot
into thesource/MINT
directory and mount theproc
filesystem:chroot source/MINT
mount -t proc /proc proc
Now you are in a chrooted environment. You can remove packages you don't want:
apt-get --purge remove packagename
And you can add new packages to the distribution:
apt-get install packagename
This is how you'll add Java or whatever your friend wants. This is also a good time to customize the wallpaper.
Once you set up the MINT root filesystem in the source directory, create the actual filesystem that will appear in your remastered ISO image. Put this filesystem in a new directory called
master
. From the mounted partition, run:mkdir master
rsync -a /cdrom /master
Then you'll need to use
mkisofs
to create an ISO-9660 filesystem, and to generate the ISO image from that filesystem.
It's a lot of steps, and this is only sketchy information, and I can't really spend more time trying this out so I can answer questions about the Mint-specific implementation. But hopefully it's enough to get you on the right track.
Good luck!
-
this is what i was looking for. wish there was a program specifically for this Dec 18, 2018 at 8:46
-
There might be! I didn't even ask Google because I had that book on a shelf, but now you know what kind of stuff to search for. Let me know how it goes! Dec 18, 2018 at 12:12
-
the only one i know of is PowerISO, and im linux only right now Dec 19, 2018 at 20:52
growisofs -M ...
; it's the last session which will be mounted by default by the installer, and files from it will override those from the previous session(s). But better than all this, buy your friend an USB-stick ;-) That's much more faster, versatile, easier to edit, and less prone to error than a clunky DVD or CD.