I think I figured out the cause. Basically PEBCAK..
There's a program called stderred (https://github.com/sickill/stderred) which colorizes stderr to differentiate it from stdout, via a LD_PRELOAD hook. I have had this set for years in my ~/.bashrc:
When I examine the initrd file as follows, I see half the binaries in bin/ contain ANSI escape codes, and the libstderred.so library has been pulled in:
root@jturner-home:/boot# update-initramfs -u -k 4.13.0-25-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-25-generic
root@jturner-home:/boot# mkdir bad
root@jturner-home:/boot# ( cd bad; zcat ../initrd.img-4.13.0-25-generic | cpio -idmv; )
root@jturner-home:/boot# ls bad/home/jturner/src/github/stderred/build/libstderred.so
bad/home/jturner/src/github/stderred/build/libstderred.so
root@jturner-home:/boot# ls -1 bad/bin
?[0m
?[0m?[1m?[31m[[?[0m?[1m?[31m
?[0m?[1m?[31macpid?[0m?[1m?[31m
?[0m?[1m?[31mash?[0m?[1m?[31m
?[0m?[1m?[31mawk?[0m?[1m?[31m
?[0m?[1m?[31mbasename?[0m?[1m?[31m
?[0m?[1m?[31mblockdev?[0m?[1m?[31m
?[0m?[1m?[31mcat?[0m?[1m?[31m
...
?[1m?[31m[?[0m?[1m?[31m
busybox
cat
chroot
cpio
dash
date
dd
...
The output of update-initramfs goes red halfway.
Perhaps update-initramfs could sanitize its environment, or explicitly unset LD_PRELOAD. Hard to be idiot-proof when there's such sophisticated idiots :)
I think I figured out the cause. Basically PEBCAK..
There's a program called stderred (https:/ /github. com/sickill/ stderred) which colorizes stderr to differentiate it from stdout, via a LD_PRELOAD hook. I have had this set for years in my ~/.bashrc:
root@jturner- home:~# echo $LD_PRELOAD src/github/ stderred/ build/libstderr ed.so
/home/jturner/
When I examine the initrd file as follows, I see half the binaries in bin/ contain ANSI escape codes, and the libstderred.so library has been pulled in:
root@jturner- home:/boot# update-initramfs -u -k 4.13.0-25-generic img-4.13. 0-25-generic home:/boot# mkdir bad home:/boot# ( cd bad; zcat ../initrd. img-4.13. 0-25-generic | cpio -idmv; ) home:/boot# ls bad/home/ jturner/ src/github/ stderred/ build/libstderr ed.so jturner/ src/github/ stderred/ build/libstderr ed.so home:/boot# ls -1 bad/bin [31m[[? [0m?[1m? [31m [31macpid? [0m?[1m? [31m [31mash? [0m?[1m? [31m [31mawk? [0m?[1m? [31m [31mbasename? [0m?[1m? [31m [31mblockdev? [0m?[1m? [31m [31mcat? [0m?[1m? [31m ?[0m?[1m? [31m
update-initramfs: Generating /boot/initrd.
root@jturner-
root@jturner-
root@jturner-
bad/home/
root@jturner-
?[0m
?[0m?[1m?
?[0m?[1m?
?[0m?[1m?
?[0m?[1m?
?[0m?[1m?
?[0m?[1m?
?[0m?[1m?
...
?[1m?[31m[
busybox
cat
chroot
cpio
dash
date
dd
...
The output of update-initramfs goes red halfway.
Perhaps update-initramfs could sanitize its environment, or explicitly unset LD_PRELOAD. Hard to be idiot-proof when there's such sophisticated idiots :)