Customizing NAND images: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (section level cosmetics)
m (cosmetics)
Line 9: Line 9:
* Make the modifications on the host laptop that you want to be present in the generated image. If you've logged into Sugar and want the user to see the welcome/login prompt again, see the Section [[#Forcing Sugar to reprompt for name and colors]]. If you plan to use the image in laptops with different languages and keyboard layouts, you should delete also the file <tt>/.olpc-configured</tt>. This will force the system to run the olpc-configure script in the next boot.
* Make the modifications on the host laptop that you want to be present in the generated image. If you've logged into Sugar and want the user to see the welcome/login prompt again, see the Section [[#Forcing Sugar to reprompt for name and colors]]. If you plan to use the image in laptops with different languages and keyboard layouts, you should delete also the file <tt>/.olpc-configured</tt>. This will force the system to run the olpc-configure script in the next boot.


* IMPORTANT: Make sure you delete these files in /etc/ssh:
* IMPORTANT: Make sure you delete these files in <tt>/etc/ssh</tt>:
ssh_host_dsa_key
ssh_host_dsa_key
ssh_host_dsa_key.pub
ssh_host_dsa_key.pub
Line 19: Line 19:
* Insert a Windows-formatted (VFAT) USB disk into the host laptop, and reboot.
* Insert a Windows-formatted (VFAT) USB disk into the host laptop, and reboot.


* At the "Type any key to interrupt automatic startup" key, press a key. At the "ok" prompt, type "save-nand disk:\nand.img" and press return. The contents of the NAND will be backed up to the nand.img file on the USB disk. The "ok" prompt will return when the copy has finished, and you can then power the laptop off with the power button.
* At the "Type any key to interrupt automatic startup" key, press a key. At the "ok" prompt, type "<tt>save-nand disk:\nand.img</tt>" and press return. The contents of the NAND will be backed up to the <tt>nand.img</tt> file on the USB disk. The "ok" prompt will return when the copy has finished, and you can then power the laptop off with the power button.


* Since build 406, you need a checksum file to successfully upgrade the system. To create the CRC file see the Section [[#Creating CRC file]].
* Since build 406, you need a checksum file to successfully upgrade the system. To create the CRC file see the Section [[#Creating CRC file]].


* Move to the "target" laptop, and insert the USB disk. Again, interrupt at the prompt, and at the ok prompt type "copy-nand disk:\nand.img". This will copy from nand.img to the internal NAND. When back at the ok prompt, power off, remove the USB disk, and power on again to load from the new NAND image.
* Move to the "target" laptop, and insert the USB disk. Again, interrupt at the prompt, and at the ok prompt type "<tt>copy-nand disk:\nand.img</tt>". This will copy from <tt>nand.img</tt> to the internal NAND. When back at the ok prompt, power off, remove the USB disk, and power on again to load from the new NAND image.


== Example Customizations ==
== Example Customizations ==
Line 31: Line 31:
Sometimes you may want to define the default language for the system, either for use or while localizing.
Sometimes you may want to define the default language for the system, either for use or while localizing.


The ''/etc/sysconfig/i18n'' file defines the '''LANG''' variable that Sugar will use.
The ''<tt>/etc/sysconfig/i18n</tt>'' file defines the '''<tt>LANG</tt>''' variable that Sugar will use.


=== Timezone ===
=== Timezone ===


Timezone information is stored in the file ''/etc/timezone''. For example, the east coast of the US is "America/New_York". This name references files found in ''/usr/share/zoneinfo'', that control the system's timezone and daylight savings time behavior.
Timezone information is stored in the file ''<tt>/etc/timezone</tt>''. For example, the east coast of the US is "<tt>America/New_York</tt>". This name references files found in ''<tt>/usr/share/zoneinfo</tt>'', that control the system's timezone and daylight savings time behavior.


=== Installing TrueType or OpenType Fonts ===
=== Installing TrueType or OpenType Fonts ===


Either install as root prepackaged font package(s) from the Fedora repository as outlined below, or install the fonts in a subdirectory of ''/usr/share/fonts/ttf'' and run the ''fc-cache -f'' command afterwards.
Either install as root prepackaged font package(s) from the Fedora repository as outlined below, or install the fonts in a subdirectory of ''<tt>/usr/share/fonts/ttf</tt>'' and run the ''<tt>fc-cache -f</tt>'' command afterwards.


=== Activities ===
=== Activities ===


To remove an activity from the build, delete the desired directory from: ''/usr/share/activities'':<br>
To remove an activity from the build, delete the desired directory from: ''<tt>/usr/share/activities</tt>'':<br>
''rm -r TamTam.activity'' (for example)
''<tt>rm -r TamTam.activity</tt>'' (for example)


To add an activity, install it in this same directory.
To add an activity, install it in this same directory.
Line 55: Line 55:
# After the system has booted, press <tt>ctrl+alt+f1</tt> (f1 is the same as the "mesh-view" key);
# After the system has booted, press <tt>ctrl+alt+f1</tt> (f1 is the same as the "mesh-view" key);
# Login in as root (no password required);
# Login in as root (no password required);
# Open the file /etc/X11/xorg.conf for editing (use vi or any editor you are comfortable with);
# Open the file <tt>/etc/X11/xorg.conf</tt> for editing (use vi or any editor you are comfortable with);
# In the first InputDevice Section do the following modifications:
# In the first <tt>InputDevice Section</tt> do the following modifications:
#* To change the default language, e.g., from English to Spanish:
#* To change the default language, e.g., from English to Spanish:
#** Modify XkbLayout Setting from "us" to "es" (use "pt" for Portuguese, "ng" for Nigerian language support, etc.);
#** Modify <tt>XkbLayout Setting</tt> from "us" to "es" (use "pt" for Portuguese, "ng" for Nigerian language support, etc.);
#** Add an XkbOptions Option with the value "olpc";
#** Add an <tt>XkbOptions Option</tt> with the value "olpc";
#* To add a second language, e.g., English and Arabic:
#* To add a second language, e.g., English and Arabic:
#** Modify XkbLayout Setting from "us" to "us,ara" (use "ru" for Cyrillic, "ur" for Urdu, "th" for Thai, etc.);
#** Modify <tt>XkbLayout Setting</tt> from "<tt>us</tt>" to "<tt>us,ara</tt>" (use "<tt>ru</tt>" for Cyrillic, "<tt>ur</tt>" for Urdu, "<tt>th</tt>" for Thai, etc.);
#** Add an XkbOptions Option with the value "olpc2,olpc";
#** Add an <tt>XkbOptions Option</tt> with the value "<tt>olpc2,olpc</tt>";
# Save and close the file;
# Save and close the file;
# Either reboot the machine or restart X by issuing a "/sbin/telinit 3" command, followed by the "/sbin/telinit 5" command.
# Either reboot the machine or restart X by issuing a "<tt>/sbin/telinit 3</tt>" command, followed by the "<tt>/sbin/telinit 5</tt>" command.


After you make the modifications, the two lines in xorg.conf should be similar to one of the following:
After you make the modifications, the two lines in <tt>xorg.conf</tt> should be similar to one of the following:
Option "XkbLayout" "es"
Option "XkbOptions" "olpc"


{|
After X is restarted, the default language will be Spanish.
! width=50% | l10n for [[spanish]] !! l10n for [[english]] / [[arabic]]
|-
|
Section "InputDevice"
Option "XkbLayout" "es"
Option "XkbOptions" "olpc"
|
Section "InputDevice"
Option "XkbLayout" "us,ara"
Option "XkbOptions" "olpc2,olpc"
|- valign=top
| After X is restarted, the default language will be [[Spanish]] (es). || After X is restarted, the default language will be [[English]] (us); you will be able to switch to [[Arabic]] (ara) using the [[Image:Key arabic.jpg|30px]] key.


|}
Option "XkbLayout" "us,ara"
Option "XkbOptions" "olpc2,olpc"

After X is restarted, the default language will be English; you will be able to switch to Arabic using the <i>AB/اب</i> key.


=== Installing packages from the Fedora repositories using yum ===
=== Installing packages from the Fedora repositories using yum ===
Line 81: Line 88:
Sugar is based off of Fedora and as such has a large amount of packages available to add to the base system. The tool used to do this is called yum. Because of memory constraints it is best to drop into run mode 3 which stops X. To do this log in as root either in the developer console or one of the virtual terminals and type this command:
Sugar is based off of Fedora and as such has a large amount of packages available to add to the base system. The tool used to do this is called yum. Because of memory constraints it is best to drop into run mode 3 which stops X. To do this log in as root either in the developer console or one of the virtual terminals and type this command:


'''init 3'''
'''<tt>init 3</tt>'''


X should exit and you should find yourself either at a login prompt or in the same virtual terminal. Log in as root if you are not already. To install or upgrade a package you simply use this command:
X should exit and you should find yourself either at a login prompt or in the same virtual terminal. Log in as root if you are not already. To install or upgrade a package you simply use this command:


'''yum upgrade <package name>'''
'''<tt>yum upgrade <package name></tt>'''


To search for available packages you can use this command:
To search for available packages you can use this command:


'''yum search <keyword>'''
'''<tt>yum search <keyword></tt>'''


More information about using yum with fedora [http://docs.fedoraproject.org/yum/ can be found here].
More information about using yum with fedora [http://docs.fedoraproject.org/yum/ can be found here].
Line 107: Line 114:
You can always edit:
You can always edit:
/home/olpc/.sugar/default/config
/home/olpc/.sugar/default/config
However, there may be times when you may want to force Sugar to prompt for a new name and colors as if with a new machine. You can do this by deleteing the configuration file and the SHH keys in the ./sugar/default directory.
However, there may be times when you may want to force Sugar to prompt for a new name and colors as if with a new machine. You can do this by deleteing the configuration file and the SHH keys in the <tt>./sugar/default</tt> directory.
rm /home/olpc/.sugar/default/config
rm /home/olpc/.sugar/default/config
rm /home/olpc/.sugar/default/owner.key
rm /home/olpc/.sugar/default/owner.key
Line 127: Line 134:
After, you can from the command prompt create the crc from your custumized image
After, you can from the command prompt create the crc from your custumized image
./crcimg myfile.img
./crcimg myfile.img
Output is in myfile.crc
Output is in <tt>myfile.crc</tt>





Revision as of 19:20, 7 September 2007

  This page is monitored by the OLPC team.
  english | español HowTo [ID# 63821]  +/-  

This document describes how to create a jffs2 image from a laptop's internal NAND, producing an image that can be flashed onto a different XO. The laptop that is being backed up is the "host" laptop, and the laptop receiving the contents of the host laptop is the "target" laptop.

Basic Procedure

Steps:

  • Make the modifications on the host laptop that you want to be present in the generated image. If you've logged into Sugar and want the user to see the welcome/login prompt again, see the Section #Forcing Sugar to reprompt for name and colors. If you plan to use the image in laptops with different languages and keyboard layouts, you should delete also the file /.olpc-configured. This will force the system to run the olpc-configure script in the next boot.
  • IMPORTANT: Make sure you delete these files in /etc/ssh:
ssh_host_dsa_key
ssh_host_dsa_key.pub
ssh_host_key
ssh_host_key.pub
ssh_host_rsa_key
ssh_host_rsa_key.pub
  • Insert a Windows-formatted (VFAT) USB disk into the host laptop, and reboot.
  • At the "Type any key to interrupt automatic startup" key, press a key. At the "ok" prompt, type "save-nand disk:\nand.img" and press return. The contents of the NAND will be backed up to the nand.img file on the USB disk. The "ok" prompt will return when the copy has finished, and you can then power the laptop off with the power button.
  • Since build 406, you need a checksum file to successfully upgrade the system. To create the CRC file see the Section #Creating CRC file.
  • Move to the "target" laptop, and insert the USB disk. Again, interrupt at the prompt, and at the ok prompt type "copy-nand disk:\nand.img". This will copy from nand.img to the internal NAND. When back at the ok prompt, power off, remove the USB disk, and power on again to load from the new NAND image.

Example Customizations

Language

Sometimes you may want to define the default language for the system, either for use or while localizing.

The /etc/sysconfig/i18n file defines the LANG variable that Sugar will use.

Timezone

Timezone information is stored in the file /etc/timezone. For example, the east coast of the US is "America/New_York". This name references files found in /usr/share/zoneinfo, that control the system's timezone and daylight savings time behavior.

Installing TrueType or OpenType Fonts

Either install as root prepackaged font package(s) from the Fedora repository as outlined below, or install the fonts in a subdirectory of /usr/share/fonts/ttf and run the fc-cache -f command afterwards.

Activities

To remove an activity from the build, delete the desired directory from: /usr/share/activities:
rm -r TamTam.activity (for example)

To add an activity, install it in this same directory.

Keyboard

If the manufacturing data does not match the keyboard you need, you can set the keyboard type.

To change the symbol mapping of the keyboard, follow the following steps:

  1. After the system has booted, press ctrl+alt+f1 (f1 is the same as the "mesh-view" key);
  2. Login in as root (no password required);
  3. Open the file /etc/X11/xorg.conf for editing (use vi or any editor you are comfortable with);
  4. In the first InputDevice Section do the following modifications:
    • To change the default language, e.g., from English to Spanish:
      • Modify XkbLayout Setting from "us" to "es" (use "pt" for Portuguese, "ng" for Nigerian language support, etc.);
      • Add an XkbOptions Option with the value "olpc";
    • To add a second language, e.g., English and Arabic:
      • Modify XkbLayout Setting from "us" to "us,ara" (use "ru" for Cyrillic, "ur" for Urdu, "th" for Thai, etc.);
      • Add an XkbOptions Option with the value "olpc2,olpc";
  5. Save and close the file;
  6. Either reboot the machine or restart X by issuing a "/sbin/telinit 3" command, followed by the "/sbin/telinit 5" command.

After you make the modifications, the two lines in xorg.conf should be similar to one of the following:

l10n for spanish l10n for english / arabic
Section "InputDevice"
 Option    "XkbLayout"   "es"
 Option    "XkbOptions"  "olpc"
Section "InputDevice"
 Option    "XkbLayout"   "us,ara"
 Option    "XkbOptions"  "olpc2,olpc"
After X is restarted, the default language will be Spanish (es). After X is restarted, the default language will be English (us); you will be able to switch to Arabic (ara) using the Key arabic.jpg key.

Installing packages from the Fedora repositories using yum

Sugar is based off of Fedora and as such has a large amount of packages available to add to the base system. The tool used to do this is called yum. Because of memory constraints it is best to drop into run mode 3 which stops X. To do this log in as root either in the developer console or one of the virtual terminals and type this command:

init 3

X should exit and you should find yourself either at a login prompt or in the same virtual terminal. Log in as root if you are not already. To install or upgrade a package you simply use this command:

yum upgrade <package name>

To search for available packages you can use this command:

yum search <keyword>

More information about using yum with fedora can be found here.

Installing Flash, Java, MP3 codecs, MPEG4, patented codecs

These Restricted Formats have problems that makes it difficult or impossible for OLPC to preinstall, but you may be able and interested in deploying systems with these preinstalled.

(Note that the Adobe Flash plugin 9.0.31.0 is known to work and 9.0.60.120 is known not to work.)

Helix (Real) Media Player

The Helix media activity page covers installation of this activity and its associated codecs.

Forcing Sugar to reprompt for name and colors

You can always edit:

/home/olpc/.sugar/default/config

However, there may be times when you may want to force Sugar to prompt for a new name and colors as if with a new machine. You can do this by deleteing the configuration file and the SHH keys in the ./sugar/default directory.

rm /home/olpc/.sugar/default/config
rm /home/olpc/.sugar/default/owner.key
rm /home/olpc/.sugar/default/owner.key.pub

Note that:

  • The above process does not clean out the Journal data repository—the additional step of deleteing the directory /home/olpc/.sugar/default/datastore will empty the Journal;
rm -r /home/olpc/.sugar/default/datastore
  • This process does force the generation of new keys, which will potentially have (an adverse) impact on access to backup files on the school server.

Creating CRC file

First, you need to download and compile pilgrim

git clone git://git.fedoraproject.org/git/pilgrim
cd pilgrim/crcimg
make

File:Crcimg.sh - Linux crcimg executable

After, you can from the command prompt create the crc from your custumized image

./crcimg myfile.img

Output is in myfile.crc