mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-17 09:21:35 +00:00
99 lines
3.4 KiB
Diff
99 lines
3.4 KiB
Diff
From bc6e353902d5fc17c3fcb194d43cb29ed2f6d6ec Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Sun, 23 May 2021 09:59:53 +0200
|
|
Subject: [PATCH] certificates: add ability to persistently store certificates
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
---
|
|
package/base-files/files/lib/upgrade/nand.sh | 9 +++++++++
|
|
.../files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi | 3 +--
|
|
.../linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi | 7 ++++++-
|
|
.../linux/realtek/dts/rtl8392_edgecore_ecs4100-12ph.dts | 8 ++++++--
|
|
4 files changed, 22 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
|
|
index ab3db4cdf2..36977244bc 100644
|
|
--- a/package/base-files/files/lib/upgrade/nand.sh
|
|
+++ b/package/base-files/files/lib/upgrade/nand.sh
|
|
@@ -157,6 +157,8 @@ nand_upgrade_prepare_ubi() {
|
|
local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )"
|
|
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
|
|
local data_ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
|
+ local cert_ubivol="$( nand_find_volume $ubidev certificates )"
|
|
+ local cert_mtd="$(find_mtd_index certificates)"
|
|
|
|
local ubiblk ubiblkvol
|
|
for ubiblk in /dev/ubiblock*_? ; do
|
|
@@ -196,6 +198,13 @@ nand_upgrade_prepare_ubi() {
|
|
fi
|
|
fi
|
|
|
|
+ if [ -z "$cert_ubivol" -a ! "$cert_mtd" ]; then
|
|
+ if ! ubimkvol /dev/$ubidev -N certificates -s 2MiB; then
|
|
+ echo "cannot create certificates volume"
|
|
+ return 1;
|
|
+ fi
|
|
+ fi
|
|
+
|
|
# create rootfs_data for non-ubifs rootfs
|
|
if [ "$rootfs_type" != "ubifs" ]; then
|
|
local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks)
|
|
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
|
|
index 8f971e505c..0f1f083a5b 100644
|
|
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
|
|
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
|
|
@@ -229,9 +229,8 @@
|
|
};
|
|
|
|
partition@b880000 {
|
|
- label = "syscfg";
|
|
+ label = "certificates";
|
|
reg = <0xb880000 0x4680000>;
|
|
- read-only;
|
|
};
|
|
};
|
|
};
|
|
diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi
|
|
index b6ce7b1f56..471be72001 100644
|
|
--- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi
|
|
+++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi
|
|
@@ -43,7 +43,12 @@
|
|
partition@50000 {
|
|
compatible = "tplink,firmware";
|
|
label = "firmware";
|
|
- reg = <0x50000 0x770000>;
|
|
+ reg = <0x50000 0x760000>;
|
|
+ };
|
|
+
|
|
+ partition@7b0000 {
|
|
+ label = "certificates";
|
|
+ reg = <0x7b0000 0x10000>;
|
|
};
|
|
|
|
partition@7c0000 {
|
|
diff --git a/target/linux/realtek/dts/rtl8392_edgecore_ecs4100-12ph.dts b/target/linux/realtek/dts/rtl8392_edgecore_ecs4100-12ph.dts
|
|
index 303b79ac83..7a228aea86 100644
|
|
--- a/target/linux/realtek/dts/rtl8392_edgecore_ecs4100-12ph.dts
|
|
+++ b/target/linux/realtek/dts/rtl8392_edgecore_ecs4100-12ph.dts
|
|
@@ -176,11 +176,15 @@
|
|
reg = <0x100000 0x100000>;
|
|
read-only;
|
|
};
|
|
- partition@b260000 {
|
|
+ partition@200000 {
|
|
label = "firmware";
|
|
- reg = <0x200000 0xe00000>;
|
|
+ reg = <0x200000 0xdf0000>;
|
|
compatible = "openwrt,uimage", "denx,uimage";
|
|
};
|
|
+ partition@ff0000 {
|
|
+ label = "certificates";
|
|
+ reg = <0xff0000 0x10000>;
|
|
+ };
|
|
};
|
|
};
|
|
};
|
|
--
|
|
2.25.1
|
|
|