When you are going to customize your ariane CD-ROM, sooner or later you want to create an image of your modified system which you can then put on the CD to boot with your modifications directly.
mkimage is your friend for image creation. This script creates a
mkimage excludes certain parts of the running system you don't want to have in the image. Hardcoded exclusion are /proc/*, /tmp/* and /var/tmp/* since the contents of these directories simply interferes with the idea of a fresh installed system. More exclusions can be configured in the file /sbin/ariane.d/etc/image.exclude. This file contains filenames (with or without shell wildcards) that should be excluded from the image, one per line. There are already some exclusion defined because there is more to drop for a clean image than just the directories above.
mkimage's command line is
mkimage options [outputfile]
If called without options mkimage
- increases the system's version counter stored in /sbin/ariane.d/etc/version, and
- creates the image file /tmp/linux.tgz.
mkimage supports the following options:
sets a different output file than the default /tmp/linux.tgz. Take care that the created image is an excluded directory, otherwise it will become also part of the image.
Using this option is identical to specifying the outputfile parameter on the command line.
- sets a version suffix and keeps mkimage from increasing the system's version counter.
mkimage limits the resulting archive to the root filesystem. So when using the
-o option it's safe to put the archive on a different partition, e.g. a USB disk or lufs mount (see ArianeNetworkAccess).
Another feature of mkimage is that it writes the archive to it's standard output if this is not a tty (e.g. a pipe). This makes it possible to write the image directly to a server with e.g.
mkimage | ftpc -l login:password -pc put server linux.tgz
stores the image under the name linux.tgz directly in login's home directory on the FTP server server without consuming any local disk space for it.
If you want to boot your system from a PXE server (see ArianePxeBoot) you must put your ariane image into an envelope. This is done with mkpxedisk:
root@ariane:~ > cd /usr/local/gdk root@ariane:/usr/local/gdk > bin/mkpxedisk /tmp/linux.gz
will take the ariane image, pack it into the PXE initrd output the result to /tmp/pxe-initrd.gz.
Although this works, it requires a lot of disk space: for the ariane image, for the PXE initrd and approximately 35MB temporary scratch area. This can be reduced to only the scratch area.
mkpxedisk's commmand line is
mkpxedisk image [pxedisk]
where either parameter can be a dash "
-" to set standard input or output as source or destination. So it's again possible to use an ftpc pipe like the above
root@ariane:/usr/local/gdk > mkimage | bin/mkpxedisk - | ftpc ...
to put the output file directly on a server without even having the ariane image on disk. Also notice that in the command above only a single dash is given to mkpxedisk because it recognizes that it's output is not a tty and therefore switches automatically to pipe mode.
Ok, it's not really hibernation but it comes near. hibernate creates a PXE image and writes it direct to the TFTP sever from which the system was booted. The output file has the name pxe-latest.gz. If your are using ariane's pxelinux.cfg you can boot this image by typing "
latest" at the PXE boot prompt.
If your system did not boot from a TFTP server but you have one around you can give it's address also on hibernates's command line:
# hibernate [tftp-server]
And here again, if hibernate sees it's not running on a tty as standard output, the PXE image is printed and not placed on the TFTP server.
# hibernate - | ftpc -l login:password -pc put server pxe-latest.tgz
will put the PXE disk to an FTP server.
Notice that if you boot a hibernation image ariane will not execute it's ramdisk startup sequence. In other words you can configure an ariane images the way you want it, put it on your TFTP server and boot it later again as it was before, without automatic modifications.
If you want to boot different computers in different configurations, using different PXE images, you should read ArianePxeBoot to see how to setup the server.