mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 02:48:18 +00:00
certificates: improve the code loading sqsh certificates
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -7,12 +7,15 @@ boot() {
|
|||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
mkdir -p /certificates /etc/ucentral/
|
mkdir -p /certificates /etc/ucentral/
|
||||||
local mtd=$(find_mtd_index certificates)
|
local mtd=$(find_mtd_index certificates)
|
||||||
[ -n "$mtd" -a -f /sys/class/mtd/mtd$mtd/oobsize ] && ubiattach -p /dev/mtd$mtd
|
|
||||||
if [ -n "$(ubinfo -a | grep certificates)" ]; then
|
if [ "$(head -c 4 /dev/mtd$mtd)" == "hsqs" ]; then
|
||||||
[ -e /dev/ubi0 ] && mount -t ubifs ubi0:certificates /certificates
|
|
||||||
[ -e /dev/ubi1 ] && mount -t ubifs ubi1:certificates /certificates
|
|
||||||
else
|
|
||||||
mount -t squashfs /dev/mtdblock$mtd /certificates
|
mount -t squashfs /dev/mtdblock$mtd /certificates
|
||||||
|
else
|
||||||
|
[ -n "$mtd" -a -f /sys/class/mtd/mtd$mtd/oobsize ] && ubiattach -p /dev/mtd$mtd
|
||||||
|
if [ -n "$(ubinfo -a | grep certificates)" ]; then
|
||||||
|
[ -e /dev/ubi0 ] && mount -t ubifs ubi0:certificates /certificates
|
||||||
|
[ -e /dev/ubi1 ] && mount -t ubifs ubi1:certificates /certificates
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
[ -f /certificates/dev-id ] && {
|
[ -f /certificates/dev-id ] && {
|
||||||
cp /certificates/*.pem /etc/ucentral/
|
cp /certificates/*.pem /etc/ucentral/
|
||||||
|
|||||||
Reference in New Issue
Block a user