1

I've created a minimal environment on my embedded ARM device consisting of just the Linux kernel, and with Busybox and a minimal filesystem in an initrd image. I have an inittab that runs /etc/init.d/rcS on start up.

I have the following line in rcS:

/bin/mount -t proc none /proc

However, when this line runs, I get

/etc/init.d/rcS: line 2: /bin/mount -t proc none /proc: not found

The last line of rcS appears to execute - that line is simply /bin/sh to get a shell, and the shell opens automatically.

When I run the exact same mount command from the shell, it works. /bin/mount is a symlink to /bin/busybox.

Why isn't my script able to find /bin/mount?

2
  • Could you please post an exact copy-and-paste of the contents of rcS (or upload to gist.github.com if it is too big)? Also, are you sure you have the error message copied exactly right?
    – BenjiWiebe
    Jul 11, 2014 at 20:38
  • I found my error, see my answer below. Thanks, though :)
    – Steve
    Jul 11, 2014 at 21:12

1 Answer 1

1

As it turns out, the spaces in the file were actually two characters, 0xD0 0xA0 (Unicode? Maybe it's just a coincidence that those look like CR/LF left shifted 4 bits... They also appear as a single blank character, not two). A clue right off the bat was the error message - it should have only displayed the command, not the parameters, but there wasn't any whitespace in the line.

Once I discovered that, I realized what the cause probably was. My OS is Windows 7, and I'm running Ubuntu in a VirtualBox VM, and I use a shared clipboard. I had copied the script from a webpage in Chrome on Windows 7 and pasted it into gedit on Ubuntu. Either those characters were copied from the web page, or something didn't play right with encoding on the way from the page to gedit.

Replacing those with space characters solved it.

1
  • Interesting problem. And fix. :)
    – BenjiWiebe
    Jul 11, 2014 at 22:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .