<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 23, 2020, 09:21 ZhouPeng <<a href="mailto:zhoupengwork01@163.com">zhoupengwork01@163.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Thank you very much for you great suggestions.<br>
<br>
I chroot the rootfs and tried to the 3 methods in '/usr/lib/udev/rules.d' respectively:<br>
<br>
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<br>
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<br>
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.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">At least the 1st one *should* have worked, though NAME= seems wrong in the 2nd one...</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
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"".<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This line is irrelevant, since TAG+="systemd" is the important part – groups and modes shouldn't be the problem.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But they didn't take any effect.<br>
<br>
Then at the same time, I do<br>
cp /usr/lib/systemd/system/serial-getty@.service /etc/systemd/system/serial-getty@ttyPS0.service<br>
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"<br>
ln -s /etc/systemd/system/serial-getty@ttyPS0.service /etc/systemd/system/getty.target.wants/<br>
<br>
But there was still no effect. There is still boot failure logs like:<br>
[ *] (3 of 3) a start job is running for dev-ttyPS0.device (41s / 1min 30s)// **here**<br>
...<br>
[ TIME ] Timed out waiting for device dev-ttyPS0.device. // **here**<br>
...<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yeah, the baudrate won't change anything if systemd doesn't even see the device in the first place. It doesn't even get to the point of launching agetty.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
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?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">No. The kernel automatically creates device nodes (as long as /dev has a "devtmpfs" mounted); udev only applies modes/symlinks. The problem here is that udev doesn't properly inform systemd about the new device.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
>What does "udevadm info -a /dev/ttyPS0" output?<br>
I can not get a console from ttyPS0, so I can not run "udevadm info -a /dev/ttyPS0" in the target(xilinx pynq) board.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Try booting with the 'rescue' option, this should directly create a root login prompt on the kernel console.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Alternatively, try creating a simple .service that runs this command, then you'll find its output in the journal or in the boot console (depending on what StandardOutput= you set).</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thanks all,<br>
At 2020-09-22 20:34:15, "Andrei Borzenkov" <<a href="mailto:arvidjaar@gmail.com" target="_blank" rel="noreferrer">arvidjaar@gmail.com</a>> wrote:<br>
>On Tue, Sep 22, 2020 at 2:53 PM Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank" rel="noreferrer">grawity@gmail.com</a>> wrote:<br>
>><br>
>> On Tue, Sep 22, 2020 at 1:46 PM Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com" target="_blank" rel="noreferrer">arvidjaar@gmail.com</a>> wrote:<br>
>>><br>
>>> On Tue, Sep 22, 2020 at 1:35 PM ZhouPeng <<a href="mailto:zhoupengwork01@163.com" target="_blank" rel="noreferrer">zhoupengwork01@163.com</a>> wrote:<br>
>>> ><br>
>>> > Hi all,<br>
>>> ><br>
>>> > When I use Fedora image as rootfs on Xilinx PYNQ-Z2, I encountered the issue when use the /dev/ttyPS0.<br>
>>> > 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?<br>
>>> ><br>
>>> > **systemd version the issue has been seen with**<br>
>>> > udevadm --version<br>
>>> > 237<br>
>>> > systemd-udev.riscv64 237-1.0.riscv64.fc28<br>
>>> ><br>
>>> ><br>
>>> > **Unexpected behaviour you saw**<br>
>>> > We can see ttyPS0 boots ok in the kernel boot period:<br>
>>> > [ 0.180000] console [ttyPS0] enabledat MMIO 0xe0000000 (irq = 2, base_baud = 6250000) is a xuartps<br>
>>> > [ 0.180000] console [ttyPS0] enabled<br>
>>> ><br>
>>> > But, when boot into systemd, it failed on dev ttyPS0:<br>
>>> > [ TIME ] Timed out waiting for device dev-ttyPS0.device. // **here**<br>
>>><br>
>>> systemd only monitors for devices with "sysemd" tag. Tags are assigned<br>
>>> by udev rules. You should add rule to assign tag to ttyPS0. I have no<br>
>>> idea what it is, but something like<br>
>>><br>
>>> ACTION!="remove", KERNEL=="ttyPS0", TAG+="systemd"Mantas<br>
>>><br>
>>> should do it. Whether this should go upstream depends on how common<br>
>>> this device is.<br>
>><br>
>><br>
>> Well yes, but that should have been already covered by the existing upstream rules:<br>
>><br>
>> 99-systemd.rules:12:SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"<br>
>><br>
><br>
>Are you sure ttyPS0 has the "tty" subsystem?<br>
</blockquote></div></div></div>