Subject: Re: Well, blast, I'll have to try that one again. Newsgroups: gmane.linux.distributions.grml.user Date: 2007-02-10
The script grml2hd creates a standard Debian system. It does not work like live CD. To add or remove packages, simply run apt-get.
The grml2hd script already generates initrd files and configures LILO. Click "yes" when prompted. You can modify later, but nothing requires that.
A different script called grml2usb creates a device which does imitate grml live CD. It is meant for smaller capacity devices like flash sticks.
Mark @ sneakemail.com
Subject: ndiswrapper in grml-small Newsgroups: gmane.linux.distributions.grml.user Date: Fri, 13 Oct 2006 18:28:19 +0200
> I would like to > add ndiswrapper to my grml-small iso image. I see ndiswrapper-modules > in the repo - is there a simple way to add it to my iso? > ... I did see this > section [0] on adding personal files in a separate directory, but is > there a better way to add software? > > [0] > http://wiki.grml.org/doku.php?id=tips&how_to_add_your_own_files_to_a_second_session_on_a_grml_cd#how_to_add_your_own_files_to_a_second_session_on_a_grml_cd[]
If you use the scripts boot para, this is pretty easy.
Create a directory called scripts in the top of the cdrom, and put a shell script named grml.sh on it.
You can now install packages or other stuff from this shell script. You can also put the .deb itself on the cdrom and just run
,---- | dpkg -i /cdrom/$deb-package.deb `----
Ulrich Dangel
Oh, btw. i forgot to mention, you can also just put youre deb files under /cdrom/debs/ and use the debs boot para…
Ulrich Dangel
Remastering grml from Debian Sarge which doesn't understand the GRML/GRML SquashFS file system, without applying the kernel patch for SquashFS.
boot grml
copy the content from /GRML, the loop mounted grml file system, to the place you want. mine is /mnt/os1/grml.remaster/GRML.
I now have a read-/writable copy of grml filesystem.
Note: I did not apply the kernel patch for SquashFS to my Debian Sarge because of approach above.
I boot back to my Debian Sarge to make the changes, because although I can't use the squashfs modules in Debian Sarge, I can create squashfs file system with the native squashfs-tools package.
All that I need to do is to chroot into it, and do whatever I like to do with grml, eg to run apt-get and so on.
Please refer to knoppix remastering howto, chroot howto and in depth coverage on chroot for details. Most important, don't forget to back up first. |
You now need to create a new squashfs image (the huge GRML/GRML file). The tool used is 'mksquashfs' from the squashfs-tools package. Ran it as root with the source directory and the destination file as arguments:
mksquashfs /mnt/os1/grml.remaster/GRML dest/GRML.new
documented on: 2006.07.02
Table of Contents
Copying /
Remaster while keeping the original squashfs
Remaster with modified squashfs
Making changes
Putting the changes back
To get access to grml's /, you first have to mount the grml_X.Y.iso somewhere. This ISO image is a iso9660 filesystem - any recent distribution kernel should include support for iso9660.
I put all my remastering stuff under '\~/grml-remaster', just to keep track of all the files. So create a mount point and mount the iso image:
$ mkdir -p ~/grml-remaster/mount1 # We will create another mountpoint, hence the '1' at the end $ sudo mount /path/to/grml-X.Y.iso ~/grml-remaster/mount1 -o loop
Now we have the CD image mounted at 'mount1/'. Inside the cd image there's e.g. the isolinux stuff, the index.html (which you get displayed when you put grml into a windows pc) and a file called 'GRML' in the directory 'GRML'. This file contains grml's root file system and is a squashfs filesystem.
The rest of this procedure depends on whether you intend to change the contents of the sqashfs filesystem or not. Since grml is very flexible, there are chances that you do not need to modify the squashfs.
You can start exploring the grml CD's / in '\~/grml-remaster/mount1' right now. Beware that the file system is mounted read-only, as iso9660 is a read-only filesystem (anything else wouldn't make sense on the CD, either :-)).
To make changes, we have to copy the mounted CD. I created '\~/grml-remaster/copy-mount1' for this and copied 'mount1/' there:
$ mkdir ~/grml-remaster/copy-mount1 $ cp -av ~/grml-remaster/mount1/* ~/grml-remaster/copy-mount1
This takes some time. After cp is finished you have a read-/writeable copy of the grml CD's '/' in '\~/grml-remaster/copy-mount1'. You may umount '\~/grml-remaster/mount1' now, if you wish.
After making your changes, create a new .iso:
$ cd copy-mount1 $ mkisofs -V "locally modified grml" -publisher 'Your Name <your.address@example>' -l -r -J \ -no-emul-boot -boot-load-size 4 -boot-info-table -c boot/isolinux/boot.cat -b \ boot/isolinux/isolinux.bin -o ../my-local-grml.iso .
You can treat \~/grml-remaster/copy-mount2 like a root filesystems of an installed linux (in fact, it isn't something else).
You can just copy files there or chroot into it, to run apt-get or so.
$ sudo chroot ~/grml-remaster/copy-mount2 /usr/bin/zsh root@foo ~ # (do whatever you like to do with grml) root@foo ~ # exit $
consult any knoppix remastering howto (like the one on knoppix.net).
To create a new squashfs image, mksquashfs is needed. If you are on a Debian system, just apt-get install squashfs-tools. Ran it with the source directory and the destination file as arguments:
# do this as root, else mksquashfs can't read all files: $ sudo mksquashfs ~/grml-remaster/copy-mount2 ~/grml-remaster/new-GRML
to put the new-GRML into an iso9660 image and others, check back the original wiki.
documented on: 2006.11.26
Newsgroups: gmane.linux.distributions.grml.user Date: 2007-02-13
> I'm playing around with adding things to grml_small (being that stipping > the big one down seems rather intimidating)
Stripping the big one down works fairly well (in my opinion better than adding things to grml_small because you might add newer/untested versions accidentally) and even without network connection.
Just take dpkg —get-selections, and set everything to purge which is not listed in the grml-small-selections file. Keep the following packages as well (since packages on grml-small are named differently for these):
linux-image-2.6.18-grml install grml-policyrcd install locales install unionfs-modules-2.6.18-grml install unionfs-tools install unionfs-utils install policyrcd-script-zg2 install
Run apt-get dselect-upgrade and after some time you will have a smaller system. Keep more packages to get a bigger cd image.
From one of my scripts for a similar purpose:
export LANG=C export LC_MESSAGES= mv /etc/apt/sources.list{,-moved} touch /etc/apt/sources.list apt-get update dpkg --get-selections | sed s/install$/purge/ | dpkg --set-selections dpkg --set-selections <grml-small-0.3-selections dpkg --set-selections <my-selections apt-get -y dselect-upgrade apt-get -f install apt-get dselect-upgrade
Michael Schierl
So I have played around with this script for a while; I am trying to keep X, so my 'my-selections' looks like this:
linux-image-2.6.18-grml install unionfs-modules-2.6.18-grml install grml-policyrcd install policyrcd-script-zg2 install locales install man-db install fluxbox install grml-x install hwinfo install libhal1 install libhd13 install pciutils install xbase-clients install xfonts-base install xserver-xorg install xserver-xorg-core install xserver-xorg-input-all install xserver-xorg-input-evdev install xserver-xorg-input-kbd install xserver-xorg-input-mouse install xserver-xorg-input-synaptics install xserver-xorg-input-vmmouse install xserver-xorg-input-wacom install xserver-xorg-video-fbdev install xserver-xorg-video-vesa install xterm install
The first 'apt-get -y dselect-upgrade' runs fine and leaves everything related to X alone.
The second one, though, wants to remove everything that looks remotely like X:
apt-get -y dselect-upgrade Reading package lists... Done Building dependency tree... Done The following packages will be REMOVED: grml-x xkb-data* xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-evdev xserver-xorg-input-kbd xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-video-fbdev xserver-xorg-video-vesa 0 upgraded, 0 newly installed, 12 to remove and 0 not upgraded. Need to get 0B of archives. After unpacking 15.6MB disk space will be freed.
What am I missing there? Do I have to put the whole dependency tree for those packages into my selection file?
Maybe it would be easier to strip grml down to the minimum packages you mentioned and then go using aptitude or apt-get…
Juergen Fiedler
Newsgroups: gmane.linux.distributions.grml.user Date: 2007-02-13
What I want to know is how do you actually make a live cd? What I mean is this, and I will explain what I mean in more detail.
Ok, starting from a running grml system on your development machine, all the programs are on there, the bugs are out, to the best of your knowledge, and you are ready to make a new release. What is done to get from that to the iso file system with its large compressed file system, and the other files that are with it.
I know how to make an iso-9660 file system, at least, well enough to make a cd, but how do you make the thing bootable? How does the technology work that is used to compress the software and documentation down? How does the thing know which parts of this large file to use when accessing programs?
Why I wonder this is, I like to add in a few packages that I use. I would like to have my own disk with config files, new packages and more so that I can just set up on any machine and rock and roll.
Doug Smith
> Why I wonder this is, I like to add in a few packages that I use. I > would like to have my own disk with config files, new packages and > more so that I can just set up on any machine and rock and roll.
If you just want to remaster it, follow one of the remastering guides. If you want to change how the boot process works, you will have to dig deeper. I'll try to sketch it below, but if you are really interested to build your own live cd "from scratch", you will have to read a lot more…
> I know how to make an iso-9660 file system, at least, well enough to > make a cd, but how do you make the thing bootable?
There are, in theory, two ways.
create a bootable floppy image and use that one as an "emulation boot image". The BIOS will copy it to RAM, emulate a floppy there and boot from it. On that floppy there should be a bootloader that can boot Linux from a CD. This works for any OS that can be booted from a floppy and needs access to a CD, so it is the more traditional way. See mkisofs for options how to build an iso with an emulation boot image.
Use a special bootloader for CDs, as a so called "no-emulation boot image". (you don't understand the name if you do not know what option 1 is about…) The BIOS will copy the image into RAM verbatim and execute it. Mkisofs can do that as well, but you have to check the bootloader documentation for the offset (the position in RAM) where the image should be loaded to.
In practice, nowadays you use only method (b). Popular boot loaders for CDs are for example isolinux (used by grml), grub, and cdshell (which can boot almost everything: Windows install and live cds, cd and floppy images, and of course Linux).
> How does the technology work that is used to compress the software and > documentation down?
It is a compressed filesystem. It is read-only (similar to iso) but compresses all files on disk. The filesystem itself is not stored directly on a disk, but in a filesystem image which is on the CD and appears a one file there. There are several compressed filesystems available; most live cds use squashfs nowadays (which needs a kernel patch since it is not in mainline yet), older ones used cloop.
Since the filesystem is read-only, you need some place to store temporary data as well. The filesystem for this is tmpfs (which lives just in RAM). Live CDs used to set up sophisticated symlinks so that all read-only files are on compressed filesystem and all files that have to be changed are copied to RAM at boot. But nowadays there is a better solution called unionfs: It will take two filesystems and create a view that unites both. All write access will go to the read-write filesystem (i. e. RAM), unchanged files live on the compressed filesystem. This is not limited to live cds, but can as well be used everywhere else where you have a "base filesystem" you have to go back to regularly.
> How does the thing know which parts of this > large file to use when accessing programs?
Just like an on-disk filesystem knows what parts of your hard disk to access to find your files.
The more tricky part is how to tell the kernel how to assemble the filesystem out of three other filesystems. The solution is initrd (you can also use initramfs in more recent kernels) which is loaded to RAM (by the bootloader) and sets up the root filesystem. That means: Looks for where the CD is (IDE, SCSI, somewhere else), mount it, mount the compressed filesystem on it, create the unionfs, and give the new unionfs as root device to the kernel.
Building an initrd is tricky because you will have to use tools on it that work without having the full filesystem available. busybox is quite useful for this. But usually you can use an existing initrd (or at least modify an existing one instead of building one from scratch). On the other hand, it can be very interesting to try to build one yourself - but in that case you should have a PC emulator like VMWare or qemu handy, because otherwise you will need lots of CDs and lots of time for burning them.
> If you don't have the time to explain this to me in full detail, do > you know of a good reference where I can just read about it and get > all the details?
Start at the boot process howto (Umm, I can't find it at the moment). Or if you want to learn more about Linux, try to follow a "Linux from scratch" guide, which will tell you how to build a Linux that is on a hard disk (including kernel, bootloader and everything) and does not use any files from your current Linux distribution. Building chroot environments (directories that do not allow access outside to prevent malicious programs inside to use programs outside) helps as well because it gives you experience what files are needed by which programs to run (which is useful for building an initrd).
> I am sorry to come on here with such strange questions, but I hope > there is a simply-understood answer for this one.
Ask again if you do not understand the answers. Since no one here knows what you know about Linux and what you don't, it is hard to give a description that does not bore the intermediate used and does not ask too much of a complete newbie (that never used a Linux console before) either.
Michael Schierl
Newsgroups: gmane.linux.distributions.grml.user Date: Thu, 21 Sep 2006 18:47:59 +0200
> I've experimented quite a bit with remastering grml. Basically i wanted > to do change the package list to about that what i have on my desktop, > which basically is mostly kde and kde apps, stuff like quanta, kile, > etc...
> I'm quite there now, it works almost the way i want it. To have it > working perfectly i would only need a view changes/additions to the grml > scripts:
> *) option to change the default windowmanager > - not hardcoding wm-ng in /etc/grml/autoconfig.functions
You already know the bootoption "startx"?
grml startx => start default window manager wm-ng (fluxbox with addons)
grml startx=ion3 => start X with window manager ion3
> *) options to start x on boot, so you can either > - don't do anything
Hm, sorry - what does 'don't do anything' mean? :) Interesting feature request. Do I have to implement nothing as well? ;)
> - just create xorg.conf, but don't start xorg
Ok, so you mean you want to get a special bootoption which runs 'grml-x -force -nostart wm-ng' in background during bootup?
> - create xorg.config and start xorg
Bootoption startx does that. :)
regards,
Newsgroups: gmane.linux.distributions.grml.user Date: Wed, 5 Jul 2006 20:18:30 +0200
> > ... Adjust your live-cd system with the configuration framework: > > http://grml.org/config/[]
> If one can afford the persistenthome, ie, have a local partition to use, > would it be a great idea to offer a total persistent grml system on local > partition?
> I mean, since we can use the unionfs to allows user to install packages, > tweak configs, why don't we save the changes on disk, instead of in ram. > So with persistentroot, no need to save-config/restore-config every > time...
Someone has to implement it. :) I have some more important stuff on my todo list and would like to see unionfs in a more stable state before doing such a major modification with unionctl (inclusion in mainline kernel once would be great).
Michael Prokop