forked from jt1134/fascinate_initramfs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit
executable file
·41 lines (29 loc) · 882 Bytes
/
init
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
32
33
34
35
36
37
38
39
40
#!/stage1/sh
export _PATH="$PATH"
export PATH="/stage1"
cd /
mkdir -p /dev/block
mkdir -p /mnt/.lfs
mkdir -p /proc
mkdir -p /sys
mknod -m 0644 /dev/block/bml6 b 137 6
mknod -m 0644 /dev/block/stl6 b 138 6
mknod -m 0644 /dev/mem c 1 1
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
mount -t proc proc /proc
mount -t sysfs sysfs /sys
// bootloader parameter
insmod /lib/modules/j4fs.ko
// mount bml6 which is used by bootloader to set the bootloader param setting
mount -t j4fs /dev/block/stl6 /mnt/.lfs
insmod /lib/modules/param.ko
// set our own init setting to boot which is using devmem
REC_BOOT_ADDR="0x57fff800"
REC_BOOT_MAGIC="0x5EC0B007" # Must be in caps.
devmem "$REC_BOOT_ADDR" 32 "$REC_BOOT_MAGIC"
umount /sys
umount /proc
// reset parameter which is in the bootloader.
// which call the bootloader param.lfs to reset the parameter setting
reboot