[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: trixie: cdrecord can no longer write to CD



On 22/11/2025 00:05, Thomas Schmitt wrote:
Max Nikulin wrote:
return 0 != uname(&buf)
   || 2 != sscanf(buf.release, "%d.%d", &major, &minor)
   || major > 2
   || (major == 2 && minor >= 6)

Urm, wouldn't this change the return value in the first two cases ?

I wrote earlier: "I would even change default return value in the case of failure". I assume that nowadays it is more reasonable to expect kernel >= 2.6. Another code branch remains primary to document earlier case. Due to long standing bugs I would not remove it completely.

On the way to Linux 2.6 the ability to perform ioctl(SG_IO) was given
to the block level devices /dev/hdX, /dev/srN, /dev/scdN, so that the
ide-scsi module became obsolete. That "new" state is described in
   http://sg.danny.cz/sg/sg_io.html
(Sorry, i found no info when exactly this happened.)

I have tried git blame game. At first I realized that my clone was shallow. A bit later I discovered that upstream repositories are shallow as well.

<https://docs.kernel.org/admin-guide/devices.html>
"Linux allocated devices (4.x+ version)"
(Currently 6.18.0-rc6)

  11 block      SCSI CD-ROM devices
                  0 = /dev/scd0         First SCSI CD-ROM
                  1 = /dev/scd1         Second SCSI CD-ROM
                    ...

                The prefix /dev/sr (instead of /dev/scd) has been deprecated.

<https://docs.kernel.org/admin-guide/devices.html#recommended-links>
Recommended links
| /dev/scd? | sr? | hard | Alternate SCSI CD-ROM name |

Should it be considered as a documentation bug? If followed, there is should be a udev rule creating aliases out of the box.

It appeared in
<https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/tag/?h=1.3.22>
"Linus Torvalds: Import 1.3.22"
as
+               The prefix /dev/scd instead of /dev/sr has been used
+               as well, and might make more sense.

In kernel, "scd" devices were tried for root filesystem from

<https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/init?h=1.3.82&id=2ab298effd>
"Import 1.3.82"

see also v2.5.0:
7a2deb32924142696b8174cdf9b38cd72a11fc96 "Import changeset"

<https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/tree/init/main.c?h=v2.5.0&id=381ab1f538162eb985c9244aa7d56e54315881ab#n171>

till 2.5.45
<https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/init?h=v2.5.45&id=51924607bd>
"[PATCH] removal of root_dev_names[]"

Either I missed something, or after that "/dev/sr<n>" is expected for root= cmdline argument. (The repository is weird. Commits are separated into several independent trees.)

It seems, the sr.c driver is registered as "sr" since beginning and used "scd" only in log messages.

Another evidence of confusion:

<https://lore.kernel.org/lkml/20061105100926.GA2883@pelagius.h-e-r-e-s-y.com/>
Scsi cdrom naming confusion; sr or scd? Sun, 5 Nov 2006 10:09:26 +0000

Documentation/devices.txt says:

 "The prefix /dev/sr (instead of /dev/scd) has been deprecated"

but booting 2.6.18.2 from a scsi CD only works if I pass the kernel
parameter root=/dev/sr0 and fails with root=/dev/scd0

I guess the kernel ought to be taught about the scd* names aswell?
I am lost which way /dev/scd<n> were created in the past.


Reply to: