[systemd-devel] systemd doesn't see ttyPS0 devices from udev

ZhouPeng zhoupengwork01 at 163.com
Wed Sep 23 06:20:19 UTC 2020


Thank you  very much for you great suggestions.

I chroot the rootfs and tried to the 3 methods in '/usr/lib/udev/rules.d'  respectively:

try 1) add  a line of  ACTION!="remove", KERNEL=="ttyPS0", TAG+="systemd" below the line of  "ACTION=="remove", GOTO="systemd_end"" in file 99-systemd.rules
try 2) add  a line of  ACTION!="remove", KERNEL=="ttyPS0",  NAME="ttyPS0", TAG+="systemd"  below the line of  "ACTION=="remove", GOTO="systemd_end"" in file 99-systemd.rules
try 3) replace the line  "SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd" with "SUBSYSTEM=="tty", KERNEL=="ttyPS[0-9]|tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"",  in file 99-systemd.rules.

At the same time, I replace the line of "KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"" with "KERNEL=="ttyPS[0-9]|tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"".

But they didn't take any effect.

Then at the same time, I do
cp /usr/lib/systemd/system/serial-getty at .service /etc/systemd/system/serial-getty at ttyPS0.service
Edit /etc/systemd/system/serial-getty\@ttyPS0.service:  replace  "ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM" with "ExecStart=-/sbin/agetty --keep-baud 115200 %I $TERM"
ln -s /etc/systemd/system/serial-getty at ttyPS0.service /etc/systemd/system/getty.target.wants/

But there was still no effect. There is still boot failure logs like:
[ *] (3 of 3) a start job is running for dev-ttyPS0.device (41s / 1min 30s)// **here**
...
 [ TIME ] Timed out waiting for device dev-ttyPS0.device. // **here**
...

By the way, Do I need to add some configuration to tiger executing something like 'mknod /dev/ttyPS0 c 248 0'  for systemd or udev pls? If needed, where is the proper place to add this action pls?

>What does "udevadm info -a /dev/ttyPS0" output?
I can not get a console from ttyPS0, so I can not run  "udevadm info -a /dev/ttyPS0" in the target(xilinx pynq) board.


Thanks all,
At 2020-09-22 20:34:15, "Andrei Borzenkov" <arvidjaar at gmail.com> wrote:
>On Tue, Sep 22, 2020 at 2:53 PM Mantas Mikulėnas <grawity at gmail.com> wrote:
>>
>> On Tue, Sep 22, 2020 at 1:46 PM Andrei Borzenkov <arvidjaar at gmail.com> wrote:
>>>
>>> On Tue, Sep 22, 2020 at 1:35 PM ZhouPeng <zhoupengwork01 at 163.com> wrote:
>>> >
>>> > Hi all,
>>> >
>>> > When I use Fedora image as rootfs on Xilinx PYNQ-Z2, I encountered the issue  when use the /dev/ttyPS0.
>>> > I think the issue is because systemd and udev on fedora can didn't detect ttyPS0 properly. Do I need to install any other package or do some special configuration?
>>> >
>>> > **systemd version the issue has been seen with**
>>> > udevadm --version
>>> > 237
>>> > systemd-udev.riscv64                     237-1.0.riscv64.fc28
>>> >
>>> >
>>> > **Unexpected behaviour you saw**
>>> > We can see ttyPS0 boots ok in the kernel boot period:
>>> > [    0.180000] console [ttyPS0] enabledat MMIO 0xe0000000 (irq = 2, base_baud = 6250000) is a xuartps
>>> > [    0.180000] console [ttyPS0] enabled
>>> >
>>> > But, when boot into systemd, it failed on dev ttyPS0:
>>> > [ TIME ] Timed out waiting for device dev-ttyPS0.device. // **here**
>>>
>>> systemd only monitors for devices with "sysemd" tag. Tags are assigned
>>> by udev rules. You should add rule to assign tag to ttyPS0. I have no
>>> idea what it is, but something like
>>>
>>> ACTION!="remove", KERNEL=="ttyPS0", TAG+="systemd"Mantas
>>>
>>> should do it. Whether this should go upstream depends on how common
>>> this device is.
>>
>>
>> Well yes, but that should have been already covered by the existing upstream rules:
>>
>> 99-systemd.rules:12:SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"
>>
>
>Are you sure ttyPS0 has the "tty" subsystem?


More information about the systemd-devel mailing list