From MEPIS Documentation Wiki
This script has been written by MEPIS users to make it easier to remaster the CD, please see remastering article for more details, please improve the script and add suggestion in the discussion page.
- creates your remastering environment
- mounts the CD/ISO and squashfs
- logs in to chroot, the remastering environment, where you can customize the image, run updates, remove programs that you don't need, add new programs, etc.
- has a -b or --build-iso option (as in: sh remaster.sh -b) to skip creating the remastering environment and go straight into rebuilding the iso
- has a -c or --chroot option (as in: sh remaster.sh -c) to skip creating the remastering environment and log in directly to chroot
- has a -d or --from-hdd option for remastering from hard disk (this is an experimental feature, use it with caution), there are two options in this mode:
- create a "generic ISO" (you'll lose your accounts and passwords, you will have to use demo/demo and root/root as from the normal Live CD)
- create a "custom ISO", not working yet is a work in progress, when is done you should be able to log in using your own account and password from the HDD, for now this works only in CLI, and /home is not preserved.
- has in-built "version" file editing
- does basic clean-up: removes .bash_history and the content of /var/lib/apt/lists/
- creates the ISO file after you exit from chroot
Because of SquashFS changes you probably won't be able to remaster MEPIS 8 from within MEPIS 7 and the other way round.
Remastering is a resource intensive operations, you need to take into consideration that these operations will tie down your computer for some time, don't run the script if you have other things going at the same time (especially if you burn CDs or DVDs.)
Run X-based (GUI) programs in chroot
Disclaimer: This process seems to work only if the drivers are present in the chroot remaster project for your particular video card. If you run proprietary drivers like Nvidia or ATI that has been installed through smxi or via the Mepis Assistants, it may be better to make a copy of the xorg.conf created by the SimplyMEPIS Live-CD and keep it on file for this very purpose. As a further recommendation, it may be beneficial to boot the Live-CD with the simplest driver like vesa and copy the xorg.conf from that for use with this process.
Type this in console as normal user (not in chroot) before starting:
DISPLAY=:0.0 xhost +
After you are in your chroot, open another terminal and enter:
Then in the first terminal:
nano /etc/X11/xorg.conf (this file will be blank)
Copy the first (your machines xorg.conf) into the second (your chroot's xorg.conf) and save it, then run:
startx -- :1
Your chroot's gui should be on Ctrl+Alt+F8 and your original on Ctrl+Alt+F7, delete the xorg.conf when you are done.
Alternative way to run GUI programs
Once you are in the chroot environment you can run different commands in the console. However there's a little trick you need to start GUI programs:
- install xnest
apt-get install xnest
- outside of chroot run this command in console (this should open a window)
Xnest -ac :1
- within chroot run this command:
Then, when you start a command in chroot, for example "synaptic", the GUI should appear in the window opened before.
Download the Script
- Install git-core on your system through Synaptic or apt-get.
- For MEPIS 11 copy&paste following command:
git clone git://github.com/MEPIS-Community/remastering-script.git
This command will create a remastering-script directory in your current directory that will contain the remastering script.
- For MEPIS 8.5 copy&paste following command:
git clone -b 8.5 git://github.com/MEPIS-Community/remastering-script.git
- For antiX and older than 8.5 MEPIS releases copy&paste following command:
git clone -b antiX git://github.com/MEPIS-Community/remastering-script.git
NOTE: if the -b switch is unrecognized, do the following:
- add the lenny-backports repo
deb http://archive.debian.org/debian-backports/ lenny-backports main contrib non-free
- Then install the git version from that repo, using the command line:
apt-get install git/lenny-backports
Running the Script
cd remastering-script ## change directory to the downloaded script su -c ./remaster.sh filename.iso ## run script as root, where filename.iso is the name of the ISO you want to remaster (use TAB for autocompletion)