DoudouLinux dev's blog

To content | To menu | To search

Tag - LiveCD

Entries feed - Comments feed

Wednesday 20 February 2013

Booting a DoudouLinux ISO from an USB key

The current stable version of DoudouLinux, Gondwana 1.x, requires to download a different file if you want to burn a CD or to write an USB key. Since Grub2 is now able to boot the kernel image that is contained into an ISO file, it is possible to boot a Live ISO written onto an USB key and then to only use the ISO file whatever the target support. This is of course very practical but doesn't work on Debian Squeeze Live images without a dedicated patch called findiso. We have included this patch in the latest development release, 2013-02, that will be turned into the next stable release Hyperborea 2.0 around April/May. Doing so provides several advantages:

  • Only one file to be downloaded, per language.
  • Easy system update on the USB key: just replace the ISO file with the newer one! (and update Grub parameters)
  • A single FAT partition can be preserved on the USB key, allowing the normal use of an USB key, especially on capricious systems that can only read FAT :p (do you really keep using these old-fashion systems???).
  • Ability to have several flavors of DoudouLinux on the same key, for example the stable release and the development one, or several languages.
  • Does not require to reformat the USB key and then should lead to better R/W access performances by preserving factory settings.

Of course it is better for DoudouLinux developers too since we don't need to test the USB image anymore. This also solves the issue we had with isohybrid images that don't run on every computer and also broke our persistence activation tool… So now let's see how to take benefit of this new feature :). Beware: the process to turn an ISO file into an USB live system is done from the command line! Ready?

Installing Grub2

NB: Here we are using Grub2 from a Debian system but, if you don't care about copying the kernel image and its ramdisk onto the USB key too, this should also be possible to use any other bootloader (no test ever achieved though).

You need to have Grub2 installed in your system. If not, install the corresponding package. A particularity of Grub2 is that it doesn't fit anymore on the very small 512 first bytes of a disk. It has then 2 alternatives:

  • If the first partition starts at the cylinder number 1 instead of number 0, there may be enough space after the first 512 bytes for Grub to copy all its files. As they are outside any partition, they should be preserved from any modification.
  • If there is not enough space before the first partition, Grub uses sectors in the first partition and records their position in the first 512 bytes. Of course the file system in the first partition may move these sectors without Grub knowing, this is then not 100% reliable.

If you are in the second situation and want to change to the first one, you have no other choice but reformatiing your USB disk. Grub displays a message during its installation when you are in the second situation.

So now let's install grub onto the USB key. We need to mount it and launch the Grub installation command:

$ sudo mount /dev/sdx1 /mnt/
$ sudo grub-install --force --no-floppy --root-directory=/mnt/ /dev/sdx

That's it! Take care of replacing the USB device path /dev/sdx by the actual path of your key ;).

Making the USB key bootable

(update of 2013/02/21)

Your USB key will probably not boot if you don't set its partition as active, the so-called boot flag. This operation can be quickly achieved with fdisk. First start fdisk onto your USB key:

$ sudo fdisk /dev/sdx

You should get a prompt. Type p to display information about your disk partitions:

Command (m for help): p

Disk /dev/sdh: 2 GB, 2070216704 bytes
64 heads, 62 sectors/track, 1019 cylinders
Units = cylinders of 3968 * 512 = 2031616 bytes

   Device Boot      Start         End      Blocks   Id  System 
/dev/sdh1               1        1019     2021665    b  FAT32
Command (m for help): 

As you can see, the boot flag (second column of the partition information table) is not set since there is no * sign in this column. So in the fdisk prompt, type a to activate the partition. fdisk will ask you to enter the partition number (ie. 1). You then just need to write the partition table by pressing w:

Command (m for help): a                                                   
Partition number (1-1): 1                                                 
Command (m for help): w                                                   

Copying files

You can now copy the ISO file – it takes few minutes, the Unicode font and the Grub background image:

$ sudo cp doudoulinux-2013-02-fr.iso /mnt/boot/
$ sudo cp /usr/share/grub/unicode.pf2 /mnt/boot/grub/
$ sudo mkdir /mnt/boot/grub/splash
$ wget http://doudoulinux.org/blog/public/screenshots/install/witch-knight-grub.png
$ sudo mv witch-knight-grub.png /mnt/boot/grub/splash/background.png
$ sudo sync

We have chosen to put all the files into the /boot directory that Grub made, but you can choose any other directory on your USB key. The Unicode font is required if you want translated messages in the Grub splash screen. So now everything is ready to get DoudouLinux boot, except that Grub hasn't been configured…

Setting Grub2, quickly

The Grub configuration must be placed in the file “/mnt/boot/grub/grub.cfg” that does not exist yet. A very basic setting of Grub2, to start the ISO, is the following:

set timeout=5
set default=0

menuentry "DoudouLinux testing 2013-02" {
  set isofile=doudoulinux-2013-02-fr.iso
  loopback loop /boot/$isofile

  linux (loop)/live/vmlinuz findiso=boot/$isofile boot=live config locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-variant=oss keyboard-options=grp:alt_shift_toggle,terminate:ctrl_alt_bksp utc=yes timezone=Europe/Paris nox11autologin quiet splash nomodeset video=uvesafb:mode_option=640x480-16,mtrr=3,scroll=ywrap persistent persistent-subtext=doudoulinux username=tux hostname=doudoulinux
  
  initrd (loop)/live/initrd.img
}

Of course isofile is the name of the ISO you want to boot, change it to fit your needs! In these settings we tell Grub to mount the ISO file so that he can access the kernel image and the ramdisk image file into it. This feature is only needed to launch the kernel with the minimalistic system in the ramdisk. This minimalistic system will then use the boot parameter findiso to find the ISO file and mount it into the final Linux system, DoudouLinux.

If you wonder how we could have written so long a boot parameter line, well, that's just the LiveCD boot line with few arguments removed or added :). To retrieve it, mount the DoudouLinux CD and look in the file “isolinux/live.cfg”. Note that you may have to change the localization parameters of this boot command for your particular use:

  • locales → your language settings
  • keyboard-layouts → your keyboard layout
  • keyboard-variant → your keyboard variant
  • keyboard-options → your keyboard options
  • utc → whether your computer clock is UTC or local time
  • timezone → your timezone

Don't forget to unmount your key:

$ sudo sync
$ sudo umount /mnt/

So now you should have a booting USB key that launches DoudouLinux, except that the Grub screen is not very nice. Let's see how to improve this.

(update of 2013/02/21) NB: once you've launched DoudouLinux on your USB key, you can use its persistence tool to make a persistence file on the USB key so that your DoudouLinux system won't loose user's work :).

Setting Grub2 for real

In the following Grub configuration file we have added:

  • language settings, to get translated Grub messages
  • video modules to show the background image
  • colors and background image
  • classes to the DoudouLinux system entry, in case you want to graphically customize this entry

This is a bit more complicated but the result is as expected: a graphical boot as early as Grub! You now have no reason to not have DoudouLinux everywhere with you since it can also be on your USB stick of everyday use :).

set lang=fr

set timeout=5
set default=0

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
  insmod png
}

if loadfont /boot/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm

set locale_dir=/boot/grub/locale
insmod gettext

if background_image /boot/grub/splash/background.png; then
  set color_normal=black/black
  set color_highlight=black/white
fi

#####################################
menuentry "DoudouLinux testing 2013-02" --class doudoulinux --class gnu-linux --class gnu --class os {
  set isofile=doudoulinux-2013-02-fr.iso
  loopback loop /boot/$isofile

  linux (loop)/live/vmlinuz findiso=boot/$isofile noeject boot=live config locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-variant=oss keyboard-options=grp:alt_shift_toggle,terminate:ctrl_alt_bksp utc=yes timezone=Europe/Paris nox11autologin quiet splash nomodeset video=uvesafb:mode_option=640x480-16,mtrr=3,scroll=ywrap persistent persistent-subtext=doudoulinux username=tux hostname=doudoulinux
  
  initrd (loop)/live/initrd.img
}
#####################################

Saturday 19 January 2013

DoudouLinux ISO relocalization

One issue we have with the DoudouLinux ISO images is that, since it is designed to start without any user interaction, localization parameters are preset inside the ISO and cannot be easily changed. While this can be acceptable for most language variations (eg. French from Canada and French from France do not differ that much), this can be a real issue for the keyboard layout and the timezone. Indeed, if you try to teach children the keyboard and that it outputs an Azerty layout while you only have Qwerty ones in your country, this is rather annoying… This is however the case between France (Azerty), Canada (Qwerty) and Switzerland (Qwertz) in which French is spoken. Currently the only official solution is to play with combinations of Left Alt+Shift to change between predefined CD keyboard layouts[1].

So, as we can't propose an ISO for each country and each timezone, we have created a ticket quite a long time ago about this issue[2]. The problem to solve is that localization parameters are computed at each CD boot. It is then not possible to make changes persistent without patching the Debian live tools we're using for DoudouLinux. The only solution right now is then to unpack an ISO, change whatever needed, then repack a new ISO. We are indeed lucky enough to not have to unpack the whole CD filesystem because the CD localization parameters need to be accessed during the early boot process and then are contained in the CD boot parameters. Our relocalization process is then simply the following:

  1. Unpack the ISO image
  2. Change the boot configuration file
  3. Repack the ISO image

To achieve this, we will use rsync and genisoimage from the Debian packages of the same name. So first let's “loop” mount the ISO then copy its content into an empty directory:

$ sudo mount -o loop doudoulinux-2012-10-fr.iso /mnt/
$ mkdir isofs
$ rsync -at --del /mnt/ isofs/

File copying just takes few seconds. Now we can directly edit the boot configuration file:

$ sudo nano isofs/isolinux/live.cfg

You will find inside two boot lines of the following form (it's a very long line):

append initrd=/live/initrd.img boot=live config locales=fr_FR.UTF-8 keyboard-layouts=fr,us,de keyboard-variant=oss,, keyboard-options=grp:alt_shift_toggle,lv3:ralt_switch,compose:menu,terminate:ctrl_alt_bksp notimezone nox11autologin quiet splash nomodeset video=uvesafb:mode_option=640x480-16,mtrr=3,scroll=ywrap live-media=removable  persistent persistent-subtext=doudoulinux username=tux hostname=doudoulinux  quiet

The first line is the default boot entry, the second one allows to disable any live persistence that would have been set formerly. You can change or add the following parameters:

  • locales, this is the interface language, eg. fr_FR.UTF-8
  • keyboard-layouts, self-explanatory, it can be a single layout, eg. fr, or a series, eg. fr,us,de
  • keyboard-variant if you need to use a particular variant, eg. the French variant in Canada fr-legacy
  • keyboard-options if you don't need all the stuff we added to DoudouLinux like Left Shift+Alt
  • notimezone can be replaced with a particular timezone, eg. timezone=America/Montreal
  • utc=yes sets the hardware clock to UTC, utc=no sets it to the local time

Note that if your machine is unluckily running Windows :p, you have to set the hardware clock to local time. If it runs Linux, you probably have to set it to UTC. On the other hand, if the hardware clock is the local time, preserving the setting no timezone should automatically get the correct date and time. A list of timezones can be found on Wikipedia. Concerning keyboard layouts, the answer is at the bottom of one of our README files. Finally language codes and country codes can be found on Wikipedia too.

So, for a Canadian/Québec setting, we might use the following parameters:

locales=fr_CA.UTF-8
keyboard-layouts=ca
keyboard-variant=fr-legacy
keyboard-options=lv3:ralt_switch,compose:menu,terminate:ctrl_alt_bksp
utc=yes
timezone=America/Montreal

Now we have to recompute the MD5 checksum of the modified file since the ISO integrity can be checked using it:

$ MD5=$(md5sum isofs/isolinux/live.cfg | grep -o '^[^ ]*')
$ sudo sed -ri 's|^[^ ]+(\s+./isolinux/live.cfg)|'$MD5'\1|' isofs/md5sum.txt

And we now just have to repack the ISO:

$ TITLE=$(file doudoulinux-2012-10-fr.iso | grep -o "'[^']*'" | sed "s/'//g")
$ sudo genisoimage -o doudoulinux-2012-10-fr_CA.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "$TITLE" -cache-inodes -r -J -l isofs/

Of course, once the job is done, cleaning useless files is a good idea:

$ sudo rm -fr isofs/
$ sudo umount /mnt/

Here is a screenshot of the resulting environment that you can't currently get out of one of our CD's without modification:

DoudouLinux fr relocalized into fr_CA

That's it!

What we are now dreaming of is a simple set of web pages that would allow to queue such ISO customization online. Our web server would do the job of unpacking/setting/repacking using its own set of CD's and would then send an email to users for them to download the resulting ISO before it is removed to make room for other users :). Any volunteer?

PS: credits to the Linux Mint ISO relocalization tool for the source of the command lines.

Notes

[1] DoudouLinux CD's are often configured with Azerty, Qwerty and Qwertz keyboards

[2] Unfortunately our project management software is temporarily down…

Saturday 30 June 2012

Summertime and new builds

“Summertime, and the livin' is easy” (G. Gershwin), especially with DoudouLinux as you now know since this is our main goal ;). We've just uploaded several new dailybuilds to let you test our new features with your children during the long summer break. Here are some screenshots and screencasts:

New interface (2012-04)

MIDI piano keyboard + USB loudspeakers

Fichier vidéo intégré

(download in OGG format, 1.5MB)

You can download the dailybuilds from our Dailybuild download section. The file names follow the pattern doudoulinux-2012-06-*, LiveCD and LiveUSB images are available. We provide these builds in English, French, Italian, Russian and Spanish. An ARM™ version for Genesi Efika is available as well, in English and French only:

  • FR Image : Azerty (Belgian) and French language default configuration.
  • EN Image : Qwerty (US) and English language default configuration.

NB: root password is still efika in ARM™ builds ;-).

Our development version is still under intense work. The main new features are the following:

  • new application Piano Booster, to teach playing the piano
  • audio output selector can now identify HDMI audio outputs
  • automatically connects MIDI piano keyboards to Timidity at hotplug
  • automatically changes the audio output when an USB audio card is (un)plugged
  • automatically changes the monitor/screen when (un)plugged
  • automatically manages removable disks (the file manager is simply shown)
  • updated application icons translation
  • now sends DBus notifications when applications are started/quited

And the main bug fixes are the following:

  • fixed charge_full can be named energy_full on laptops
  • fixed screen brightness changed twice when keys are already mapped in hardware
  • fixed OSD not shown in GDM
  • fixed unable to quit session if the exit button is removed from launcher
  • fixed Timidity not restarted when audio output is changed
  • fixed GHelp issue (solves #462)

Although we still haven't brought all the feature we would like, we are getting closer to the final release that will replace our current stable release named Gondwana. The feature we are really lacking is a real and easy installer that doesn't require to be already installed on the LiveCD. You can help if you want to :). For this reason, the development version will not be turned into the next stable release before September, instead of June as planned initially.

Enjoy :]

Friday 25 November 2011

Automatic login now available

The default behavior of DoudouLinux is to show the menu of activities (see below) after the system has started and as soon as any activity is leaved. This is good for small children because the activities menu offers activities in the increasing order of difficulties, from top to bottom. However, for older children, the first activities are or will quickly become of poor interest. This is why the list of activities shown – but not their order – can be changed with the activities menu editor .

Activities menu (small)

However the oldest children may still have no interest at all in seeing a menu of activities, since they will surely login into “Whole DoudouLinux”. The new version of the activities menu editor can now do this. The trick is quite simple: if only one activity is selected in the menu, DoudouLinux will not show the activities menu but instead will enter this activity directly. Activities menu settings are recorded in the directory /home/etc/, which means that any data persistence (user data or user+system) is sufficient to make settings survive a reboot or a shutdown.

This new version of the activities menu editor will be available with next releases: the coming development release numbered 2011-11 and the planned official release update Gondwana 1.2, due to mid January.

Saturday 9 April 2011

Clean install of DoudouLinux on hard disk

Currently the DoudouLinux installer just copies onto disk the Live media as is. While this is very practical for us and brings interesting features to users (rock-solid read-only system), this also has drawbacks:

  • the system is still compressed and slows down startup on old computers
  • you can not remove software
  • upgrading software creates a duplicate version of each software
  • many boot parameters cannot be changed (they're not persistent)

One of our most active contributors, Richard, suggested to use Remastersys. This is a tool whose goal is to perform full system backup onto a Live CD for Debian-based distributions. One of its features is to let users re-install a clean system onto hard disk from the Live CD: just what we need!

Thanks to it, on a laptop from 2003-2004, DoudouLinux is now booting in 40s instead of 120s from CD. I installed the system in 3 separate partitions: root, home and swap. The root system needs 1.9 GB so you have to setup at least a 2.5 GB root partition. Of course if you want to add software or don't want a separated home partition (bad idea), make it larger! Now let's look at the recipe :).

Remastersys is offered as a Debian package. The package provides a shell script to install the running Live system on disk: “remastersys-installer”. Reading the script showed that it is doing what we need. We have then successfully performed a clean install of DoudouLinux with the following operations:

  1. add Remastersys repository to a running DoudouLinux
  2. install Remastersys
  3. run the Remastersys script called “remastersys-installer”
  4. reboot!

Note that there are some issues to be corrected after the first boot (see after the source code below). We also have to customize the Remastersys script for use in an official future DoudouLinux release. In the meanwhile, if you want to test it by yourself, you need to type several code lines as root then as the main user to be able to use the graphical Gtk interface:

# log as root
su -

# define parameters
SOURCESLIST=/etc/apt/sources.list
DANSREGEXPEXCEPT=/etc/dansguardian/lists/exceptionregexpurllist
DANSSERVICE=/etc/init.d/dansguardian

# register remastersys repository
echo 'deb http://www.geekconnection.org/remastersys/repository debian/' >> $SOURCESLIST

# fix bug DansGuardian blocking some deb's files
# see: https://gna.org/bugs/index.php?18003
echo '\\.deb$' >> $DANSREGEXPEXCEPT
$DANSSERVICE restart

# install remastersys
apt-get update
apt-get install --assume-yes --force-yes remastersys

# call installer as normal user
exit
sudo remastersys-installer gui

Once completed, if you see messages complaining about the impossibility to unmount /TARGET and /TARGET/home, just unmount them manually in the console:

sudo umount /TARGET/home/
sudo umount /TARGET/

Finally please note that there are few details to be corrected:

  • at boot GRUB is complaining about a missing splash image
  • network may not work because the file /etc/network/interfaces is appended with another network configuration at each boot (which causes inconsistencies)
  • boot is hanging tens of seconds when network is not plugged because it is waiting for a DHCP lease

The first point can be solved by editing /boot/grub/menu.lst and adding “boot” between the double slash (//) in the line speaking of splash. Note that the Remastersys splash image is not childish at all. Prefer installing the package grub-splashimages-doudoulinux instead! (and replace the file /boot/grub/splash.xpm.gz)

The second one can be solved by removing the for loop of the 3rd block of code in /etc/rc.local.

The last one cannot be simply solved. We have to achieve additional experiments to find a solution. They'll be reported in the ticket related to this topic: Provide a way to do a real DDL installation.

Have nice DoudouLinux installs! ;)

Saturday 9 October 2010

Daily builds available!

We have created a new download section named “Daily build”. There is a section for LiveCD images and section for USB key images. Please note that these files cannot be downloaded from the standard download web page because these files are uploaded onto the server for testing purposes only. As usual, this does not mean that they do not work correctly at all!

Unlike what its name suggests, we do not intend to build a DoudouLinux version every night in this directory for obvious upload bandwidth reasons. Instead you may find sometimes versions that are being developed and made available during several days (say at least 7 days). The page Release notes provide information about what has been changed from the latest official build (currently the 2010-08).

Thursday 2 September 2010

Upload en cours…

Allez patience, encore quelques heures et la nouvelle mouture sera disponible au téléchargement. Rendez-vous normalement dans 24h, en attendant lisez les notes de mise à jour

Sunday 28 February 2010

La construction de CD multi-lingue est opérationnelle !

Ça y'est ! Les modifications nécessaires ont été apportées au code source afin de pouvoir générer des LiveCD dans d'autres langues que le français. Il reste encore à organiser un peu mieux les répertoires et, notamment, ne plus faire de l'anglais la base du LiveCD mais une langue comme une autre ;-). Néanmoins n'importe quelle autre langue peut être créée dans la mesure où elle est gérée par Debian. Il suffit de lancer la commande suivante dans le répertoire doudoulinux/live/trunk :

$ ./init-lang.sh xx

xx est le code de la langue sur deux lettres. On trouve ces codes par exemple dans la page List of ISO 639-1 codes. Ensuite il faut modifier les fichiers placés dans le répertoire de la langue qui vient d'être créé. La liste est la suivante (fichiers en italiques) :

$ tree es/
es/
|-- binary
|-- binary_local-hooks
|   `-- 10-set-grub.sh
|-- bootstrap
|-- chroot
|-- chroot_local-hooks
|   `-- 30-translate-shutdown.sh
`-- chroot_local-includes
   |-- etc
   |   `-- skel
   |       |-- .profile
   |       `-- .vkeybdmap
   `-- usr
       `-- share
           `-- lxlauncher
               `-- default
                   `-- lxpanel
                       `-- panels
                           `-- panel

Toutes les explications se trouvent dans le fichier HOWTO, du moins en théorie ;-). Du coup j'ai envoyé sur le serveur deux nouvelles langues du CD :

NB: si les liens sont morts, il faut aller directement dans http://download.doudoulinux.org/livecd/trunk/ !

Wednesday 3 February 2010

Un premier CD est disponible !

J'ai uploadé, pardon, envoyé une image ISO de CD il y a quelques jours. C'est la dernière version de DoudouLinux que j'ai compilée, avec notamment la persistence des données activée. Ça veut dire que, une fois qu'on a sélectionné le périphérique sur lequel enregistrer les données (clef USB, disque dur interne, etc.), au démarrage suivant les travaux des utilisateurs pourront être enregistrées automatiquement puis restaurées à chaque démarrage suivant.

Il ne reste plus qu'à indiquer l'emplacement de ce CD :

http://download.doudoulinux.org/liv...

Chez moi j'obtiens un débit plus qu'honorable d'environ 800 ko/s soit 12 min. de téléchargement. On dirait pour le moment que je ne me suis pas fait roulé en prenant cet hébergeur ;-) !

NB: vous pouvez vérifier l'intégrité du CD téléchargé en vérifiant sa somme de contrôle MD5. Sous Linux c'est très simple :

$ md5sum --check doudoulinux-20100115.iso.md5 
doudoulinux-20100115.iso: OK

Sous Mac OS, ça doit marcher pareil, par contre sous Windows… il faut certainement commencer par télécharger l'outil qui va bien et qui ne fait évidemment pas partie du système par défaut parce que sinon ça aurait coûté 2j d'ingénieur en plus à la pauvre société milliardaire qui l'édite ;-) ! Cela dit tout logiciel de gravure de CD qui se respecte vérifie la somme de contrôle intégrée au CD avant de graver…