There are two main options for writing to the flash, either using the RedBoot commands or using the Linux commands. There is a third option, using JTAG but it takes hours to write an image. I would only ever use that method to recover the RedBoot on a bricked Livebox and then use RedBoot to flash the images.
Using the RedBoot commands requires that you have a copy of RedBoot installed on the Livebox that allows you to break into the boot process. The earlier versions would allow you to break into the boot process by typing Ctrl-C during the initial loading of RedBoot. Later versions removed this. Also, the latest versions used in the Livebox now run a checksum on the root filesystem and refuse to complete the boot if the checksum is wrong.
Unfortunately, none of the older versions understand the squashfs filesystem used by the latest firmwares. This makes things difficult but not impossible. If you have your own local PC that you can use as a TFTP server and have installed a JTAG connection on the Livebox, you can use JTAG or Linux comands to flash an old version of RedBoot to the Livebox which you can break into via the serial port with Ctrl-C, then flash the image you want and finally use TFTP to load the kernel to the Livebox for booting. This is the method that I currently use on my Livebox. The following assumes that the IP address of the TFTP Server is 10.7.58.114 (the default for Livebox RedBoot tftp).
To use the RedBoot commands you need to do the following,
load -r -v -h 10.7.58.114 -m tftp -b 0x80800000 file_to_flash
RedBoot 0xBE400000 0xBE400000 0x00030000 0x00000000
user_fs 0xBE430000 0xBE430000 0x00720000 0x80800000
jffs_system 0xBEB50000 0xBEB50000 0x000A0000 0x80800000
FIS directory 0xBEBF0000 0xBEBF0000 0x0000F000 0x00000000
RedBoot config 0xBEBFF000 0xBEBFF000 0x00001000 0x00000000
RedBoot 0xBE400000 0xBE400000 0x00030000 0x00000000
user_fs 0xBE430000 0xBE430000 0x00390000 0x80800000
user_2_fs 0xBE7C0000 0xBE7C0000 0x00390000 0x80800000
jffs_system 0xBEB50000 0xBEB50000 0x000A0000 0x80800000
FIS directory 0xBEBF0000 0xBEBF0000 0x0000F000 0x00000000
RedBoot config 0xBEBFF000 0xBEBFF000 0x00001000 0x00000000
fis create -b 0x80800000 -l 0x00390000 -f 0xBE7C0000 user_2_fs
load -r -v -h 10.7.58.114 -m tftp -b 0x80010000 Image
exec -c "boot_loader=RedBoot root=1F01 mem=16M" 0x80010000
On my system, I modified the boot_script to do the load and exec on every boot. This can be done by doing the following at the RedBoot prompt,
fconfig boot_script true
fconfig boot_script timeout 20
fconfig boot_script data
now enter the following two lines followed by a blank line.
load -r -v -h 10.7.58.114 -m tftp -b 0x80010000 Image
exec -c "boot_loader=RedBoot root=1F01 mem=16M" 0x80010000
The Livebox will now boot automatically via tftp every time it is reset.
Using the Linux commands requires you to have access to the command line on the Livebox. Unfortunately, unless you have already hacked the Livebox, I am not sure how you would get to a command prompt on the latest versions of firmware. This is something I need to investigate again. On versions of firmware that are less than v5.05.1-uk you can get to a command line by changing the Broadband Username to
;echo root::0:0:root:/root:/bin/sh >/etc/passwd
and clicking submit, then rebooting the Livebox. This removes the root password and so, when you login at the serial port with username
root and hit enter you get a command prompt. If you don't have a serial port cable, you can get access via telnet on firmware versions
less than v5.05.1-uk by following this.
If you can get to a command prompt, you can use the fcp command to write to the flash in the following manner.
/etc/init.d/ramdisk start 16
cd /mnt/ramdisk/rd1
wget http://url_to_get/to/filename
fcp -v imagename /dev/mtdX
0 for RedBoot
1 for CRAMFS image (user_fs)
2 for jffs_system (r/w /etc directory)
3 for FIS directory
4 for RedBoot config
0 for RedBoot
1 for SQSHFS image (user_fs)
2 for SQSHFS image (user_2_fs)
3 for jffs_system (r/w /etc directory)
4 for FIS directory
5 for RedBoot config
Please note that on the SQUASHFS filesystems, there is a check in /etc/init.d/normal_boot called flash_verify that checks to see if the checksum of the user_2_fs is correct or not (ie have you changed it). The version of RedBoot that comes with the later firmwares checks the user_fs for the same and refuses to boot if altered. This means that we cannot change any of the filesystems if we want to use the later RedBoot, or we need to use an old version of RedBoot and tftp to boot with modified filesystems.