User:Kevgor/Reflash to Custom Install Image using Ntugigroup USB stick: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Created page with 'These instructions are used to re-flash an Ntugi group XO to signed 11.3.0 deployment defaults, using an Ntugi group provided signed build with custom software from a USB thumb d…')
 
No edit summary
Line 1: Line 1:
These instructions are used to re-flash an Ntugi group XO to signed 11.3.0 deployment defaults, using an Ntugi group provided signed build with custom software from a USB thumb drive:
These instructions are used to re-flash an Ntugigroup XO to signed 11.3.1 deployment defaults, using an Ntugi group provided un-signed OOB 4.1 customised build from the appropriately pre-supplied USB thumb drive:


This is a two-step refresh and install process takes around 30 minutes from start to finish on an XO 1.0; and about an 40 minutes on an XO 1.5 due to more custom software being installed onto the XO 1.5.
This is a one-step refresh and install process takes around 20 minutes from start to finish on an XO 1.0; and about 25 minutes on an XO 1.5 due to more software being installed onto the XO 1.5.


The XO 1.0, XO 1.5 and XO 1.75 machines, although similar in look and feel, are of very different architectures with very different capabilities. The Ntugi build sticks are made unique for each model of machine. Besides certain software being incompatible, the supplemental script is also optimizing the machines for its specifics. '''In other words, you must use an XO 1.0 build stick on an XO 1.0, an XO 1.5 stick on a 1.5, and an XO 1.75 stick on a 1.75.''' They should not be interchanged.
The XO 1.0 and XO 1.5 machines, although similar in look and feel, are of very different architectures with very different capabilities. The Ntugi custom-build sticks and this procedure are shared for both models of the machine.


The first step involves replacing the entire operating system, and the default Sugar Activities, with the master copy, which has been saved onto the labelled USB Refresh stick. Any work previously saved on the XO internal storage since delivery, or any new programs or activities installed on internal storage since delivery, will be erased. All Sugar journal entries from the main storage will also be erased. At the end of this install, the machine internal memory will be exactly as the original image on the USB drive. If this is the same USB drive that was used for the initial deployment, this could alternately be termed: Return to Defaults. Be advised that during in this first step of the process, no changes are made to any external SD cards or other USB flash drives. So, if there is any content you wish to save before the reflash, please ensure it exists either on the SD card, or on a user's USB thumb drive before proceeding. If in doubt, contact the appropriate technical resource to ensure that no valuable information will be lost.
The procedure involves replacing the entire operating system, and the default Sugar Activities, with the master copy, which has been saved onto the labelled USB Refresh stick. Any work previously saved on the XO internal storage since delivery, or any new programs or activities installed on internal storage since delivery, will be erased. All Sugar journal entries from the main storage will also be erased. At the end of this install, the machine internal memory will be exactly as the originally deployed image on the USB drive. If this is the same USB drive that was used for the initial deployment, then this could alternately be termed: Return to Defaults. Be advised that during this process, no changes are made to any external SD cards or other USB flash drives. So, if there is any content you wish to save before the reflash, please ensure it exists either on the SD card, or on a user's USB thumb drive before proceeding. If in doubt, contact the appropriate technical resource to ensure that no valuable information will be lost.


To begin, ensure the XO is turned off. Plug the charger into the wall, and the other end into the XO. Ensure that XO is fully charged by observing that the green battery light is on. If an XO is completely discharged, it can take a few hours for the yellow light to turn green. Being fully charged and having line power may not be mandatory in all re-flash circumstances, it is the best practice.
To begin, ensure the XO is turned off. Plug the charger into the wall, and the other end into the XO. Ensure that XO is fully charged by observing that the green battery light is on. If an XO is completely discharged, it can take a few hours for the yellow light to turn green. Being fully charged and having line power may not be mandatory in all re-flash circumstances, but it is the best practice.


Put the Refresh USB stick in the right hand vertical XO USB port.
Put the Refresh USB stick in the right hand vertical XO USB port.


Press the power button, then quickly hold down all 4 game keys on the front right side beside the display - the ones right above the power button.
Press the power button, then quickly hold down all top game key - the circle key - on the front right side beside the display - the ones right above the power button.


Release the game keys when prompted on the screen. If this prompt does not appear, and the machine just continues to boot, then after the system comes up and is running, then power it off elegantly (using the shutdown command. Start again: perhaps being faster on hitting, or more accurate at simultaneously holding down, all 4 game keys.
Release the game key when prompted on the screen. If this prompt does not appear, and the machine just continues to boot, then after the system comes up and is running, power it off elegantly (using a shutdown command). Start again: perhaps being faster on hitting, or more accurate at holding down, that one game key.


The screen will now show a grid of black rectangles, followed by a partial grid of yellow rectangles, signifying memory erasure. On an XO 1, It will then slowly fill the yellow rectangles with green and blue rectangles as the operating system is loaded from the USB stick into memory. You will also see the red light from the USB stick flashing during this process, indicating activity. On an XO 1.5, there will be alternating green and white fill rectangles.
On an XO-1, the screen will now show a grid of black rectangles, followed by a partial grid of yellow rectangles, signifying memory erasure. It will then slowly fill the yellow rectangles with green and blue rectangles as the operating system is loaded from the USB stick into memory. Y

On an XO 1.5, there will be alternating green and white fill rectangles as the process continues.


When it has finished installing the base image, the Linux Operating system and the two operating desktop environments, Sugar and Gnome are both available on the machine. On first boot, the XO will begin to start the Sugar environment. You will be asked to Name the machine. Please use a unique name.
When it has finished installing the base image, the Linux Operating system and the two operating desktop environments, Sugar and Gnome are both available on the machine. On first boot, the XO will begin to start the Sugar environment. You will be asked to Name the machine. Please use a unique name.
Line 21: Line 23:
After naming the machine, you will be prompted to change the colour of the machine icon. You may elect to just hit return here, if having accurately matched coloured icons is not required in your deployment.
After naming the machine, you will be prompted to change the colour of the machine icon. You may elect to just hit return here, if having accurately matched coloured icons is not required in your deployment.


At the top right of the screen there are two small icons. The square with 4 lines across it on the right corresponds to the ‘List View’ of Sugar Activities. Beside that is the circle which corresponds to selecting the 'Favourites' wheel view of the activity icons. Place the pointer on the square, and hit the left-click button. You will now have changed from the Favourite Home View to the List View of activities. You will most likely wish to look at the ‘List View’ of the activities again, and click the star beside any which you would also like to see on the favourites wheel view, that have not appeared. removed by this refresh.
Once this phase is complete, you will be at the Sugar Activity Home View screen. After the Linux Operating System and base activities have been loaded, there are still some customized programs and activities to be loaded. This is done by running a script in the Terminal activity. To prepare, right click on the central XO icon, click on My Settings, click on "Power", and un-check any Power-saving options. Click the right check mark to exit Power settings panel, and click the right-top check mark again to exit "My Settings"


You will then also need to re-attach to your network, since your previous network settings will have been Please be reminded that the Network Neighbourhood View key is the 3rd key from the left on the top row of the keyboard, looking like a circle with eight dots in it. To return to the home activity view, one can then use the Home key, which is also on the top row of the keyboard. It is a circle with a single dot in it.
At the top right of the screen there are two small icons. The square with 4 lines across it on the right corresponds to the ‘List View’ of Sugar Activities. Beside that is the circle which corresponds to selecting the 'Favourites' wheel view of teh activity icons. Place the pointer on the square, and hit the left-click button. You will now have changed from the Favourite Home View to the List View of activities. You need to slide down the list using the bar on the right until you see the Terminal activity. Click the ‘star’ icon beside the Terminal activity. Return to the 'Favourite' wheel view, bu hitting the appropriate icon in the top right. Select the Terminal activity icon from the Wheel, the icon resembles a Square with a ">" in the top left corner. This will now start the Terminal activity.


If you are connected to a network, perhaps check the browse activity at this time to ensure you have internet connectivity. At this point, you can then switch to the Gnome desktop, through the My Settings panel in Sugar, attach to the desired Network in Gnome, then return to Sugar. This procedure ensures that future boots will automatically attach to the last connected network.
Besides the regular activity menus and status bars at the top of the screen, you should now see a series of various languages saying “Hello”, and then a command prompt beginning with “[olpc” The cursor is a black rectangle beside the prompt. It is very important to type the following at the prompts *exactly* as they appear below. Failure to do so will cause the machine refresh to be incomplete. In the worst case, you may have to return to the beginning of this document and begin the entire process anew. Enter:


This completes the full refresh of the XO.
su -


Following is the content of the olpc.fth script stored in the /boot/ directory of the USB key:
(There is a space between the “su” and the “-“)
\ OLPC boot script


\ visible
You should see pretty much the same prompt, except it will now start with “[bash” and end with “#”


\ Returns a number identifying the XO version - 2 for XO-1, 3 for XO-1.5
Enter:
: xo-version ( -- n ) fw-version$ drop 1+ c@ [char] 0 - ;


\ To pass hardware specific arguments we define the xo-1? and xo-1.5? flags
bash /media/PATRIOT/installrpms.sh
\ Returns true if the machine is XO-1
: xo-1? ( -- flag ) xo-version 2 = ;


\ Returns true if the machine is XO-1.5
Hit return, and again, the USB stick will flash, signifying activity. For those of you familiar with tab-complete method of command entry, that works here too. You will see various status messages appear; for example:
: xo-1.5? ( -- flag ) xo-version 3 = ;


\ Sets the DN macro to expand to the device name from which this script
“New Activities”
\ was booted. That's useful for subsequently booting the kernel from
\ the same device.
\ Also sets the PN macro depending on the XO version
: set-path-macros ( -- )
\ "O" game button forces boot from internal FLASH
button-o game-key? INVERT if
" \boot" pn-buf place
" int:" dn-buf place
exit
then
\ Set DN to the device that was used to boot this script
" /chosen" find-package if ( phandle )
" bootpath" rot get-package-property 0= if ( propval$ )
get-encoded-string ( bootpath$ )
[char] \ left-parse-string 2nip ( dn$ )
dn-buf place ( )
then
then


\ Set PN according to the XO version
followed by many rolling lines of text, and then ending with
xo-version case
2 of " \boot10" endof
3 of " \boot15" endof
( default ) " \" rot
endcase ( adr len )
pn-buf place
;


\ We check if we are booting from USB or SDcard to specify device-specific parameters
“Please reboot”


: dn-contains? ( $ -- flag ) " ${DN}" expand$ sindex 0>= ;
At this prompt, enter:
: usb? ( -- flag ) " /usb" dn-contains? ;
: sd? ( -- flag ) " /sd" dn-contains? ;
: slot1? ( -- flag ) " /disk@1" dn-contains? ;


: olpc-fth-boot-me ( -- )
reboot
set-path-macros


\ We can pass boot-device-specific kernel arguments here with the PD macro
The system will restart and take you back to the Favorites view of Sugar. You will most likely wish to look at the ‘List View’ of the activities again, and click the star beside any which you would also like to see on the favourites wheel view, that have not aappeared. You will then also need to re-attach to your network, since your previous network settings will have been removed by this refresh.
\ PDEV1 tells Puppy Linux's init script where to find Puppy-specific files.
\ If PDEV1 is omitted, Puppy searches for the files. If a USB FLASH drive
\ takes a long time to wake up after a USB reset, Puppy sometimes misses it,
\ so it's better to avoid the search by telling Puppy where to find the files.
usb? if
" PDEV1=sda1"
else
sd? if
slot1? if
" PDEV1=mmcblk0p1" \ External SD card
else
" PDEV1=mmcblk1p1" \ Internal SD card
then
else
" " \ Internal raw NAND
then
then
" PD" $set-macro


Please be reminded that the Network Neighbourhood View key is the 3rd key from the left on the top row of the keyboard, looking like a circle with eight dots in it. To return to the home activity view, one can then use the Home key, which is also on the top row of the keyboard. It is a circle with a single dot in it.


" console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22 ${PD}" expand$ to boot-file
If you are connected to a network, perhaps check the browse activity at this time to ensure you have internet connectivity. At this point, you can then switch to the Gnome desktop, through the My Settings panel in Sugar, attach to the desired Network in Gnome, then return to Sugar. This procedure ensures that future boots will automatically attach to the last connected network.


\ Uncomment the next 2 lines to see the command line
This completes a full refresh of the XO.
\ ." cmdline is " boot-file type cr
\ d# 4000 ms
button-o game-key? INVERT if
" ${DN}${PN}\vmlinuz" expand$ to boot-device
" ${DN}${PN}\initrd.img" expand$ to ramdisk
boot
then
;
olpc-fth-boot-me
button-o game-key? if
visible
xo-1? if
" copy-nand u:\os.img" eval
else
xo-1.5? if
" fs-update u:\fs.zd" eval
then
then
CR ." Rebooting in ten secons. "
1000 ms
bye
then

Revision as of 19:41, 17 June 2012

These instructions are used to re-flash an Ntugigroup XO to signed 11.3.1 deployment defaults, using an Ntugi group provided un-signed OOB 4.1 customised build from the appropriately pre-supplied USB thumb drive:

This is a one-step refresh and install process takes around 20 minutes from start to finish on an XO 1.0; and about 25 minutes on an XO 1.5 due to more software being installed onto the XO 1.5.

The XO 1.0 and XO 1.5 machines, although similar in look and feel, are of very different architectures with very different capabilities. The Ntugi custom-build sticks and this procedure are shared for both models of the machine.

The procedure involves replacing the entire operating system, and the default Sugar Activities, with the master copy, which has been saved onto the labelled USB Refresh stick. Any work previously saved on the XO internal storage since delivery, or any new programs or activities installed on internal storage since delivery, will be erased. All Sugar journal entries from the main storage will also be erased. At the end of this install, the machine internal memory will be exactly as the originally deployed image on the USB drive. If this is the same USB drive that was used for the initial deployment, then this could alternately be termed: Return to Defaults. Be advised that during this process, no changes are made to any external SD cards or other USB flash drives. So, if there is any content you wish to save before the reflash, please ensure it exists either on the SD card, or on a user's USB thumb drive before proceeding. If in doubt, contact the appropriate technical resource to ensure that no valuable information will be lost.

To begin, ensure the XO is turned off. Plug the charger into the wall, and the other end into the XO. Ensure that XO is fully charged by observing that the green battery light is on. If an XO is completely discharged, it can take a few hours for the yellow light to turn green. Being fully charged and having line power may not be mandatory in all re-flash circumstances, but it is the best practice.

Put the Refresh USB stick in the right hand vertical XO USB port.

Press the power button, then quickly hold down all top game key - the circle key - on the front right side beside the display - the ones right above the power button.

Release the game key when prompted on the screen. If this prompt does not appear, and the machine just continues to boot, then after the system comes up and is running, power it off elegantly (using a shutdown command). Start again: perhaps being faster on hitting, or more accurate at holding down, that one game key.

On an XO-1, the screen will now show a grid of black rectangles, followed by a partial grid of yellow rectangles, signifying memory erasure. It will then slowly fill the yellow rectangles with green and blue rectangles as the operating system is loaded from the USB stick into memory. Y

On an XO 1.5, there will be alternating green and white fill rectangles as the process continues.

When it has finished installing the base image, the Linux Operating system and the two operating desktop environments, Sugar and Gnome are both available on the machine. On first boot, the XO will begin to start the Sugar environment. You will be asked to Name the machine. Please use a unique name.

After naming the machine, you will be prompted to change the colour of the machine icon. You may elect to just hit return here, if having accurately matched coloured icons is not required in your deployment.

At the top right of the screen there are two small icons. The square with 4 lines across it on the right corresponds to the ‘List View’ of Sugar Activities. Beside that is the circle which corresponds to selecting the 'Favourites' wheel view of the activity icons. Place the pointer on the square, and hit the left-click button. You will now have changed from the Favourite Home View to the List View of activities. You will most likely wish to look at the ‘List View’ of the activities again, and click the star beside any which you would also like to see on the favourites wheel view, that have not appeared. removed by this refresh.

You will then also need to re-attach to your network, since your previous network settings will have been Please be reminded that the Network Neighbourhood View key is the 3rd key from the left on the top row of the keyboard, looking like a circle with eight dots in it. To return to the home activity view, one can then use the Home key, which is also on the top row of the keyboard. It is a circle with a single dot in it.

If you are connected to a network, perhaps check the browse activity at this time to ensure you have internet connectivity. At this point, you can then switch to the Gnome desktop, through the My Settings panel in Sugar, attach to the desired Network in Gnome, then return to Sugar. This procedure ensures that future boots will automatically attach to the last connected network.

This completes the full refresh of the XO.

Following is the content of the olpc.fth script stored in the /boot/ directory of the USB key:

\ OLPC boot script 
\ visible
\ Returns a number identifying the XO version - 2 for XO-1, 3 for XO-1.5
: xo-version  ( -- n )  fw-version$ drop 1+ c@ [char] 0 -  ;
\ To pass hardware specific arguments we define the xo-1? and xo-1.5? flags   
\ Returns true if the machine is XO-1
: xo-1?  ( -- flag )  xo-version 2 =  ;
\ Returns true if the machine is XO-1.5
: xo-1.5?  ( -- flag )  xo-version 3 =  ;
\ Sets the DN macro to expand to the device name from which this script
\ was booted.  That's useful for subsequently booting the kernel from
\ the same device.
\ Also sets the PN macro depending on the XO version
: set-path-macros  ( -- )
   \ "O" game button forces boot from internal FLASH
   button-o game-key? INVERT if
      " \boot"  pn-buf place
      " int:"   dn-buf place
      exit
   then

   \ Set DN to the device that was used to boot this script
   " /chosen" find-package  if                       ( phandle )
      " bootpath" rot  get-package-property  0=  if  ( propval$ )
         get-encoded-string                          ( bootpath$ )
         [char] \ left-parse-string  2nip            ( dn$ )
         dn-buf place                                ( )
      then
   then 
   \ Set PN according to the XO version
   xo-version  case
      2 of  " \boot10"  endof
      3 of  " \boot15"  endof
      ( default )  " \" rot
   endcase  ( adr len )
   pn-buf place
; 
\ We check if we are booting from USB or SDcard to specify device-specific parameters
: dn-contains?  ( $ -- flag )  " ${DN}" expand$  sindex 0>=  ;
: usb?    ( -- flag )  " /usb"     dn-contains?  ;
: sd?     ( -- flag )  " /sd"      dn-contains?  ;
: slot1?  ( -- flag )  " /disk@1"  dn-contains?  ; 
: olpc-fth-boot-me  ( -- )
   set-path-macros
   \ We can pass boot-device-specific kernel arguments here with the PD macro
   \ PDEV1 tells Puppy Linux's init script where to find Puppy-specific files.
   \ If PDEV1 is omitted, Puppy searches for the files.  If a USB FLASH drive
   \ takes a long time to wake up after a USB reset, Puppy sometimes misses it,
   \ so it's better to avoid the search by telling Puppy where to find the files.  
   usb?  if
      " PDEV1=sda1"
   else
      sd?  if
         slot1?  if
            " PDEV1=mmcblk0p1"  \ External SD card
         else
            " PDEV1=mmcblk1p1"  \ Internal SD card
         then
      else
         " "   \ Internal raw NAND
      then
   then
   " PD" $set-macro 


   " console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22 ${PD}" expand$ to boot-file 
\ Uncomment the next 2 lines to see the command line
\   ." cmdline is " boot-file type cr
\   d# 4000 ms
	button-o game-key? INVERT if
   		" ${DN}${PN}\vmlinuz"    expand$ to boot-device
   		" ${DN}${PN}\initrd.img" expand$ to ramdisk
   		boot 
	then
;
olpc-fth-boot-me
button-o game-key? if
   visible
   xo-1? if
      " copy-nand u:\os.img" eval
   else 
      xo-1.5? if
          " fs-update u:\fs.zd" eval
      then
  then
  CR ." Rebooting in ten secons. "
  1000 ms
  bye

then