From patchwork Thu Aug 8 13:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Fischer X-Patchwork-Id: 7941 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4WfpWF1DqXz3wwf for ; Thu, 8 Aug 2024 13:56:57 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E5" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4WfpWD5Vmzz1T9; Thu, 8 Aug 2024 13:56:56 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4WfpWD4tW2z33mK; Thu, 8 Aug 2024 13:56:56 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4WfpWC1Yqjz33mK for ; Thu, 8 Aug 2024 13:56:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4WfpWB4t8yznC for ; Thu, 8 Aug 2024 13:56:54 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1723125414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id:to: cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=USdKbhfH+d57580tbtz8znILFYXxZR2+4XWCZUS5c/Y=; b=E9k3GdbxqqVKeEBBbLwDzgMqYdp9OUVq5hqmjFD3NxUXz244LC2mvb+fYeDSCiO4g7atXM savhMGaXx1fGrjAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1723125414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id:to: cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=USdKbhfH+d57580tbtz8znILFYXxZR2+4XWCZUS5c/Y=; b=EJSFfKahuMNwzYVKzOTNxPOLLpksqlEx9t6QBqtmNQgqEV2RuQYU+7Y0sdOA9cFHUvnlKT p1hhmr3G+ARrZdT+lakl8mu6v6UtSkeMGv7fBxOWPDC3ICj/HsOIh7yriHDkNXdCHA1kqI curVfeKxi5jE2t4+bQPqUZ6ug0QtVWycNgCJSSdxlhLcEJebKlRepIDxlnht6hC9CbYw/R DMjxjixNjAtDiXwQfZvzteSeZogk5yJ8cvrAuzA08gIzz/z7RB6f8KXReq0tTnqMRqGRXM JqnAhpQXjpNDEKx5c2GFjo5jojoLmCUOQqI7YExn+VeIskcO8w1K4WTM7SIhKw== Message-ID: <8ad8b53e-0e31-4059-87d4-b3c08ab3d7e7@ipfire.org> Date: Thu, 8 Aug 2024 15:56:54 +0200 MIME-Version: 1.0 Subject: Fwd: The unshared changes give a problem with build after doing git pull on next Content-Language: en-US References: Cc: "IPFire: Development-List" From: Matthias Fischer In-Reply-To: X-Forwarded-Message-Id: Message-ID-Hash: 3CJSJGDILDHTCNUEYPMPG34OGFSG3SOY X-Message-ID-Hash: 3CJSJGDILDHTCNUEYPMPG34OGFSG3SOY X-MailFrom: matthias.fischer@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Again - I only hit "Reply" not "Reply all"... -------- Forwarded Message -------- Subject: Re: The unshared changes give a problem with build after doing git pull on next Date: Thu, 8 Aug 2024 14:06:24 +0200 From: Matthias Fischer To: Michael Tremer Hi, ok - please don't laugh. I did something completely different... I added the following to 'make.sh': ***SNIP*** ***SNAP*** No 'invalid argument' error anymore. I don't know why - but with this patch the build is running... Any comments? Best Matthias On 06.08.2024 17:40, Michael Tremer wrote: > Hello, > > We should not touch the mount propagation of the host’s namespace. > > Instead, we should create our own mount namespace and that should be private. > > You can however try to see what happens when you add —-propagation=slave to the first unshare command. > > I just installed the plain Ubuntu Server, installed git, checkout out the repository, downloaded the toolchain and ran the build. > > -Michael > >> On 3 Aug 2024, at 12:22, Matthias Fischer wrote: >> >> On 03.08.2024 10:54, Michael Tremer wrote: >>> Hello Matthias, >> >> Hi Michael, >> >> just looked through https://man7.org/linux/man-pages/man1/unshare.1.html >> and ran 'findmnt -o+PROPAGATION' (see attachment). >> >> I don't know if this could help but does this differ from your test >> installation? >> >> Best >> Matthias >> >>>> On 3 Aug 2024, at 08:47, Matthias Fischer wrote: >>>> >>>> Hi Michael, >>>> >>>> [shortened some stuff] >>>> >>>> ... >>>> >>>>>>>> >>>>>>>> Being curious I tried to build 'next', but I always get the same error: >>>>>>>> >>>>>>>> ***SNIP*** >>>>>>>> root@Devel64-1: /git/ipfire-2.x # ./make.sh build >>>>>>>> Packaged toolchain compilation >>>>>>>> Building IPFire >>>>>>>> stage2 >>>>>>>> Jul 26 13:32:59: Building stage2 unshare: cannot change >>>>>>>> /git/ipfire-2.x/build_x86_64/proc filesystem propagation: Invalid argument >>>> >>>>>>> ... >>>> >>>>> It looks like you can simply update the kernel staying on the same release: >>>>> >>>>> https://ubuntu.com/security/livepatch/docs/livepatch/reference/kernels >>>>> >>>>> For 22.04 LTS, there is a Linux 6.8 image available. >>>>> >>>>> Could you check that and confirm that it fixes the mount propagation problem? >>>> >>>> Done. >>>> >>>> Current state is as follows: >>>> >>>> ***SNIP*** >>>> ... >>>> root@Devel64-1: /git/ipfire-2.x # lsb_release -a >>>> No LSB modules are available. >>>> Distributor ID: Ubuntu >>>> Description: Ubuntu 22.04.4 LTS >>>> Release: 22.04 >>>> Codename: jammy >>>> ... >>>> root@Devel64-1: /git/ipfire-2.x # uname -mrs >>>> Linux 6.8.0-39-generic x86_64 >>>> ... >>>> ***SNAP*** >>>> >>>> But when I try to build 'next' I get exactly the same error as >>>> before: >>>> >>>> ***SNIP*** >>>> root@Devel64-1: /git/ipfire-2.x # ./make.sh build >>>> Packaged toolchain compilation >>>> Building IPFire >>>> stage2 >>>> Aug 2 21:21:15: Building stage2 unshare: cannot change >>>> /git/ipfire-2.x/build_x86_64/proc filesystem propagation: Invalid argument >>> >>> Ah, this is good information. So it is not the kernel, it rather is Ubuntu handling something differently. >>> >>> I will have a look at this and get back to you. >>> >>>> ERROR: Downloading stage2 >>>> [ FAIL ] >>>> Check /git/ipfire-2.x/log_x86_64/_build.ipfire.log for errors if >>>> applicable [ FAIL ] >>>> ***SNAP*** >>>> >>>> Being curious, I commented line line 633 in 'make.sh' >>>> ("--mount-proc=${BUILD_DIR}/proc") => Building starts but fails during >>>> 'glib 2.77.0': >>>> >>>> ***SNIP*** >>>> ... >>>> glib (2.77.0) >>>> [ 1:14 ][0/1011] >>>> >>>> [951/1374] Compiling C object gio/gio.p/gio-tool-tree.c.o >>>> [952/1374] Linking target gio/gio >>>> [953/1374] Compiling C object >>>> gio/gio-querymodules.p/gio-querymodules.c.o >>>> [954/1374] Linking target gio/gio-querymodules >>>> [955/1374] Compiling C object gio/gresource.p/gresource-tool.c.o >>>> [956/1374] Compiling C object >>>> gio/glib-compile-schemas.p/.._subprojects_gvdb_gvdb_gvdb-reader.c.o >>>> [957/1374] Linking target gio/gresource >>>> [958/1374] Compiling C object >>>> gio/glib-compile-schemas.p/.._subprojects_gvdb_gvdb_gvdb-builder.c.o >>>> [959/1374] Compiling C object >>>> gio/glib-compile-resources.p/.._subprojects_gvdb_gvdb_gvdb-reader.c.o >>>> [960/1374] Compiling C object >>>> gio/glib-compile-resources.p/.._subprojects_gvdb_gvdb_gvdb-builder.c.o >>>> [961/1374] Compiling C object >>>> gio/glib-compile-resources.p/glib-compile-resources.c.o >>>> [962/1374] Linking target gio/glib-compile-resources >>>> [963/1374] Compiling C object >>>> gio/tests/modules/libtestmodulea.so.p/test-module-a.c.o >>>> [964/1374] Compiling C object gio/gapplication.p/gapplication-tool.c.o >>>> [965/1374] Compiling C object gio/gsettings.p/gsettings-tool.c.o >>>> [966/1374] Linking target gio/tests/modules/libtestmodulea.so >>>> [967/1374] Generating gio/tests/plugin-resources.c with a custom command >>>> FAILED: gio/tests/plugin-resources.c >>>> /usr/src/glib-2.77.0/builddir/gio/glib-compile-resources >>>> --compiler=gcc --target=gio/tests/plugin-resources.c --sour >>>> cedir=/usr/src/glib-2.77.0/gio/tests --internal --generate-source >>>> --c-name _g_plugin ../gio/tests/test4.gresource.xml >>>> /usr/src/glib-2.77.0/builddir/gio/glib-compile-resources: error >>>> while loading shared libraries: libgio-2.0.so.0: can >>>> not open shared object file: No such file or directory >>>> [968/1374] Linking target gio/gapplication >>>> [969/1374] Compiling C object >>>> gio/glib-compile-schemas.p/glib-compile-schemas.c.o >>>> [970/1374] Linking target gio/gsettings >>>> [971/1374] Compiling C object >>>> gio/tests/modules/libtestmoduleb.so.p/test-module-b.c.o >>>> [972/1374] Compiling C object >>>> gio/tests/gdbus-overflow.p/gdbus-overflow.c.o >>>> [973/1374] Compiling C object gio/gdbus.p/gdbus-tool.c.o >>>> [974/1374] Compiling C object >>>> gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.so.p/meson-gener >>>> ated_.._objectmanager-gen.c.o >>>> ninja: build stopped: subcommand failed. >>>> make: *** [glib:75: /usr/src/log/glib-2.77.0] Error 1 >>>> make: Leaving directory '/usr/src/lfs' >>>> >>>> ERROR: Building glib >>>> [ FAIL ] >>>> Check /git/ipfire-2.x/log_x86_64/_build.ipfire.log for errors if >>>> applicable [ FAIL ] >>>> ***SNAP*** >>>> >>>> Best >>>> Matthias >>> > > > diff --git a/make.sh b/make.sh index 922fc4b4c..212256ab1 100755 --- a/make.sh +++ b/make.sh @@ -662,6 +662,11 @@ execute() { # If unshare is asked to terminate, terminate all child processes "--kill-child" ) + +mount --bind ${BUILD_DIR}/proc ${BUILD_DIR}/proc + +mount --make-rslave ${BUILD_DIR}/proc + fi while [ $# -gt 0 ]; do