summaryrefslogtreecommitdiff
blob: cbe33e728d315cd2eee6f922b39c851be2e005d4 (plain)
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
#!/sbin/runscript

# This script generates the sreadahead pack file, which lists the blocks that
# sreadahead should load into memory.
# To regenerate the pack file, delete /etc/readahead.packed and reboot the
# system.

description="Generate sreadahead pack file (if it does not exist)"

depend() {
	after *
}

start() {
	if [ -f /etc/readahead.packed ]
	then
		return 0
	fi

	ebegin "Generating sreadahead pack file"
	cd /tmp
	find / \
		-path /home -prune -o \
		-path /tmp -prune -o \
		-path /var -prune -o \
		-path /proc -prune -o \
		-path /usr/portage -prune -o \
	    -type f \( -fstype ext3 -o -fstype rootfs \) > \
		/tmp/readahead.packed.new
	/sbin/sreadahead-pack readahead.packed.new &> /dev/null
	mv readahead.packed /etc/readahead.packed
	eend $?
}