LimHD:Firmware: Difference between revisions

From Lundman Wiki
No edit summary
No edit summary
Line 1: Line 1:
== Building a new Firmware ==
== Building a new Firmware ==
Want to just download binary version?
[http://www.lundman.net/ftp/lim/update-1026-ftp.bin update-1026-ftp.bin] Patched 2007/10/26 firmware.
[http://www.lundman.net/ftp/lim/lim-firmware-utils.tgz lim-firmware-utils.tgz] Got a newer firmware you want to patch yourself?





Revision as of 06:54, 1 November 2007

Building a new Firmware

Want to just download binary version?

update-1026-ftp.bin Patched 2007/10/26 firmware.

lim-firmware-utils.tgz Got a newer firmware you want to patch yourself?


Unpack firmware

unrar x update.rar
mount -o loop -t romfs update.bin /mnt
rsync -arv /mnt limdata

Now all the work is in limdata/ For example, you should have limdata/linux.bin.gz


telnetd

Make sure you have a symlink for telnetd.

cd limdata/sbin/
ln -s ../bin/busybox telnetd

Add it to start up:

cd limdata/etc/init.d/
vi S30network

add five line, between the existing lines near the end:

insmod gpio_int.o
insmod fuse.o
mkdir /tmp/dev/
mknod /tmp/dev/fuse -m 0666 c 10 229
/usr/sbin/telnetd &
/usr/sbin/inetd /etc/inetd.conf & 
cd /curacao
./curacao /mnt /dev/ir

Don't forget the & sign.

fuse support

Copy the fuse binaries:

cd /downloaded_files/
cp fuse.o limdata/
cp fusermount ntfs-3g remount limdata/usr/bin/
cp ftpd limdata/usr/bin/
cp busybox_ext2 limdata/bin/
cp inetd.conf limdata/etc/

Create symlinks

cd /sbin/
ln -s ../bin/busybox_ext2 e2fsck
ln -s ../bin/busybox_ext2 e2label
ln -s ../bin/busybox_ext2 fdisk
ln -s ../bin/busybox_ext2 fsck
ln -s ../bin/busybox_ext2 fsck.ext2
ln -s ../bin/busybox_ext2 mke2fs
ln -s ../bin/busybox_ext2 mkfs.ext2
ln -s ../bin/busybox_ext2 tune2fs

ext2 support in curacao

If you want to be able to use internal HDD with ext2 filesystem type, you need to do this patch. Edit curacao with your favorite hex editor. I use emacs, in hexl-mode, but anything will work. (Not vi though). For details you can view LimHD:EXT2 ext2 link, but essentially, find the string vfat near the /dev/ide/ section. (Which is after /dev/scsi/ - ie USB), and replace this string with "ext2". Also change iocharset=utf8 with nocheck.

BEFORE:

002c8940: 6172 740a 0000 0000 2f64 6576 2f69 6465  art...../dev/ide
002c8950: 2f68 6f73 7430 2f62 7573 302f 7461 7267  /host0/bus0/targ
002c8960: 6574 302f 6c75 6e30 2f70 6172 7425 6400  et0/lun0/part%d.
002c8970: 2f6d 6e74 2f48 4425 642f 0000 7666 6174  /mnt/HD%d/..vfat
002c8980: 0000 0000 696f 6368 6172 7365 743d 7574  ....iocharset=ut
002c8990: 6638 0000 2573 2564 0000 0000 6e74 6673  f8..%s%d....ntfs
002c89a0: 0000 0000 6e6c 733d 7574 6638 0000 0000  ....nls=utf8....

AFTER:

002c8940: 6172 740a 0000 0000 2f64 6576 2f69 6465  art...../dev/ide
002c8950: 2f68 6f73 7430 2f62 7573 302f 7461 7267  /host0/bus0/targ
002c8960: 6574 302f 6c75 6e30 2f70 6172 7425 6400  et0/lun0/part%d.
002c8970: 2f6d 6e74 2f48 4425 642f 0000 6578 7432  /mnt/HD%d/..ext2
002c8980: 0000 0000 6e6f 6368 6563 6b00 743d 7574  ....nocheck.t=ut
002c8990: 6638 0000 2573 2564 0000 0000 6e74 6673  f8..%s%d....ntfs
002c89a0: 0000 0000 6e6c 733d 7574 6638 0000 0000  ....nls=utf8....

Don't forget to null-terminate the nocheck string. Key sequence usage for emacs is:

emacs -nw curacao
M-x hexl-mode      (M-x means ESC-x, or if setup correctly, ALT-x)
C-s vfat           (C-s is ctrl-s, or Search.)
C-s                (Second C-s searches for 2nd occurence of VFAT)
C-g                (Stop search)
M-x overwrite-mode
Position cursor to start of vfat
ext2
Position cursor to start of iocharset=ut8
nocheck
M-C-x              (or, ESC then ctrl-x to input hex number)
00                 (insert hex 00)
C-x C-s            (Save buffer, answer yet to losing undo buffer)
C-x C-c            (Quit emacs)


Read/Write ext2

You can optionally make curacao mount the ext2 filesystem as read/write, but since you can remount it from the ftpd this is strictly not required. See LimHD:EXT2 ext2 page for more information.

Near the address 0x56910 look for 07 and make it 06. The first one is for the vfat mount, which we changed above. The second is for ntfs. Don't bother with the second as the kernel only has read-only support for ntfs.

00056910: 0610 a0e1 9020 9fe5 0730 a0e3 4e4d 09eb  ..... ...0..NM..
00056920: 0000 50e3 0800 000a 8030 9fe5 0030 8de5  ..P......0...0..
00056930: 6000 4be2 8010 4be2 7420 9fe5 0730 a0e3  `.K...K.t ...0..

In the 1026 firmware it is here:

00057e90: 0520 a0e1 9d49 09eb 9c30 9fe5 0730 8de5  . ...I...0...0..
00057ea0: 0700 a0e1 0610 a0e1 9020 9fe5 0030 a0e3  ......... ...0..
00057eb0: 7d64 09eb 0000 50e3 0800 000a 8030 9fe5  }d....P......0..


Pack new firmware up

genromfs -f update.bin -d limdata/ -V MAMBO

As a safety, if you run:

hexdump -C ~/update.bin |head
00000000  2d 72 6f 6d 31 66 73 2d  00 ce b5 d0 4f 0a 22 d5  |-rom1fs-....O.".|
00000010  4d 41 4d 42 4f 00 00 00  00 00 00 00 00 00 00 00  |MAMBO...........|
00000020  00 00 00 49 00 00 00 20  00 00 00 00 d1 ff ff 97  |...I... ........|
00000030  2e 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 60 00 00 00 20  00 00 00 00 d1 d1 ff 80  |...`... ........|
00000050  2e 2e 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000060  00 15 22 e2 00 00 00 00  00 15 22 58 d2 8e 17 f7  |.."......."X....|
00000070  62 69 74 6d 61 70 2e 62  69 6e 00 00 00 00 00 00  |bitmap.bin......|
00000080  52 41 57 44 8c 87 87 17  3c 0a 00 00 00 00 00 00  |RAWD....<.......|

Since bitmap.bin is in the root of limdata/ it looks correct.


Flash the lim

Copy update.bin to your LimHD200i's internal HDD, into a directory called update so you end up with /update/update.bin then using the LimHD200i's menu, select Update App.

If you download the binary package for updating firmwares, you can also run the script that does all this for you. Except for binary patch curacao. Binary patch curacao yourself and name it curacao_ext2 in the same directory that contains the binary package files.

[lundman@test utils]$ ./firmware_install ../update1026/update.bin
Attempting to mount
Password:
Creating limdata/ directory (please wait)
Making sure telnetd symlink is there (ignore error)
Copying files...
Patching limdata/etc/init.d/S30network ...
If you have patched curacao to mount ext2, name it curacao_ext2 in this directory
Copying in patched curacao_ext2
Packing up new firmware
-rw-rw-r-- 1 lundman lundman 14523392 Nov  1 15:27 update.bin
00000000  2d 72 6f 6d 31 66 73 2d  00 dd 9a 10 4e fb 3e 95  |-rom1fs-....N.>.|
00000010  4d 41 4d 42 4f 00 00 00  00 00 00 00 00 00 00 00  |MAMBO...........|
00000020  00 00 00 49 00 00 00 20  00 00 00 00 d1 ff ff 97  |...I... ........|
00000030  2e 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 60 00 00 00 20  00 00 00 00 d1 d1 ff 80  |...`... ........|
00000050  2e 2e 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000060  00 15 22 e2 00 00 00 00  00 15 22 58 d2 8e 17 f7  |.."......."X....|
00000070  62 69 74 6d 61 70 2e 62  69 6e 00 00 00 00 00 00  |bitmap.bin......|
00000080  52 41 57 44 8c 87 87 17  3c 0a 00 00 00 00 00 00  |RAWD....<.......|
00000090  09 00 00 00 00 00 00 00  d8 8c 87 17 4e 00 00 00  |............N...|


Good luck.


Using your special LimHD200i Firmware

You can telnet to you lim and login as root. You can FTP to the lim, login as root using any password (But not empty).

To remount the HDD issue

ftp> site mount
200- Executing remount command:
Currently mounted filesystems are: 
/mnt/HD2 ext2
/mnt/HD1 ntfs
200 MOUNT ' ' finished.

ftp> site mount /mnt/HD1
200- Executing remount command:
Attempting remount of /dev/ide/host0/bus0/target0/lun0/part1 as ntfs
Unmounting /mnt/HD1 ...
Return code 0
200 MOUNT '/mnt/HD1' finished.

ftp> site mount
200- Executing remount command:
Currently mounted filesystems are: 
/mnt/HD2 ext2
/mnt/HD1 ntfs-3g (read/write)
200 MOUNT ' ' finished.