0000-boot-profile 771 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

Boot_profile ()
{
	# Only start profiler when "profile" appears on kernel command line
	grep -qw "profile" /proc/cmdline || return 0

	echo -n " boot-profile"

	Start_boot_profile
}

Start_boot_profile ()
{

	# Schedule stop script
Tails developers's avatar
Tails developers committed
17
	mkdir -p /etc/skel/.config/autostart
18
	cat <<EOF >"/etc/skel/.config/autostart/end-profile.desktop"
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[Desktop Entry]
Version=1.0
Name=EndProfile
GenericName=EndProfile
Exec=/usr/local/bin/end-profile
Terminal=false
Type=Application
EOF

	echo 32768 >/proc/sys/fs/inotify/max_user_watches
	/usr/local/sbin/boot-profile /var/log/boot-profile

	# Put readahead list at the very begining
	head -n 1 /usr/share/amnesia/readahead-list >/dev/null || true

	# Creating state file
	touch /var/lib/live/config/boot-profile
}

Boot_profile