From patchwork Wed Dec 11 09:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 13910880 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 805C4E7717F for ; Tue, 17 Dec 2024 02:03:33 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.web11.7128.1733910910361504527 for ; Wed, 11 Dec 2024 01:55:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=felix.moessbauer@siemens.com header.s=fm2 header.b=iSvpiNMe; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1321639-202412110955073844123a5e5daa6eb9-jcb_lv@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202412110955073844123a5e5daa6eb9 for ; Wed, 11 Dec 2024 10:55:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=WNalhAQXzP5D46IOdSBd92sPiTvV3WxjlwtRaJSbSgo=; b=iSvpiNMe7+146NLa5O4MbwyDBCe2eSxumgmAgU2F1sen7FREQfkeHj7zYZ8ar3fMZ0Net4 dRn2yzupXCXktm/1HduOO69TTkssCwu5aVeNidf/mlrtaFyA7YLOx+g5JdLvayf+K6zmxugO 9OnsbPlw+DalUn98cQN/3KufCMPgVMSZvxCEEUWlfFpzgY3DiWcsqN1/XzIWn4s8RJnP3IuE QNAFwDIoel0fWksoxqVxL7ieHz1uElK/CQFixSUZxFx1U8c3V76qwIKpJUTaISrA6grllWKi nqODmlrINfNqjeVymm6ERtuKdlTTQGo7qC5tK8oOZH9ZU25C/TSkWTFg==; From: Felix Moessbauer To: cip-dev@lists.cip-project.org Cc: jan.kiszka@siemens.com, Felix Moessbauer Subject: [isar-cip-core][PATCH v2 1/3] fix expansion of erofs exclude dirs Date: Wed, 11 Dec 2024 10:54:54 +0100 Message-Id: <20241211095456.2735691-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1321639:519-21489:flowmailer 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 ; Tue, 17 Dec 2024 02:03:33 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17432 When defining erofs exclude dirs, these are expanded and appended to the erofs creation args. However, this only works if the target variable exists and is of the correct type (string). Signed-off-by: Felix Moessbauer --- classes/erofs.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/erofs.bbclass b/classes/erofs.bbclass index 95e7be3..189c1ea 100644 --- a/classes/erofs.bbclass +++ b/classes/erofs.bbclass @@ -19,6 +19,7 @@ python __anonymous() { exclude_directories = d.getVar('EROFS_EXCLUDE_DIRS').split() if len(exclude_directories) == 0: return + args = "" # Use regex to exclude only content of the directory. # This allows to use the directory as a mount point. for dir in exclude_directories: From patchwork Wed Dec 11 09:54:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 13910883 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 805F6E77183 for ; Tue, 17 Dec 2024 02:03:33 +0000 (UTC) Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by mx.groups.io with SMTP id smtpd.web10.7057.1733910910832790430 for ; Wed, 11 Dec 2024 01:55:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=felix.moessbauer@siemens.com header.s=fm2 header.b=FTqjxD4r; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-1321639-20241211095507d9956385f551687e73-xkekbu@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20241211095507d9956385f551687e73 for ; Wed, 11 Dec 2024 10:55:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=cYojANsm5P1Ub1xFY0gDGFZUQUinIZXIbrw3myMWvlI=; b=FTqjxD4r+9D/3SslDye/hIekuAvsoaa3w2WCHZ0Un9gxXRzIphgpiXSqvTs8lT+yN4yCVF vA2hVTT8XFQluJtmbLH8tg4yS4LhgG26gVfbddC6uKEIkLm54zsDrsc3OO6NZ3PSa5n3s7nF zffTsZiOd4FowbLG9EYUCPEeq0JKzJQlJGmDEEHDVMYyN+L+u15XfNXYByTbNWuuCPnKffHh pnGD6SdlcFmsTzzGXvBhONqaAdGCVqyxh9lxJFgsE/oAeh13XBBGXkfB1cUDcJkd0XuRcNyO roq8A/sUa853vqKqfSTpeBCRSinCrgc2sT6/y7uU3LaqZNw8sHhb3e5w==; From: Felix Moessbauer To: cip-dev@lists.cip-project.org Cc: jan.kiszka@siemens.com, Felix Moessbauer Subject: [isar-cip-core][PATCH v2 2/3] erofs: ensure only dir prefixes are excluded Date: Wed, 11 Dec 2024 10:54:55 +0100 Message-Id: <20241211095456.2735691-2-felix.moessbauer@siemens.com> In-Reply-To: <20241211095456.2735691-1-felix.moessbauer@siemens.com> References: <20241211095456.2735691-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1321639:519-21489:flowmailer 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 ; Tue, 17 Dec 2024 02:03:33 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17433 The regex used to implement the path exclusions in erofs needs to be "anchored" to only match path prefixes but not arbitrary sections of the path. Previously, also paths that contained an excluded part were excluded as well. Further, we must single-quote the regex to ensure that the '*' is not expanded by bash-globbing. I further considered to use --exclude-path, but this is not an option as it excludes the excluded directory as well. In case of /var and /boot the directories (not the content) needs to be present as mountpoint. These semantics differ from the equally named parameter in squashfs. Signed-off-by: Felix Moessbauer --- classes/erofs.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/erofs.bbclass b/classes/erofs.bbclass index 189c1ea..72458bb 100644 --- a/classes/erofs.bbclass +++ b/classes/erofs.bbclass @@ -23,7 +23,7 @@ python __anonymous() { # Use regex to exclude only content of the directory. # This allows to use the directory as a mount point. for dir in exclude_directories: - args += " --exclude-regex {dir}/.* ".format(dir=dir) + args += " --exclude-regex '^{dir}/.*' ".format(dir=dir) d.appendVar('EROFS_CREATION_ARGS', args) } From patchwork Wed Dec 11 09:54:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 13910882 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 9D1B5E77188 for ; Tue, 17 Dec 2024 02:03:33 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.web10.7058.1733910910870362771 for ; Wed, 11 Dec 2024 01:55:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=felix.moessbauer@siemens.com header.s=fm2 header.b=Sv35vF9q; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1321639-2024121109550761e6db7d21ca0f0812-wknfrn@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2024121109550761e6db7d21ca0f0812 for ; Wed, 11 Dec 2024 10:55:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=qiP8m9TROp+UIucuQF111dScdcheu3nyIoDTnChVyOE=; b=Sv35vF9q/6eN7p0c/FeBzUXQekgtbLReWTPaUkv5+ynkVlB8F5RaoL31d41F2jAOO6yUQn YSdxJAx/IdBUuvBFA6LTpWpHF2as+ZkSY00qt48sYlEsr09OgL6+QeA60qQQnXheBgOhtSDj 4i1XaMck5bAnSQizUGUh3zNSbYXtU4DtjDtmIRYk+4tt+C3Al36/JnjYBxieBoJFCbJ+D4kE cpU/kuv2BYcxL+12GrI0C3nicc4eWhR+uCTFHe8ay0BdhDO05NRDjBUIwChPU90Nj0pQHNls fe7G5qFF4r0CIwZs42zSYrUaZh7W4vL0EmPpvtGhCKrjr0gmzj0PNoAQ==; From: Felix Moessbauer To: cip-dev@lists.cip-project.org Cc: jan.kiszka@siemens.com, Felix Moessbauer Subject: [isar-cip-core][PATCH v2 3/3] exclude boot and var in squashfs and erofs Date: Wed, 11 Dec 2024 10:54:56 +0100 Message-Id: <20241211095456.2735691-3-felix.moessbauer@siemens.com> In-Reply-To: <20241211095456.2735691-1-felix.moessbauer@siemens.com> References: <20241211095456.2735691-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1321639:519-21489:flowmailer 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 ; Tue, 17 Dec 2024 02:03:33 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17434 These dirs are anyways not used in a ro-rootfs. boot is over-mounted by systemd via sd boot protocol, implemented by EBG. var is deployed empty. Signed-off-by: Felix Moessbauer --- classes/erofs.bbclass | 2 +- classes/squashfs.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/erofs.bbclass b/classes/erofs.bbclass index 72458bb..0624b75 100644 --- a/classes/erofs.bbclass +++ b/classes/erofs.bbclass @@ -11,7 +11,7 @@ IMAGER_INSTALL:erofs += "erofs-utils" -EROFS_EXCLUDE_DIRS ?= "" +EROFS_EXCLUDE_DIRS ?= "boot var" EROFS_CONTENT ?= "${PP_ROOTFS}" EROFS_CREATION_ARGS ?= "-z lz4hc,12" diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass index b39be0c..cebda70 100644 --- a/classes/squashfs.bbclass +++ b/classes/squashfs.bbclass @@ -22,7 +22,7 @@ def get_free_mem(): IMAGER_INSTALL:squashfs += "squashfs-tools" -SQUASHFS_EXCLUDE_DIRS ?= "" +SQUASHFS_EXCLUDE_DIRS ?= "boot var" SQUASHFS_CONTENT ?= "${PP_ROOTFS}" SQUASHFS_CREATION_ARGS ?= ""