Linux Hotplug development
 help / color / mirror / Atom feed
* [Patch Part3 V7 8/8] pci, ACPI, iommu: Enhance pci_root to support DMAR device hotplug
From: Jiang Liu @ 2014-11-09 14:48 UTC (permalink / raw)
  To: Joerg Roedel, David Woodhouse, Yinghai Lu, Bjorn Helgaas,
	Dan Williams, Vinod Koul, Rafael J . Wysocki, Rafael J. Wysocki,
	Len Brown
  Cc: Tony Luck, linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-hotplug-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dmaengine-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Jiang Liu
In-Reply-To: <1415544483-27990-1-git-send-email-jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

Finally enhance pci_root driver to support DMAR device hotplug when
hot-plugging PCI host bridges.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Reviewed-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/acpi/pci_root.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index cd4de7e038ea..c6bcb8c719d8 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -33,6 +33,7 @@
 #include <linux/pci.h>
 #include <linux/pci-acpi.h>
 #include <linux/pci-aspm.h>
+#include <linux/dmar.h>
 #include <linux/acpi.h>
 #include <linux/slab.h>
 #include <linux/dmi.h>
@@ -525,6 +526,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
 	struct acpi_pci_root *root;
 	acpi_handle handle = device->handle;
 	int no_aspm = 0, clear_aspm = 0;
+	bool hotadd = system_state != SYSTEM_BOOTING;
 
 	root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
 	if (!root)
@@ -571,6 +573,11 @@ static int acpi_pci_root_add(struct acpi_device *device,
 	strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
 	device->driver_data = root;
 
+	if (hotadd && dmar_device_add(handle)) {
+		result = -ENXIO;
+		goto end;
+	}
+
 	pr_info(PREFIX "%s [%s] (domain %04x %pR)\n",
 	       acpi_device_name(device), acpi_device_bid(device),
 	       root->segment, &root->secondary);
@@ -597,7 +604,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
 			root->segment, (unsigned int)root->secondary.start);
 		device->driver_data = NULL;
 		result = -ENODEV;
-		goto end;
+		goto remove_dmar;
 	}
 
 	if (clear_aspm) {
@@ -611,7 +618,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
 	if (device->wakeup.flags.run_wake)
 		device_set_run_wake(root->bus->bridge, true);
 
-	if (system_state != SYSTEM_BOOTING) {
+	if (hotadd) {
 		pcibios_resource_survey_bus(root->bus);
 		pci_assign_unassigned_root_bus_resources(root->bus);
 	}
@@ -621,6 +628,9 @@ static int acpi_pci_root_add(struct acpi_device *device,
 	pci_unlock_rescan_remove();
 	return 1;
 
+remove_dmar:
+	if (hotadd)
+		dmar_device_remove(handle);
 end:
 	kfree(root);
 	return result;
@@ -639,6 +649,8 @@ static void acpi_pci_root_remove(struct acpi_device *device)
 
 	pci_remove_root_bus(root->bus);
 
+	dmar_device_remove(device->handle);
+
 	pci_unlock_rescan_remove();
 
 	kfree(root);
-- 
1.7.10.4


^ permalink raw reply related

* Re: [Patch Part3 V7 0/8] Enable support of Intel DMAR device hotplug
From: Joerg Roedel @ 2014-11-18 10:25 UTC (permalink / raw)
  To: Jiang Liu
  Cc: David Woodhouse, Yinghai Lu, Bjorn Helgaas, Dan Williams,
	Vinod Koul, Rafael J . Wysocki, Ashok Raj, Yijing Wang, Tony Luck,
	iommu, linux-pci, linux-hotplug, linux-kernel, dmaengine
In-Reply-To: <1415544483-27990-1-git-send-email-jiang.liu@linux.intel.com>

Hi Jiang,

On Sun, Nov 09, 2014 at 10:47:55PM +0800, Jiang Liu wrote:
> Jiang Liu (8):
>   iommu/vt-d: Introduce helper function dmar_walk_resources()
>   iommu/vt-d: Dynamically allocate and free seq_id for DMAR units
>   iommu/vt-d: Implement DMAR unit hotplug framework
>   iommu/vt-d: Search for ACPI _DSM method for DMAR hotplug
>   iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit
>     hotplug
>   iommu/vt-d: Enhance error recovery in function
>     intel_enable_irq_remapping()
>   iommu/vt-d: Enhance intel-iommu driver to support DMAR unit hotplug
>   pci, ACPI, iommu: Enhance pci_root to support DMAR device hotplug
> 
>  drivers/acpi/pci_root.c             |   16 +-
>  drivers/iommu/dmar.c                |  532 ++++++++++++++++++++++++++++-------
>  drivers/iommu/intel-iommu.c         |  297 ++++++++++++++-----
>  drivers/iommu/intel_irq_remapping.c |  249 ++++++++++++----
>  include/linux/dmar.h                |   50 +++-
>  5 files changed, 897 insertions(+), 247 deletions(-)

The patches look good, but I need an ack from PCI/ACPI for patch 8
before I can merge it. Patches 1-7 are applied.

Thanks,

	Joerg


^ permalink raw reply

* Re: [Patch Part3 V7 0/8] Enable support of Intel DMAR device hotplug
From: Jiang Liu @ 2014-11-18 12:57 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: David Woodhouse, Yinghai Lu, Bjorn Helgaas, Dan Williams,
	Vinod Koul, Rafael J . Wysocki, Ashok Raj, Yijing Wang, Tony Luck,
	iommu, linux-pci, linux-hotplug, linux-kernel, dmaengine
In-Reply-To: <20141118102537.GB3762@8bytes.org>

On 2014/11/18 18:25, Joerg Roedel wrote:
> Hi Jiang,
> 
> On Sun, Nov 09, 2014 at 10:47:55PM +0800, Jiang Liu wrote:
>> Jiang Liu (8):
>>   iommu/vt-d: Introduce helper function dmar_walk_resources()
>>   iommu/vt-d: Dynamically allocate and free seq_id for DMAR units
>>   iommu/vt-d: Implement DMAR unit hotplug framework
>>   iommu/vt-d: Search for ACPI _DSM method for DMAR hotplug
>>   iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit
>>     hotplug
>>   iommu/vt-d: Enhance error recovery in function
>>     intel_enable_irq_remapping()
>>   iommu/vt-d: Enhance intel-iommu driver to support DMAR unit hotplug
>>   pci, ACPI, iommu: Enhance pci_root to support DMAR device hotplug
>>
>>  drivers/acpi/pci_root.c             |   16 +-
>>  drivers/iommu/dmar.c                |  532 ++++++++++++++++++++++++++++-------
>>  drivers/iommu/intel-iommu.c         |  297 ++++++++++++++-----
>>  drivers/iommu/intel_irq_remapping.c |  249 ++++++++++++----
>>  include/linux/dmar.h                |   50 +++-
>>  5 files changed, 897 insertions(+), 247 deletions(-)
> 
> The patches look good, but I need an ack from PCI/ACPI for patch 8
> before I can merge it. Patches 1-7 are applied.
Hi Joerg,
	Thanks for support:)
	Bjorn has given his acked-by for v6 at
https://lkml.org/lkml/2014/9/24/975. But I forgot to carry this
acked-by, sorry:(
Regards!
Gerry
> 
> Thanks,
> 
> 	Joerg
> 

^ permalink raw reply

* Re: [Patch Part3 V7 0/8] Enable support of Intel DMAR device hotplug
From: Joerg Roedel @ 2014-11-18 14:28 UTC (permalink / raw)
  To: Jiang Liu
  Cc: David Woodhouse, Yinghai Lu, Bjorn Helgaas, Dan Williams,
	Vinod Koul, Rafael J . Wysocki, Ashok Raj, Yijing Wang, Tony Luck,
	iommu, linux-pci, linux-hotplug, linux-kernel, dmaengine
In-Reply-To: <546B4249.7050502@linux.intel.com>

On Tue, Nov 18, 2014 at 08:57:45PM +0800, Jiang Liu wrote:
> 	Bjorn has given his acked-by for v6 at
> https://lkml.org/lkml/2014/9/24/975. But I forgot to carry this
> acked-by, sorry:(

Okay, I see, applied the patch with the Acked-by, thanks.


	Joerg


^ permalink raw reply

* Re: [Patch Part3 V7 0/8] Enable support of Intel DMAR device hotplug
From: Jiang Liu @ 2014-11-18 14:54 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: David Woodhouse, Yinghai Lu, Bjorn Helgaas, Dan Williams,
	Vinod Koul, Rafael J . Wysocki, Ashok Raj, Yijing Wang, Tony Luck,
	iommu, linux-pci, linux-hotplug, linux-kernel, dmaengine
In-Reply-To: <20141118142815.GD3762@8bytes.org>

On 2014/11/18 22:28, Joerg Roedel wrote:
> On Tue, Nov 18, 2014 at 08:57:45PM +0800, Jiang Liu wrote:
>> 	Bjorn has given his acked-by for v6 at
>> https://lkml.org/lkml/2014/9/24/975. But I forgot to carry this
>> acked-by, sorry:(
> 
> Okay, I see, applied the patch with the Acked-by, thanks.
Hi Joerg,
	Could you please help to make the branch immutable
so we could pull it into tip/x86/apic to solve some conflicts
between IOMMU hotplug and hierarchy irqdomain patch sets?
Regards!
Gerry
> 
> 
> 	Joerg
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply

* Re: [Patch Part3 V7 0/8] Enable support of Intel DMAR device hotplug
From: Joerg Roedel @ 2014-11-18 15:21 UTC (permalink / raw)
  To: Jiang Liu
  Cc: David Woodhouse, Yinghai Lu, Bjorn Helgaas, Dan Williams,
	Vinod Koul, Rafael J . Wysocki, Ashok Raj, Yijing Wang, Tony Luck,
	iommu, linux-pci, linux-hotplug, linux-kernel, dmaengine
In-Reply-To: <546B5D8D.8050601@linux.intel.com>

On Tue, Nov 18, 2014 at 10:54:05PM +0800, Jiang Liu wrote:
> 	Could you please help to make the branch immutable
> so we could pull it into tip/x86/apic to solve some conflicts
> between IOMMU hotplug and hierarchy irqdomain patch sets?

Yes, the patches are in my x86/vt-d branch and that branch will not be
rebased. So this can be pulled into tip/x86/apic.


	Joerg


^ permalink raw reply

* udev not renaming interface if driver is built-in
From: Rajib Karmakar @ 2014-12-02 13:58 UTC (permalink / raw)
  To: linux-hotplug

Hello,

My ethernet driver was built as a module and once it was probed, I can
see that udev renames the interface. but when I try to have the
ethernet driver as built-in. the driver is probed but udev no longer
renames the interface.

Can you please help me in this?

Thanks in advance.

Regards,
Rajib

^ permalink raw reply

* Re: udev not renaming interface if driver is built-in
From: Greg KH @ 2014-12-02 15:21 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAOi_9k_LXDGZsc18AS7epxW4eUkCX5Hy1hA9Gj2-gQ-gAVoU5Q@mail.gmail.com>

On Tue, Dec 02, 2014 at 07:16:19PM +0530, Rajib Karmakar wrote:
> Hello,
> 
> My ethernet driver was built as a module and once it was probed, I can
> see that udev renames the interface. but when I try to have the
> ethernet driver as built-in. the driver is probed but udev no longer
> renames the interface.
> 
> Can you please help me in this?

You aren't providing the version of udev you are using, the distro you
are using, what initramfs you are using, or the kernel you are using, so
it's a bit hard to help you out without that...

thanks,

greg k-h

^ permalink raw reply

* Re: udev not renaming interface if driver is built-in
From: Rajib Karmakar @ 2014-12-03  4:58 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAOi_9k_LXDGZsc18AS7epxW4eUkCX5Hy1hA9Gj2-gQ-gAVoU5Q@mail.gmail.com>

On Tue, Dec 2, 2014 at 8:51 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Dec 02, 2014 at 07:16:19PM +0530, Rajib Karmakar wrote:
>> Hello,
>>
>> My ethernet driver was built as a module and once it was probed, I can
>> see that udev renames the interface. but when I try to have the
>> ethernet driver as built-in. the driver is probed but udev no longer
>> renames the interface.
>>
>> Can you please help me in this?
>
> You aren't providing the version of udev you are using, the distro you
> are using, what initramfs you are using, or the kernel you are using, so
> it's a bit hard to help you out without that...
>
> thanks,
>
> greg k-h
Sorry for this, I am a bit new to kernel driver development and does
not quite understand a lot of things. Here are the details you wanted,

kernel version: 2.6.34
udev version 175
I am building this on a kirkwood board

Regards,
Rajib

^ permalink raw reply

* Re: udev not renaming interface if driver is built-in
From: Greg KH @ 2014-12-03  5:13 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAOi_9k_LXDGZsc18AS7epxW4eUkCX5Hy1hA9Gj2-gQ-gAVoU5Q@mail.gmail.com>

On Wed, Dec 03, 2014 at 10:16:49AM +0530, Rajib Karmakar wrote:
> On Tue, Dec 2, 2014 at 8:51 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Tue, Dec 02, 2014 at 07:16:19PM +0530, Rajib Karmakar wrote:
> >> Hello,
> >>
> >> My ethernet driver was built as a module and once it was probed, I can
> >> see that udev renames the interface. but when I try to have the
> >> ethernet driver as built-in. the driver is probed but udev no longer
> >> renames the interface.
> >>
> >> Can you please help me in this?
> >
> > You aren't providing the version of udev you are using, the distro you
> > are using, what initramfs you are using, or the kernel you are using, so
> > it's a bit hard to help you out without that...
> >
> > thanks,
> >
> > greg k-h
> Sorry for this, I am a bit new to kernel driver development and does
> not quite understand a lot of things. Here are the details you wanted,
> 
> kernel version: 2.6.34

Wow that's a very old and obsolete and unsupported kernel version, you
really are on your own here.  If you have to use this kernel, get
support from the company that is forcing you to stick with it, that is
what you are paying them for.

Best of luck,

greg k-h

^ permalink raw reply

* create /etc/udev/rules.d/70-persistent-net.rules
From: Christoph Pleger @ 2015-03-26 10:04 UTC (permalink / raw)
  To: linux-hotplug

Hello,

I hope that this is a right place fur udev questions.

My problem is that I need to create a file
/etc/udev/rules.d/70-persistent-net.rules on a PXE-Booted computer with an
NFS-Rootfilesystem. Unfortunately, that file ist not created automatically
at boot time, also "echo add > /sys/class/net/*/uevent" did not work,
though it did an another, disk-booted computer where I had deleted the
file before.

So, how can I create /etc/udev/rules.d/70-persistent-net.rules on a
netbooted computer, if possible without using tools like ifconfig, sed and
awk?

Regards
  Christoph


^ permalink raw reply

* Re: create /etc/udev/rules.d/70-persistent-net.rules
From: Tom Gundersen @ 2015-03-26 21:15 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <77e5d094647c5243d3b238ef82ee9328.squirrel@postweb.cs.tu-dortmund.de>

Hi Christopher,

On Thu, Mar 26, 2015 at 11:04 AM, Christoph Pleger
<Christoph.Pleger@cs.tu-dortmund.de> wrote:
> I hope that this is a right place fur udev questions.

Sure, though most udev discussions happen on the systemd mailinglist these days.

> My problem is that I need to create a file
> /etc/udev/rules.d/70-persistent-net.rules on a PXE-Booted computer with an
> NFS-Rootfilesystem. Unfortunately, that file ist not created automatically
> at boot time, also "echo add > /sys/class/net/*/uevent" did not work,
> though it did an another, disk-booted computer where I had deleted the
> file before.
>
> So, how can I create /etc/udev/rules.d/70-persistent-net.rules on a
> netbooted computer, if possible without using tools like ifconfig, sed and
> awk?

This mechanism is no longer supported/shipped upstream. Instead we
suggest using the scheme outlined here:
<http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/>,
which is the default.

HTH,

Tom

^ permalink raw reply

* how to install zxdsl 852 v2
From: zkubinski @ 2015-04-18  8:21 UTC (permalink / raw)
  To: linux-hotplug

Hello,
How to install a modem zxdsl 852 v2 on kernel 3.19.3 or 4.0 ?

Best redgards, Zbyszek

^ permalink raw reply

* PCI Hotplug Hardware Support
From: Daniel Norris @ 2015-04-20 15:07 UTC (permalink / raw)
  To: linux-hotplug

Hi there,

Can anyone recommend a modern server/workstation (prefer tower form
factor) that supports PCI hotplug? I've checked with HP and Dell; both
of them have dropped support for hotplug, although it's supported by
the intel chipsets they use...

My customers use PCI FPGA cards for development. Each time they load a
device model onto their PCI cards, the card appears as whatever type
of device they loaded on the PCI bus for the the OS (linux) to
interact with.  So, I'm not necessarily looking for
electrical/physical support, but software support as devices
appear/disappear from the bus.

Right now, we have to reboot the server each time their cards are
reconfigured, but I'd like to remove that need.

Thanks,
--Dan

^ permalink raw reply

* Re: PCI Hotplug Hardware Support
From: Greg KH @ 2015-04-20 15:28 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CABL2swbJaX-AEdoNF8KDLbuu_M4uXWBECe4imphi7poV=8MhQw@mail.gmail.com>

On Mon, Apr 20, 2015 at 08:07:43AM -0700, Daniel Norris wrote:
> Hi there,
> 
> Can anyone recommend a modern server/workstation (prefer tower form
> factor) that supports PCI hotplug? I've checked with HP and Dell; both
> of them have dropped support for hotplug, although it's supported by
> the intel chipsets they use...
> 
> My customers use PCI FPGA cards for development. Each time they load a
> device model onto their PCI cards, the card appears as whatever type
> of device they loaded on the PCI bus for the the OS (linux) to
> interact with.  So, I'm not necessarily looking for
> electrical/physical support, but software support as devices
> appear/disappear from the bus.
> 
> Right now, we have to reboot the server each time their cards are
> reconfigured, but I'd like to remove that need.

There is the "fakephp" kernel driver support, that might work for you,
but it doesn't do any electrical reset of the device, so that might
cause problems with your hardware.

good luck,

greg k-h

^ permalink raw reply

* how to do ? minimal udev script for my rc.sysinit ?
From: linuxcbon linuxcbon @ 2015-05-05 21:27 UTC (permalink / raw)
  To: linux-hotplug

Hi,

my kernel boots ok and gives the hand to init which runs rc.sysinit.
I am writing a minimal rc.sysinit.
It creates /dev with devtmpfs and now all works except udev.
I need 1 or 2 or 3 lines with udev commands to make it work
and detect and modprobe needed modules.
I don't know the minimal and shortest commands to do this ?
Can you please help me ?

Thanks in advance.
Linuxcbon

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: Greg KH @ 2015-05-05 21:34 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Tue, May 05, 2015 at 09:27:38PM +0000, linuxcbon linuxcbon wrote:
> Hi,
> 
> my kernel boots ok and gives the hand to init which runs rc.sysinit.
> I am writing a minimal rc.sysinit.
> It creates /dev with devtmpfs and now all works except udev.
> I need 1 or 2 or 3 lines with udev commands to make it work
> and detect and modprobe needed modules.
> I don't know the minimal and shortest commands to do this ?
> Can you please help me ?

Try using mdev.

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: linuxcbon linuxcbon @ 2015-05-06  0:43 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Tue, May 5, 2015 at 10:34 PM, Greg KH <greg@kroah.com> wrote:
> On Tue, May 05, 2015 at 09:27:38PM +0000, linuxcbon linuxcbon wrote:
>> Hi,
>>
>> my kernel boots ok and gives the hand to init which runs rc.sysinit.
>> I am writing a minimal rc.sysinit.
>> It creates /dev with devtmpfs and now all works except udev.
>> I need 1 or 2 or 3 lines with udev commands to make it work
>> and detect and modprobe needed modules.
>> I don't know the minimal and shortest commands to do this ?
>> Can you please help me ?
>
> Try using mdev.


Hi Greg,

I already do this "mount -t devtmpfs dev /dev" which automagically
creates /dev files
When I do a "mdev -s" , it will recreate /dev, so what's the point of
using devtmpfs
I am also not sure if mdev triggers modprobes like udev does ?
If you have some working mdev or udev examples, I will try.
Until now, this problem has been a real pain for me...

Thanks.
linuxcbon

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: Tom Gundersen @ 2015-05-06  6:01 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Tue, May 5, 2015 at 11:27 PM, linuxcbon linuxcbon
<linuxcbon@gmail.com> wrote:
> my kernel boots ok and gives the hand to init which runs rc.sysinit.
> I am writing a minimal rc.sysinit.
> It creates /dev with devtmpfs and now all works except udev.
> I need 1 or 2 or 3 lines with udev commands to make it work
> and detect and modprobe needed modules.
> I don't know the minimal and shortest commands to do this ?
> Can you please help me ?

A good starting point is to look at the ExecStart lines in the udev
service files used by systemd. You'll likely want to pass --daemon to
the main daemon though so that it will fork to the background:

http://cgit.freedesktop.org/systemd/systemd/tree/units/systemd-udevd.service.in
http://cgit.freedesktop.org/systemd/systemd/tree/units/systemd-udev-trigger.service.in
http://cgit.freedesktop.org/systemd/systemd/tree/units/systemd-udev-settle.service.in

(note that the order matters).

Apart from that I don't think anyone is using/testing/developing for
this setup any longer, so you are mostly on your own, sorry.

HTH,

Tom

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: Robert Milasan @ 2015-05-06  6:46 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Tue, 5 May 2015 21:27:38 +0000
"linuxcbon linuxcbon" <linuxcbon@gmail.com> wrote:

> Hi,
> 
> my kernel boots ok and gives the hand to init which runs rc.sysinit.
> I am writing a minimal rc.sysinit.
> It creates /dev with devtmpfs and now all works except udev.
> I need 1 or 2 or 3 lines with udev commands to make it work
> and detect and modprobe needed modules.
> I don't know the minimal and shortest commands to do this ?
> Can you please help me ?
> 
> Thanks in advance.
> Linuxcbon
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-hotplug" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

This might help:

# start udev daemon (udevd might be called systemd-udevd)
/path/to/udevd --daemon || echo "udev error" >&2

# trigger events
/path/to/udevadm trigger --action­d || echo "udev trigger error" >&2
/path/to/udevadm trigger --type=subsystems --action­d || echo "udev trigger error" >&2

# wait for events to finish
/path/to/udevadm settle || echo "udev settle error" >&2

-- 
Robert Milasan

L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: rmilasan@suse.com
GPG fingerprint: B6FE F4A8 0FA3 3040 3402  6FE7 2F64 167C 1909 6D1A

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: linuxcbon linuxcbon @ 2015-05-06 17:16 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Wed, May 6, 2015 at 7:01 AM, Tom Gundersen <teg@jklm.no> wrote:
> A good starting point is to look at the ExecStart lines in the udev
> Tom

Hi Tom,
I don't have systemd, I have udev or mdev only.
Thanks.
linuxcbon

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: linuxcbon linuxcbon @ 2015-05-06 17:20 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Wed, May 6, 2015 at 7:46 AM, Robert Milasan <rmilasan@suse.com> wrote:
>
> This might help:
>
> # start udev daemon (udevd might be called systemd-udevd)
> /path/to/udevd --daemon || echo "udev error" >&2
>
> # trigger events
> /path/to/udevadm trigger --action≠d || echo "udev trigger error" >&2
> /path/to/udevadm trigger --type=subsystems --action≠d || echo "udev trigger error" >&2
>
> # wait for events to finish
> /path/to/udevadm settle || echo "udev settle error" >&2
>
> --
> Robert Milasan

Hi Robert,
thanks, actually, I am testing things like that.
Do you know if I need to add a line for --typefivices and what it is for ?
Do you also know the minimal rules to have inside /lib/udev ?
I don't need to add rules inside /etc/udev ?
I also noticed udev mandatorely needs /run/udev, otherwise it doesnt start ?
thanks linuxcbon
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: Robert Milasan @ 2015-05-06 17:33 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Wed, 6 May 2015 18:20:56 +0100
"linuxcbon linuxcbon" <linuxcbon@gmail.com> wrote:
> 
> Hi Robert,
> thanks, actually, I am testing things like that.
> Do you know if I need to add a line for --typeÞvices and what it is

No, because --typeÞvices is the default

> for ? Do you also know the minimal rules to have inside /lib/udev ?

Depends on your hardware and what you'll in the future

> I don't need to add rules inside /etc/udev ?

No

> I also noticed udev mandatorely needs /run/udev, otherwise it doesnt
> start ? thanks linuxcbon

/run/udev is required and hardcoded in udev.


-- 
Robert Milasan

L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: rmilasan@suse.com
GPG fingerprint: B6FE F4A8 0FA3 3040 3402  6FE7 2F64 167C 1909 6D1A

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: linuxcbon linuxcbon @ 2015-05-07  1:15 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Wed, May 6, 2015 at 6:33 PM, Robert Milasan <rmilasan@suse.com> wrote:
> Depends on your hardware and what you'll in the future
> Robert Milasan

Hi Robert,
I have added your lines to sysinit.
For testing, I don't have any /etc/udev and I have an empty /lib/udev/
I get many errors with --debug , for example :
[    4.304862] udevd[77]: seq 2397 queued, 'add' 'module'
[    4.304878] udevd[81]: seq 2397 running
[    4.304890] udevd[81]: no db file to read
/run/udev/data/+module:pata_rz1000: No such file or directory
[    4.304901] udevd[81]: passed -1 bytes to netlink monitor 0x63dc00
[    4.304903] udevd[81]: seq 2397 processed with 0
[    4.304908] udevd[77]: passed 144 bytes to netlink monitor 0x62d3a0
If I understand, for each error, there must be a rule for a modprobe ? sigh...
Cheers.
linuxcbon

^ permalink raw reply

* Re: how to do ? minimal udev script for my rc.sysinit ?
From: Robert Milasan @ 2015-05-07  6:25 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <CAJ-LWjMrUwRSn4Fr_eUchG8=zfv6VR3dxT6ySfwa2gur2OD1zw@mail.gmail.com>

On Thu, 7 May 2015 02:15:51 +0100
"linuxcbon linuxcbon" <linuxcbon@gmail.com> wrote:

> Hi Robert,
> I have added your lines to sysinit.
> For testing, I don't have any /etc/udev and I have an empty /lib/udev/
> I get many errors with --debug , for example :
> [    4.304862] udevd[77]: seq 2397 queued, 'add' 'module'
> [    4.304878] udevd[81]: seq 2397 running
> [    4.304890] udevd[81]: no db file to read
> /run/udev/data/+module:pata_rz1000: No such file or directory
> [    4.304901] udevd[81]: passed -1 bytes to netlink monitor 0x63dc00
> [    4.304903] udevd[81]: seq 2397 processed with 0
> [    4.304908] udevd[77]: passed 144 bytes to netlink monitor 0x62d3a0
> If I understand, for each error, there must be a rule for a
> modprobe ? sigh... Cheers.
> linuxcbon
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-hotplug" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Yes, of course. You don't need udev if you don't have any rules. 

-- 
Robert Milasan

L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: rmilasan@suse.com
GPG fingerprint: B6FE F4A8 0FA3 3040 3402  6FE7 2F64 167C 1909 6D1A

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox