diff --git a/feeds/tip/certificates/files/usr/bin/mount_certs b/feeds/tip/certificates/files/usr/bin/mount_certs index 596df19ec..5472d19bc 100755 --- a/feeds/tip/certificates/files/usr/bin/mount_certs +++ b/feeds/tip/certificates/files/usr/bin/mount_certs @@ -26,16 +26,20 @@ cig,wf672) mmc_dev=$(echo $(find_mmc_part "cert") | sed 's/^.\{5\}//') [ -n "$mmc_dev" ] && mount -t ext4 /dev/$mmc_dev /certificates ;; -sonicfi,rap7110c-341x) - mmc_dev=$(echo $(find_mmc_part "certificates") | sed 's/^.\{5\}//') - [ -n "$mmc_dev" ] && mount -t squashfs /dev/$mmc_dev /mnt - bootconfig=$(bootconfig_lookup) - if [ -n "$bootconfig" ]; then - mmc_dev=$(echo $(find_mmc_part "$bootconfig") | sed 's/^.\{5\}//') - [ -n "$mmc_dev" ] && tar xf /dev/$mmc_dev -C /certificates +sonicfi,rap7*) + if [ "$(board_name)" = "sonicfi,rap7110c-341x" ]; then + mmc_dev=$(echo $(find_mmc_part "certificates") | sed 's/^.\{5\}//') + [ -n "$mmc_dev" ] && mount -t ext4 /dev/$mmc_dev /certificates else - cp /mnt/* /certificates/ - umount /mnt + mtd=$(find_mtd_index certificates) + [ -n "$mtd" ] && mount -t ext4 /dev/mtdblock$mtd /certificates + fi + if [ ! -f /certificates/cert.pem ] || [ ! -f /certificates/key.pem ]; then + bootconfig=$(bootconfig_lookup) + if [ -n "$bootconfig" ]; then + mmc_dev=$(echo $(find_mmc_part "$bootconfig") | sed 's/^.\{5\}//') + [ -n "$mmc_dev" ] && tar xf /dev/$mmc_dev -C /certificates + fi fi ;; *)