• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1do_mounts()
2{
3	mount --bind /proc debian/proc/ > /dev/null
4
5	mount --bind /dev debian/dev/ > /dev/null
6	mount --bind /dev/pts debian/dev/pts > /dev/null
7
8	mount --bind /sys debian/sys/ > /dev/null
9	mount --bind /sys/fs/bpf/ debian/sys/fs/bpf/ > /dev/null
10	mount --bind /sys/kernel/debug/ debian/sys/kernel/debug/ > /dev/null
11	mount --bind /sys/kernel/debug/tracing/ debian/sys/kernel/debug/tracing/
12
13	# Fix up weirdness with debugfs permission changing because of
14	# above mounts.
15	chmod 0777       /sys/kernel/debug > /dev/null
16	chmod 0777 debian/sys/kernel/debug > /dev/null
17	chmod 0777       /sys/kernel/debug/tracing > /dev/null
18	chmod 0777 debian/sys/kernel/debug/tracing > /dev/null
19
20	# Mount Android partitions
21	if [ -d /d/ ]; then
22		if [ ! -d debian/d ]; then ln -s /sys/kernel/debug debian/d; fi
23	fi
24
25	if [ -d /data/ ]; then
26		mkdir -p debian/data/
27		mount --bind /data debian/data/
28	fi
29
30	if [ -d /system/ ]; then
31		mkdir -p debian/system/
32		mount --bind /system debian/system/
33	fi
34
35	if [ -d /vendor/ ]; then
36		mkdir -p debian/vendor/
37		mount --bind /vendor debian/vendor/
38	fi
39}
40
41mount | grep debian > /dev/null
42if [ $? -ne 0 ]; then do_mounts; fi
43