aboutsummaryrefslogtreecommitdiffstats
path: root/usr/d710_initramfs_files/init
blob: 70353613053193e8e08b27f4b040390af4b982ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/stage1/busybox sh
export _PATH="$PATH"
export PATH=/stage1
BOOT_IMAGE=/dev/block/mmcblk0p5

busybox cd /
busybox date >>boot.txt
exec >>boot.txt 2>&1
busybox rm init
busybox mount -t proc proc /proc
busybox mount -t sysfs sysfs /sys

eval $(read_boot_headers ${BOOT_IMAGE})

load_offset=$boot_offset
load_len=$boot_len

if busybox grep -q bootmode=2 /proc/cmdline ; then
	# recovery boot
	load_offset=$recovery_offset
	load_len=$recovery_len
fi

busybox dd bs=512 if=${BOOT_IMAGE} skip=$load_offset count=$load_len | busybox zcat | busybox cpio -i

busybox umount /sys
busybox umount /proc
busybox date >>boot.txt
busybox rm -fr /stage1 /dev/*
export PATH="${_PATH}"
exec /init