Create your own PCLinuxOS-derived Linux distribution.
See also:
Introduction ∞
You can create a new livecd that can install to reproduce most (or all) of your current PCLinuxOS installation.
By adding and removing packages, or changing any files, you can customize the distribution.
With the right knowhow, mklivecd
is a simple way to make a "new" Linux distribution. With significant work, your remaster could totally diverge from its PCLinuxOS roots. However, a basic remaster really isn't a new distribution.. it's more of an homage to PCLinuxOS, with a bit of personalization.
A remaster that works on older computers ∞
There are two types of kernels:
normal
-- Optimised for newer computers (i586 and better).-
lve
-- Optimised for older computers (i386 and better) but not newer computers.
The original PCLinuxOS LiveCD is made using the lve
kernel so that it will work on older computers. However, when you install it and then update your system, you will end up using the normal kernel (FIXME - Is this true?).
When you create your own LiveCD, it will use your existing kernel by default.
-
TODO - Write up some advice on switching kernels. Link to a howto if possible.
Working with packages ∞
It's probably a good idea to update an installation before remastering it, so it's in tip-top shape.
Sure, you could log into X, run Synaptic, reload, mark upgrades and apply.. but on the console, I do:
# As root # Update all packages # WARNING: In theory, updating can break things! # Consider backing up before, and rebooting then testing after. apt-get autoclean && apt-get update && apt-get dist-upgrade
Removing packages you don't ever use is probably a good idea to reduce the size of your installation and therefore the resulting mklivecd ISO. I use synaptic for this, and I keep a careful eye on the dependancies so I don't remove things I really do need.
Pre-remaster preparation ∞
2008-08 - updated for PCLinuxOS 2007
When you have a PCLinuxOS installation which you would like to remaster into its own liveboot CD, what kinds of things should be considered?
-
Your users stay, including their passwords and all files in their home folders. This includes all cached files, command history and the like.
My intention is to wrap this into a script. I should even be able to build it as an RPM which is designed to perform these actions, and then fail to install. I can also put this into the PCLinuxOS contrib
repository as some kind of apt-get install cleanup
command.. which would rock.
I have users root
, user
and guest
. Your system may be different and you will need to modify this script for your system. Yes it could be made much more intelligent. However, I would sooner rewrite it as a Ruby script than get technical with Bash. =)
This manual application cleanup could be supplemented by software:
mklivecd new.iso --bootopt splash=silent --bootkey F2=advanced.msg --bootimg boot.lss
Notes:
- How do I clean out the
/tmp
directory safely? - Clear out Mozilla Firefox saved passwords.
-
Lynx doesn't appear to need cleanup.. I can't find any lynx-related files after using it.
Generating the LiveCD ∞
mklivecd new.iso
Yeah, that's it. Isn't Linux great? For more options, type
mklivecd --help
More advanced examples ∞
If you want to do something a bit fancier, you can have an initial splash, bootsplash and have the F2
key working on bootup:
mklivecd new.iso --bootopt splash=silent --bootkey F2=advanced.msg --bootimg boot.lss
Ignoring certain directories and files, specifying the working directory, the target directory and file, etc:
mklivecd \ --nodir ^/root/temp,^/root/tmp,^/mnt,^/tmp,^/root/temp/livecd,^/root/livecd_iso \ --nofile ^/etc/X11/xorg.conf,^/etc/X11/XF86Config,^/etc/modprobe.conf,^/etc/modeprobe.preload,^/etc/fstab \ --root / \ --workdir /root/temp/livecd \ --bootopt splash=silent \ --bootimg boot.lss \ /root/livecd_iso/filename.iso
(Untested) Here's an example using the CVS version with $nodir
and $nofile
set, and uses this mklivecd
command:
mklivecd \ --nodir=^/root/temp,^/root/temp/livecd,^/root/livecd_iso \ --nofile=/etc/X11/xorg.conf,/etc/X11/XF86Config,/etc/modprobe.conf,/etc/fstab, \ /etc/resolv.conf,/etc/sysconfig/harddrake2/previous_hw,/etc/asound.state \ --workdir /root/temp/livecd \ --bootopt splash=silent \ --bootimg boot.lss \ --bootkey F2=advanced.msg \ --md5sum \ /root/livecd_iso/filename.iso
Omiting certain directories ∞
Note that the CVS version of livecd-utils has some advantages over the current version. See below for information on how to get, and use, the CVS version.
Example:
mklivecd \ --nodir ^/root/temp,^/root/tmp,^/mnt,^/tmp,^/root/temp/livecd,^/root/livecd_iso \ --nofile ^/etc/X11/xorg.conf,^/etc/X11/XF86Config,^/etc/modprobe.conf,^/etc/modeprobe.preload,^/etc/fstab \ filename.iso
Alternately, because this seems to work:
cd ~ find|grep ^/*.*/[.]links/cookies
I'm fairly confident that you can omit certain files and directories like this:
mklivecd \ --nodir ^/home/*.*/[.]thumbnails/, ^/root/[.]thumbnails/ \ --nofile ^/root/[.]links/cookies, ^/root/[.]links/links.his, ^/home/*.*/[.]links/cookies, ^/home/*.*/[.]links/links.his \ filename.iso
the CVS version ∞
I have not worked with the CVS livecd-utils. This is all untested.
To get and install the CVS livecd-utils:
mkdir /tmp/mklivecd cd /tmp/mklivecd cvs -d:pserver:anonymous@cvs.livecd.berlios.de:/cvsroot/livecd login cvs -z3 -d:pserver:anonymous@cvs.livecd.berlios.de:/cvsroot/livecd co mklivecd livecd-utils cd mklivecd make;make install cd ../livecd-utils/;make;make install cd rm -rf /tmp/mklivecd
Omitting certain directories ∞
(untested)
The CVS version of the mklivecd
script uses the $nodirs
and $nofiles
parameters automatically.
$nodirs = '^/[.].* ^/dev$ ^/initrd$ ^/lost+found$ ^/mnt$ ^/proc$ ^/sys$ ^/tmp$ ^/var/tmp$ ^/root/tmp$'; $nofile = '^/[.].* ^/fastboot$ /core[.][0-9][0-9]*$ .*~$ .*[.]rpmnew$ .*[.]rpmsave$ [.]bash_history$ [.]fonts[.]cache-[0-9]$ [.]xauth.* [.]wh[.]* [.]xsession-errors$ ^/var/run/ ^/var/lock/subsys/';
The nodirs
and nofiles
specifies files and directories which don't participate in the livecd creation, these directories and files will be recreated during the livecd boot.
Notes and Issues ∞
Other files and directories to clean up ∞
find / -name ".wh*" -exec rm -f {} \;
I'm not sure what files these are. There may be a better way to clean up after them. When I search for these files, I see:
/var/lib/alsa/dev/snd/.wh.controlC0 /var/lib/alsa/dev/snd/.wh.pcmC0D0c /var/lib/alsa/dev/snd/.wh.pcmC0D0p /var/lib/alsa/dev/snd/.wh.pcmC0D1c /var/lib/alsa/dev/snd/.wh.timer /var/lib/alsa/dev/.wh.adsp /var/lib/alsa/dev/.wh.audio /var/lib/alsa/dev/.wh.dsp /var/lib/alsa/dev/.wh.mixer
I don't want to delete things without understanding what they're doing.
I don't know how to not include certain users ∞
While it's possible to not include certain directories, I don't know how to not include an entire user.
I suspect that if I do this, it will still leave 'user' lingering around. Meaning that 'user' could log in but it has no home folder.
mklivecd \ --nodir ^/home/user \ /root/livecd_iso/filename.iso
Untested things ∞
CVS livecd-utils ∞
'old kernels' cleanup ∞
Other notes and issues ∞
One recommended command to generate the livecd is:
mklivecd new.iso --tmp=/mnt/sda6/tmp --bootopt splash=silent --bootimg=boot.lss --bootkey F2=advanced.msg --md5sum --fstab=rw,noauto --nofile=/etc/X11/xorg.conf,/etc/X11/XF86Config,/etc/modprobe.conf,/etc/fstab,/etc/resolv.conf,/etc/sysconfig/harddrake2/previous_hw,/etc/asound.state
What are the files that determine the "default" new user settings for KDE?
/etc/skel/.kde/share/config
If you want your custom settings to be for the default user then you would copy them into /etc/skel
directory. Anything in that directory gets transferred to the new user.
If you go into the guest/root account and make your changes then build the livecd then yes they will show up just like they are on the hard drive. However if they install from the livecd to the hard drive and create a new user for themselves then no they will get the standard settings.
ported