Firmware/Storage: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Firmware commands that work with internal storage.
Firmware commands that work with internal storage.


== fs-update ==
= fs-update =


The ''fs-update'' command has two variants; ''signed'' and ''unsigned''.
The {{Code|fs-update}} command has two variants; ''signed'' and ''unsigned''.


=== signed ===
== signed ==


* triggered by four game key hold during startup,
* triggered by four game key hold during startup,
* searches for fs.zip or fs''N''.zip where N is the model tag; this file '''must''' be present on boot media,
* searches for {{Code|fs.zip}} or {{Code|fs''N''.zip}} where N is the model tag; this file '''must''' be present on boot media,
* verifies the signature in the .zip file,
* verifies the signature in the {{Code|.zip}} file,
* installs the .zd file to the internal storage, verifying the block hashes in the .zip file against the block data in the .zd file,
* installs the {{Code|.zd}} file to the internal storage, verifying the block hashes in the {{Code|.zip}} file against the block data in the {{Code|.zd}} file,
* reboots automatically on completion,
* reboots automatically on completion,


=== unsigned ===
== unsigned ==


* installs a .zd file to the internal storage, verifying the block hashes in the .zd file against the block data in the .zd file,
* installs a {{Code|.zd}} file to the internal storage, verifying the block hashes in the {{Code|.zd}} file against the block data in the {{Code|.zd}} file,
* does not require or use the .zip file,
* does not require or use the {{Code|.zip}} file,
* does not reboot on completion.
* does not reboot on completion.


fs-update ''filename''
fs-update ''filename''


== fs-verify ==
= fs-verify =


* verifies internal storage against the signed install .zip file,
* verifies internal storage against the signed install {{Code|.zip}} file,


fs-verify ''filename''
fs-verify ''filename''


== fs-save ==
= fs-save =


* writes an .img file using the internal storage as source,
* writes an {{Code|.img}} file using the internal storage as source,
* is very slow, intended for diagnostic use only.
* is very slow, intended for diagnostic use only.


== fs-resize ==
= fs-resize =


The {{Code|fs-resize}} command enlarges the second partition of the internal storage so that it takes up all the remaining space on the device. It was an interim fix until <trac>10040</trac> was fixed. The partition resize is now handled in OLPC OS by the startup scripts. {{Code|fs-resize}} remains applicable to builds that were created before this fix. The method to install them was:
== devalias fsdisk ==


* on a 4GB or 8GB laptop, use [[#fs-update|{{Code|fs-update}}]] to install the 2GB build,
* used before an ''fs-update'', ''fs-verify'', or ''fs-save'' chooses which storage device will be used,
* use {{Code|fs-resize}} to resize the partition that holds the root filesystem,
* defaults to the internal storage,
* boot the build,
* is typically with external SD card slot,
* use {{resize2fs /dev/mmcblk0p2}} to resize the root filesystem to the new size of the partition.


devalias fsdisk ext:0
= devalias fsdisk =


* used before an [[[#fs-update|{{Code|fs-update}}]], [[#fs-verify|{{Code|fs-verify}}]], or [#fs-save|{{Code|fs-save}}]] to choose which storage device will be used,
== Signed Install ==
* defaults to the internal storage,
* configuration setting is lost on restart,
* is typically with external SD card slot, see [[#How to install to SD card|below]].


= Recipes =
== To Be Merged ==


=== How to install a 2GB build on a 4GB or 8GB machine ===
== How to install to SD card ==


The laptop has an external SD card slot which can be used instead of internal storage. To install to the SD card requires a special command:
* use ''fs-update'' to install the 2GB build,
* instead of only [[#fs-update|{{Code|fs-update}}]], use [[#devalias fsdisk|{{Code|devalias fsdisk}}]] followed by the [[#fs-update|{{Code|fs-update}}]] command:
* use ''fs-resize'' to resize the partition that holds the root filesystem,
devalias fsdisk ext:0
* boot the build,
fs-update u:\os.zd
* use ''resize2fs /dev/mmcblk0p2'' to resize the root filesystem to the new size of the partition.
* does not work for signed install,
* does not work on [[XO-1]].


== How to make an image copy of internal storage ==
An interim fix until <trac>10040</trac> is fixed.
----


* determine the size of the internal storage, as shown by {{Code|banner}},
== Recipes ==

=== How to make an image copy of internal storage ===

* determine the size of the internal storage, as shown by ''banner'', usually 4GB or 8GB,
* choose a USB flash drive, USB hard drive, or SD card that is larger than the internal storage size,
* choose a USB flash drive, USB hard drive, or SD card that is larger than the internal storage size,
:*choose a size higher than the internal storage, because filesystems add some overhead,
:*filesystems add some overhead, so it might not be possible for a 4GB USB flash drive to hold the 4GB internal storage of an XO,
:*choose ext2 or FAT filesystems for best compatibility with Open Firmware,
:*choose ext2 or FAT filesystems, because these offer the best compatibility,
:*choose a filesystem that has no critical data on it already, unless you already have copies of the data,
:*choose a device that has no critical data on it already, because the feature is not well tested and may corrupt filesystems,
* use the ''fs-save'' command to make the image copy, for example:
* use the [[#fs-save|{{Code|fs-save}}]] command to make the image copy, for example:
ok fs-save u:\os.img
ok fs-save u:\os.img

The screen will fill with grey blocks, and these will turn ''red'' indicating progress.
The screen will fill with grey blocks, and these will turn ''red'' indicating progress.


The process is very slow, typically 15 minutes for 4GB to a USB HDD, or three hours over NFS over USB ethernet. Use [[Tiny Core Linux]] (XO-1.5) or [http://www.delorie.com/arm/olpc/ olpc-rescue] for a faster process.
The process is very slow, typically 15 minutes for 4GB to a USB HDD, or three hours over NFS over USB ethernet. Use [[Tiny Core Linux]] for a faster process.

The image can be used for diagnosis. It may be converted to .zd for use by [[#fs-update|{{Code|fs-update}}]] using the ''zhashfs'' program included in [[OSBuilder|olpc-os-builder]].


See also [[Imaging]].
The image can be used for diagnosis. It may be converted to .zd for use by ''fs-update'' using the zhashfs program included in olpc-os-builder.

Revision as of 04:37, 20 August 2013

Firmware commands that work with internal storage.

fs-update

The fs-update command has two variants; signed and unsigned.

signed

  • triggered by four game key hold during startup,
  • searches for fs.zip or fsN.zip where N is the model tag; this file must be present on boot media,
  • verifies the signature in the .zip file,
  • installs the .zd file to the internal storage, verifying the block hashes in the .zip file against the block data in the .zd file,
  • reboots automatically on completion,

unsigned

  • installs a .zd file to the internal storage, verifying the block hashes in the .zd file against the block data in the .zd file,
  • does not require or use the .zip file,
  • does not reboot on completion.
fs-update filename

fs-verify

  • verifies internal storage against the signed install .zip file,
fs-verify filename

fs-save

  • writes an .img file using the internal storage as source,
  • is very slow, intended for diagnostic use only.

fs-resize

The fs-resize command enlarges the second partition of the internal storage so that it takes up all the remaining space on the device. It was an interim fix until <trac>10040</trac> was fixed. The partition resize is now handled in OLPC OS by the startup scripts. fs-resize remains applicable to builds that were created before this fix. The method to install them was:

  • on a 4GB or 8GB laptop, use fs-update to install the 2GB build,
  • use fs-resize to resize the partition that holds the root filesystem,
  • boot the build,
  • use Template:Resize2fs /dev/mmcblk0p2 to resize the root filesystem to the new size of the partition.

devalias fsdisk

  • used before an [[[#fs-update|fs-update]], fs-verify, or [#fs-save|fs-save]] to choose which storage device will be used,
  • defaults to the internal storage,
  • configuration setting is lost on restart,
  • is typically with external SD card slot, see below.

Recipes

How to install to SD card

The laptop has an external SD card slot which can be used instead of internal storage. To install to the SD card requires a special command:

devalias fsdisk ext:0
fs-update u:\os.zd
  • does not work for signed install,
  • does not work on XO-1.

How to make an image copy of internal storage

  • determine the size of the internal storage, as shown by banner,
  • choose a USB flash drive, USB hard drive, or SD card that is larger than the internal storage size,
  • choose a size higher than the internal storage, because filesystems add some overhead,
  • choose ext2 or FAT filesystems, because these offer the best compatibility,
  • choose a device that has no critical data on it already, because the feature is not well tested and may corrupt filesystems,
  • use the fs-save command to make the image copy, for example:
ok fs-save u:\os.img

The screen will fill with grey blocks, and these will turn red indicating progress.

The process is very slow, typically 15 minutes for 4GB to a USB HDD, or three hours over NFS over USB ethernet. Use Tiny Core Linux for a faster process.

The image can be used for diagnosis. It may be converted to .zd for use by fs-update using the zhashfs program included in olpc-os-builder.

See also Imaging.