-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathinit
More file actions
50 lines (38 loc) · 1005 Bytes
/
init
File metadata and controls
50 lines (38 loc) · 1005 Bytes
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
42
43
44
45
46
47
48
49
50
#!/bin/sh
/bin/mkdir -p /dev/
/bin/mount -t devtmpfs devtmpfs /dev
/bin/echo "Aether-OS init script is running..."
/bin/mkdir -p /mnt/
root_mounted=0
for path in /dev/*; do
if [[ $path == *"part"* ]]; then
/bin/echo "Trying mount $path as root"
/bin/mount -t ext $path /mnt/
if [ $? -eq 0 ]; then
root_mounted=1
break
fi
fi
done
if [ $root_mounted -eq 0 ]; then
/bin/echo "Mount root failed..."
exec /bin/sh
fi
/bin/umount /dev
/bin/rm -rf /mnt/dev
/bin/rm -rf /mnt/proc
/bin/rm -rf /mnt/sys
/bin/rm -rf /mnt/run
/bin/rm -rf /mnt/tmp
/bin/mkdir -p /mnt/dev/
/bin/mkdir -p /mnt/proc/
/bin/mkdir -p /mnt/sys/
/bin/mkdir -p /mnt/run/
/bin/mkdir -p /mnt/tmp/
/bin/mount -t devtmpfs devtmpfs /mnt/dev
/bin/mount -t proc proc /mnt/proc
/bin/mount -t sysfs sysfs /mnt/sys
/bin/mount -t tmpfs tmpfs /mnt/run
/bin/mount -t tmpfs tmpfs /mnt/tmp
/bin/echo "Ready to switch root..."
exec /sbin/switch_root /mnt/ /usr/lib/aether/init