From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7343661073770217472 X-Forwarded-Encrypted: i=2; AJvYcCVvGTEi7CJjVpXmpwhi6DADci0Y2OlDHzgMgOtWwvCKvbjTfmL9lsQZKWECGleBlQFMimY7/py2TX7haku89t4+NJnB0/j84/q/Ifc= X-Received: by 2002:a2e:2e09:0:b0:2d4:269e:59df with SMTP id u9-20020a2e2e09000000b002d4269e59dfmr2522812lju.52.1710494240371; Fri, 15 Mar 2024 02:17:20 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:98d1:0:b0:2d3:9a3f:6456 with SMTP id s17-20020a2e98d1000000b002d39a3f6456ls133579ljj.0.-pod-prod-08-eu; Fri, 15 Mar 2024 02:17:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqC139YJ0iVKAB1mNgETDW8LipgpQ7V1BdYhCz42fvXkGgkPrFHYbHH1OTAbj25f57GdvkV2a2FikF06ARTdIla9j0VCvraoW0iLA= X-Google-Smtp-Source: AGHT+IEfarLpZPBU21TAPzcrN/MzZuDakugI27QOZ1Hh9TC2DmyCxj/GkEXc5dbGtFW9utDaNPIg X-Received: by 2002:a2e:2283:0:b0:2d4:68ef:c711 with SMTP id i125-20020a2e2283000000b002d468efc711mr2894066lji.25.1710494237938; Fri, 15 Mar 2024 02:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710494237; cv=none; d=google.com; s=arc-20160816; b=Pa6FGNwNOwsxz2ZQ6xbhRVBR9VQ1J8Et9qSXrLntPQ59HiFgAMmYIzUWpIrs0o/705 A4hez8zvrMqwaWyxOHTmUGX4LsHfkZGePmT4FrJRB7S5ENA4cbfWVj+yFD3HNWE5zYeA GKZLrYqC6hX0vzs+fhBbOGGIt1BP+LIcP5FqldTg2Iq1CQyTqwU43FnnJcJh4O9D5Sqr n7P31wIlLxg2OQVqV7418ttATSVb3DQQj6y0/VeODJBLxH20wU69GqrvQ8bzwzvhCOKa tTeKTsXUE9M1MCT5p7VFS/UUuEtlDU21OJC3sTcR7sN15CQI8x3pKwTVED5TShM5rbBf hHvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id; bh=151rwqIAjlxRXQQESPxcFHQhnsqjDh4P9uYThcX69Uo=; fh=YY32tW40YGyAIvacPR0vvTXoRy68jPWkjo70Hnxb3kU=; b=nfA4c77I4WDU2tSa7hbpBygUv+mKHityX03SQiPe646+Q35Xyn2QrkeIiOcmPbimq7 fkS1hPuNm39/ysnUZFQRV3NBsrse4wgZvtuuUAxB/o26mTUuNuoAeOR3Wz0xguNxAT1L JZNFvc63kFCmu4rlMrPOISnc2Xb7xcF52OkuAuffFOLqU+rrllLuSBxxdd2h6XVkQCH3 abPdnT7ogrVYX8Gg9dUQAMGjwvlMCYtajZXvFTT3TO16PLwC0GpmlNsl3A3Gh6LFUzkU QpNaOfe0B5nAAo6HFXNDke6gee7XWWp05sU01ED+VxI6ANCSAmm9WoFlSVq4JM3yYO4V uV3Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id w4-20020a2e3004000000b002d2ddef9d5asi143216ljw.8.2024.03.15.02.17.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2024 02:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 42F9HEd2028570 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Mar 2024 10:17:15 +0100 Message-ID: <2cb96a28-8df6-47c2-b16f-a8379d4ae6dc@ilbers.de> Date: Fri, 15 Mar 2024 11:17:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: No network available during task do_install on debian bullseye/5.10 host - but on a debian buster/4.19 host network is available Content-Language: en-US, ru-RU To: Bjoern Kaufmann , isar-users References: <0a3ee875-d004-42d4-906b-4e6e847c7cd7@ilbers.de> <86320af4-266d-4040-9f41-6d2d9f267015n@googlegroups.com> <5850e65d-9636-47a9-847d-b6d2462353f9n@googlegroups.com> From: Anton Mikanovich In-Reply-To: <5850e65d-9636-47a9-847d-b6d2462353f9n@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: kw0lACpTD64f 15/03/2024 11:06, Bjoern Kaufmann wrote: > I did what you proposed, but there is still no eth0. > What I also tested and what might be interesting: > > def print_ifs(): >     import subprocess >     import socket > >     output = subprocess.check_output("ip a", shell=True) >     print(f'Output of ip a: "{str(output)}"') > >     print(socket.if_nameindex()) >     return '' > > do_testtask() { >     ${@ print_ifs()} >     ip a > } > addtask testtask > > > I executed it inside kas shell by 'bitbake -c testtask my-recipe' > again and the log looks as follows: > > DEBUG: Executing shell function do_testtask > Output of ip a: "b'1: lo: mtu 65536 qdisc > noqueue state UNKNOWN group default qlen 1000\n  link/loopback > 00:00:00:00:00:00 brd 00:00:00:00:00:00\n    inet 127.0.0.1/8 scope > host lo\n       valid_lft forever preferred_lft forever\n4: eth0@if5: > mtu 1500 qdisc noqueue state UP > group default \n    link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff > link-netnsid 0\n    inet 172.17.0.2/16 brd 172.17.255.255 scope global > eth0\n       valid_lft forever preferred_lft forever\n'" > [(1, 'lo'), (4, 'eth0')] > Output of ip a: "b'1: lo: mtu 65536 qdisc noop state DOWN > group default qlen 1000\n    link/loopback 00:00:00:00:00:00 brd > 00:00:00:00:00:00\n'" > [(1, 'lo')] > 1: lo: mtu 65536 qdisc noop state DOWN group default qlen 1000 >     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 > DEBUG: Shell function do_testtask finished > > > So as you can see > 1. The python function is printed twice in a row, most probably in two > different contexts? I guess you know more about it > 2. During the first execution of the python function, eth0 interfaces > are available > 3. During the second execution of the python function, no eth0 > interface is available > > > Also Jan Kiszka told me that to his knowledge the newer bitbake > isolates tasks from networks by default. If this is the case it still > doesn't really explain the behavior show in the log above and it > doesn't explain why this doesn't happen on the buster host VMs. > > Best regards, > Bjoern Hello Bjoern, The first print_ifs execution was done during recipe parsing, the second one was done during task execution. It happens because you've used inline python call. For bitbake 2.0+ you can enable network access for your task by setting: do_testtask[network] = "1" On my side even without it 'ip a' was showing eth0, but there maybe some other permissions configuration.