RangoliDevLog
From IndLinux
Contents |
Steps in developing a Rangoli LiveCd
Background Rangoli Live CD is based on Morphix live Cd base. The main tree and Base module is from morphix. Main module is created from scratch.
Necessary
- A latest download of Morphix ISO (base, lightgui etc)
- Have cloop-utils , debootstrap , mkisofs , cdrecord etc installed.
- have Qemu - to test bootable ISO images , without need to burn them
- min 256MB RAM and 1GB swap.
/Rangoli1/NewMain - tree of main module /Rangoli1/baseMod - tree of base module /Rangoli1/CD - CD tree ( from which u make final ISO) /Rangoli1/CD/mainmod/ - location of main module /Rangoli1/CD/base/ - where base module (morphix) , boot.img would go /Rangoli1/CD/boot/grub - menu.lst, options.lst - boot menu files. /Rangoli1/CD/copy/ - anything under this gets copied (or overlayed) onto Mainmod at runtime. /Rangoli1/CD/exec/ - any scripts put here will be run after Mainmod is loaded. /Rangoli1/CD/deb/ - any small deb package here will be installed onto Mainmod. /Rangoli1/CD/minimod - copy minimods here.
Patches and script modified are in CVS modue livecd at http://cvs.sourceforge.net/viewcvs.py/indlinux/livecd/ to check it out
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/indlinux login (press Enter) cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/indlinux co -P livecd
Read the README file for details on files in module.
Pre setup
# mount -o loop morphix-lightgui.iso /mnt/ # cp -a /mnt/* /Rangoli1/CD/ # umount /mnt
Tools required
- morphix tools from www.morphix.org/debian
- cloop utils, module-builder, mkisofs, qemu
From Indic perspective we need to add/have the following
- Locales built
- Fonts installed
- keyboard / input method packages installed
- language options at boot time, and selection of desktop on that basis
- custom home directory , with background, desktop links,
Making a customized live CD involves following steps
Boot image customization
- Adding proper boot options
Boot menu options go in /boot/grup/menu.lst , submenus can be defined in seperate files & add in main one. Boot parameters lang=xx passes the language option to the system to boot. desktop=xxx will set the proper desktop
- Boot screen/logo
boot splash screen is in /boot/grub/message , this needs to be a 16 color image of same resolution as the default one. Other splash screens in miniroot.gz # cp miniroot.gz /tmp/ # gzip -d /tmp/miniroot.gz # mount -o loop /tmp/miniroot /media/floppy/ # cd /media/floppy in bootsplash/images use own images in following names (the order is the order of their appearance) size should be 1024x768. bootsplash-1024x768.jpg silent-1024x768.jpg silent2-1024x768.jpg silent3-1024x768.jpg silent4-1024x768.jpg silent5-1024x768.jpg in linuxrc , changed branding from Morphix -> Rangoli after done, unmount & compress the image # umount /media/floppy # gzip /tmp/miniroot # cp /tmp/miniroot.gz /Rangoli1/CD/boot/
- Boot time options / parameters.
Base module customization
- to extract stock base mod
# module-extractor CD/base/morphix baseMod
- Adding language options in auto-config scripts (knoppix-autoconfig / knoppix-locales ), paths relative to baseMod/ , (see locales.diff)
- /etc/init.d/knoppix-locales has the language options in the following form
hi)
# Hindi
LANGUAGE="hi_IN.UTF-8"
COUNTRY="in"
LANG="hi_IN.UTF-8"
KEYTABLE="us"
XKEYBOARD="dev,us"
KDEKEYBOARD="dev"
CHARSET="UTF-8"
KDEKEYBOARDS="dev,us"
TZ="Asia/Calcutta"
;;
- in /etc/init.d/knoppix-autoconfig (see autoconfig.diff)
To get the desktop from boot menu. uncomment following line DESKTOP="$(getbootparam desktop 2>/dev/null)" # Export it now, so error messages get translated, too export LANG COUNTRY CHARSET DESKTOP
- in /etc/init.d/morphix-start (see start.diff )
added this line to copy the generated xorg.conf to Mainmod mount cp -af /etc/X11/xorg.conf /mnt/main/etc/X11/
- and in /usr/sbin/mkxf86config (see mkxf86.diff)
cp /etc/X11/XF86Config-4 /etc/X11/xorg.conf
- build the module again
# module-builder baseMod morphix-new
# cp morphix-new CD/base/morphix
Main module customization
- Building a main module from scratch
# debootstrap sarge|etch|sid NewMain (wait for few minutes! :)
- Building from lightgui mainmod.
# module-extractor CD/mainmod/lightgui.mod NewMain (wait for few minutes! :)
once done, set /etc/resolv.conf as per ur network settings and prepare for chroot add morphix repository to NewMain/etc/apt/sources.list deb http://www.morphix.org/debian/ ./
# mount --bind /proc NewMain/proc # mount --bind /dev NewMain/dev # chroot NewMain
Install new packages # apt-get update # apt-get install kde gnome-desktop-environment openoffice.org # apt-get install morphing-tools morphix-init Install extra packages as needed, like kde-i18n-(hi,pa,bn,ta), aspell, aspell-(hi,bn,ta,te,gu,or,pa) etc. openoffice.org-l10n-(gu,pa,bn,hi). iiimf, scim etc. see packages.txt in CVS for complete list.
Pre-steps to customization
To customize inside a main module, most work needs to be done in chroot'ed environment
Paths relative to NewMain/ or / in chroot'ed env.
Indic specific
- Building locales
Locales to be available on system are built from the list in /etc/locale.gen Make sure all Indic locales are present like below. Locale definition files should be present in /usr/share/i18n/locales/ . Copy any modified/updated definitions to this path.
en_IN UTF-8 hi_IN UTF-8 bn_IN UTF-8 gu_IN UTF-8 kn_IN UTF-8 ml_IN UTF-8 mr_IN UTF-8 or_IN.UTF-8 pa_IN UTF-8 te_IN UTF-8 ta_IN UTF-8
then run locale-gen utility to build the listed locales # locale-gen Locales will be built into /usr/lib/locale/locale-archive
(ensure locale-gen is disable in morphix-start in baseMod )
- Installing fonts
# apt-get install ttf-indic-fonts Run fc-cache -v -f to regenerate the font database. # fc-cache -f -v
- Keymaps - If any extra keymaps are needed to be installed, they could either be installed in home dir. or in system localations . For XKB maps it is /etc/X11/xkb/symbols/pc .
- IIIMF input - make sure all the IIIMF packages needed are installled (look for iiim* in packages list)
- Translations - copy updated translations (mo files) to /usr/share/locale/LANG/LC_MESSAGES ( LANG=hi say for Hindi ).
Building and testing
- Creating the new Mainmod
# apt-get clean ( clear the apt download cache ) Do ctrl+d to log out from chroot'ed env. # umount NewMain/proc # umount NewMain/dev (Some amount of process killings may be needed here esp for any famd, dbus, exim4, gconf etc running and using NewMain) It has to be ensured that a compressed Mainmod doesnt exceed 650MB, ideally should be below 600MB, assuming 1/3 compression, Mainmod tree shouldnt go beyond 1.8GB. # time module-builder -t ext3 NewMain rangoli.mod (take a break of 20-40mins!) # mv rangoli.mod CD/mainmod/ # ./makecd.sh makecd.sh is basically the following time mkisofs -pad -l -r -J -v -V "IndLinux" -b boot/grub/iso9660_stage1_5 -c base/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -hide-rr-moved -o rangoli-1.0b.iso CD/ # ./testcd.sh which is basically qemu -std-vga -dummy-net -cdrom rangoli-1.0.iso
Or burn the ISO image using cdrecord/xcdroast/k3b # cdrecord -scanbus (note the device parameters usually something like 1,0,0 & use below in dev=1,0,0 ) # cdrecord dev=/dev/hdc speed=10 blank=fast -eject -v -isosize rangoli-1.0b (for 10x RW media)
Fine tuning
- Setting up language selection (currently set in /morphix/init.d/X11-setup (see X11-setup.diff)
Based on language & desktop options at boot, set the appropriate language config & desktop windowmanager.
if [ "$LANG" = "hi_IN.UTF-8" ] ; then
echo "Language is Hindi"
WINDOWMANAGER=/usr/bin/startkde
if [ "$DESKTOP" = "gnome" ]; then
WINDOWMANAGER=/usr/bin/gnome-session
fi
ln -s /home/morph/.kde/share/config/kdeglobals-hi /home/morph/.kde/share/config/kdeglobals
ln -s /home/morph/.kde/share/config/kxkbrc-hi /home/morph/.kde/share/config/kxkbrc
ln -s /home/morph/.gconf/desktop/gnome/peripherals/keyboard/kbd/%gconf-hi.xml /home/morph/.gconf/desktop/gnome/peripherals/keyboard/kbd/%gconf.xml
fi
Force the settings for X startup rm -f /etc/X11/xinit/xinitrc echo "exec xsetbg -fullscreen $BGIMAGE &" >> /etc/X11/xinit/xinitrc echo "exec $WINDOWMANAGER" >> /etc/X11/xinit/xinitrc cp /etc/X11/xinit/xinitrc /home/$USER/.xinitrc
Desktop customizations
Boot the CD, if desktop working properly and network is setup automatically, customize the desktop as needed
eg. adding panel applets, changing background, themes, font sizes, desktop links etc. This is best done when running from CD on another machine on network.
Take a backup of all /home/morph
# sudo su ( to become root when running live CD) # tar zcvf /root/morph-home.tar.gz /home/morph/
copy morph-home.tar.gz to Build machine, and untar contents in NewMain/etc/skel # tar zxvf morph-home.tar.gz --directory /Rangoli1/NewMain/etc/skel/ # cd /Rangoli1/NewMain/etc/skel/ # mv morph/. . # rmdir morph
- Keyboard configuration - for getting default keyboard for a lang in desktops (TODO: find better ways to handle this).
GNOME keyboard applet settings is in .gconf/desktop/gnome/peripherals/keyboard/kbd/%gconf.xml
<entry name="layouts" mtime="1135935204" type="list" ltype="string">
<li type="string">
<stringvalue>dev</stringvalue>
</li>
<li type="string">
<stringvalue>us</stringvalue>
</li>
</entry>
copies of %gconf-LANG.xml can be made with first entry set to appropriate lang. this is then linked to %gconf.xml at runtime.
KDE Keyboard config is in /home/morph/.kde/share/config/kxkbrc [Layout] Additional=us EnableXkbOptions=true Includes= Layout=dev again per lang copies & link at runtime
- KDE locale settings
In .kde/share/config/kdeglobals [Locale] Country=in Language=hi have per lang files & link runtime.
- Desktop background
GNOME - .gconf/desktop/gnome/background/%gconf.xml
<entry name="picture_filename" mtime="1136087050" type="string">
<stringvalue>/home/morph/background.png</stringvalue>
</entry>
KDE - in .kde/share/config/kdesktoprc [Desktop0] ... Wallpaper=$HOME/background.png
- Rebuild CD
Home dir customizations could be copied to CD/copy/home/morph which gets copied (overlayed) onto Mainmod runtime. Any minor changes in files could again go in CD/copy , to avoid rebuilding Mainmod everytime. Rebuild ISO image and test.

