1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Creating Customised Firmware for Foxsat HD - newbie question

Discussion in 'FOXSAT-HD Freesat Receiver' started by garynl, Jul 2, 2012.

  1. garynl

    garynl New Member

    I apologize in advance for this post being slightly off topic because it is about the Foxsat HD, but I am convinced that the people who can answer my question read this section of the forum and probably don't read the foxsat hd section.

    I am interested in learning how to create customised versions of firmware but I only have a foxsat-hd I can experiment with. When I feel more confident I might branch out onto a box with more capabilities (such as the foxsat hdr downstairs)
    I am making an assumption that the initial steps of setting up a dev env for these boxes would would be more or less the same (and very simiilar to the T2's)

    I very quickly discovered that not all the tools work reliably in Windows so I use an Ubuntu 12.04 virtual machine with humidify 1.0.2, mksquashfs and unsquashfs 4.2 (2011/02/28)

    My problem is I cant make an HDF file that works.

    Test 1 Create a working HDF with Humax provided raw file
    a) Extract .raw files for a standard firmware upgrade file supplied by humax
    b) For the HD, the raw file '2.hdfbin-1-300000.raw' appears to contain the root file system (discovered during play) so use this.
    c) Create a new HDF file containing just this raw file
    sudo ./humidify-linux-i386 -c FOXSAT-HD_upgrade.hdf 35f1.0000 2.hdfbin-1-300000.raw
    d) put it on a USB stick
    e) Upload to the hummy

    The firmware updates as expected, reboot box and everything is honky dory.
    Test passed.

    Test 2 Create HDF file with raw file I create
    a) unsquash the raw file used in test 1 (you have to be superuser)
    sudo ./unsquashfs 2.hdfbin-1-300000.raw

    This succcesfully creates a directory squashfs-root containing, at least what looks like to the non-expert eye , the important linux files.

    b) Create a new raw file from the *unchanged* files in squashfs-root directory
    sudo ./mksquashfs squashfs-root new.raw -all-root -noappend

    First sign of trouble: the new raw file is not the same size as the original one.

    c) rename the raw file to 2.hdfbin-1-300000.raw and create a new HDF file as in test 1

    sudo ./humidify-linux-i386 -c new.hdf 35f1.0000 2.hdfbin-1-300000.raw

    d) rename the HDF file FOXSAT-HD_upgrade.hdf and put it on a USB stick
    e) Upload to the hummy

    The firmware uploads successfully but when the box is rebooted it hangs.
    Test failed.
    (restore the box to working order by uploading the humax supplied firmware)

    Conclusion: I am not (un)squashing properly. Can anyone point out what I am doing wrong? Or is the '2' in the filename significant? Should it be '1' (just occurred to me as I write this - but it cant be because test 1 worked.)

    thanks
    (If someone can help me, I promise not to post off-topic again!)
     
  2. af123

    af123 Administrator Staff Member

    I think you need to use an older version of squashfs tools.
    I use 3.1-r2 - other versions caused various issues.

    Everything else looks reasonable.
     
  3. af123

    af123 Administrator Staff Member

    Run the file command on the old and new squashfs image:

    Code:
    # file tmp/2.hdfbin-3-000000.raw
    tmp/2.hdfbin-3-000000.raw: Squashfs filesystem, little endian, version 3.0, ...
    
    Is your new one version 3.0? Also check the endianess - I would expect the Foxsat image to be big-endian.
     
  4. garynl

    garynl New Member

    I'm making progress, but not there yet.

    The oldest version the squashfs tools I could quickly find was v3.3 so I tried that out.
    The endianness is/was definitely a probelem. The raw file from Humax is indeed big endian and the one I was creating was little endian.

    I added the -be option to mksquashfs (which isn't available in v4.x) and successfully created a big endian raw file.
    Checked the format with file:
    2.hdfbin-1-300000.raw: Squashfs filesystem, big endian, version 3.1 ...

    I infer from that fact that you asked about the version of the squash fs, that it is important so I am going to look for the 3.1-r2 version of the squash too,s
     
  5. af123

    af123 Administrator Staff Member

  6. garynl

    garynl New Member

    The raw file from the official firmware is version 3.0. Thanks for the sources.
     
  7. garynl

    garynl New Member

    That's cracked it!
    Version 3.1-r2 of the squashfs-tools are needed for the -be option which is missing from v4 of the tools (to create big endian files) and to be able to create a squashfs v3.0 filesystem.
    Maybe if I unsquashed all the raw files from the official firmware and resquashed them, a later version of the file system would work as well, but this is good enough for me.

    thanks ever so much af123

    now if only I could remember why I wanted to create customised firmware in the first place... ;)
     
  8. af123

    af123 Administrator Staff Member

    No problem.

    I'm not that familiar with the Foxsat firmware but one of the other .raw files will be a Linux kernel (the file command will tell you which). That kernel will have been compiled to support specific versions of SquashFS and you won't get it to support newer versions without recompiling it.

    Let us know what you do now you've got an in. I'm interested to see what can't be done with Raydon's version - just nosy really! : )
     
  9. garynl

    garynl New Member

    Updating the firmware with a raw file which has the same contents as the official isn't that exciting. To demonstrate that it really was being updated I set the envvar http_proxy. I live outside the uk and so the BBC iplayer doesn't work. Updated the firmware and strangely enough the ITV player now works but the BBC iplayer does not. I am guessing it may have something to do with the performance of the (free) proxy, the ITV player gives up with an error as well sometimes. It's not important, it shows the firmware has changed.

    Next step , I think is to get telnet up and running. Am I right in assuming that all the pre-compiled packages on hummypkg.org.uk are little endian binaries? I'll need to get my ubuntu image set up to compile stuff first.

    Once I can telnet to the box, I really need a memory map, because I know that there is very little room left in the rom. I'll try and mount a network drive to create a bit more room.

    There's probably not much else that can be done, but for me this is about hands on escapism after spending my working hours on high level concepts and budgets.
     
  10. af123

    af123 Administrator Staff Member