mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 02:48:18 +00:00
certificates: Enhance PKI enrollment on squashfs (SonicFi RAP6* series)
The updated flow: - Mount /dev/mtdblock* (the certificates partition) to /mnt - Copy its contents to /certificates - Unmount /mnt - Extract the PKI 2.0 certificates into /certificates Fixes: WIFI-14904 Signed-off-by: jackcybertan <jack.tsai@cybertan.com.tw>
This commit is contained in:
committed by
John Crispin
parent
acca9737e4
commit
d85dc2a819
@@ -58,6 +58,19 @@ udaya,a5-id2)
|
|||||||
[ -n "$mtd" ] && tar xf /dev/mtdblock$mtd -C /certificates
|
[ -n "$mtd" ] && tar xf /dev/mtdblock$mtd -C /certificates
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
sonicfi,rap6*)
|
||||||
|
mtd=$(find_mtd_index certificates)
|
||||||
|
if [ "$(head -c 4 /dev/mtd$mtd)" == "hsqs" ]; then
|
||||||
|
mount -t squashfs /dev/mtdblock$mtd /mnt
|
||||||
|
cp /mnt/* /certificates
|
||||||
|
umount /mnt
|
||||||
|
fi
|
||||||
|
part=$(tar_part_lookup "0:BOOTCONFIG" "0:BOOTCONFIG1")
|
||||||
|
if [ -n "$part" ]; then
|
||||||
|
mtd=$(find_mtd_index $part)
|
||||||
|
[ -n "$mtd" ] && tar xf /dev/mtdblock$mtd -C /certificates
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
mtd=$(find_mtd_index certificates)
|
mtd=$(find_mtd_index certificates)
|
||||||
|
|
||||||
|
|||||||
@@ -28,4 +28,16 @@ udaya,a5-id2)
|
|||||||
mtd=$(find_mtd_index $part)
|
mtd=$(find_mtd_index $part)
|
||||||
dd if=/tmp/certs.tar of=/dev/mtdblock$mtd
|
dd if=/tmp/certs.tar of=/dev/mtdblock$mtd
|
||||||
;;
|
;;
|
||||||
|
sonicfi,rap6*)
|
||||||
|
if [ "$(fw_printenv -n store_certs_disabled)" != "1" ]; then
|
||||||
|
cd /certificates
|
||||||
|
tar cf /tmp/certs.tar .
|
||||||
|
part=$(tar_part_lookup "0:BOOTCONFIG" "0:BOOTCONFIG1")
|
||||||
|
mtd=$(find_mtd_index $part)
|
||||||
|
block_size=$(cat /sys/class/mtd/mtd$mtd/size)
|
||||||
|
dd if=/tmp/certs.tar of=/tmp/certs_pad.tar bs=$block_size conv=sync
|
||||||
|
mtd write /tmp/certs_pad.tar /dev/mtd$mtd
|
||||||
|
rm -f /tmp/certs.tar /tmp/certs_pad.tar
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user