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?

2
  • "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 raspberrypi.com/documentation/computers/…
    – Milliways
    Feb 1, 2023 at 1:28
  • Please see the 2nd paragraph of my answer below.
    – Seamus
    Feb 1, 2023 at 5:47

1 Answer 1

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.

8
  • 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 1, 2023 at 8: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 unix.stackexchange.com might be a better place to ask the question.
    – David Arno
    Feb 1, 2023 at 8: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 1, 2023 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 2, 2023 at 8: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 3, 2023 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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