Start a new topic

Changing default PATH for initramfs?

I would like to add /usr/local/bin and /usr/local/sbin to the PATH for our TS-7600 boards for any users that connect to them.  I can do this in the full Debian boot, but I am not sure where to find this setting for initramfs.  The only mention I can find for the initramfs is that it uses a different path then debian, so programs in the /ts/init script require full paths.  This is useful, but hardly enough for me to find the appropriate location to set this so that root will have the directories I want in the path whether connected by telnet or serial console.

Can someone help?

1 Comment

Good morning Steve,

The initramfs is, as the name might imply, a ram-only filesystem.  It comes from a binary blob included with the kernel and isn't really designed for easy alteration.  

Probably the easiest thing to do is to add /mnt/root/usr/local/bin/ and any other directory you want to your PATH from within the /ts/init script.  

Alternatively the much less simple method would be to unpack the initramfs.cpio from the kernel sources, alter the initramfs to your liking, then re-pack the .cpio file, and recompile the kernel.  That's a little ways outside the help we can provide in our free support paradigm, so I don't have any documentation resources I can point you toward aside from those you might find in a standard Google search.

Login or Signup to post a comment