Re: [OpenWrt-Devel] Q: procd: re-evaluation of inittab entries
On 05/12/2018 07:42, Michael Heimpold wrote: Hi, Am Mittwoch, 5. Dezember 2018, 03:52:20 CET schrieb Yousong Zhou: On Wed, 5 Dec 2018 at 06:00, Michael Heimpold wrote: Hi, I'm currently playing with USB gadget stuff. The goal is to run an Ethernet link and a console over the USB link. I already selected the relevant kernel modules and ACM device and RNDIS device is created on the USB host system - all fine so far. The ACM device on the USB gadget side is created as /dev/ttyGS0, and when I use "echo foobar > /dev/ttyGS0" or "cat /dev/ttyGS0" on USB device side with corresponding counterparts on USB host side, then it already works like a charme. My problem is the inittab: I think the right approach is to add an entry to inittab when I want to provide a login console on this tty, so I added: ttyGS0::askfirst:/usr/libexec/login.sh at the end of my inittab. However, during boot ttyGS0 is not yet available - it takes until the USB gadget is setup. procd skips this line at boot time. So my question is: is this the correct approach, or should I use a hotplug script to start such a console? I think we should make it possible to use serial console directly in inittab. In this case, could it be that the kernel module was only loaded after parsing inittab and askfirst quitted because it couldn't find the device? Please check if that is the case by grepping module name in /etc/modules-boot.d/ . Setting boot flag when calling AutoProbe should fix the issue. No, the order is this one: 1. modules are loaded (device does not appear yet) 2. inittab is parsed 3. entry is skipped because device does not exists yet 4. configuration of USB gadget with shell script and/or init script 5. device appears 6. hotplug-call tty is being called and running hotplug scripts So it seems that we need a feedback from hotplug script to procd to rescan inittab for formerly skipped items and re-trigger start in case of device is present now. Regards, mhei should have cleaned up the inbox and read all mails before replying. for a normal ttyX the approach with modules-boot.d should work. in your case there is 4) so what i initially proposed should be the solution. John ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Q: procd: re-evaluation of inittab entries
On 05/12/2018 03:52, Yousong Zhou wrote: On Wed, 5 Dec 2018 at 06:00, Michael Heimpold wrote: Hi, I'm currently playing with USB gadget stuff. The goal is to run an Ethernet link and a console over the USB link. I already selected the relevant kernel modules and ACM device and RNDIS device is created on the USB host system - all fine so far. The ACM device on the USB gadget side is created as /dev/ttyGS0, and when I use "echo foobar > /dev/ttyGS0" or "cat /dev/ttyGS0" on USB device side with corresponding counterparts on USB host side, then it already works like a charme. My problem is the inittab: I think the right approach is to add an entry to inittab when I want to provide a login console on this tty, so I added: ttyGS0::askfirst:/usr/libexec/login.sh at the end of my inittab. However, during boot ttyGS0 is not yet available - it takes until the USB gadget is setup. procd skips this line at boot time. So my question is: is this the correct approach, or should I use a hotplug script to start such a console? I think we should make it possible to use serial console directly in inittab. In this case, could it be that the kernel module was only loaded after parsing inittab and askfirst quitted because it couldn't find the device? Please check if that is the case by grepping module name in /etc/modules-boot.d/ . Setting boot flag when calling AutoProbe should fix the issue. yousong This would be the correct approach actually, i just checked the code, preinit will only spawn the early_console, then load /etc/modules-boot.d/* and then spawn the real procd which will parse inittab John ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Q: procd: re-evaluation of inittab entries
On 04/12/2018 22:59, Michael Heimpold wrote: Hi, I'm currently playing with USB gadget stuff. The goal is to run an Ethernet link and a console over the USB link. I already selected the relevant kernel modules and ACM device and RNDIS device is created on the USB host system - all fine so far. The ACM device on the USB gadget side is created as /dev/ttyGS0, and when I use "echo foobar > /dev/ttyGS0" or "cat /dev/ttyGS0" on USB device side with corresponding counterparts on USB host side, then it already works like a charme. My problem is the inittab: I think the right approach is to add an entry to inittab when I want to provide a login console on this tty, so I added: ttyGS0::askfirst:/usr/libexec/login.sh at the end of my inittab. However, during boot ttyGS0 is not yet available - it takes until the USB gadget is setup. procd skips this line at boot time. So my question is: is this the correct approach, or should I use a hotplug script to start such a console? Hi, procd uses json_script for hotplug. you could simply extend the clauses by adding a is_console function and a execution target such as start_console. then add a tiny json script that makes use the of two. John Regards, mhei ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Q: procd: re-evaluation of inittab entries
Hi, Am Mittwoch, 5. Dezember 2018, 03:52:20 CET schrieb Yousong Zhou: > On Wed, 5 Dec 2018 at 06:00, Michael Heimpold wrote: > > Hi, > > > > I'm currently playing with USB gadget stuff. The goal is to run an > > Ethernet > > link and a console over the USB link. I already selected the relevant > > kernel modules and ACM device and RNDIS device is created on the USB host > > system - all fine so far. > > The ACM device on the USB gadget side is created as /dev/ttyGS0, and > > when I use "echo foobar > /dev/ttyGS0" or "cat /dev/ttyGS0" on USB device > > side with corresponding counterparts on USB host side, then it already > > works like a charme. > > My problem is the inittab: I think the right approach is to add an entry > > to > > inittab when I want to provide a login console on this tty, so I added: > > ttyGS0::askfirst:/usr/libexec/login.sh > > at the end of my inittab. > > However, during boot ttyGS0 is not yet available - it takes until the > > USB gadget is setup. procd skips this line at boot time. > > > > So my question is: is this the correct approach, or should I use a > > hotplug script to start such a console? > > I think we should make it possible to use serial console directly in > inittab. > > In this case, could it be that the kernel module was only loaded after > parsing inittab and askfirst quitted because it couldn't find the > device? Please check if that is the case by grepping module name in > /etc/modules-boot.d/ . Setting boot flag when calling AutoProbe > should fix the issue. No, the order is this one: 1. modules are loaded (device does not appear yet) 2. inittab is parsed 3. entry is skipped because device does not exists yet 4. configuration of USB gadget with shell script and/or init script 5. device appears 6. hotplug-call tty is being called and running hotplug scripts So it seems that we need a feedback from hotplug script to procd to rescan inittab for formerly skipped items and re-trigger start in case of device is present now. Regards, mhei ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Q: procd: re-evaluation of inittab entries
On Wed, 5 Dec 2018 at 06:00, Michael Heimpold wrote: > > Hi, > > I'm currently playing with USB gadget stuff. The goal is to run an Ethernet > link and a console over the USB link. I already selected the relevant kernel > modules and ACM device and RNDIS device is created on the USB host > system - all fine so far. > The ACM device on the USB gadget side is created as /dev/ttyGS0, and > when I use "echo foobar > /dev/ttyGS0" or "cat /dev/ttyGS0" on USB device > side with corresponding counterparts on USB host side, then it already works > like a charme. > My problem is the inittab: I think the right approach is to add an entry to > inittab when I want to provide a login console on this tty, so I added: > ttyGS0::askfirst:/usr/libexec/login.sh > at the end of my inittab. > However, during boot ttyGS0 is not yet available - it takes until the > USB gadget is setup. procd skips this line at boot time. > > So my question is: is this the correct approach, or should I use a > hotplug script to start such a console? I think we should make it possible to use serial console directly in inittab. In this case, could it be that the kernel module was only loaded after parsing inittab and askfirst quitted because it couldn't find the device? Please check if that is the case by grepping module name in /etc/modules-boot.d/ . Setting boot flag when calling AutoProbe should fix the issue. yousong ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Q: procd: re-evaluation of inittab entries
Hi, I'm currently playing with USB gadget stuff. The goal is to run an Ethernet link and a console over the USB link. I already selected the relevant kernel modules and ACM device and RNDIS device is created on the USB host system - all fine so far. The ACM device on the USB gadget side is created as /dev/ttyGS0, and when I use "echo foobar > /dev/ttyGS0" or "cat /dev/ttyGS0" on USB device side with corresponding counterparts on USB host side, then it already works like a charme. My problem is the inittab: I think the right approach is to add an entry to inittab when I want to provide a login console on this tty, so I added: ttyGS0::askfirst:/usr/libexec/login.sh at the end of my inittab. However, during boot ttyGS0 is not yet available - it takes until the USB gadget is setup. procd skips this line at boot time. So my question is: is this the correct approach, or should I use a hotplug script to start such a console? Regards, mhei ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel