| 1 |
To boot from the SD card, a "backflip" is needed |
|---|
| 2 |
to be done. The Zipit Z2 will boot look for, and |
|---|
| 3 |
run, the z2script.sh. Manipulation of resident |
|---|
| 4 |
environment is done, then a HUP is sent to the |
|---|
| 5 |
init process to force a reboot onto our new rootfs. |
|---|
| 6 |
|
|---|
| 7 |
You must prepare the SD card for booting OE (OpenEmbedded) |
|---|
| 8 |
on the Z2. First, you need a media reader working on |
|---|
| 9 |
your host computer (this development box). You will |
|---|
| 10 |
need to know what the device is that is found when you |
|---|
| 11 |
insert the SD card into the media reader. |
|---|
| 12 |
|
|---|
| 13 |
The way to do this is to login as root, then tail the |
|---|
| 14 |
/var/log/messages file, then repeatedly insert and remove |
|---|
| 15 |
the card, you shoud see something like this: |
|---|
| 16 |
|
|---|
| 17 |
========= looking at messages =============== |
|---|
| 18 |
[root@jtag OE-projects]# tail -f -n 0 /var/log/messages |
|---|
| 19 |
Jan 25 11:04:35 jtag kernel: SCSI device sdh: 1984000 512-byte hdwr sectors (1016 MB) |
|---|
| 20 |
Jan 25 11:04:35 jtag kernel: sdh: Write Protect is off |
|---|
| 21 |
Jan 25 11:04:35 jtag kernel: sdh: assuming drive cache: write through |
|---|
| 22 |
Jan 25 11:04:35 jtag kernel: SCSI device sdh: 1984000 512-byte hdwr sectors (1016 MB) |
|---|
| 23 |
Jan 25 11:04:35 jtag kernel: sdh: Write Protect is off |
|---|
| 24 |
Jan 25 11:04:35 jtag kernel: sdh: assuming drive cache: write through |
|---|
| 25 |
Jan 25 11:04:35 jtag kernel: sdh: sdh1 |
|---|
| 26 |
Jan 25 11:04:35 jtag kernel: SCSI device sdh: 1984000 512-byte hdwr sectors (1016 MB) |
|---|
| 27 |
Jan 25 11:04:35 jtag kernel: sdh: Write Protect is off |
|---|
| 28 |
Jan 25 11:04:35 jtag kernel: sdh: assuming drive cache: write through |
|---|
| 29 |
Jan 25 11:04:35 jtag kernel: SCSI device sdh: 1984000 512-byte hdwr sectors (1016 MB) |
|---|
| 30 |
Jan 25 11:04:35 jtag kernel: sdh: Write Protect is off |
|---|
| 31 |
Jan 25 11:04:35 jtag kernel: sdh: assuming drive cache: write through |
|---|
| 32 |
Jan 25 11:04:35 jtag kernel: sdh: sdh1 |
|---|
| 33 |
Jan 25 11:04:35 jtag kernel: SCSI device sdh: 1984000 512-byte hdwr sectors (1016 MB) |
|---|
| 34 |
Jan 25 11:04:35 jtag kernel: sdh: Write Protect is off |
|---|
| 35 |
Jan 25 11:04:35 jtag kernel: sdh: assuming drive cache: write through |
|---|
| 36 |
Jan 25 11:04:35 jtag kernel: SCSI device sdh: 1984000 512-byte hdwr sectors (1016 MB) |
|---|
| 37 |
Jan 25 11:04:35 jtag kernel: sdh: Write Protect is off |
|---|
| 38 |
Jan 25 11:04:35 jtag kernel: sdh: assuming drive cache: write through |
|---|
| 39 |
Jan 25 11:04:35 jtag kernel: sdh: sdh1 |
|---|
| 40 |
============== snip ========================= |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
As you can see from the above log, with my media |
|---|
| 45 |
reader, my Linux system sees the SD card as /dev/sdh? |
|---|
| 46 |
To verify that this is correct, get a list of the |
|---|
| 47 |
partitions on that suspected card: |
|---|
| 48 |
|
|---|
| 49 |
========= checking partition table ========== |
|---|
| 50 |
[root@jtag OE-projects]# fdisk -l /dev/sdh |
|---|
| 51 |
|
|---|
| 52 |
Disk /dev/sdh: 1015 MB, 1015808000 bytes |
|---|
| 53 |
32 heads, 63 sectors/track, 984 cylinders |
|---|
| 54 |
Units = cylinders of 2016 * 512 = 1032192 bytes |
|---|
| 55 |
|
|---|
| 56 |
Device Boot Start End Blocks Id System |
|---|
| 57 |
/dev/sdh1 1 984 991840+ 6 FAT16 |
|---|
| 58 |
============== snip ========================= |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
Ok, that is a 1Gig SD (991K) card and it is a FAT16 partition. |
|---|
| 63 |
That does look like the correct device. If unsure, just |
|---|
| 64 |
pop the SD card out of the reader and try the fdisk |
|---|
| 65 |
command again and you should now get an error message. |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
Next, edit the prepSDcard.pl script and change: |
|---|
| 69 |
my $DEVICE = "/dev/sdX"; |
|---|
| 70 |
|
|---|
| 71 |
To what your card is, in my case 'sdh': |
|---|
| 72 |
my $DEVICE = "/dev/sdh"; |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
The prepSDcard.pl script will do the work for you of |
|---|
| 76 |
getting a card ready to use to boot Linux on the Zipit Z2. |
|---|
| 77 |
This script also can be used as a development tool to |
|---|
| 78 |
update the ext3 partition contents as you go along. |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
To make a bootable Linux system for the Zipit Z2, have |
|---|
| 82 |
the fatroot.zip file and the Linux image tarball on |
|---|
| 83 |
your system, then: |
|---|
| 84 |
|
|---|
| 85 |
./prepSDcard.pl --partitions --fatroot=zipitZ2BBfiles/fatroot/fatroot.zip --tarball=tmp.zipitZ2/deploy/images/base-image-zipit2.tar |
|---|
| 86 |
|
|---|
| 87 |
That is all one line. It will partition the card, |
|---|
| 88 |
format the vfat and ext3 filesystems on the card, then, |
|---|
| 89 |
will populate the card with the data needed. Once it |
|---|
| 90 |
declares "Success", simply put the card in the Z2 and |
|---|
| 91 |
power it on. The first time you may have to wait a |
|---|
| 92 |
minute or two for the firstime configuration to finish. |
|---|
| 93 |
|
|---|
| 94 |
Subsequent use of the script to replace the ext3 filesystem |
|---|
| 95 |
contents would be something like this: |
|---|
| 96 |
|
|---|
| 97 |
./prepSDcard.pl --tarball=tmp.zipitZ2/deploy/images/base-image-zipit2.rootfs.tar |
|---|
| 98 |
|
|---|
| 99 |
Don't worry, if you have the DEVICE named correctly, then |
|---|
| 100 |
all should proceed correctly. The script does a number of |
|---|
| 101 |
checkpoints to avoid problems or to catch errors. |
|---|
| 102 |
|
|---|
| 103 |
Enjoy! :-) |
|---|
| 104 |
|
|---|
| 105 |
|
|---|