You are right.
I don't know if this is the best way to do it, but exporting LD_LIBRARY_PATH=/root/usr/lib:/root/lib:/usr/lib:/lib (and leaving the PATH as is) solves the problems with dynamically linked binaries.
However it seems a little hackish to me.
The only, and IMHO better, alternative is to completely remove /root/* dirs from the PATH and only use tools from the busybox, so that the initramfs is somehow self-contained and its scripts are indipendent from the rootfs, as much as possible.
I'm currently checking all the scripts in /scripts/casper-bottom in order to find eventual commands which require full featured GNU tools or tools not in busybox.
You are right. PATH=/root/ usr/lib: /root/lib: /usr/lib: /lib (and leaving the PATH as is) solves the problems with dynamically linked binaries.
I don't know if this is the best way to do it, but exporting LD_LIBRARY_
However it seems a little hackish to me.
The only, and IMHO better, alternative is to completely remove /root/* dirs from the PATH and only use tools from the busybox, so that the initramfs is somehow self-contained and its scripts are indipendent from the rootfs, as much as possible.
I'm currently checking all the scripts in /scripts/ casper- bottom in order to find eventual commands which require full featured GNU tools or tools not in busybox.