Commit 01833d85 authored by intrigeri's avatar intrigeri

Merge branch 'feature/15915-remove-readahead' into devel (Fix-committed: #15915)

parents e0ec60c0 79907a50
......@@ -27,7 +27,6 @@
/config/chroot_local-includes/usr/share/doc/amnesia/Changelog
/config/chroot_local-includes/usr/share/doc/tails/website
/config/chroot_local-includes/usr/share/tails/build/variables
/config/chroot_local-includes/usr/share/tails/readahead-list
/.lock
/.stage
/source
......
......@@ -182,15 +182,6 @@ fi
# changelog
cp debian/changelog config/chroot_local-includes/usr/share/doc/amnesia/Changelog
# create readahead-list from squashfs.sort
if [ -e config/binary_rootfs/squashfs.sort ]; then
mkdir -p config/chroot_local-includes/usr/share/tails
sort -k2 -n -r config/binary_rootfs/squashfs.sort | \
cut -d' ' -f1 | \
grep --invert-match --extended-regexp "$READAHEAD_EXCLUDE_PATTERN" \
> config/chroot_local-includes/usr/share/tails/readahead-list
fi
# custom APT sources
tails-custom-apt-sources > config/chroot_sources/tails.chroot \
|| fatal "tails-custom-apt-sources failed with exit code $?"
......
......@@ -32,10 +32,6 @@ KERNEL_SOURCE_VERSION=$(
| perl -p -E 's{\A (\d+ [.] \d+) [.] .*}{$1}xms'
)
# Files to exclude from the readahead list
# (passed to `grep --extended-regexp`)
READAHEAD_EXCLUDE_PATTERN='^lib/live/mount/medium/'
### You should not have to change anything below this line ####################
# sanity checks
......
......@@ -28,9 +28,6 @@ EOF
echo 32768 >/proc/sys/fs/inotify/max_user_watches
/usr/local/lib/boot-profile /var/log/boot-profile
# Put readahead list at the very begining
head -n 1 /usr/share/tails/readahead-list >/dev/null || true
# Creating state file
touch /var/lib/live/config/boot-profile
}
......
#!/bin/sh
READAHEAD_LIST="/usr/share/tails/readahead-list"
BACKGROUND_AT="^usr/bin/Xorg$"
Readahead ()
{
# Do not readahead when "profile" appears on kernel command line
if grep -qw "profile" /proc/cmdline
then
return 0
fi
if ! test -e "$READAHEAD_LIST"
then
echo "the readahead list (${READAHEAD}) does not exist."
return
fi
echo " readahead"
Start_readahead
}
Start_readahead ()
{
FG_FILES="sed -n -e \\:$BACKGROUND_AT:q;p $READAHEAD_LIST"
BG_FILES="sed -n -e \\:$BACKGROUND_AT:,\$p $READAHEAD_LIST"
FG_SIZE=$(
cd /
$FG_FILES |
xargs du -bc 2>/dev/null |
awk '$2 ~ /^total$/ { t = t + $1 } END { print t }')
(cd /
$BG_FILES |
xargs stat >/dev/null 2>/dev/null || :)
(cd /
$FG_FILES |
xargs cat 2>/dev/null |
pv -f -s ${FG_SIZE} >/dev/null || :)
(cd /
start-stop-daemon \
--start --background --make-pidfile --startas /bin/sh \
--pidfile /run/background-readahead.pid -- \
-c "$BG_FILES | xargs cat >/dev/null 2>&1")
# Creating state file
touch /var/lib/live/config/readahead
}
Readahead
[Unit]
Description=Wipe memory on live media removal
Documentation=https://tails.boum.org/contribute/design/memory_erasure/
After=memlockd.service
After=memlockd.service initramfs-shutdown.service
[Service]
Type=simple
......
......@@ -26,8 +26,6 @@ libdatetime-format-dateparse-perl
libgetopt-long-descriptive-perl
# needed by htpdate and tails-security-check
libtry-tiny-perl
# needed by readahead
pv
# needed by our chroot_local-hooks
live-build
# needed by tordate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment