blob: 248b5acb2ab0936a16fdecd96d82c1220f8d0cec [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2#This is the first script called by init process
3
4find_mtd_index() {
5 local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
6 local INDEX="${PART##mtd}"
7
8 echo ${INDEX}
9}
10
11
12/bin/mount -a
13mount -t tmpfs tmpfs /tmp
14echo /sbin/mdev > /proc/sys/kernel/hotplug
15mdev -s
16
17if [ -e /dev/dm-0 ]; then
18 blkdev=/dev/dm-0
19else
20 mtdpart_idx="$(find_mtd_index rootfs)"
21 blkdev=/dev/mtdblock${mtdpart_idx}
22fi
23
24echo "==> mount squashfs from $blkdev to /mnt"
25mount -t squashfs -o ro $blkdev /mnt
26