From 6f27e125889a6cb8b7642dd6a8913e0d7ca50188 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 22 Dec 2012 19:11:03 +0800 Subject: [PATCH] sysmobts-firmware: Install both 3.0.1pre and 3.1 and add symlinks The latest release currently does not support the RevC hardware. Install both 3.0.1pre and 3.1 (luckily ubifs compresses them) and set a symlink. Use the EEPROM size as an indicator if we are on revD or revC hardware and then set the symlink. It has been tested for revC and needs to be tested on revD hardware. --- .../firmware/sysmobts-firmware_3.0.1pre.bb | 14 ------ .../firmware/sysmobts-firmware_3.1.bb | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 14 deletions(-) delete mode 100644 recipes-sysmobts/firmware/sysmobts-firmware_3.0.1pre.bb create mode 100644 recipes-sysmobts/firmware/sysmobts-firmware_3.1.bb diff --git a/recipes-sysmobts/firmware/sysmobts-firmware_3.0.1pre.bb b/recipes-sysmobts/firmware/sysmobts-firmware_3.0.1pre.bb deleted file mode 100644 index 7180024..0000000 --- a/recipes-sysmobts/firmware/sysmobts-firmware_3.0.1pre.bb +++ /dev/null @@ -1,14 +0,0 @@ -COMPATIBLE_MACHINE = "sysmobts-v2" -FIRMWARE-VERSION = "superfemto_v${PV}" -PR = "r2.${INC_PR}" - -require ${PN}.inc - -do_install() { - install -d ${D}/lib/firmware/ - - install -m 0666 ${S}/Image/Dsp/superfemto.out ${D}/lib/firmware/sysmobts-v2.out - install -m 0666 ${S}/Image/Fpga/superfemto.bit ${D}/lib/firmware/sysmobts-v2.bit -} - -FILES_${PN} = "/lib/firmware/sysmobts-v2*" diff --git a/recipes-sysmobts/firmware/sysmobts-firmware_3.1.bb b/recipes-sysmobts/firmware/sysmobts-firmware_3.1.bb new file mode 100644 index 0000000..7afe5f4 --- /dev/null +++ b/recipes-sysmobts/firmware/sysmobts-firmware_3.1.bb @@ -0,0 +1,48 @@ +COMPATIBLE_MACHINE = "sysmobts-v2" +FIRMWARE-VERSION = "superfemto_v${PV}" +PR = "r6.${INC_PR}" + +require ${PN}.inc + +S2 = "${WORKDIR}/sysmobts-firmware-superfemto_v3.0.1pre" + +# Currently there is no common Firmware for RevC and RevD Hardware and we +# need to handle this differently for now. + +SRC_URI = "file://sysmobts-firmware-${FIRMWARE-VERSION}.tar.bz2 \ + file://sysmobts-firmware-superfemto_v3.0.1pre.tar.bz2" + + +do_install() { + install -d ${D}/lib/firmware/ + + # Install the firmware for revD + install -m 0666 ${S}/Image/Dsp/superfemto.out ${D}/lib/firmware/sysmobts-v2-revd.out + install -m 0666 ${S}/Image/Fpga/superfemto.bit ${D}/lib/firmware/sysmobts-v2-revd.bit + + # Install the firmware for revC + install -m 0666 ${S2}/Image/Dsp/superfemto.out ${D}/lib/firmware/sysmobts-v2-revc.out + install -m 0666 ${S2}/Image/Fpga/superfemto.bit ${D}/lib/firmware/sysmobts-v2-revc.bit +} + +# Change a symlink depending on revC or revD. We are using the EEPROM size +# as an indicator for revC and revD +pkg_postinst_${PN} () { +# Building the rootfs? +if [ "x$D" != "x" ]; then + exit 1 +fi + +EEPROM_SIZE=`stat -c '%s' /sys/bus/i2c/devices/1-0050/eeprom` +if [ $EEPROM_SIZE -eq 256 ]; then + cd /lib/firmware + ln -fs sysmobts-v2-revc.out sysmobts-v2.out + ln -fs sysmobts-v2-revc.bit sysmobts-v2.bit +else + cd /lib/firmware + ln -fs sysmobts-v2-revd.out sysmobts-v2.out + ln -fs sysmobts-v2-revd.bit sysmobts-v2.bit +fi +} + +FILES_${PN} = "/lib/firmware/sysmobts-v2*"