summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2016-09-04 03:11:45 +0200
committerDaniel Golle <daniel@makrotopia.org>2016-09-04 04:58:36 +0200
commitc773a2c46e043b8426a023d355aa74b538f4a9b4 (patch)
tree085a94c4546af8210f93a2911b823c439e62501f /target
parentfe89f9011904c80191b167619f8dc5778d714411 (diff)
downloadmtk-20170518-c773a2c46e043b8426a023d355aa74b538f4a9b4.zip
mtk-20170518-c773a2c46e043b8426a023d355aa74b538f4a9b4.tar.gz
mtk-20170518-c773a2c46e043b8426a023d355aa74b538f4a9b4.tar.bz2
oxnas: kd20: generate image compatible with stock firmware
* adjust MTD partitions to match vendor's scheme * generate *factory.tar.gz image compatible with stock web-if firmware upgrade interface Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target')
-rw-r--r--target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts26
-rw-r--r--target/linux/oxnas/image/Makefile27
2 files changed, 47 insertions, 6 deletions
diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
index 217d812..b5c79de 100644
--- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
+++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
@@ -13,7 +13,7 @@
model = "Shuttle KD20";
chosen {
- bootargs = "console=ttyS0,115200n8 earlyprintk=serial";
+ bootargs = "console=ttyS0,115200n8 earlyprintk=serial mem=256M";
};
pcie-controller@47C00000 {
@@ -33,14 +33,30 @@
status = "okay";
partition@0 {
- label = "boot";
- reg = <0x00000000 0x00e00000>;
- /*read-only;*/
+ label = "stage1";
+ reg = <0x00000000 0x00040000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "u-boot";
+ reg = <0x00040000 0x00200000>;
+ read-only;
+ };
+
+ partition@240000 {
+ label = "initrd";
+ reg = <0x00240000 0x00600000>;
+ };
+
+ partition@840000 {
+ label = "kernel";
+ reg = <0x00840000 0x007C0000>;
};
partition@e00000 {
label = "ubi";
- reg = <0x00e00000 0x07200000>;
+ reg = <0x01000000 0x07000000>;
};
};
diff --git a/target/linux/oxnas/image/Makefile b/target/linux/oxnas/image/Makefile
index 097d894..a9fb139 100644
--- a/target/linux/oxnas/image/Makefile
+++ b/target/linux/oxnas/image/Makefile
@@ -48,11 +48,36 @@ define Device/akitio
endef
TARGET_DEVICES += akitio
+define Build/omninas-factory
+ rm -rf $@.tmp $@.dummy $@.dummy.gz
+ mkdir -p $@.tmp
+ $(CP) $@ $@.tmp/uImage
+ dd if=/dev/zero bs=64k count=4 of=$@.dummy
+ gzip $@.dummy
+ mkimage -A arm -T ramdisk -C gzip -n "dummy" \
+ -d $@.dummy.gz \
+ $@.tmp/rdimg.gz
+ echo 2.35.20140102 > $@.tmp/version ; echo >> $@.tmp/version
+ chmod 0744 $@.tmp/*
+ $(TAR) -C $@.tmp -czvf $@ .
+endef
+
+define Build/encrypt-3des
+ openssl enc -des3 -a -k $(1) -in $@ -out $@.new && mv $@.new $@
+endef
+
define Device/kd20
- DTS := kd20
+ DEVICE_DTS := ox820-kd20
DEVICE_TITLE := Shuttle KD20
+ KERNEL := kernel-bin | append-dtb | uImage none
+ KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory
+ KERNEL_INITRAMFS_SUFFIX := .tar.gz
+ KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | encrypt-3des sohmuntitnlaes
+ KERNEL_IMAGE := zImage
DEVICE_PACKAGES := kmod-usb3 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper \
kmod-hwmon-core kmod-hwmon-gpiofan
+ KERNEL_IN_UBI :=
+ UBOOTENV_IN_UBI :=
endef
TARGET_DEVICES += kd20