executes
Code: Select all
apt-get install live-build live-boot live-config syslinux kpartx apt-cacher
as explained earlier, it might be a good idea to symlink the /var/cache directory to a dir somewhere on a disk to avoid clobber.
If you do
build.sh (module1 module2 ... )
then in a first step the configuration files from the /config directory are loaded. The default file is always loaded, settings from the modules can override the default settings.
example - in the config/icewm there is>
Code: Select all
IMAGE='iso-hybrid'
RECOMMENDS='false'
INDICES='false'
LINUX_FLAVOURS='486'
NON_FREE_WIRELESS='0'
MODULES='icewm wireless'
The first 4 of those settings are options to the lb command (debian live builder). Alternatives would be e.g.
IMAGE='hdd' (would build a binary image ready to dd to usb ord harddisk),
RECOMMENDS='true' (would install all recommended packages, this would make the iso much bigger),
INDICES='true' this would install all apt indices, which would mean no apt-get update is necessary before installing new files
LINUX_FLAVOURS="686" or "686pae" or "AMD64" would be possible among other alternatives
the last to options influence which packages are installed.
NON_FREE_WIRELESS=1 would install propriaty drivers
the most important setting is
MODULES='icewm wireless' - this defines which packages and commands are executed.
after the configs are loaded the build.sh script executes the code from the MODULES variable.
They are defined in the /module directory. Lets study /modules/wireless.
it has only the file wireless-config.sh (each Module has such a config file). The first part of this file is:
Code: Select all
add_packages "wireless" "wireless-tools wpasupplicant firmware-linux-free"
add_packages "wireless" "ndisgtk ndiswrapper-utils-1.9 wicd"
with the add-packages function, debian packages are added to the list which will be installed to the new system (the first string, "wireless", is just an identifier). The 2nd part of the wireless-config loads non-free wireless packages if NON_FREE_WIRELESS='1'.
The second module icewm is more interesting. Beside the icewm-config.sh there are also directories (hooks, includes.chroot and packages.chroot).
/includes.chroot
contains files which will be included in the new filesystem.
For example ther is the /etc/skel/.config/ directory, which has the keyboard switcher and the rox.sourceforge.net folder with the pinboard file. This is the skeleton user directory which will be copied into every new user home directory.
I also added to /usr/share/icewm . There is a themes folder with two additional icewm themes, a new startup file and a new default theme.
In the /usr/share/pixamps folder there is a custom icon set. In /usr/share/applications I define some custom applications (those are the applications which are also put into the rox pinboard file.
In the /opt directory there is the background folder with some wallpapers and the /opt/bin folder with some scripts - I think every non debian app should go to /opt.
Hooks:
hooks are programs which will be installed after the packages are installed. For example there is config.chroot:
Code: Select all
#!/bin/sh
# set some environemtal variables
echo 'VISUAL=xfwrite' >> /etc/environment # set editor in X to xfwrite
echo 'GDK_NATIVE_WINDOWS=true' >> /etc/environment # fix ROX filer focus bug
# change terminal default font and fontsize
echo "*faceName: Liberation Mono" >> /etc/X11/app-defaults/XTerm
echo "*faceSize: 11" >> /etc/X11/app-defaults/XTerm
the stripped.chroot hook will remove:
Code: Select all
or PACKAGE in apt-utils aptitude man-db manpages info wget dselect
do
if ! apt-get remove --purge --yes "${PACKAGE}"
then
echo "WARNING: ${PACKAGE} isn't installed"
fi
done
apt-get autoremove --yes || true
# Removing unused files
find . -name *~ -print0 | xargs -0 rm -f
#rm -rf /usr/include/*
rm -rf /usr/share/groff/*
rm -rf /usr/share/doc/*
rm -rf /usr/share/locale/*
rm -rf /usr/share/man/*
rm -rf /usr/share/i18n/*
rm -rf /usr/share/info/*
rm -rf /usr/share/lintian/*
rm -rf /usr/share/linda/*
rm -rf /usr/share/zoneinfo/*
rm -rf /var/cache/man/*
# Truncating logs
for FILE in $(find /var/log/ -type f)
do
: > ${FILE}
done
the packages.chroot folder should contain deb packages which are automaticly installed while building - I have to admit it didn't quite work for me until now.
during the build process, all files are stored to the /build directory. there is the chroot directory which will become squashed to be the new filesystem.squashfs
I hope I could give an idea of how those script work and about options for customisation. There are additional possibilities, e.g. include binary files and also to customize the boot behavior.
cheers emil
PS: the live-tool manuals have lots of info