From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 379BDC36002 for ; Wed, 9 Apr 2025 09:29:02 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.121]) by mx.groups.io with SMTP id smtpd.web11.4268.1744190939066581669 for ; Wed, 09 Apr 2025 02:28:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@topic.nl header.s=selector2 header.b=l2tfRVG3; spf=pass (domain: topic.nl, ip: 40.107.20.121, mailfrom: mike.looijmans@topic.nl) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Sn2YGEsWelR3IJ0Zg6Fi6tpJZEXncXyJ+SDFM/FivXNJ5eYtFNQzMHUGp59T19sHz9uY9BgfF4Rr7L8nzX8TWe/XKPcrYLhNZh++MjRBBaep5h6OtQPw+kjPUcn9DV052JBqSPJo9yO1MXPoGSfEqTLUp9s6VatPyXFeTz3opn9kCJ1dPfqOyirHDmx9hOpNua8qxWr0oCS0Ogfe8ltz9nDentgBPaX+iJMu2Ng5Hy7R9zJXLb/AM9s/bBAS3KxhAdMw3TRZCZ5FzI3OBWm0sqcfzkl9ix5txdp2pvn/OLKkxRFn/QyMkiRpsnc6DkJG4gEC5JzdJy8jHdEzy/vjgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I3PK8YVjYhwyjIOX3VS7gdmx+igw8Xu9Aeqb6N04+OU=; b=oLQzmESB4af22aJn3jeJ1WRDqhw+sYDJ63KHTLJLBJ79ats5WjTM0GiTGEpsECWFvI/5qG8Lw13QPUTgulR35TPLCKzLNy5INAAVGeNDlUndo0ayy2OiwrJQXzI0jUBNKVr0W+viwLa4ZV/1v6q9s1+DCO0KewIZvYQ7MjePV+RUbQb+ZMbeGjdrUElolqsvzEkafO+8wZA9ce7ECb1UM2bBYJvZgTdx76arMEuwS/YBAHi1smTSPtz83OOyQbOxYnoljAYdGsFeHXGguG6vY/fmUP230du/VnyIBEZDSbmAserJ6DGBM9Jx/pb4Edn1UwS6Ao+yl9v9B1sElUEQgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 13.93.42.39) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=topic.nl; dmarc=pass (p=none sp=none pct=100) action=none header.from=topic.nl; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=topic.nl; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I3PK8YVjYhwyjIOX3VS7gdmx+igw8Xu9Aeqb6N04+OU=; b=l2tfRVG3fyyGTva+j0aV5hJfNzwdPD9oOJab27dk1Hjr7uqkjQvyo4r58NxkVdghVGSaaSH1dw+o6tljXIx7TaZ9sr1RDw/lIw2otvZzl7FYqJvW1YVNlQ32FA2dhmlqkxANJSRc9xotQ9rJ/bOFntL8OSETZ/CM7GRo++nghcOPA131xOwawOgThSaeS1C7B9coVTAHPg4VXQO/KnBZmC5OZyfhDeXHQxz4jicT3J70VZGB3d8OhMAxAak0uGIpnmIJpHrDr02khCoSCiZVg9NeBMcXRCylYYA+30cAzCauHasYRUpapZ/JqtWwJlfwGgAhEDNDgSPbe8joTGOvlw== Received: from AS4P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::18) by AM9PR04MB7603.eurprd04.prod.outlook.com (2603:10a6:20b:2d6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.34; Wed, 9 Apr 2025 09:28:54 +0000 Received: from AM1PEPF000252DC.eurprd07.prod.outlook.com (2603:10a6:20b:5d5:cafe::e2) by AS4P191CA0003.outlook.office365.com (2603:10a6:20b:5d5::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.36 via Frontend Transport; Wed, 9 Apr 2025 09:28:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 13.93.42.39) smtp.mailfrom=topic.nl; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=topic.nl; Received-SPF: Pass (protection.outlook.com: domain of topic.nl designates 13.93.42.39 as permitted sender) receiver=protection.outlook.com; client-ip=13.93.42.39; helo=westeu12-emailsignatures-cloud.codetwo.com; pr=C Received: from westeu12-emailsignatures-cloud.codetwo.com (13.93.42.39) by AM1PEPF000252DC.mail.protection.outlook.com (10.167.16.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.13 via Frontend Transport; Wed, 9 Apr 2025 09:28:53 +0000 Received: from DUZPR83CU001.outbound.protection.outlook.com (40.93.64.11) by westeu12-emailsignatures-cloud.codetwo.com with CodeTwo SMTP Server (TLS12) via SMTP; Wed, 09 Apr 2025 09:28:53 +0000 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=topic.nl; Received: from AS8PR04MB8644.eurprd04.prod.outlook.com (2603:10a6:20b:42b::12) by VE1PR04MB7373.eurprd04.prod.outlook.com (2603:10a6:800:1ab::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.34; Wed, 9 Apr 2025 09:28:50 +0000 Received: from AS8PR04MB8644.eurprd04.prod.outlook.com ([fe80::e86d:f110:534e:480a]) by AS8PR04MB8644.eurprd04.prod.outlook.com ([fe80::e86d:f110:534e:480a%5]) with mapi id 15.20.8606.033; Wed, 9 Apr 2025 09:28:50 +0000 Message-ID: <8bd1387d-2a27-494e-91de-f7e0e9138a2a@topic.nl> Date: Wed, 9 Apr 2025 11:28:49 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [OE-core] [PATCH] udev-extraconf: fix ifupdown for non hotplug devices To: openembedded-core@lists.openembedded.org References: <20250407174904.1191173-1-jeroen@myspectrum.nl> Content-Language: nl, en-US From: Mike Looijmans Organization: TOPIC In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0PR10CA0112.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::29) To AS8PR04MB8644.eurprd04.prod.outlook.com (2603:10a6:20b:42b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR04MB8644:EE_|VE1PR04MB7373:EE_|AM1PEPF000252DC:EE_|AM9PR04MB7603:EE_ X-MS-Office365-Filtering-Correlation-Id: 71c29d4d-8412-4387-94ac-08dd7748f1f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?MklFTEF5SkRac3h3RWVqNVNBaFRuTk0rM1ljNEoxMU4xbDlySXpKTUxEVGg3?= =?utf-8?B?WEd0aXJIVzlRb2x4QkVSWEM3TFVsR1gyUFZyMnREc0RpZDNHNXIwUVFybzV6?= =?utf-8?B?SmZPYi9nWmtQZXBCKzVBUTJuTGZ5Y0hrS0NnalhCUlp0L2NSWUVxTndqRGtO?= =?utf-8?B?bVpMOERSUncvTHZGYmxVTTdmRkNhbk4vSFRqdUhJNjhvemtBUm1Dakl1dHgz?= =?utf-8?B?QTZFdCtkRS9aK1RzMzdsbnlVcDUrZk5sZDV3eWhUWVJIQn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pudGJXV1ZGajJaOTl3?= =?utf-8?B?cU01b0JWSHFCVW5CM29IcXBOcGZKWGxjaW0zYVNCMUdzOEo5Ui9KOGY4NUgx?= =?utf-8?B?d1BueEJJWUZzb0ZOWGZDNnh2aWNZOXFLR3Z5S2l3MlZjMWxnMXFkVWNubmNG?= =?utf-8?B?Q2YxSlVPRytlbzE5ZjhyOVpBK2p2VklodGlaazVEaWZqREFscjZsOCt2MTJq?= =?utf-8?B?RC83c2dKS1p0ZFJMU2VUZzFOMGtVOGJzYnI2LzdnVk1FQ051U2liREJCS3Vi?= =?utf-8?B?ZTZMb3p2bnMrcURWVzV3V0ZMc1ViOENySkJJMkEweCttdjRublFERHhGb3k0?= =?utf-8?B?dVptajhoaDhyTnlsKzJ4WWdwU2Nkd3lIQ3JSRkRhZFYraUtZNkEvcEpLOUpB?= =?utf-8?B?NGkzSkh0V0pKZjI1VmJqMFhUdkgwNDhITDNiczBzdnNBVW5RdkJYQUt0cHpG?= =?utf-8?B?WEs2WDB4Z2ZSSmRrUmZLdWh3bzdIam1jRENmV1k0QjV2Kzljb21wNVNDU0xi?= =?utf-8?B?bEQ5YzdFQkYxN2drVlFMUjJWVTZ3K3ZKU3Y2WkwzdTNOdWhOcEJUSDVwNWpC?= =?utf-8?B?V3F6YTZyeEIxTzUxQ2tUeGVtNmJ5aG84RXVhVUpmSDlVemZtM2YvSVQrY0Jo?= =?utf-8?B?MXFhSVJhVml2dUJTeklBdz09?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8644.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7373 X-CodeTwo-MessageID: 6f5852db-f07b-4732-82b9-d19ef9b8eecc.20250409092853@westeu12-emailsignatures-cloud.codetwo.com X-CodeTwoProcessed: true X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM1PEPF000252DC.eurprd07.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 95b3b73a-d72d-4b3d-4a14-08dd7748efc0 X-Microsoft-Antispam: BCL:0;ARA:13230040|14060799003|82310400026|376014|36860700013|35042699022|1800799024|13003099007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YlM3MXNoc2dzQ3VWQUdhOEg0Vnh3VnVHYUN0WnVVbkNqZHNONnFtY0lqRzVl?= =?utf-8?B?YmdBNzNKWHBjTDBEUkg3cWhOcDFsSElFMU1UaGxGVW53WXc2NmhtNjA5SnBK?= =?utf-8?B?eGRsV1ZqQUladHBJK01UMXlUQmZNTWZPTFF0Ri9CcnUxMTl5Y010b3ZZZ2xN?= =?utf-8?B?U2c3eW00eWxqU25IZ3U5UEpWZ0FCZ3FIenpKK3REREFZQWVsM05paGNEV3A2?= =?utf-8?B?ZWRnekJZeHdvUHUwcFpQcCtzWmdGU0NERHIxbVdJMWZSVFBkbzFXa3AyMnQ4?= =?utf-8?B?U3ROL3NRN2p2Wi83MU8yZXhVUnlCUEtkQlhSeFlKd2xLNXBDUk1pcnljdG5D?= =?utf-8?B?S2ZlcTdsb05kM24rT3VBdzRDdGNnR0ZWMjB3dXZyQ1Y1VE8rdDdIRkFaZ2RY?= =?utf-8?B?ZXlOZ05jNnFQTk5vMUF5NFAvTXI1Znh1OU9ud1VMbkVkbWpTU24vRzFTL3hl?= =?utf-8?B?b2tuSnF3TndaclNWL0h2d1pPQis1dmFlS2NvNkhpT2Y3U216dyt2SldmVlVG?= =?utf-8?B?RHdJNGloejJsRlZ0N2hxU01FcnRPWUJNaXFhZEVacDZKMGVNeFVCOFMvNVVD?= =?utf-8?B?cTU0SUpLdGswdTN1WHlUb1g1NllnUVErVmZDYWxwU2tpNUpEL1VlU3NtVEdS?= =?utf-8?B?M3pycEl4dmpiUUNOQ2NIak80QTB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ZRWnBaN25DbWZ1T1MxOXRIdmpYWlROWWZ3cXJMV0d2RXR5?= =?utf-8?B?QWVhQnNWZWFYZkhJQ0lsMW16eW9Fc3JkNitGMzVjcVZqTGIrdXdKclJKbkZp?= =?utf-8?B?MTA1MXlTeDZJaWpXQlBiMGZYd0M3TVRFelBMVTJWajJFQkMzSVM5c2VvQzVT?= =?utf-8?B?U0VlSFZMaUxhM2RkRFEzNUxENlJUc0dYY0JZTEcvWFdmdHNQeWhvbllSdTRH?= =?utf-8?B?bTJsT3V0RGdxa3RoUlZYMGU1T05yTTlWNWI5bVBPM0p0bXUrOVdmVjlUMWYz?= =?utf-8?B?Q0FtdWt6U0RRZ2VRT2oxeEZuclNLbHluaE56a2RMdDJDVzVLN0cwZUN5b0Mx?= =?utf-8?Q?A+JcqzIl2yU=3D?= X-Forefront-Antispam-Report: CIP:13.93.42.39;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:westeu12-emailsignatures-cloud.codetwo.com;PTR:westeu12-emailsignatures-cloud.codetwo.com;CAT:NONE;SFS:(13230040)(14060799003)(82310400026)(376014)(36860700013)(35042699022)(1800799024)(13003099007);DIR:OUT;SFP:1102; X-OriginatorOrg: topic.nl X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2025 09:28:53.6919 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71c29d4d-8412-4387-94ac-08dd7748f1f5 X-MS-Exchange-CrossTenant-Id: 449607a5-3517-482d-8d16-41dd868cbda3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=449607a5-3517-482d-8d16-41dd868cbda3;Ip=[13.93.42.39];Helo=[westeu12-emailsignatures-cloud.codetwo.com] X-MS-Exchange-CrossTenant-AuthSource: AM1PEPF000252DC.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7603 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Apr 2025 09:29:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214581 On 09-04-2025 10:37, Richard Purdie via lists.openembedded.org wrote: > On Mon, 2025-04-07 at 19:49 +0200, Jeroen Hofstee via lists.openembedded.= org wrote: >> From: Jeroen Hofstee >> >> Commit 160f713917 (udev-extraconf: fix network.sh script did not >> configure hotplugged interfaces, 2024-10-18) fixed ifupdown for >> hotplug devices, but also calls it for non hotplug devices. That >> can cause issue, since they might not expect the ifupdown from >> udev, since it wasn't called before mentioned patch got merged. >> >> For util-linux this can simply be fixed by adding --allow=3Dhotplug. >> Unfortunately busybox doesn't have that option, so a function is >> added to check if the device is marked as allow-hotplug. >> >> Since wilcards are supported adding 'allow-hotplug *' allows to >> restore behaviour of mentioned patch, while this restores the >> original behaviour. >> >> Signed-off-by: Jeroen Hofstee >> --- >> =C2=A0.../udev/udev-extraconf/network.sh=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 28 +++++++++++++++++++ >> =C2=A01 file changed, 28 insertions(+) >> >> diff --git a/meta/recipes-core/udev/udev-extraconf/network.sh b/meta/rec= ipes-core/udev/udev-extraconf/network.sh >> index 500e60ae61..da79f00d5a 100644 >> --- a/meta/recipes-core/udev/udev-extraconf/network.sh >> +++ b/meta/recipes-core/udev/udev-extraconf/network.sh >> @@ -6,6 +6,34 @@ echo "$INTERFACE" | grep -q wifi && exit 0 >> =C2=A0# udevd does clearenv(). Export shell PATH to children. >> =C2=A0export PATH >> =20 >> +# udev should only trigger ifupdown for interfaces marked as allow-hotp= lug >> +# and with util-linux that is as simple as adding --allow=3Dhotplug. >> +# Busybox unfortunately doesn't have this option. >> +# allow-hotplug is a pattern like eth0 /eth* /eth*/1 /eth*=3Deth. >> +# This function checks if INTERFACE matches an allow-hotplug pattern. >> + >> +allow_hotplug() { >> +=C2=A0=C2=A0=C2=A0 allow_hotplug=3D"$(sed -n -e 's/^allow-hotplug \+\([= ^=3D ]*\).*/\1/p' /etc/network/interfaces)" >> +=C2=A0=C2=A0=C2=A0 for pattern in $allow_hotplug; do >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 options=3D"$(echo $pattern |= sed -n -e 's,^/\?[^ /]\+/\(.*\),\1,p')" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value=3D"$(echo $pattern | s= ed -n -e 's,^/\?\([^ /]\+\).*,\1,p')" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 interfaces=3D"$(ls -d /sys/c= lass/net/$value 2>/dev/null | xargs -r -n 1 basename)" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if [ "$options" !=3D "" ]; t= hen >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inte= rfaces=3D"$(echo $interfaces | awk -v n=3D$options '{print $n }')" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 echo "$interfaces" | grep -w= -q "$INTERFACE" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if [ $? -eq 0 ]; then >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 retu= rn 0 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi >> +=C2=A0=C2=A0=C2=A0 done >> + >> +=C2=A0=C2=A0=C2=A0 return 1 >> +} >> + >> +if ! allow_hotplug; then >> +=C2=A0=C2=A0=C2=A0 exit 0 >> +fi >> + >> =C2=A0# if this interface has an entry in /etc/network/interfaces, let = ifupdown >> =C2=A0# handle it >> =C2=A0if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then >> > Firstly thanks for the patch, we should try and fix issues like this. I > feel I should mention our code comes from a backdrop of resource > constrained devices and the above code makes me cringe a bit due to the > execution overhead of it. That was my first reaction as well. Immediately followed by "luckily I use= =20 mdev on constrained devices". > We've purposefully kept the code called from udev and in our > initscripts relatively minimal/simple as the overhead of executing > multiple programs does build up over time. Taking the above, we have > loops, then pipelines, each of which runs more commands. Each command > has a fork/exec overhead. > > Is there some way we can simplify this rather than all the shell > pipelines and loops? I've always found that the way that initscripts starts the network interfac= es=20 is broken. It immediately tries to bring up an interface when it detects it. It will s= end=20 out DHCP requests, of which the first few usually get dropped because the=20 interface doesn't have a carrier yet. Causing a delay of sometimes 10 secon= ds=20 before the interface actually configures. So what I have been putting in there for years is to start "ifplugd" for=20 interfaces when they arrive (cold and hotplug treated the same). And once=20 ifplugd reports a link "up", I call "ifup" on that interface. Then the DHCP= =20 actually works immediately and the configuration finishes quickly. That also works great for wifi devices, because a "link up" means "associat= ed=20 with an AP", so all it takes for a wifi link is to start wpa_supplicant whe= n=20 it registers. This works for mdev, and should work for udev as well (after adding device= =20 add/remove hooks). Recipes are on github (ifplugd-auto-net): https://github.com/topic-embedded-products/topic-platform/tree/scarthgap/me= ta-topic-platform/recipes-topic/network Maybe it'd be interesting to move these to core? Mike.