6

I'm using a SD-card with raspian (with /boot-partition + the rootfs). I compiled my own kernel and now I would like to boot with nfsroot.

I've added the following line into the cmdline.txt:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 
kgdboc=ttyAMA0,115200 root=/dev/nfs rootfstype=nfs 
nfsroot=192.168.2.1:/[..]/rootfs_rpi 
ip=192.168.2.2:::::eth0:off elevator=deadline rootwait

(line-breaks are only there for readability - I have it all in one line)

however the system seems to ignore my line completely and boots with a default cmdline. After having booted I check with cat /proc/cmdline - completely different. During boot I don't see any error message regarding a cmdline.txt-problem.

What could be wrong?

Lekensteyn
  • 1,501
  • 1
  • 15
  • 24
Patrick B.
  • 312
  • 1
  • 7
  • 21

3 Answers3

5

Well, I think I found the problem: the one who parses cmdline.txt does not like empty lines before the valid cmdline: I have that:

# comment
# <previous cmmdline line commented out>

# comment
<new cmdline>

changing it to:

# comment
# <previous cmmdline line commented out>
# comment
<new cmdline>

makes it work.

Patrick B.
  • 312
  • 1
  • 7
  • 21
  • Your saying that if you add a new line, it reverts the whole file back to original? – Vincent P Mar 26 '13 at 06:40
  • No, if there is a newline it seems to use the one which is built-in (in the kernel) or uses a default one. The default one seems to use rootfs=/dev/mmcblkp1. – Patrick B. Mar 26 '13 at 06:43
  • The one who parses cmdline.txt is bootloader run by GPU. And according to all descriptions that I know, it should contain a string that will be passed to kernel. Do you have any reference where it says that comments are actually supported? – Krzysztof Adamski Mar 26 '13 at 12:47
  • 1
    No, I simply tried. – Patrick B. Mar 26 '13 at 13:29
1

Well if you get the issue on the RPi itslef then, it seems that you might be the victim of the SD card corruption saga.

Run the following commands on the RPi itself.

After modifying the cmdline.txt file. Run the following command.

sync && sudo sync

Then run the following command and see if there are any issues at the end

dmesg

An issue would be a message about MMC0. Report any of these issues.

Vincent P
  • 2,210
  • 15
  • 24
  • I had this problem as well - but I always unmount (which does the sync) and I checked on my host - it was OK. But corruption could have been an issue at least in one of my tries. – Patrick B. Mar 26 '13 at 06:41
  • Well just in case. One of the known ways to prevent corruption is to under clock the RPi. Do note that this is not guaranteed. – Vincent P Mar 26 '13 at 07:37
0

Another cause of changes to /boot/cmdline.txt being ignored is that for some SD cards the wrong partition is mounted as /boot in /etc/fstab.

As this is a bug that's been fixed, rather than changing /etc/fstab manually, the simplest option is to update your Raspberry Pi:

$ sudo apt-get update
$ sudo apt-get upgrade
Mircea Baja
  • 171
  • 6