Rockbox Technical Forums

Installation / Removal => Manual Installation => Apple - Installation/Removal => Topic started by: B on July 11, 2006, 04:56:35 PM

Title: iPod install problems under FreeBSD
Post by: B on July 11, 2006, 04:56:35 PM
I am having problems with the writing the boot partition to the ipod onto my 4gen ipod under FreeBSD 6.1.

Here are the steps I have taken:

dd if=/dev/da0 of=mbr.bin count=1
dd if=/dev/da0 of=bootpartition.bin
./ipod_fw -o apple_os.bin -e 0 bootpartition.bin
./ipod_fw -g 4g -o rockboot.bin -i apple_os.bin bootloader-4g.bin
dd if=rockboot.bin of=/dev/da0

When I try to write the boot partition using 'dd if=rockboot.bin of=/dev/da0' I get:

dd: /dev/da0: Invalid argument
246+1 records in
246+0 records out
125952 bytes transferred in 3.851500 secs (32702 bytes/sec)

Any ideas?
Title: Re: iPod install problems under FreeBSD
Post by: linuxstb on July 16, 2006, 04:49:22 AM
I don't know how disk partitions are named under FreeBSD, but you shouldn't be using the same name for the mbr and bootpartition.bin.

Under Linux, the convention is:

/dev/sda - the "whole disk" device.
/dev/sda1 - Partition 1
/dev/sda2 - Partition 2

The MBR is the first sector on the disk - so you read and write that via /dev/sda.

The first partition (/dev/sda1) is the firmware partition and is marked as "empty" - type 0x00.  The second (/dev/sda2) is the FAT32 partition - type 0x0b.

Another issue is that some operating systems (Mac OS X is one) will not create a device node for empty partitions - on Mac OS X you only see the equivalent to /dev/sda2.

If this is the case for you, then you can access the first partition via the "whole disk" device.  The first partition (on every ipod I've seen) starts at sector 63, so you can use dd with the seek option.

i.e. to read bootpartition.bin:

dd if=/dev/sda iseek=63 count=16384 of=bootpartition.bin

count=16384 will read 16384 sectors - i.e. 8MB of data.

To write it, use:

dd if=rockboot.bin oseek=63 of=/dev/sda

(replacing /dev/sda in the above two examples with the "whole disk" device for your ipod).