-
Notifications
You must be signed in to change notification settings - Fork 6
/
init.protect.rc
executable file
·41 lines (32 loc) · 1.45 KB
/
init.protect.rc
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
41
#init.protect.rc
on early-init
#create mount point for protect partition
mkdir /protect_f 0771 system system
mkdir /protect_s 0771 system system
# mount protected partitions
on fs_property:ro.mount.fs=EXT4
write /proc/bootprof "INIT:PROTECT:Mount_START"
exec /sbin/e2fsck -pfD /emmc@protect_f
exec /sbin/tune2fs -O has_journal /emmc@protect_f
mount ext4 /emmc@protect_f /protect_f noatime nosuid nodev wait commit=1,nodelalloc,noauto_da_alloc
exec /sbin/e2fsck -pfD /emmc@protect_s
exec /sbin/tune2fs -O has_journal /emmc@protect_s
mount ext4 /emmc@protect_s /protect_s noatime nosuid nodev wait commit=1,nodelalloc,noauto_da_alloc
write /proc/bootprof "INIT:PROTECT:Mount_END"
on fs_property:ro.mount.fs=UBIFS
write /proc/bootprof "INIT:PROTECT:Mount_START"
mount yaffs2 mtd@protect_f /protect_f nosuid nodev
mount yaffs2 mtd@protect_s /protect_s nosuid nodev
write /proc/bootprof "INIT:PROTECT:Mount_END"
on fs_property:ro.mount.fs=YAFFS
write /proc/bootprof "INIT:PROTECT:Mount_START"
mount yaffs2 mtd@protect_f /protect_f nosuid nodev
mount yaffs2 mtd@protect_s /protect_s nosuid nodev
write /proc/bootprof "INIT:PROTECT:Mount_END"
#end of mount protected partitions
on post-fs-data
# We chown/chmod /protect_f and /protect_s again so because mount is run as root + defaults
chown system system /protect_f
chmod 0771 /protect_f
chown system system /protect_s
chmod 0771 /protect_s