Firmware Building
From Eminent Opensource
Contents |
Disclaimer
If you decide to work on your own firmware for the EM7075, Eminent Europe B.V. will not provide technical support for it. This kind of work is only for professionals who know what they are doing and (for example) have been working with linux and embbedded hardware for quite some time. Eminent-Europe does not take any responsibility if your firmware kills the device. We also reserve the right to seek out individuals that release improper functioning firmware which may damage our equipment. The base firmware remains property of Eminent Europe B.V. and these Wiki pages are only provided as a reference.
Firmware building for the EM7075
Building firmware for the EM7075 is a simple task. Some basic knowledge of Linux is required.
Just follow the steps below and you should be fine. Note that we don't provide any linux support. (We suggest to read the MAN pages that come with your distribution.)
Warning: Flashing your device with a bad firmware can result in a non-working device! Please do not attempt this unless you know what you are doing!
Not working per firmware 2.x since block size is changed to 16kb A patched cramfsck is in the works. Use rsync or something to extract by rs232 for now. Sorry.
Extracting from current firmwares
- Install your favourite Linux distro. We advise to use Ubuntu, both 8.10 or 9.04 should work.
- After you've installed your distro of choice, upgrade it with a tool of your choice.
- (For example using apt-get update, followed by apt-get upgrade.)
- When done, drop into a Linux shell. From Ubuntu, you can do this by clicking Applications-Accessories-Terminal
- Become root: type "sudo su" , press "enter" and then enter your password.
- Install cramfs programs, so you can manipulate the image.
- Use the modified version of Cramfsck 1.1 from here : http://downloads.eminent-online.com/cramfsck-1.1-static.tar.gz
- Copy cramfsck into /usr/sbin or wherever in your path.
- Create a script to extract the firmware to a directory, like the example below:
#!/bin/sh dd if=em7075.bin of=./em7075.romfs bs=32 skip=1 cramfsck -v -x /home/7075 ./em7075.romfs
- Save the script, and call 'dumprom.sh' for example. Change mode to executable: chmod +x ./dumprom.sh
- Download the EM7075 firmware, and put both the 'em7075.bin' and 'dumprom.sh' in the same folder
- Run dumprom.sh and you will end up with the extracted contents in /home/em7075
- Notes
- You can now edit the contents of /home/em7075 as you wish. Note that if the extraction directory exists, errors may occur when running cramfsck. Remove the existing /home/em7075 before extracting and all should be fine.
Update per 24-11: Standard cramfsck 1.1 does not work with the new 16384 block size. Updated version is here : http://downloads.eminent-online.com/cramfsck-1.1-static.tar.gz
How to create your own TAR file of the full filesystem
If you mount the firmware inside a temporary directory on your EM7075 it will always be 100% correctly readable. You could TAR it up and and then work on it on a PC. Don't copy the filesystem to a usb stick, you need TAR to preserve any symlinks!!
/ # cd /tmp /tmp # mkdir mount /tmp # cd /tmp/media/usb/USB1/D2E9-8C28/ /tmp/media/usb/USB1/D2E9-8C28 # wget http://www.eminent-online.com/firmware/EM7075/em7075.bin /tmp/media/usb/USB1/D2E9-8C28 # dd if=em7075.bin of=./em7075.romfs bs=32 skip=1 /tmp/media/usb/USB1/D2E9-8C28 # ls -al em70* -rwxr-xr-x 1 root root 24297504 Jan 1 00:03 em7075.bin -rwxr-xr-x 1 root root 24297472 Jan 1 00:04 em7075.romfs /tmp/media/usb/USB1/D2E9-8C28 # mount -o loop ./em7075.romfs /tmp/mount NTFS signature is missing. Failed to mount '/dev/loop0': Invalid argument The device '/dev/loop0' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? /tmp/media/usb/USB1/D2E9-8C28 # ls /tmp/mount bin etc md5sum.txt proc tmp conf home mnt sbin usr conf_src init opt sys var dev lib osd sysconfig /tmp/media/usb/USB1/D2E9-8C28 # wget http://www.eminent-online.com/firmware/EM7075/tar /tmp/media/usb/USB1/D2E9-8C28 # ./tar -cvf ./em7075-tarred.tar /tmp/mount/* /tmp/media/usb/USB1/D2E9-8C28 # sync
Now you have a tar file in the root of your usb stick, and can take it out, and work with it.
Rebuilding a changed firmware
- Create a script like below, to re-compress the image back, and add the md5 header to it.
#!/bin/sh mkcramfs -b 16384 -q /home/7075/ ./output/em7075.img # 16kb block size per 2.x firmware! md5sum ./output/em7075.img> ./output/em7075.sum dd if=./output/em7075.sum of=./output/em7075.bin bs=32 count=1 cat ./output/em7075.img >> ./output/em7075.bin rm ./output/em7075.img ./output/em7075.sum
- Save the script and call it 'makefs.sh'. Change mode to executable: chmod +x ./dumprom.sh
- Go into /home/em7075 and edit md5sum.txt:
- Remove the line with sysconfig on it.
- Remove the line with any other changed files on it.
- Alternatively you can update this file with correct md5sums, but for minor changes this is not needed.
- Save the changed md5sum file.
- Edit the /home/em7075/sysconfig file version number in /home/em7075/sysconfig
- Increase SYSCONF_BUILD_DATE so that it is different from the version in your EM7075.
- Don't touch other options for now.
- Save the file.
- You are now ready to rebuild. Go to the folder where you saved 'makefs.sh' and run it.
- You should end up with a new file called em7075.bin in the subfolder output.
- Increase version number in the file em7075.ver, and put both the bin and ver files onto usb stick.
- Your EM7075 will detect the new firmware if you place the stick into the USB port.
- Follow the steps on screen to flash it.
- All done!
