Wiz Firmware Tools
From OpenWiz
Hopefully PRL/Peter can ellaborate more on the firmware tools here, but I just thought I would document what modifications were made to the current 08May2008_ver_01.05.235 firmware to enable the telnet, recording fixer etc, all via the USB port (firmware not provided here as it is a Beyonwiz binary file). The modified/new files are here: http://tonyspage.abock.de/beyonwiz/everythingexceptfw.zip
Essentially to build the wrp binary, the firmware is unpacked with the wizfwtools like so:
unpack_wrp.pl DPS1_Firmware_08May2008_ver_01.05.235.wrp 235s1flash 235s1root
which expands the rootfs into the 235s1root directory. I advise doing this only in linux as it needs an OS which is case sensitive and also an editor which supports saving files in unix mode. It can be done in windows (Peter has kindly coded the unpack/pack to accomodate case changes, but it makes the directory structure a bit more difficult to understand what is really happening) but that won't be described here.
The rc.sysinit file in the 235s1root/etc directory contains the whole startup process for the Wiz, and the only modification required to this file was to copy the newly built rc.local into /tmp/config/ when the rc.sysinit script runs. You can see this in the attached above, look for rc.local. NOTE: the DPP1 rc.sysinit file has a very tiny difference, WizDVP (the main Beyonwiz application) is called with "./wizdvp -tgd -dpp1 -dump-from-romfs &" rather than "./wizdvp -tgd -dump-from-romfs &". So don't copy the rc.sysinit file in the zip above over your DPP1 file, it is best to make the edits to your own file (as it may change with future f/w upgrades too!)
Then put the rc.localcopy into the 235s1root/etc directory, and pack the whole thing back up like so:
pack_wrp.pl -s_tweaked235S1 DPS1_FirmwareTweaked01.05.235.wrp 235s1flash 235s1root
This will tell you how many bytes free are in the filesystem and wrp image also, take heed of the information it gives you, if it doesn't look right, try again (the wizfwtools compression can use one of a number of methods including perl itself, so look at these options if you are finding strange results).
Once you have upgraded with the new firmware, the next time it reboots after the upgrade, the rc.local script is loaded and attempts to mount FAT or NTFS drives on either USB stick and look for the directory /etc/init.d on the stick. If it finds this, it will load all files in this directory. This enables you to put multiple "tweaks" as I have called them onto the stick, and have the flexibility of simply removing the stick to stop the tweaks in future, or remove the stick and add new tweaks quite simply. I guess if you have the nouse to do the above, you can simply do all the tweaks from telnet, but this is about making a system flexible enough for anyone to do.
So the main reason I developed this is the current 235 series of f/w has a bug where sometimes the stat filename gets corrupted in a recording directory, and this makes the file unplayable (the fileplayer indicates "Error Loading Media File"). We have found copying any file across as the "stat" file will repair the recording, and have found the stat file contents seem to be irrelevant for file playback, and is a very simple fix with telnet. I knew this would be a simple fix to script in a shell command, so this is where the idea of loading shell scripts from USB came in (thanks PeterU). So the attached S02recfixer "tweak" will simply scan the recordings directory for a good stat file, and then scan every directory looking for a missing stat file, and copy across, thus repairing any "Error Loading Media File" issue when you next boot up the wiz with the USB stick connected.
Oh, if you already have an rc.local from another mod, this will not interfere with an already existing rc.local, so either delete it, or edit it to be like the attached one.
The rc.local in /tmp/config survives firmware upgrades also, as this is the config area that stores things like channel details, timer info etc. If you need (and or want) to completely remove all evidence of the rc.local caller (for, say, bug reporting strange f/w behaviour), upgrade to standard firmware, put the USB stick in with the tweaks on it, one of which enables telnet, and then delete the rc.local with "rm /tmp/config/rc.local". On next reboot with the remote control or front panel, the file will be wiped completely out of storage.
I can also provide a "tweak" to do this automotically for you quite simply (it is funny actually, rc.local loads the tweak which kills rc.local :-))
Also, alreay Rod Whitby has come up with a few good ideas for the USB loader to check the /proc directory for any installed media, and try mounting all the ones found (so would support the CF and SD slots etc), once the initial framework is in place to load files from USB with the mods described here, than a "tweak" put into the /etc/init.d directory can expand and improve the current rc.local.
Hope this helps a few of you! Cheers, Tony.

