Hi Trent, Il 19/03/2014 07:18, Trent W. Buck ha scritto:
I got it to work, but I had to be evil.
Nice!
sed -i /usr/share/initramfs-tools/init \ -e '\|/run/initramfs$|a/lib/bootchart/bootchart-collector &' \ -e '/^mount.*move.*proc$/ a mount -n -o move /lib/bootchart/tmpfs ${rootmnt}/lib/bootchart/tmpfs' That is, it starts /lib/bootchart/bootchart-collector *after* /proc and /dev are mounted (takes about 1s). This also fixes the problem where bootchart-collector thought it was "run outside initrd" -- because it does that by reading /proc/self/mountinfo, so /proc must be mounted first.
Correct
I'm also moving /lib/bootchart/tmpfs inside the pivot. I'm not sure if that's actually needed.
It should not be needed, if you can test it's not needed it would be helpful
Finally, bootchart-collector --dump needs to the "real" collector process, so I had to stop banning ptrace with these: $ cat /etc/sysctl.d/disable-ptrace.conf kernel/yama/ptrace_scope=3 $ cat /proc/cmdline [...] security=yama
Yes, ptrace is used to extract collection data from the other process
Attached is my first successful ramdisk trace. Because I'm waiting for scripts/init to mount proc and dev, I still lose a full second at the start. But it works. I *wasn't* passing rdinit or init at all. I guess way to clean this up is similar to live-boot's strategy: boot with "boot=bootchart2 real_boot=local", where /usr/share/initramfs-tools/bootchart2 goes something like mountroot() { # -*- shell-script -*- /lib/bootchart/bootchart-collector & # FIXME: parse /proc/cmdline here # Chainload the real mountroot function. . scripts/${real_boot:-local} mountroot # FIXME: is this needed? mount -omove /lib/bootchart/tmpfs ${rootmnt}/lib/bootchart/tmpfs } I don't think the rdinit=/sbin/bootchartd approach will work well, short of duplicating dozens of lines of code from initramfs-tools' init.
If you have time to dedicate to that, care to post a patch? Thanks a lot, riccardo -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org