Archive for March, 2006

Linux on XV6600 – Formatting SD Card

Saturday, March 4th, 2006

Earlier, I gave a quick overview of putting Linux on my XV6600. This and the following posts will describe in more detail how to put Linux on an XV6600 (U Verizon version).

Assuming that your linux box can see the card, the tool to format the card is fdisk.
For me, my linux box saw the card as /dev/sdc. You’ll need to figure out which device to use. You can find out by looking at /var/log/messages.

First, you need to delete any existing partitions. Then you’ll need to create two new partitions, the first one being 30MB and FAT16, the second the remainder of the card and a Linux partition (I recommend at least a 64MB SD card). After you create the partitions, and write it out to the card, you create the file systems and the you are good to go.

Here is a transcript of me doing this to a 128MB SD Card – the card is plugged into a USB-HUB Combo Card Reader. I’ve bolded my input. Comments are italicized and should not be entered. Note the following is done as root – be very careful!

to exit tail -f command>

[root@chocolate ~]# tail -f /var/log/messages
Feb 23 18:22:43 chocolate kernel: SCSI device sdc: 246016 512-byte hdwr sectors (126 MB)
Feb 23 18:22:43 chocolate kernel: sdc: Write Protect is off
Feb 23 18:22:43 chocolate kernel: sdc: assuming drive cache: write through
Feb 23 18:22:43 chocolate kernel: SCSI device sdc: 246016 512-byte hdwr sectors (126 MB)
Feb 23 18:22:43 chocolate kernel: sdc: Write Protect is off
Feb 23 18:22:43 chocolate kernel: sdc: assuming drive cache: write through
Feb 23 18:22:43 chocolate kernel: sdc: sdc1
Feb 23 18:22:44 chocolate fstab-sync[18371]: added mount point /media/CANON_DV for /dev/sdc1
^C[root@chocolate ~]# fdisk /dev/sdc

Command (m for help): p (print partition table for sanity check)

Disk /dev/sdc: 125 MB, 125960192 bytes
8 heads, 32 sectors/track, 961 cylinders
Units = cylinders of 256 * 512 = 131072 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 961 122959+ 6 FAT16

Command (m for help): d (make sure to delete all partitions)
Selected partition 1

Command (m for help): n (create first primary partition)
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-961, default 1): (use default value)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-961, default 961): +30M [/i](first partition is 30 MB)[/i]

Command (m for help): p (sanity check)

Disk /dev/sdc: 125 MB, 125960192 bytes
8 heads, 32 sectors/track, 961 cylinders
Units = cylinders of 256 * 512 = 131072 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 230 29424 83 Linux (need to change to FAT16)

Command (m for help): t (change partition type)
Selected partition 1
Hex code (type L to list codes): 6 (6 is FAT16)
Changed system type of partition 1 to 6 (FAT16)

Command (m for help): p

Disk /dev/sdc: 125 MB, 125960192 bytes
8 heads, 32 sectors/track, 961 cylinders
Units = cylinders of 256 * 512 = 131072 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 230 29424 6 FAT16

Command (m for help): n (second partition is linux, remainder of card)
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (231-961, default 231): (use default value)
Using default value 231
Last cylinder or +size or +sizeM or +sizeK (231-961, default 961): (use default value)
Using default value 961

Command (m for help): p (check out our work)

Disk /dev/sdc: 125 MB, 125960192 bytes
8 heads, 32 sectors/track, 961 cylinders
Units = cylinders of 256 * 512 = 131072 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 230 29424 6 FAT16
/dev/sdc2 231 961 93568 83 Linux

Command (m for help): w (write it out, use q if uncertain. w will destroy whatever is on the card)
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
[root@chocolate ~]# mkfs.vfat /dev/sdc1 ## Format the first partition – you can then plug this into a Windows box and see a 30MB drive.
mkfs.vfat 2.10 (22 Sep 2003)
[root@chocolate ~]# mkfs.ext3 /dev/sdc2 ## Be patient, this may take a while
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
23424 inodes, 93568 blocks
4678 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
12 block groups
8192 blocks per group, 8192 fragments per group
1952 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@chocolate ~]#

That should be it.
Good luck.

Hacking my XV6600

Saturday, March 4th, 2006

I came across a link detailing how to install a working Linux kernel on my XV6600. It was so cool I had to try it – and I did. I was able to get a functional UI up and running (GPE), although a bit of the screen was cut-off.
The directions were not quite clear and I had to do some digging to find out more. Here is a the version of the steps with some working instructions.

STEP 0. Backup all of your data (including sd card). I use Sprite Backup software.

STEP 1. Download the Kernel, etc.

[WWW]zImage [WWW]initrd haret.exe [WWW]GPE BlueAngel Image [WWW]startup.txt [WWW]autorun

STEP 2. Format SD-Card

Become root and create 2 partitions on the SD-Card

The first partition is for the kernel, startup scripts and bootloader. The second is for the GPE image.

  • fdisk /dev/sda should do this (it may be under /dev/mmc on your machine, this is mearly an example).

One of 30MB (for kernel and bootloader) and another (or rest of SD) for the GPE image.

Format the Partitions

  • mkfs.vfat /dev/sda1
  • mkfs.ext3 /dev/sda2 (These two commands may differ for your system, they are only meant as an example)

Now mount those partitions.

  • mount -t vfat /dev/sda1 /mnt/sd0
  • mount -t ext3 /dev/sda2 /mnt/sd1

STEP 3. Copy kernel, etc onto first partition

Create a new directory in /mnt/sd0 called ‘linux’. Copy zImage, initrd, startup and haret into the ‘linux directory’

Create another directory in /mnt/sd0 called ’2577′.

Copy autorun.exe into ’2577′

STEP 4. Extract GPE into the EXT3 Partition

Change to /mnt/sd1 ‘cd /mnt/sd1′

  • Execute tar xjvpf
    /gpe-ba.tar.bz2
  • DO NOT, as many intelligent people have done, just copy the archive onto the partition!

STEP 5. Change to /root ‘cd / ‘

  • Execute sync
  • Execute umount /dev/sda1
  • Execute umount /dev/sda2

STEP 6. Now boot linux by inserting the SD-Card into the BlueAngel. DONE!

stop spam with honeypot!