1

I get a modified Linux installation on QNAP x86 based NAS. In the initrd image file, I noticed there are both a init script /initand a symbolic link that points to a different program(busybox): linuxrc ->/bin/busybox.

How can I figure out which one is the init process that is run every time the system is booted?

  • symbolic link points to the actual script, which gets to be run. I can not really understand your question what you are trying to figure out here. Symbolic links do not run. They are just pointers to the files which in turn do something when someone invokes the symlink. – MelBurslan Feb 22 '16 at 20:16
  • The init is a script. Linuxrc links to busybox binary. The two are different. – NathaneilCapital Feb 22 '16 at 20:26
0

/linuxrc is launched on an old-style initrd, /sbin/init is launched on a newer-style initrd, /init is launched on an initramfs. Initrd and initramfs are two mechanisms with the same purpose: to mount a filesystem in RAM from which storage drivers can be loaded. Initrd is older, initramfs is the current recommended method.

Some distributions have kept a setup from the days before initramfs existed, and call the image initrd even when it's an initramfs image. So the fact that you have a file called initrd does not mean that it's loaded as one. Some distributions, evidently including yours, have kept a file structure on the initrd/initramfs that allows the same directory tree to be used on either. The format of the image file is different, however.

To figure out whether you have an initrd or initramfs, the easiest way is to run

file /path/to/initrd

If you have a cpio archive, it's an initramfs. If you have an initrd, it's <rummage> “Linux Compressed ROM File System data”.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.