-
Notifications
You must be signed in to change notification settings - Fork 250
/
init
67 lines (52 loc) · 2.26 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Initial script for Linux Live Kit
# Author: Tomas M <http://www.linux-live.org/>
export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin
. /lib/config
. /lib/livekitlib
transfer_initramfs
MEMORY=/memory
CHANGES=$MEMORY/changes
UNION=$MEMORY/union
DATAMNT=$MEMORY/data
BUNDLES=$MEMORY/bundles
header "Live Kit init <http://www.linux-live.org/>"
init_proc_sysfs
debug_start
debug_shell
# load some modules manually first, then modprobe everything we have
init_devs
init_aufs
init_zram
# modprobe all devices excluding network drivers
modprobe_everything -v /drivers/net/
# initialize blkid cache file
init_blkid_cache
# find data dir with filesystem bundles
DATA="$(find_data 45 "$DATAMNT")"
check_data_found "$DATA"
debug_shell
# setup persistent changes, if possible
persistent_changes "$DATA" "$CHANGES"
debug_shell
# copy to RAM if needed
DATA="$(copy_to_ram "$DATA" "$CHANGES")"
# mount bundles
mount_bundles "$DATA" "$BUNDLES"
debug_shell
# init aufs union, or setup overlayfs union
init_union "$CHANGES" "$UNION" "$BUNDLES"
# add data to aufs union
union_append_bundles "$BUNDLES" "$UNION"
debug_shell
# rootcopy
copy_rootcopy_content "$DATA" "$UNION"
# create fstab
fstab_create "$UNION" "$DATAMNT"
debug_shell
# run user custom preinit
user_preinit "$DATA" "$UNION"
header "Live Kit done, starting $LIVEKITNAME"
change_root "$UNION"
header "!!ERROR occured, you shouldn't be here.!!"
/bin/sh