3 export PATH=/usr/bin:/bin:/usr/sbin:/sbin
6 FAKE_ROOT_RO=/system-ro
7 INFORM_PATH=/mnt/inform
9 REBOOT_PARAM_PATH=${INFORM_PATH}/reboot-param.bin
11 reboot_upgrade_val=upgr
12 reboot_recovery_val=rcvr
14 reboot_download_val=dwnl
16 STATUS_DIR=${FAKE_ROOT}/opt/data/recovery
17 STATUS_FILE=${STATUS_DIR}/RW.STATUS
18 DELTA_PATH_FILE=${STATUS_DIR}/DELTA.PATH
25 BLKID="/usr/sbin/blkid"
28 #------------------------------------------------
30 #------------------------------------------------
32 "$MOUNT" -t proc none /proc
33 "$MOUNT" -t sysfs none /sys
34 "$MOUNT" -t smackfs smackfs /smack
35 "$MOUNT" -t tmpfs tmpfs /run -o rw,nosuid,nodev,mode=755
36 "$MOUNT" -t tmpfs tmpfs /tmp -o mode=1777,smackfsroot=*
39 "$MOUNT" -t devpts devpts /dev/pts
42 #------------------------------------------------
44 #------------------------------------------------
46 PART_BOOT=$("$BLKID" -L "BOOT" -o device)
47 if [ "z$PART_BOOT" != "z" ]; then
48 "$MKDIR" -p ${BOOT_PATH}
49 "$MOUNT" -t vfat ${PART_BOOT} ${BOOT_PATH}
52 PART_INFORM=$("$BLKID" -L "inform" -o device)
53 if [ "z$PART_INFORM" != "z" ]; then
54 "$MKDIR" -p ${INFORM_PATH}
55 "$MOUNT" -t ext4 ${PART_INFORM} ${INFORM_PATH}
59 #------------------------------------------------
61 #------------------------------------------------
64 "$UMOUNT" "$INFORM_PATH"
65 "$UMOUNT" "$BOOT_PATH"
75 #------------------------------------------------
77 #------------------------------------------------
78 echo "You entered into /sbin/init on initrd"
88 if [ -f "$REBOOT_PARAM_PATH" ]; then
89 REBOOT_PARAM="$(cat $REBOOT_PARAM_PATH)"
90 if [ "$REBOOT_PARAM" = "$reboot_upgrade_val" ]; then
92 elif [ "$REBOOT_PARAM" = "$reboot_recovery_val" ]; then
94 elif [ "$REBOOT_PARAM" = "$reboot_download_val" ]; then
96 elif [ "$REBOOT_PARAM" = "$reboot_nodef_val" ]; then
97 echo "This reboot parameter is not supported..."
101 echo "BOOTMODE is ${BOOT_MODE}"
103 if [ -f /sbin/${BOOT_MODE}-init ]; then
104 exec "/sbin/${BOOT_MODE}-init"
106 echo "no ${BOOT_MODE}-init!!"