MultiCD - Combine several CDs into one.
multicd.sh is a shell script designed to build a multiboot
CD image containing many different Linux distributions and/or utilities.
user@pc$ chmod +x multicd*.sh user@pc$ ./multicd*.shThe script will detect which images are present and make a CD for you.
-c : include an MD5 checksum file (md5sum.txt)
-d : drop to a shell prompt before building the ISO (debug)
-m : don't include Memtest86+
-i : offer options like ISOLINUX menu color or copying only certain Slax modules
(requires dialog)
-o [filename] : lets you use another filename for the output instead of multicd.iso
-t : run the ISO in QEMU after it is built
-v : be more verbose
-V : print out the version number
-w : put a "press enter to continue" before exiting
clean : don't run the multicd.sh script at all - instead, get rid of the symlinks
and temporary version files that it makes automatically
The script can be downloaded from ftp://downloads.tuxfamily.org/multicd/.
In the case of version 5.0+, there are two formats:
"combined" is a single script, and the .tar.gz archive is a main script with a plugin folder.
The "nosyslinuxincluded" tarball doesn't have the syslinux tarball inside of it -
the script will try to download SYSLINUX if it is not present.
"Combined" is built from the tarball with combine.sh, which is included with the tarball download.
Alternately, you can also get the latest development version of multicd with git:
$ git clone git://git.tuxfamily.org/gitroot/multicd/multicd.gitIt is usually not very different from the released version.
|
|
|
Last updated: 10/06/10 (v5.9) - New variables and functions in use
Each plugin has its own file in the plugins folder. I'll take austrumi.sh, the plugin for Austrumi Linux, as an example.
#!/bin/sh set -e . ./functions.sh #Austrumi plugin for multicd.sh #version 5.9 #Copyright (c) 2010 maybeway36 # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #copies of the Software, and to permit persons to whom the Software is #furnished to do so, subject to the following conditions: # #The above copyright notice and this permission notice shall be included in #all copies or substantial portions of the Software. # #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN #THE SOFTWARE.
This section contains the "set -e" command that tells the script to quit on errors, the name and version of the plugin, and the MIT license. It also has a command . ./functions.sh, which loads the functions mcdmount and umcdmount from the functions.sh file packaged with multicd.sh.
if [ $1 = scan ];then if [ -f austrumi.iso ];then echo "Austrumi" fi
multicd.sh calls this section near the beginning of the script.
Each plugin will scan to see if its respective ISO is in the folder and should be included.
For some plugins, it might be more complicated, i.e. if two CDs can't be on the same disc.
elif [ $1 = copy ];then if [ -f austrumi.iso ];then mcdmount austrumi cp -r $MNT/austrumi/austrumi $WORK/ #This folder also has the kernel and initrd cp $MNT/austrumi/isolinux.cfg $WORK/boot/isolinux/al.menu umcdmount austrumi fi
This is the copy section, called in the middle of multicd.sh.
First, the plugin sees if the ISO is there (again, since it doesn't remember), then the
mcdmount function makes a temporary mountpoint for the ISO image, makes sure
nothing's mounted there, then mounts it.
After mounting, the necessary components are copied into multicd's working directory.
For Austrumi, they're all in one folder. Once this is done, umcdmount unmounts
and removes the mountpoint.
NOTE: $MNT and $WORK are defined in multicd.sh; $MNT is a location (in /tmp) where
temporary mountpoints are made, and $WORK is the folder containg the future contents
of the ISO (normally set to $(pwd)/multicd-working).
Each ISO will have different files that need to be copied.
This will often be a kernel, an initrd, and a file or folder with a compressed
filesystem image (like Ubuntu's casper.)
elif [ $1 = writecfg ];then if [ -f austrumi.iso ];then echo "label austrumilinux menu label ^Austrumi com32 vesamenu.c32 append al.menu " >> $WORK/boot/isolinux/isolinux.cfg fi
The third part of the plugin script is called right before the multicd.iso image is made.
This section adds the distro's ISOLINUX commands to the new isolinux.cfg.
It checks if the ISO is there (yet again,) and if it is, it appends text to isolinux.cfg.
In Austrumi's case, the menu option simply loads the submenu, which is the isolinux.cfg
that was copied over from the original ISO. Usually, you will see either a longer list of
commands or some sed commands to modify the contents of the copied submenu. The
decision on which direction to go (hardcoding options vs. copying and editing) depends on
how many options the distro has and how often it gets updated.
If you choose to hardcode the options (which is easier), check the isolinux.cfg of the
original ISO to see what to put here.
Keep in mind that if the files aren't in the same place as they are on the original CD,
you'll have to change some things (i.e. for Feather Linux, this might be using
"/boot/feather" instead of "/boot/isolinux" and adding "knoppix_dir=FEATHER".)
else
echo "Usage: $0 {scan|copy|writecfg}"
echo "Use only from within multicd.sh or a compatible script!"
echo "Don't use this plugin script on its own!"
fi
The end is always the same. If the script is not called with one of the three arguments multicd.sh uses (i.e. if a user calls it seperately), the script tells the user that the script can't be used on its own.
multicd.sh comes with NO WARRANTY and is provided under the MIT License. Copyright (c) 2010 maybeway36 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.