Comment 14 for bug 62868

Revision history for this message
Juanje Ojeda (juanje) wrote : Re: [Bug 62868] Tested the PATH changed: workforme

> > As I said yesterday I've tested the PATH changed in '/usr/share
> > /initramfs-tools/scripts/casper' and works fine :-)
[...]
> > -export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin
> > +export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin
[...]
> > With this change (which is quite tiny and clean) is working for me. So I
> > propose to make this little change to fix the bug.
> >
> > What do you think guys?
>
> It will failed elsewhere later because:
> - softwares in /usr/bin, /bin; /sbin don't implement all GNU options
> expected by commands in /root/bin.

Well, I believe the problem is not really the path but how the scripts
in casper are implemented. If we don't use GNU options which are not
implemented in the static binaries inside the initramfs, we have
nothing to worry about.

> - some softwares not in /usr/bin, /bin will still fail to load.

Yes, but this is a problem of the person who writes the scripts. I
mean, if that person take care of not to use software that is not in
the initrd, or run those through a chroot, nothing bad should happen.

> The whole PATH=/root... is brittle and IMO a disaster in waiting. If a
> casper script needs a command not in the initrd image then it must
> chroot to /root.

I'm totally agree with you in this point. If casper need something
from the distro it should get through chroot.