mirror of https://github.com/OpenIPC/firmware.git
commit
3b9eaf2f66
|
@ -652,7 +652,7 @@ xm550() {
|
||||||
# hi3516cv200 # testing..
|
# hi3516cv200 # testing..
|
||||||
# hi3518ev200 # testing..
|
# hi3518ev200 # testing..
|
||||||
# hi3518ev200_domsip # DomSip
|
# hi3518ev200_domsip # DomSip
|
||||||
hi3518ev200_hs303 # OpenIPC
|
# hi3518ev200_hs303 # OpenIPC
|
||||||
#
|
#
|
||||||
# hi3516av100 # OpenIPC
|
# hi3516av100 # OpenIPC
|
||||||
# hi3516av100_ultimate # OpenIPC_ultimate version
|
# hi3516av100_ultimate # OpenIPC_ultimate version
|
||||||
|
|
|
@ -5,8 +5,8 @@ on_exit()
|
||||||
mountpoint -q /proc && umount /proc
|
mountpoint -q /proc && umount /proc
|
||||||
exec /sbin/init $*
|
exec /sbin/init $*
|
||||||
}
|
}
|
||||||
trap on_exit 0
|
|
||||||
|
|
||||||
|
trap on_exit 0
|
||||||
|
|
||||||
mount -t proc proc /proc || exit
|
mount -t proc proc /proc || exit
|
||||||
grep -q overlay /proc/filesystems || exit
|
grep -q overlay /proc/filesystems || exit
|
||||||
|
@ -14,20 +14,30 @@ grep -q overlay /proc/filesystems || exit
|
||||||
if grep -q ubifs /proc/cmdline; then
|
if grep -q ubifs /proc/cmdline; then
|
||||||
mount -t ubifs ubi0:rootfs_data /overlay
|
mount -t ubifs ubi0:rootfs_data /overlay
|
||||||
else
|
else
|
||||||
mount -t jffs2 /dev/$(awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd | sed 's/mtd/mtdblock/') /overlay || \
|
mtdblkdev=`awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd | sed 's/mtd/mtdblock/'`
|
||||||
mount -t ubifs ubi0:rootfs_data /overlay || mount -t tmpfs tmpfs /overlay || exit
|
mtdchrdev=`grep 'rootfs_data' /proc/mtd | cut -d: -f1`
|
||||||
|
mount -t jffs2 /dev/${mtdblkdev} /overlay
|
||||||
|
|
||||||
|
if [ $? -ne 0 ] || { dmesg | grep "jffs2.*: Magic bitmask.*not found" > /dev/null 2>&1; } then
|
||||||
|
echo "jffs2 health check error, format required!"
|
||||||
|
flash_eraseall -j /dev/${mtdchrdev}
|
||||||
|
echo "Done! Remounting..."
|
||||||
|
mount -t jffs2 /dev/${mtdblkdev} /overlay || mount -t tmpfs tmpfs /overlay || exit
|
||||||
|
if ! cat /proc/mounts | grep ${mtdblkdev}; then
|
||||||
|
echo "--------------------------------"
|
||||||
|
echo "Crash - your flash in the trash!"
|
||||||
|
echo "--------------------------------"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q overlayfs /proc/filesystems; then
|
if grep -q overlayfs /proc/filesystems; then
|
||||||
mount -t overlayfs overlayfs -o lowerdir=/,upperdir=/overlay,ro /mnt \
|
mount -t overlayfs overlayfs -o lowerdir=/,upperdir=/overlay,ro /mnt || { umount /overlay; exit; }
|
||||||
|| { umount /overlay; exit; }
|
|
||||||
else
|
else
|
||||||
overlay_rootdir=/overlay/root
|
overlay_rootdir=/overlay/root
|
||||||
overlay_workdir=/overlay/work
|
overlay_workdir=/overlay/work
|
||||||
mkdir -p ${overlay_rootdir} ${overlay_workdir}
|
mkdir -p ${overlay_rootdir} ${overlay_workdir}
|
||||||
mount -t overlay overlay \
|
mount -t overlay overlay -o lowerdir=/,upperdir=${overlay_rootdir},workdir=${overlay_workdir} /mnt || { umount /overlay; exit; }
|
||||||
-o lowerdir=/,upperdir=${overlay_rootdir},workdir=${overlay_workdir} /mnt \
|
|
||||||
|| { umount /overlay; exit; }
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pivot_root /mnt /mnt/rom
|
pivot_root /mnt /mnt/rom
|
||||||
|
|
Loading…
Reference in New Issue