/usr/share/initramfs-tools/scripts/init-top/bootchart is in bootchart 0.90.2-8ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/sh -e
# initramfs init-top for bootchart
PREREQ=""
# Output pre-requisites
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
# Where we create our jail, this should be on a handy tmpfs, like /dev
JAIL="/dev/.bootchart"
grep -q "profile" /proc/cmdline && exit 0
grep -q "bootchart=disable" /proc/cmdline && exit 0
if grep -q "bootchart=[0-9]*hz" /proc/cmdline; then
HZ=$(sed -e 's/.*bootchart=//;s/hz.*//' /proc/cmdline)
else
HZ=25
fi
# Make a jail filesystem to live in and run the collector inside it
mkdir -p $JAIL
mkdir $JAIL/lib $JAIL/lib/bootchart
case "`uname -m`" in
x86_64)
mkdir $JAIL/lib64
cp /lib64/ld-linux-x86-64.so.* $JAIL/lib64
;;
ppc|ppc64)
cp /lib/ld.so.* $JAIL/lib
;;
*)
cp /lib/ld-linux.so.* $JAIL/lib
;;
esac
for lib in /lib/libc.so.* /lib/*/libc.so.*; do
[ -e "$lib" ] || continue
mkdir -p "$JAIL/${lib%/*}"
cp "$lib" "$JAIL/${lib%/*}/"
done
cp /lib/bootchart/collector $JAIL/lib/bootchart
mkdir $JAIL/proc
mount -t proc none $JAIL/proc
mkdir $JAIL/log
chroot $JAIL /lib/bootchart/collector $HZ /log 2>/dev/null &
echo $! > /run/initramfs/bootchart.pid
|