0

I added to the cmdline.txt instructions

usb-storage.quirks=152d:0578:u force_mac_address=dc:a6:32:e6:58:51

to correct issues with a sata-usb interface and to change the mac address.

The quirks are effective for the boot, but at a reboot, the cmdline edit is gone and the sata-usb interface does not work properly anymore. When I check, I see that the edit is lost in the cmdline.txt file.

How can I prevent the overwriting of the edit?

From reading various suggestions, I have the impression, that the first cmdline.txt is setting things up and booting afterwards uses a reduced set of the arguments. Is this correct? Details?

user855443
  • 119
  • 1
  • 5
  • "the first cmdline.txt is setting things up and booting afterwards uses a reduced set of the arguments" makes no sense. cmdline.txt should have only a single line https://www.raspberrypi.com/documentation/computers/configuration.html#the-kernel-command-line – Milliways Feb 01 '23 at 01:28
  • Please see the 2nd paragraph of my answer below. – Seamus Feb 01 '23 at 05:47

1 Answers1

1

At least one answer here suggests that the code that parses /boot/cmdline.txt is picky. AIUI, /boot/cmdline.txt contains a single command line, only the first line of the file is read and parameters must be space separated on that line. The answer cited above suggests that it's possible to insert comment lines preceded with #, so you could try that if you like. /boot is a FAT partition, and so the files on it can be edited by virtually any computer... BUT BEWARE OF WINDOWS EDITORS. It would also be a good idea to make a copy of the original /boot/cmdline.txt file, and keep that in a safe place.

IOW: Try putting your entire cmdline entry on a single line with no newline character, no comments, etc - just a single line with all the commands.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • good advice - I have all on one line, added the correct line afterwards as a comment, which seems to work; I edit with pluma (liinux) on the same rpi4 (desktop system, debian + MATE). - The question is, why is it edited after boot and how to prevent it. – user855443 Feb 01 '23 at 08:19
  • "The question is, why is it edited after boot and how to prevent it." At this point, you are really asking a question about Debian Linux and so https://unix.stackexchange.com/ might be a better place to ask the question. – David Arno Feb 01 '23 at 08:53
  • @DavidArno: I'm not sure what the point of your comment is, or to whom it's directed, but if you think you have a better answer, please - by all means - illuminate us. – Seamus Feb 01 '23 at 23:34
  • @user855443, just for clarity, my comment about asking for further info on the Unix Stack Exchange was directed at you :) – David Arno Feb 02 '23 at 08:03
  • i have the impression from observations that the rpi4 first boot does something special and some later boots do remove parts of the cmdline.txt (perhaps depending whether it is a reboot or a shutdown). now i have a (relatively pure) debian and I do not see any changes to the cmdline.txt (and the quirks are there but not used, new sata-usb adapter with other chipset, gigimundo) – user855443 Feb 03 '23 at 12:52
  • @user855443: I do not have that impression, but I've not researched it. I put what I know (or believe, or recall) in my answer. Have you tried the solution I suggested? It seems that might resolve the issue?? – Seamus Feb 04 '23 at 01:24
  • In some RPI4 documentation I saw the information that the '/boot/cmdline.txt' file is changed after the first boot; but I did not see details there. My system is stable now (I have found SATA-USB adaptors which do not require quirks) and I had not reason to start a fresh with a new first boot. – user855443 Feb 15 '23 at 15:45
  • @user855443: I did not suggest that you "start fresh"; I suggested you put your entire cmdline.txt file on a single line. I'm happy to hear you've made progress, but I'll stick by my recommendation. – Seamus Feb 15 '23 at 23:06