Posts Tagged Sabayon
Create your own spinoff!
Posted by joostruis in sabayon linux on May 8, 2010
If you are in a small company or simply in a situation where you want to install a preselected list of programs then why shouldn’t you just grab SabayonCore modify the ISO so it will have anything you want and burn that to a disc. Or maybe you want to create your own Sabayon based distro and fork it a bit? Yes you can!
The tool we have in stock to achieve this is called molecule.
First install molecule (equo install molecule)
Then grab an example spec file.
All I can say is that if you want to start something based on the CoreCD you want to have a look at this spec file:
(also found in /etc/molecule/examples)
Since I am for now only looking into a 64bits mastered ISO I’ve commented out:
# pre chroot command, example, for 32bit chroots on 64bit system, you always
# have to append "linux32" this is useful for inner_chroot_script
# prechroot: linux32
Next I point to where My ISO I want to remaster is:
# Path to source ISO file (MANDATORY)
source_iso: /home/joost/Sabayon_Linux_CoreCD_DAILY_amd64.iso
Now where does this all go:
# Destination directory for the ISO image path (MANDATORY)
destination_iso_directory: /home/joost
Tell molecule to update that ISO before installing anything (that is the next point in line)
# Determine whether repositories update should be run (if packages_to_add is set)
# (default is: no), values are: yes, no.
execute_repositories_update: yes
Tell it to add packages (in this case my set @lxde)
# List of packages that would be added from chrooted system (comma separated)
packages_to_add: @lxde
Ofcourse you can add as many packages here as you want!
I can imagine this does not actually give the perfect result yet.
In my example I use the @lxde set and it contains the gdm login manager by default. On CoreCD chroot there is actually nothing that triggers this to auto start. We also need to configure a file called /etc/conf.d/xdm and set it to use gdm.
Here an example snip. how thats done:
Make it use gdm:
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
Make xdm startup automaticly (and thus load gdm)
rc-update add xdm
so I created inner_chroot_script_after.sh
#!/bin/bash
# Use gdm by default
sed -i 's/DISPLAYMANAGER=".*"/DISPLAYMANAGER="gdm"/g' /etc/conf.d/xdm
# automaticly start xdm
rc-update add xdm
# to be sure, cleanup
equo cleanup
All these commands should be put in a file, and we point our specs file to trigger it from within the chroot like this:
# Inner chroot script command, to be executed inside destination chroot after
# packages installation and removal
inner_chroot_script_after: /home/joost/inner_chroot_script_after.sh
Now run molecule and make it all happen:
molecule sabayon-lxde-amd64.spec
Keep in mind I cannot guarantee anything YET, but it should give you a head start.
Also note that this is a strategy used where we take an excisting iso and modify it basicly. Much more advanced things ARE possible but lets start here rite?