Remastering script

From MEPIS Documentation Wiki

Revision as of 19:24, 14 August 2013 by Jerry bond (Talk | contribs)
Jump to: navigation, search

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.



  1. creates your remastering environment
  2. mounts the CD/ISO and squashfs
  3. 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.
  4. has a -b or --build-iso option (as in: sh -b) to skip creating the remastering environment and go straight into rebuilding the iso
  5. has a -c or --chroot option (as in: sh -c) to skip creating the remastering environment and log in directly to chroot
  6. 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:
    1. 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)
    2. 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.
  7. has in-built "version" file editing
  8. does basic clean-up: removes .bash_history and the content of /var/lib/apt/lists/
  9. 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:

kwrite /etc/X11/xorg.conf

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:
export DISPLAY=localhost:1

Then, when you start a command in chroot, for example "synaptic", the GUI should appear in the window opened before.

Download the Script

  1. Install git-core on your system through Synaptic or apt-get.
  2. For MEPIS 11 copy&paste following command:
git clone 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://
  • For antiX and older than 8.5 MEPIS releases copy&paste following command:
git clone -b antiX git://

NOTE: if the -b switch is unrecognized, do the following:

  • add the lenny-backports repo
 deb 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 ./ filename.iso   ## run script as root, where filename.iso is the name of the ISO you want to remaster (use TAB for autocompletion)

Testing resulting ISO

You can test the resulting ISO without burning it with kvm, qemu, or VirtualBox.

Personal tools