From 8cde214b955a05daad0da35ffaeab2cf194486ad Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 1 Nov 2015 15:53:58 +0100 Subject: [PATCH] rauc: support OWHW --- .../images/image-rauc-rescue-initramfs.bb | 1 + recipes-core/images/image-rauc-ubi.bb | 4 ++ .../gsmk-owhw/hardcode-layout-values.patch | 41 +++++++++++++++++++ .../rauc/files/gsmk-owhw/system.conf | 27 ++++++++++++ recipes-extra/rauc/rauc.bb | 3 +- 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 recipes-extra/barebox-state/barebox-state/gsmk-owhw/hardcode-layout-values.patch create mode 100644 recipes-extra/rauc/files/gsmk-owhw/system.conf diff --git a/recipes-core/images/image-rauc-rescue-initramfs.bb b/recipes-core/images/image-rauc-rescue-initramfs.bb index c4a5eac..e78adc7 100644 --- a/recipes-core/images/image-rauc-rescue-initramfs.bb +++ b/recipes-core/images/image-rauc-rescue-initramfs.bb @@ -17,6 +17,7 @@ IMAGE_FSTYPES = "cpio.xz" BAD_RECOMMENDATIONS_append = " busybox-syslog kbd kbd-consolefonts kbd-keymaps" BAD_RECOMMENDATIONS_append_sysmobts-v2 = " e2fsprogs-e2fsck" BAD_RECOMMENDATIONS_append_sysmocom-odu = " e2fsprogs-e2fsck" +BAD_RECOMMENDATIONS_append_gsmk-owhw = " e2fsprogs-e2fsck" inherit core-image require recipes-apps/images/image-manifest.inc diff --git a/recipes-core/images/image-rauc-ubi.bb b/recipes-core/images/image-rauc-ubi.bb index ab49545..2cd4942 100644 --- a/recipes-core/images/image-rauc-ubi.bb +++ b/recipes-core/images/image-rauc-ubi.bb @@ -33,6 +33,10 @@ do_fetch() { cp "${DEPLOY_DIR_IMAGE}/image-rauc-rescue-initramfs-${MACHINE}.cpio.xz" "${S}/fs/initramfs" } +do_fetch_append_gsmk-owhw() { + cp "${DEPLOY_DIR_IMAGE}/uImage-am335x-gsmk-owhw.dtb" "${S}/fs/devicetree" +} + IMAGE_ROOTFS = "${S}/fs" IMAGE_NAME = "${PN}-${MACHINE}-${DATETIME}" # Don't include the DATETIME variable in the sstate package sigantures diff --git a/recipes-extra/barebox-state/barebox-state/gsmk-owhw/hardcode-layout-values.patch b/recipes-extra/barebox-state/barebox-state/gsmk-owhw/hardcode-layout-values.patch new file mode 100644 index 0000000..5bb0b61 --- /dev/null +++ b/recipes-extra/barebox-state/barebox-state/gsmk-owhw/hardcode-layout-values.patch @@ -0,0 +1,41 @@ +From 4cc63588211df7bf328e55820cfe19b56ea776b6 Mon Sep 17 00:00:00 2001 +From: Jan Luebbe +Date: Sat, 30 May 2015 20:00:10 +0200 +Subject: [PATCH 3/3] hardcode symocom-odu values + +Signed-off-by: Jan Luebbe +--- + src/barebox-state.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/barebox-state.c b/src/barebox-state.c +index f56275f..002ee5c 100644 +--- a/src/barebox-state.c ++++ b/src/barebox-state.c +@@ -1738,6 +1738,7 @@ static struct state *state_get(const char *name) + return ERR_CAST(state); + } + ++#if 0 + partition_node = of_parse_phandle(node, "backend", 0); + if (!partition_node) { + fprintf(stderr, "cannot find backend node in %s\n", node->full_name); +@@ -1750,9 +1751,14 @@ static struct state *state_get(const char *name) + return ERR_PTR(ret); + } + ++#endif ++ devpath = "/sys/bus/i2c/devices/1-0050/eeprom"; ++ offset = 0xc0; ++ size = 0x40; ++ + of_property_read_string(node, "backend-type", &backend_type); + if (!strcmp(backend_type, "raw")) +- ret = state_backend_raw_file(state, partition_node->full_name, devpath, offset, size); ++ ret = state_backend_raw_file(state, "/i2c/eeprom@50/partition@0", devpath, offset, size); + else + fprintf(stderr, "invalid backend type: %s\n", backend_type); + +-- +2.1.4 + diff --git a/recipes-extra/rauc/files/gsmk-owhw/system.conf b/recipes-extra/rauc/files/gsmk-owhw/system.conf new file mode 100644 index 0000000..c716db3 --- /dev/null +++ b/recipes-extra/rauc/files/gsmk-owhw/system.conf @@ -0,0 +1,27 @@ +[system] +compatible=gsmk-owhw +bootloader=barebox +mountprefix=/mnt/rauc + +[keyring] +path=ca.pem + +[slot.rescue.0] +device=/dev/ubi0_rescue +type=ubifs +bootname=rescue +readonly=true + +[slot.rootfs.0] +device=/dev/ubi0_system0 +type=ubifs +bootname=system0 + +[slot.rootfs.1] +device=/dev/ubi0_system1 +type=ubifs +bootname=system1 + +[slot.data.0] +device=/dev/ubi0_data +type=ubifs diff --git a/recipes-extra/rauc/rauc.bb b/recipes-extra/rauc/rauc.bb index 9f607a7..f96da09 100644 --- a/recipes-extra/rauc/rauc.bb +++ b/recipes-extra/rauc/rauc.bb @@ -1,7 +1,7 @@ DESCRIPTION = "rauc update controller" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" -PR = "r0" +PR = "r1" SRC_URI = "git://github.com/jluebbe/rauc.git;protocol=https \ file://dev-ca.pem \ @@ -20,6 +20,7 @@ DEPENDS = "curl openssl glib-2.0" # rauc is invoking these depending the machine RDEPENDS_${PN}_append_sysmobts-v2 = " barebox-state" RDEPENDS_${PN}_append_sysmocom-odu = " barebox-state" +RDEPENDS_${PN}_append_gsmk-owhw = " barebox-state" RDEPENDS_${PN}_append_sysmocom-bsc = " grub" FILES_${PN} += "/mnt/rauc"