Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tails
tails
Commits
ce7f07c3
Commit
ce7f07c3
authored
Aug 10, 2010
by
amnesia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readahead: protect against failures, it runs under set -e.
parent
2474e48c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
config/chroot_local-includes/lib/live/config/000-readahead
config/chroot_local-includes/lib/live/config/000-readahead
+12
-5
No files found.
config/chroot_local-includes/lib/live/config/000-readahead
View file @
ce7f07c3
...
...
@@ -7,9 +7,16 @@ Readahead ()
{
# Do not readahead when "profile" appears on kernel command line
grep
-qw
"profile"
/proc/cmdline
&&
return
0
if
grep
-qw
"profile"
/proc/cmdline
then
return
0
fi
test
-e
"
$READAHEAD_LIST
"
||
return
if
!
test
-e
"
$READAHEAD_LIST
"
then
echo
"the readahead list (
${
READAHEAD
}
) does not exist."
return
fi
echo
" readahead"
Start_readahead
...
...
@@ -26,13 +33,13 @@ Start_readahead ()
awk
'$2 ~ /^total$/ { t = t + $1 } END { print t }'
)
(
cd
/
echo
"
$BG_FILES
"
|
xargs
stat
>
/dev/null 2>/dev/null
)
xargs
stat
>
/dev/null 2>/dev/null
||
:
)
(
cd
/
echo
"
$FG_FILES
"
|
xargs
cat
2>/dev/null |
pv
-f
-s
${
FG_SIZE
}
k
>
/dev/null
)
pv
-f
-s
${
FG_SIZE
}
k
>
/dev/null
||
:
)
(
cd
/
echo
"
$BG_FILES
"
| xargs
cat
>
/dev/null 2>&1
)
&
echo
"
$BG_FILES
"
| xargs
cat
>
/dev/null 2>&1
||
:
)
&
# Creating state file
touch
/var/lib/live/config/readahead
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment