RE: OS Builder output img ?

2013-03-26 Thread lionel

Thanks to all. It works perfectly now.
Following is my script for other beginners like me :-)

Lionel.


\ automatic installer

unfreeze
visible

: wait-for-enter
  begin key h# d = until
;

: ask-remove 
   . Remove the key and type enter to finish  cr
   wait-for-enter
;

: installer
   ['] disable-security catch drop
copy-nand u:\21014nk0.img eval
   ask-remove
change-tag LO fr_FR.UTF-8 eval
;

installer

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread James Cameron
Let us know if you have any further questions ... I expect some from
every new Forth user.  ;-)

-- 
James Cameron
http://quozl.linux.org.au/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread Richard Smith

 Here is a screen capture from the XO-1 I'm using to test the procedure:
 http://laske.fr/tmp/SHF8080270B.jpg

You appear to be using a developer key.  If you are going to be
installing a custom build on all the laptops I would encourage you to
disable the security system altogether as the last step in your
olpc.fth step with 'disable-security'.  Then some of the gotchas that
occur with secure laptops won't happen.

-- 
Richard A. Smith
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS Builder output img ?

2013-03-25 Thread lionel

Hi all,

Thanks for your answer.

 Let us know if you have any further questions ... I expect some from every
new Forth user.  ;-)

You're right, it's hard to enter in Forth language :-{
I've added a olpc.fth file in the boot directory of my key with following
commands:

 copy-nand u:\21007xx0.img eval
 change-tag LO fr_FR.UTF-8 eval

I've expected than it autoboot the key and install the image but it does
nothing, just display the ok prompt :-(
Does I miss something ?

Lionel.

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS Builder output img ?

2013-03-25 Thread lionel

Hi Richard,

 You appear to be using a developer key.  If you are going to be installing
a custom build on all the laptops I would encourage you to disable the
security 
 system altogether as the last step in your olpc.fth step with
'disable-security'.  Then some of the gotchas that occur with secure laptops
won't happen.

Yes you're right, I'm using an unlock stick [1]. What sort of problem
could occur?

Lionel.

[1]
http://wiki.laptop.org/go/Collection_stick#Unlocking_with_an_Unlock_stick 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread James Cameron
Yes, add a comment line to the start of file, so that the file is
recognised.  I also suggest encoding the work as a program
definition.  So the file might be:

\ automatic installer by lio...@olpc-france.org
: installer
copy-nand u:\21007xx0.img eval
change-tag LO fr_FR.UTF-8 eval
;
installer

-- 
James Cameron
http://quozl.linux.org.au/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread Richard Smith
On Mon, Mar 25, 2013 at 5:20 PM,  lio...@olpc-france.org wrote:

 Hi Richard,

 You appear to be using a developer key.  If you are going to be installing
 a custom build on all the laptops I would encourage you to disable the
 security
 system altogether as the last step in your olpc.fth step with
 'disable-security'.  Then some of the gotchas that occur with secure laptops
 won't happen.

 Yes you're right, I'm using an unlock stick [1]. What sort of problem
 could occur?

Well for one you have to have those keys present for your installed os
to run either on that stick or by copying the developer key to the XO.
 But then you have to make sure that the developer key is re-installed
anytime you reflash the XO.  Also if for some other reason the dev
keys are removed from the laptop it will stop booting the OS.  Other
than that the most common gotcha with running XO's in secure mode is
that if you have RTC clock problems then the laptop can stop booting
and you have to have a developer key to fix them.  Getting developer
keys after the laptops have been deployed can be a lot of extra effort
to obtain and then distribute to the XO.

Its also just less hassle.  If you are installing a customized
non-signed build then you have to have the laptops un-secure to boot
it so the one-time disable of the security system means that you won't
ever have to mess with it again unless you re-enable it.

: installer
copy-nand u:\21007xx0.img eval
change-tag LO fr_FR.UTF-8 eval
;

Note that if you want to also disable the security system in this
script then we will need a slightly different approach.  By default
each time you change a tag the laptop will reboot.  So to change
multiple tags in one go you need to use a tag change that won't reboot
the laptop.

-- 
Richard A. Smith
One Laptop per Child
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS Builder output img ?

2013-03-25 Thread lionel

 Yes, add a comment line to the start of file, so that the file is
recognised.  I also suggest encoding the work as a program definition.  So
the file might be:

YEES  It works !
You're my new Forth Hero !

Lionel.

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS Builder output img ?

2013-03-25 Thread lionel

 Well for one you have to have those keys present for your installed os to
run either on that stick or by copying the developer key to the XO.
 But then you have to make sure that the developer key is re-installed
anytime you reflash the XO.  Also if for some other reason the dev keys are
removed
 from the laptop it will stop booting the OS.  Other than that the most
common gotcha with running XO's in secure mode is that if you have RTC clock
problems 
 then the laptop can stop booting and you have to have a developer key to
fix them.  Getting developer keys after the laptops have been deployed can
be a 
 lot of extra effort to obtain and then distribute to the XO.

 Its also just less hassle.  If you are installing a customized non-signed
build then you have to have the laptops un-secure to boot it so the one-time
disable of 
 the security system means that you won't ever have to mess with it again
unless you re-enable it.

Okay, you definitively convince me to disable security.


: installer
copy-nand u:\21007xx0.img eval
change-tag LO fr_FR.UTF-8 eval
 ;
 installer

 Note that if you want to also disable the security system in this script
then we will need a slightly different approach.  By default each time you
change a tag 
 the laptop will reboot.  So to change multiple tags in one go you need to
use a tag change that won't reboot the laptop.

Hmmm. Change-tag without reboot ? Is there any way to do that ?
And that's only one part of the problem, the other one is that my
installer script run for ever:
copy-nand/change-tag/reboot/copy-nand/change-tag/reboot/...

Lionel.


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread James Cameron
On Mon, Mar 25, 2013 at 11:23:39PM +0100, lio...@olpc-france.org wrote:
 Hmmm. Change-tag without reboot ? Is there any way to do that ?

Yes, it is possible.  For XO-4 it is easy.  For XO-1 it disables
keyboard during the actions.  If you have a bug in the code at this
time, you have to remove main battery to recover.  Requires Q2F16
firmware.  tags( starts the changes, )tags ends them and does reboot.

But maybe you don't need to do that, if you are only changing one tag?
How many tags are you changing?  If one, then finish the script with
the tag change.

 And that's only one part of the problem, the other one is that my
 installer script run for ever:
 copy-nand/change-tag/reboot/copy-nand/change-tag/reboot/...

Put in a prompt to remove USB drive after copy-nand:

\ example

: wait-for-enter
  begin key h# d = until
;

: ask-remove
  . Please remove the USB drive and press enter ? 
  wait-for-enter
;

: installer
   copy-nand ...
  ask-remove
   change-tag ...
;

-- 
James Cameron
http://quozl.linux.org.au/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread Richard Smith
On Mon, Mar 25, 2013 at 7:07 PM, James Cameron qu...@laptop.org wrote:
 On Mon, Mar 25, 2013 at 06:50:00PM -0400, Richard Smith wrote:

  But maybe you don't need to do that, if you are only changing one tag?
  How many tags are you changing?  If one, then finish the script with
  the tag change.

 I mentioned that he could also disable security.  So he would be
 deleting the 'wp' tag too.

 Really?  disable-security changes the wp tag to ww rather than
 deleting it.  Do you think he should delete it instead?

The effect is the same.  We did ww and wp because 'w' is a 0x77 and
'p' is a 0x70 so you could change the w to a p with a single write
without an erase cycle in-between.  We never really used that feature
though.

 Is there a risk of having to reboot to enable writes?

I was just pondering this as well.  Its been a while,  but IIRC think
this may thwart any attempt to do it in a single pass.  The write
protect on the SPI flash is set very early so OFW has to issue a
special command to reboot without the lock.  No way around it as you
can only unlock with a reboot.  I suppose you could do the security
disable first and then when you see that its 'ww' rather than 'wp'
continue on with the re-flash and then the LO change as the last step.

-- 
Richard A. Smith
One Laptop per Child
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread Richard Smith
 special command to reboot without the lock.  No way around it as you
 can only unlock with a reboot.  I suppose you could do the security
 disable first and then when you see that its 'ww' rather than 'wp'
 continue on with the re-flash and then the LO change as the last step.

I had a vague recollection of doing something like this many moons ago
to automate the conversion of a large amount of laptops to an Arabic
keyboard.  I managed to dig up the script.  IIRC this script was for
XO-1.5 but since then I think we added this support back into XO-1
firmware.  I did a quick check on a unit I have with q2f13 and all
then necessary words existed.  I offer it up as example code.   Seems
I did exactly what I was suggesting in the previous mail.  Do the
disable-security first and and ignore the error if security has been
disabled.

the line:

['] disable-security catch drop

does that nicely.  It will reboot the 1st time then clear security the
2nd time.  On laptops that have already had security disabled it just
continues on.


\ Automate arabic conversion

visible
unfreeze

\ ka-dir$ is not used in this script but kept so the code is
\ idential to the stuff from the mfg scripts
\ Location of the files containing KA tag data
: ka-dir$  ( -- adr len )   http:\\10.1.0.1\ka\  ;

: put-ascii-tag  ( value$ name$ -- )
   2swap  dup  if  add-null  then  2swap  ( value$' key$ )
   ($add-tag) ( )
;

: put-ka-tag  ( value$ key$ -- )
   2over  8 min  ka-dir$  %s%s sprintf  ( value$ key$ filename$ )
   . Fetching KA tag file  2dup type cr ( value$ key$ filename$ )
   $read-file  if ( value$ key$ )
  . ERROR: No KA tag file for  2swap type cr  ( key$ )
  true  abort KA file not found ( key$ )
  2drop   ( )
   else   ( value$ key$ file-data$ )
  2swap ($add-tag)( value$ )
  2drop   ( )
   then
;

: special-tag?  ( value$ key$ -- true | value$ key$ false )
   2dup  KA $=  if  ( value$ key$ )
  put-ka-tag  true  exit
   then   ( value$ key$ )
   false
;

: put-tag  ( value$ key$ -- )
   special-tag?  if  exit  then   ( value$ key$ )
   put-ascii-tag
;

: compare-tag ( value$ key$ -- success? )
find-tag 0= if false exit then
?-null $= 0=
;

: arabic? ( -- true/false )

olpc  KM  compare-tag if false exit then
us,araKL  compare-tag if false exit then
olpc2,olpcKV  compare-tag if false exit then
ar_EG.UTF-8   LO  compare-tag if false exit then
   true
;

: arabic-tags  ( -- )

   get-mfg-data

KM  ($delete-tag)
KL  ($delete-tag)
KV  ($delete-tag)
LO  ($delete-tag)

olpc  KM  put-tag
us,araKL  put-tag
olpc2,olpcKV  put-tag
ar_EG.UTF-8   LO  put-tag

   flash-write-enable
   (put-mfg-data)

   kbc-on
;

: make-arabic

arabic? if
. Tags already correct cr
else
. Changing tags cr
arabic-tags
then
;

: go-arabic ( -- )
d# 5000 ms
['] disable-security catch drop
make-arabic
nb
;

go-arabic


-- 
Richard A. Smith
One Laptop per Child
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-25 Thread John Watlington

I thought you should set the dk manufacturing tag, but I
just noticed that is only supported on XO-1 and 1.5!

wp and ww are different tags, you can't just change the
tag value with change-tag.

wad

On Mar 25, 2013, at 7:07 PM, James Cameron wrote:

 On Mon, Mar 25, 2013 at 06:50:00PM -0400, Richard Smith wrote:
 But maybe you don't need to do that, if you are only changing one tag?
 How many tags are you changing?  If one, then finish the script with
 the tag change.
 
 I mentioned that he could also disable security.  So he would be
 deleting the 'wp' tag too.
 
 Really?  disable-security changes the wp tag to ww rather than
 deleting it.  Do you think he should delete it instead?
 
 Is there a risk of having to reboot to enable writes?
 
 -- 
 James Cameron
 http://quozl.linux.org.au/
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-24 Thread Samuel Greenfeld
The fs0.zip file would only appear if you configured everything to make a
signed build.  You would only be able to make a signed build if you had a
copy of the private keys for the deployment you are making the signed build
for.   Only OLPC has the keys to make a signed build that pretty much any
XO-1 will accept.

The .crc and .img files, when copied to USB, etc., are enough to install
the image on a unlocked XO-1 with a command like copy-nand
u:\21007xx0.img from the ok Open Firmware prompt (available if you press
the ESC/(X) key while the startup sound plays on unlocked units).



On Sun, Mar 24, 2013 at 4:53 AM, lio...@olpc-france.org wrote:

 Hi all,

 ** **

 Thanks to the nice documentation on the Wiki, I’ve successfully created my
 first OS Build.

 For the moment, it’s just a 12.1.0 without any customization but I’m very
 proud of this first step! :-)

 Now I want to deploy it on my unlock XO-1 but I’m slightly disappointed by
 the output of the build.

 I expected to have something like a “fs0.zip” file and a “21021o0.img”
 file but here is the content of the output directory:

 ** **

 total 2124968

 -rw-r--r--. 1 root root383 Mar 22 22:37 21007xx0.activities.txt***
 *

 -rw-r--r--. 1 root root  46485 Mar 22 22:25 21007xx0.crc

 -rw-r--r--. 1 root root 694986 Mar 22 22:37 21007xx0.files.txt.gz

 -rw-r--r--. 1 root root  676986880 Mar 22 22:25 21007xx0.img

 -rw-r--r--. 1 root root 47 Mar 22 22:26 21007xx0.img.md5

 -rw-r--r--. 1 root root150 Mar 22 22:37 21007xx0.libraries.txt

 -rw-r--r--. 1 root root  22541 Mar 22 22:36 21007xx0.packages.txt

 -rw-r--r--. 1 root root8348832 Mar 22 22:11 21007xx0.toc

 -rw-r--r--. 1 root root  448624505 Mar 22 22:36 21007xx0.tree.tar.lzma

 -rw-r--r--. 1 root root 57 Mar 22 22:36 21007xx0.tree.tar.lzma.md5
 

 -rw-r--r--. 1 root root 1041203200 Mar 22 22:29 21007xx0.usb

 ** **

 I guess that the “21007xx0.img” file is the “21021o0.img” file I’m looking
 for but where is the “fs0.zip” file?

 Sorry, it’s probably a stupid question but I’m an absolute beginner on
 that!

 ** **

 Best regards from France.

 ** **

 Lionel.

 ** **

 ** **

 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS Builder output img ?

2013-03-24 Thread lionel
 

Ok. I’ve done it.

Is it possible to have an auto install? i.e. without need to type command
from the prompt.

 

Lionel.

 

De : Samuel Greenfeld [mailto:greenf...@laptop.org] 
Envoyé : dimanche 24 mars 2013 14:40
À : lio...@olpc-france.org
Cc : devel@lists.laptop.org
Objet : Re: OS Builder output img ?

 

The fs0.zip file would only appear if you configured everything to make a
signed build.  You would only be able to make a signed build if you had a
copy of the private keys for the deployment you are making the signed build
for.   Only OLPC has the keys to make a signed build that pretty much any
XO-1 will accept.

The .crc and .img files, when copied to USB, etc., are enough to install the
image on a unlocked XO-1 with a command like copy-nand u:\21007xx0.img
from the ok Open Firmware prompt (available if you press the ESC/(X) key
while the startup sound plays on unlocked units).




 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


RE: OS Builder output img ?

2013-03-24 Thread Jerry Vonau
On Sun, 2013-03-24 at 21:33 +0100, lio...@olpc-france.org wrote:
  
 
 Ok. I’ve done it.
 
 Is it possible to have an auto install? i.e. without need to type
 command from the prompt.
 

Yes, you would need to have your security keys installed in the XOs, but
that is difficult when the XO's have security enabled. You need a key
injector signed by OLPC to be able to install your deployment key that
you used to sign the image/firmware.

Jerry

  
 
 Lionel.
 
  
 
 De : Samuel Greenfeld [mailto:greenf...@laptop.org] 
 Envoyé : dimanche 24 mars 2013 14:40
 À : lio...@olpc-france.org
 Cc : devel@lists.laptop.org
 Objet : Re: OS Builder output img ?
 
  
 
 The fs0.zip file would only appear if you configured everything to
 make a signed build.  You would only be able to make a signed build if
 you had a copy of the private keys for the deployment you are making
 the signed build for.   Only OLPC has the keys to make a signed build
 that pretty much any XO-1 will accept.
 
 The .crc and .img files, when copied to USB, etc., are enough to
 install the image on a unlocked XO-1 with a command like copy-nand u:
 \21007xx0.img from the ok Open Firmware prompt (available if you
 press the ESC/(X) key while the startup sound plays on unlocked
 units).
 
 
 
 
  
 
 
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-24 Thread James Cameron
An auto install for an unlocked laptop does not need keys or signing.

Just place the Open Firmware commands that you want to run in a file
olpc.fth in the folder boot on the USB drive.

Sometimes the commands may need careful writing to avoid certain
features of Open Firmware.

There is no action required to trigger it, apart from inserting the
USB drive and turning on the power.  You must not use the four game
keys.

(On the other hand, an auto install for a locked XO-1 laptop requires
fs.zip or fs0.zip, and you trigger it using the four game keys).

-- 
James Cameron
http://quozl.linux.org.au/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: OS Builder output img ?

2013-03-24 Thread Martin Langhoff
Hi Lionel,

your questions in recent emails lack some background -- specifically,
on how the XOs are configured. Without that info, we can give you many
different answers because it all depends on how the XOs are
configured.

Can you tell us the output of .mfg-data for the laptops you are
targetting? Are they all the same SKU?

With that info, we can give you more relevant answers...



m

On Sun, Mar 24, 2013 at 4:53 AM,  lio...@olpc-france.org wrote:
 Hi all,



 Thanks to the nice documentation on the Wiki, I’ve successfully created my
 first OS Build.

 For the moment, it’s just a 12.1.0 without any customization but I’m very
 proud of this first step! :-)

 Now I want to deploy it on my unlock XO-1 but I’m slightly disappointed by
 the output of the build.

 I expected to have something like a “fs0.zip” file and a “21021o0.img” file
 but here is the content of the output directory:



 total 2124968

 -rw-r--r--. 1 root root383 Mar 22 22:37 21007xx0.activities.txt

 -rw-r--r--. 1 root root  46485 Mar 22 22:25 21007xx0.crc

 -rw-r--r--. 1 root root 694986 Mar 22 22:37 21007xx0.files.txt.gz

 -rw-r--r--. 1 root root  676986880 Mar 22 22:25 21007xx0.img

 -rw-r--r--. 1 root root 47 Mar 22 22:26 21007xx0.img.md5

 -rw-r--r--. 1 root root150 Mar 22 22:37 21007xx0.libraries.txt

 -rw-r--r--. 1 root root  22541 Mar 22 22:36 21007xx0.packages.txt

 -rw-r--r--. 1 root root8348832 Mar 22 22:11 21007xx0.toc

 -rw-r--r--. 1 root root  448624505 Mar 22 22:36 21007xx0.tree.tar.lzma

 -rw-r--r--. 1 root root 57 Mar 22 22:36 21007xx0.tree.tar.lzma.md5

 -rw-r--r--. 1 root root 1041203200 Mar 22 22:29 21007xx0.usb



 I guess that the “21007xx0.img” file is the “21021o0.img” file I’m looking
 for but where is the “fs0.zip” file?

 Sorry, it’s probably a stupid question but I’m an absolute beginner on that!



 Best regards from France.



 Lionel.






 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel




-- 
 martin.langh...@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/24/en/User:Martin_Langhoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel