Autoyast fails on 12.3 with 'undefined local variable or method `cdrom'

I have made a customised installation DVD of 12.3 (autoinst.xml). It works perfectly on my simulated environment (VirtualBox), but when running this on real hardware (x86_64, headless, only console, SCSI disk/cdrom) I get the following error quite early after yast2/linuxrc starts doing it’s thing (right after “Initializing”):


Client call failed with 'undefined local variable or method `cdrom' for #<Yast::ProfileLocationClass:0x00000002b381c8>' ...
:
[Ruby] yast/wfm.rb:275 Internal error. Please report a bug report with logs.
Run save_y2logs to get complete logs.
Details: undefined local variable or method `cdrom' for #<Yast::ProfileLocationClass:0x00000002b381c8>
Caller:  /usr/share/YaST2/lib/transfer/file_from_url.rb:271:in `get_file_from_url'

I suspect (but cannot be sure) this is due to this error:


ttyS0:install:/var/log/YaST2 # cat y2logMount 
mount: special device /dev/disk/by-id/scsi-S__x5b does not exist

The relevant devices look like this:


ttyS0:install:/var/log/YaST2 # ls -l /dev/disk/by-id/scsi-S__\\x5b 
lrwxrwxrwx 1 root root 9 Mar 24 09:57 '/dev/disk/by-id/scsi-S__\x5b' -> ../../sr0
ttyS0:install:/var/log/YaST2 # ls -l /dev/sr0 
brw-rw---- 1 root cdrom 11, 0 Mar 24 09:57 /dev/sr0
ttyS0:install:/var/log/YaST2 # ls -l /dev/cdrom 
lrwxrwxrwx 1 root root 3 Mar 24 09:57 /dev/cdrom -> sr0

This /dev/disk/by-id/scsi-S__\x5b device also appears on the same hardware with a normal (non-autoyast) installation, regardless of which CD-/DVD-ROM device is plugged in (as far as I have been able to test) and whether it is USB or SCSI.

For other reasons (legacy dependencies), I’m stuck with 12.3.

Any ideas to a) why this is happening and b) how to fix or work around the problem?

Some additional information

linux-gj9f:~ # udevadm info -q all -n sr0                                       
P: /devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:04.0/host6/target6:0:6/
6:0:6:0/block/sr0                                                               
N: sr0                                                                          
L: -100                                                                         
S: cdrom                                                                        
S: disk/by-id/scsi-S__\x5b                                                      
S: disk/by-path/pci-0000:03:04.0-scsi-0:0:6:0                                   
S: dvd                                                                          
E: DEVLINKS=/dev/disk/by-path/pci-0000:03:04.0-scsi-0:0:6:0 /dev/disk/by-id/scsi
-S__\x5b /dev/cdrom /dev/dvd                                                    
E: DEVNAME=/dev/sr0                                                             
E: DEVPATH=/devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:04.0/host6/targ
et6:0:6/6:0:6:0/block/sr0                                                       
E: DEVTYPE=disk                                                                 
E: ID_BUS=scsi                                                                  
E: ID_CDROM=1                                                                   
E: ID_CDROM_CD=1                                                                
E: ID_CDROM_DVD=1                                                               
E: ID_CDROM_MRW=1                                                               
E: ID_CDROM_MRW_W=1                                                             
E: ID_FOR_SEAT=block-pci-0000_03_04_0-scsi-0_0_6_0                              
E: ID_PATH=pci-0000:03:04.0-scsi-0:0:6:0                                        
E: ID_PATH_COMPAT=pci-0000:03:04.0-scsi-0:0:6:0                                 
E: ID_PATH_TAG=pci-0000_03_04_0-scsi-0_0_6_0                                    
E: ID_SCSI=1                                                                    
E: ID_SCSI_DI=1                                                                 
E: ID_SCSI_SN=1                                                                 
E: ID_SERIAL=S__\x5b                                                            
E: ID_SERIAL_SHORT=\x5b                                                         
E: MAJOR=11                                                                     
E: MINOR=0                                                                      
E: SCSI_IDENT_SERIAL=\x5b                                                       
E: SUBSYSTEM=block                                                              
E: SYSTEMD_MOUNT_DEVICE_BOUND=1                                                 
E: TAGS=:systemd:uaccess:seat:                                                  
E: USEC_INITIALIZED=7184995                                                     


I found out the problem. I was not familiar with this part of the process and was barking up the wrong tree. It is the udev system which is responsible for creating the /dev/disk/ paths (obviously), and I could not find out why/how autoyast picked that device (instead of just e.g. /dev/cdrom). But after some digging, involving finding:

linux-gj9f:~ # sg_inq --export --inhex=/sys/class/scsi_device/6:0:6:0/device/inquiry --raw
SCSI_IDENT_SERIAL=\x5b

I discovered that the file /usr/lib/udev/rules.d/55-scsi-sg3_id.rules in the /parts/01_usr squashfs of the /boot/x86_64/loader/initrd file contained the rules to give this behaviour:

# Compat ID_SERIAL settingENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA_REGEXT}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA_REGEXT}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA_REGEXT}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA_REG}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA_REG}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA_REG}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA_EXT}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA_EXT}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA_EXT}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_EUI64}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="2$env{SCSI_IDENT_LUN_EUI64}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_EUI64}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAME}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="8$env{SCSI_IDENT_LUN_NAME}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAME}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_T10}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="1$env{SCSI_IDENT_LUN_T10}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_T10}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA_LOCAL}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA_LOCAL}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA_LOCAL}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_VENDOR}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="0$env{SCSI_VENDOR}_$env{SCSI_MODEL}_$env{SCSI_IDENT_LUN_VENDOR}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_VENDOR}"
ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_SERIAL}=="?*", ENV{ID_BUS}="scsi", ENV{ID_SERIAL}="S$env{SCSI_VENDOR}_$env{SCSI_MODEL}_$env{SCSI_IDENT_SERIAL}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_SERIAL}"

Specifically the last one of thise in my case. I’m unsure exactly the point of this rule - AFAIK SCSI is under no obligation to provide or convey this type of information and should not be used in this manner.

Maybe when you can recontruct this behaviour in a supported openSUSE version, it could be worth a bug report.