Meego Wiki
Views

ARM/N900/Using Rescue Initrd

From MeeGo wiki
< ARM | N900(Difference between revisions)
Jump to: navigation, search
(Download required packages)
 
(16 intermediate revisions not shown)
Line 11: Line 11:
  mkdir n900-rescue-initrd
  mkdir n900-rescue-initrd
  cd n900-rescue-initrd
  cd n900-rescue-initrd
-
  wget http://repo.meego.com/MeeGo/releases/1.0/core/repos/armv7l/packages/armv7l/nokia-n900-rescue-initrd-0.1-1.3.armv7l.rpm
+
  wget http://repo.meego.com/MeeGo/releases/1.1/core/repos/armv7l/packages/armv7l/nokia-n900-rescue-initrd-0.1-2.157.armv7l.rpm
-
  wget http://repo.meego.com/MeeGo/releases/1.0/core/repos/armv7l/packages/armv7l/kernel-n900-2.6.33.3-11.2.armv7l.rpm  
+
  wget http://repo.meego.com/MeeGo/releases/1.1/core/repos/armv7l/packages/armv7l/kernel-n900-2.6.35.3-10.3.armv7l.rpm
After this you need to extract the kernel and initrd files from the rpm packages
After this you need to extract the kernel and initrd files from the rpm packages
-
  rpm2cpio nokia-n900-rescue-initrd-0.1-1.3.armv7l.rpm | cpio -vid ./boot/initrd*
+
  rpm2cpio nokia-n900-*.rpm | cpio -vid ./boot/initrd*
-
  rpm2cpio kernel-n900-2.6.33.3-11.2.armv7l.rpm  | cpio -vid ./boot/vmlinuz*
+
  rpm2cpio kernel-*n900-*.rpm  | cpio -vid ./boot/vmlinuz*
-
Now you have some new directories in n900-rescue-initrd
+
Now you have a '''./boot/''' directory in the current dir where the initrd and vmlinuz files are located.
== Starting the rescue initrd ==
== Starting the rescue initrd ==
Line 23: Line 23:
'''NOTE:''' Here we do not flash the kernel or initrd to the device, but only <U>load</U> them to the device memory during the boot. <U>Original images are restored when the device is restarted</U>.
'''NOTE:''' Here we do not flash the kernel or initrd to the device, but only <U>load</U> them to the device memory during the boot. <U>Original images are restored when the device is restarted</U>.
 +
'''NOTE:''' Charge your battery before using initrd. Currently initrd is not able to charge the battery.
 +
 +
* Remove the back cover
* Turn off your device by removing battery
* Turn off your device by removing battery
-
* Start [[ARM/N900/tools/flasher|flasher]]
+
* Insert the battery back to the device
-
  sudo flasher-3.5 -k boot/<vmlinuz>-n900 -n boot/initrd.img -l -b"rootdelay=1 root=/dev/ram0"
+
* Put back cover to the device (This is not needed if you don't need to have access to the microsd card, or if you use magnet instead).
 +
* Start [[ARM/N900/tools/flasher|flasher]] with the following command ('''NOTE:''' change ''<vmlinuz-n900>'' and ''<initrd.img>'' to real filenames):
 +
  sudo flasher-3.5 -k boot/'''<vmlinuz-n900>''' -n boot/'''<initrd.img>''' -l -b"rootdelay=1 root=/dev/ram0"
* Connect N900 to your PC with the USB cable (directly ! some HUBS may cause strange problems)
* Connect N900 to your PC with the USB cable (directly ! some HUBS may cause strange problems)
-
* press U and keep it pressed
 
-
* Insert the battery to the device
 
Now the device boots and you can see a rescue menu.
Now the device boots and you can see a rescue menu.
Line 41: Line 44:
** Contains busybox functionality
** Contains busybox functionality
* Toggle USB storage mode on/off (U)
* Toggle USB storage mode on/off (U)
 +
 +
=== USB storage mode (U) ===
 +
 +
When using USB storage mode the initrd mounts eMMC and the microSD card, if microSD card is available and backcover is attached (or magnet in place). Below is example what devices could be seen with
 +
 +
sudo fdisk -l
 +
 +
command after USB storage mode is enabled.
 +
 +
Disk /dev/sdX: 32.0 GB, 32015122432 bytes
 +
4 heads, 16 sectors/track, 977024 cylinders
 +
Units = cylinders of 64 * 512 = 32768 bytes
 +
Sector size (logical/physical): 512 bytes / 512 bytes
 +
I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
Disk identifier: 0x0004cbd3
 +
 +
    Device Boot      Start        End      Blocks  Id  System
 +
/dev/sdX1              2      884865    28315648    c  W95 FAT32 (LBA)
 +
/dev/sdX2          884866      950401    2097152  83  Linux
 +
/dev/sdX3          950402      974977      786432  82  Linux swap / Solaris
 +
 +
Disk /dev/sdY: 7969 MB, 7969177600 bytes
 +
4 heads, 32 sectors/track, 121600 cylinders
 +
Units = cylinders of 128 * 512 = 65536 bytes
 +
Sector size (logical/physical): 512 bytes / 512 bytes
 +
I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
Disk identifier: 0x000b012c
 +
 +
    Device Boot      Start        End      Blocks  Id  System
 +
/dev/sdY1              1      24415    1562500  83  Linux
 +
/dev/sdY2          24417      28320      249856  83  Linux 
 +
 +
Here ''/dev/sdX/'' is the '''32.0 GB eMMC''' that contains the user home in Maemo 5 and the ''/dev/sdY'' is the '''8 GB microSD''' cards used during this example. <U>Be careful not to destroy your data in the eMMC of the device.</U>
 +
 +
[[Category:N900]]

Latest revision as of 10:24, 2 July 2011

WARNING: Improper use or installation of the image may harm your device. We do not take any responsibility of the damage that may be caused to your device.

Contents

Using Rescue Initrd on N900

This page contains instructions how to use the rescue initrd with the Nokia N900 device. This initrd contains some tools/functions that can be used e.g., to modify content of the external/internal memory cards.

Download required packages

You need flasher, for the very beginning - something like this - read this first.

Get the initrd and kernel images for the rescue process

mkdir n900-rescue-initrd
cd n900-rescue-initrd
wget http://repo.meego.com/MeeGo/releases/1.1/core/repos/armv7l/packages/armv7l/nokia-n900-rescue-initrd-0.1-2.157.armv7l.rpm
wget http://repo.meego.com/MeeGo/releases/1.1/core/repos/armv7l/packages/armv7l/kernel-n900-2.6.35.3-10.3.armv7l.rpm

After this you need to extract the kernel and initrd files from the rpm packages

rpm2cpio nokia-n900-*.rpm | cpio -vid ./boot/initrd*
rpm2cpio kernel-*n900-*.rpm  | cpio -vid ./boot/vmlinuz*

Now you have a ./boot/ directory in the current dir where the initrd and vmlinuz files are located.

Starting the rescue initrd

NOTE: Here we do not flash the kernel or initrd to the device, but only load them to the device memory during the boot. Original images are restored when the device is restarted.

NOTE: Charge your battery before using initrd. Currently initrd is not able to charge the battery.

  • Remove the back cover
  • Turn off your device by removing battery
  • Insert the battery back to the device
  • Put back cover to the device (This is not needed if you don't need to have access to the microsd card, or if you use magnet instead).
  • Start flasher with the following command (NOTE: change <vmlinuz-n900> and <initrd.img> to real filenames):
sudo flasher-3.5 -k boot/<vmlinuz-n900> -n boot/<initrd.img> -l -b"rootdelay=1 root=/dev/ram0"
  • Connect N900 to your PC with the USB cable (directly ! some HUBS may cause strange problems)

Now the device boots and you can see a rescue menu.

Rescue Menu Functionalities

With rescue menu you can:

  • Toggle USB networking on/off (N)
  • Reboot the device (R)
  • Shutdown the device (S)
  • Start recovery terminal (T)
    • Contains busybox functionality
  • Toggle USB storage mode on/off (U)

USB storage mode (U)

When using USB storage mode the initrd mounts eMMC and the microSD card, if microSD card is available and backcover is attached (or magnet in place). Below is example what devices could be seen with

sudo fdisk -l 

command after USB storage mode is enabled.

Disk /dev/sdX: 32.0 GB, 32015122432 bytes
4 heads, 16 sectors/track, 977024 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004cbd3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdX1               2      884865    28315648    c  W95 FAT32 (LBA)
/dev/sdX2          884866      950401     2097152   83  Linux
/dev/sdX3          950402      974977      786432   82  Linux swap / Solaris 

Disk /dev/sdY: 7969 MB, 7969177600 bytes
4 heads, 32 sectors/track, 121600 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b012c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdY1               1       24415     1562500   83  Linux
/dev/sdY2           24417       28320      249856   83  Linux  

Here /dev/sdX/ is the 32.0 GB eMMC that contains the user home in Maemo 5 and the /dev/sdY is the 8 GB microSD cards used during this example. Be careful not to destroy your data in the eMMC of the device.

Personal tools