From patchwork Thu May 18 09:47:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 2813 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 18 May 2023 11:47:40 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f60.google.com (mail-qv1-f60.google.com [209.85.219.60]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 34I9lcNW020496 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 11:47:39 +0200 Received: by mail-qv1-f60.google.com with SMTP id 6a1803df08f44-6238c64280fsf16740856d6.2; Thu, 18 May 2023 02:47:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684403253; cv=pass; d=google.com; s=arc-20160816; b=LmPN9ArPIS7IgMtncsdvj9DndU6LXSglv0v3jGhJCN9THh8w6p3uHCdJvSEVkwuELZ 998/x3J8c8mMPxLF/op72SGPvxWGvKr2UBqyAwXE9vjxIiH3xySDwd91MTk2vdwciTvR jQIsvdrQeKsVyefBLBfpsIpSkWu6139yJCBCNN5+5bhJnVM7VJWz+NvCY2/eDtYFIyfL tRSZLCnq96oUzLIs7CJ3xs2tN4PKlc0sUIabZD9PIaKAU9TT9x6Twg9iJpiCRXTmfdv7 J0GTfQFnD1+lznLMP/brWKVT9TPCM+mY+HHNReDsIzg2hi60TzThgLyUnv69DwW4z2ko wkNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=2upI6A/hV/JE7TMFkRlsh6fVf9tbgyW0B4zBlZJuPCM=; b=Mlw9lbZqyjf8BoecGqbmuc/fnGzPYyoNOUtJCs5QmpAqW7p2AQ+gE9LXggKzgVcdg9 zkQ14AQs3s4ZWJ5kmXiP0fdhim7XE+k4Roy0dtwcNBqGaEqRxWjxerbmq9KQVIMWjcV1 RN+13hl+C3u/HlOG6HDAa5zFhKNkWU5l56btFMd0w9+cN3p3k4c4mRDpzNDur2I/j9IY I+BZkCU2YqUjAGSUKUky/9SvWbv+g6TZAjgoX5kJNZ5RcjH/mLDbgGNtBFyQej9FQa/s CYhs1yK7jAABEn1Z+TvuJbW1jPGGyEFp0eaL8Qf4MIMRqoCJFzmvQ2OvA+aDnUygHxyS ohXw== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1684403253; x=1686995253; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=2upI6A/hV/JE7TMFkRlsh6fVf9tbgyW0B4zBlZJuPCM=; b=nFNgna4h9/dnR1ejH3N86TdGgrUmAM9s0zxveyYawLyRKlUhDlXNvd7B70Qaj8lVxq g6Rb4PFHOAF2y08RDZNpnqX+swfh6coMZ/Pswz6y03GAwqiw3x4+6c5shHEWg8VpawaM 3sRZ0gub7upzQcRAx18m9W01AsPutbgc/i7nHSBjLcnwaNjDxXapyG9DFLlKsTf/zVte yuHcYzZUKtgx7O1MiRPYAuLJ+1Fs7G5wFjflHnKESEuuBuYe7Xa3Sr3dmWTF/uJnwudg 7gDKoKZ7n/yjThgFhWcRPyQ1wGDmtckN2ttl/B8Q+cXJ2/AkjcoTkNqGvkLJc4wEB9KE XawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684403253; x=1686995253; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=2upI6A/hV/JE7TMFkRlsh6fVf9tbgyW0B4zBlZJuPCM=; b=K6yW3pGwbehM1nhGScLoYjmZUZsLthekWnV8cgJVD/kZut/gzCfYkB9YPJkZK1Y6LI YB8fDadTPVoGoWWwqD45hfu/vL3phkIQpSr9J+jFn5cYumEWgUgUaU280vpWVLxGFhDc EhIYPu2tMleedV52DFKSvwG2SdSJtempey/vQMCS4V3FK0l2lQqWNs3lEGTCYX963+Pl /pTzU9TQoHM84dJLXtFSNLjQYkshcX6hFhnM0gp11V8niIWjeOUzRpYDZyjP4Qr3+FOy EwfIAyCsnENMpiW8vQLlBSjJhgMVFZw5zVri8S0jrsrH1AVPQk3P21eqSrkSj9rhZKvQ sUSw== Sender: isar-users@googlegroups.com X-Gm-Message-State: AC+VfDx5K5ZmJ69lf5SMlK0+XfDmsYdBGGeLH7w++/ryCwCOGLQnLroC mRo6wK7CB0z5KdAtbmwdQqk= X-Google-Smtp-Source: ACHHUZ5ac2+aOhRm5h+CmFVzCrhhnNatXVipSUNgtMo237MgAtUTfuBeyuPooVRr1LYfIifMVEGxjw== X-Received: by 2002:ad4:55e3:0:b0:623:89db:3ed0 with SMTP id bu3-20020ad455e3000000b0062389db3ed0mr570693qvb.10.1684403253325; Thu, 18 May 2023 02:47:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac8:4a02:0:b0:3ef:573b:68e1 with SMTP id x2-20020ac84a02000000b003ef573b68e1ls1252125qtq.0.-pod-prod-05-us; Thu, 18 May 2023 02:47:33 -0700 (PDT) X-Received: by 2002:a1f:bf57:0:b0:43f:9aaf:b629 with SMTP id p84-20020a1fbf57000000b0043f9aafb629mr395416vkf.0.1684403252930; Thu, 18 May 2023 02:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684403252; cv=none; d=google.com; s=arc-20160816; b=M1jLd3r//UJSCVgftw2oDzcH/Jhkn+97yN3mrGEZfz3FbOCmgymZfovJAybwQi5vaL vIpCuq9FRFgGsEwPytXjLrYg9NHmjSb3H4WbEgWY7jc7yhBFMfNAcXY7j2UYPvu8CjHp 35Q1bobFXeLZU3wr4YN1D2GA4rDvV1Ovj7o/4qU1lqqBXuGaIDEhZtq3gN6Ly62pd16V cBt4XuxSbTutBAu9eG9g0ckgDHltLeXL+QY6ZjNfGPgvwIegIeSIT5Kr+DXDR3yiBg9i O/2FL+4N3/m1fIT7Zb3ENuIr8Ce10y7YB7bmmGiBIS16kqzT9dP2Dc1raU8rkRIoTXdp 2VSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=UVf2ejA6KJMzz8enUy/kj98uNmJqz2lP5Y6NxRgCdnY=; b=Dh7JpM507WIliElblLp6ZV5kd6SkCImoSuIsSpcxByHlCJz8UDdgPoRCF7oNs4HoB+ 1InqWuHml0jQi4iRSbJlTOpKm5T6W9sL0bAcq/Un1U/2zOZfq+iyq3ozmV3smQMCnnAh aRQ9oAtEZ4wXQdT8G4ghjJh9ICn/ow5jjTLvHYMdSR10oNxX/ZtAhtiKH/ChzR7wLPab 46M6o2kyCmm+fgBDImLYZVV9rB8EsFYkxNUxdmV1xos6TJwS26tA2e4ILxbIGJZK9RHs qTsGTSGrCq9hA60fwp/zGwQFS6Wnf9BBMdmsG+w4J9prS2pDkIv96WS1I3l34eIfGVbr vl+g== 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 Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id l38-20020a056122202600b004401f15502esi77342vkd.1.2023.05.18.02.47.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 May 2023 02:47:32 -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; Received: from user-B660.. ([85.254.74.3]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 34I9lM4T020451 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 11:47:26 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v2 3/6] isar-bootstrap: Use tar output instead of directory Date: Thu, 18 May 2023 12:47:13 +0300 Message-Id: <20230518094716.117770-4-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230518094716.117770-1-amikan@ilbers.de> References: <20230518094716.117770-1-amikan@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS 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-Original-Sender: amikan@ilbers.de X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Do not unpack tar with rootfs content inside bootstrap recipe. This also requires moving chroot prepare step to the later unpack step. Signed-off-by: Anton Mikanovich --- meta/classes/rootfs.bbclass | 11 +++++---- .../isar-bootstrap/isar-bootstrap.inc | 23 ++++--------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index 22449d71..29d5fd53 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -73,12 +73,15 @@ rootfs_do_qemu() { fi } -BOOTSTRAP_SRC = "${DEPLOY_DIR_BOOTSTRAP}/${ROOTFS_DISTRO}-host_${DISTRO}-${DISTRO_ARCH}" -BOOTSTRAP_SRC:${ROOTFS_ARCH} = "${DEPLOY_DIR_BOOTSTRAP}/${ROOTFS_DISTRO}-${ROOTFS_ARCH}" +BOOTSTRAP_SRC = "${DEPLOY_DIR_BOOTSTRAP}/${ROOTFS_DISTRO}-host_${DISTRO}-${DISTRO_ARCH}.tar.zst" +BOOTSTRAP_SRC:${ROOTFS_ARCH} = "${DEPLOY_DIR_BOOTSTRAP}/${ROOTFS_DISTRO}-${ROOTFS_ARCH}.tar.zst" rootfs_prepare[weight] = "25" rootfs_prepare(){ - sudo cp -Trpfx --reflink=auto '${BOOTSTRAP_SRC}/' '${ROOTFSDIR}' + sudo tar -xf "${BOOTSTRAP_SRC}" -C "${ROOTFSDIR}" --exclude="./dev/console" + + # setup chroot + sudo "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}" } ROOTFS_CONFIGURE_COMMAND += "rootfs_configure_isar_apt" @@ -222,7 +225,7 @@ cache_deb_src() { # Note: ISAR updates the apt state information(apt-get update) only once during bootstrap and # relies on that through out the build. Copy that state information instead of apt-get update # which generates a new state from upstream. - sudo cp -Trpn --reflink=auto "${BOOTSTRAP_SRC}/var/lib/apt/lists/" "${ROOTFSDIR}/var/lib/apt/lists/" + sudo tar -xf "${BOOTSTRAP_SRC}" ./var/lib/apt/lists --one-top-level="${ROOTFSDIR}" deb_dl_dir_import ${ROOTFSDIR} ${ROOTFS_BASE_DISTRO}-${BASE_DISTRO_CODENAME} debsrc_download ${ROOTFSDIR} ${ROOTFS_BASE_DISTRO}-${BASE_DISTRO_CODENAME} diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index fba876ea..2aeceb58 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -16,7 +16,6 @@ PV = "1.0" BOOTSTRAP_FOR_HOST ?= "0" DEBOOTSTRAP = "mmdebstrap" -ROOTFSDIR = "${WORKDIR}/rootfs" APTPREFS = "${WORKDIR}/apt-preferences" APTSRCS = "${WORKDIR}/apt-sources" APTSRCS_INIT = "${WORKDIR}/apt-sources-init" @@ -290,9 +289,6 @@ do_bootstrap() { fi E="${@ isar_export_proxies(d)}" - sudo rm -rf --one-file-system "${ROOTFSDIR}" - mkdir -p "${ROOTFSDIR}" - if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then base_apt_tmp="$(mktemp -d /tmp/isar-base-aptXXXXXXXXXX)" bootstrap_list="${WORKDIR}/sources.list.d/base-apt.list" @@ -397,18 +393,9 @@ do_bootstrap() { "${WORKDIR}/rootfs.tar.zst" \ "$bootstrap_list" - sudo -E -s <<'EOSUDO' - set -e - - tar -xf "${WORKDIR}/rootfs.tar.zst" -C "${ROOTFSDIR}" --exclude="./dev/console" - - # setup chroot - install -v -m755 "${WORKDIR}/chroot-setup.sh" "${ROOTFSDIR}/chroot-setup.sh" - "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}" + # Finalize debootstrap by setting the link in deploy + sudo ln -Tfsr "${WORKDIR}/rootfs.tar.zst" "${DEPLOY_ISAR_BOOTSTRAP}.tar.zst" - # Finalize debootstrap by setting the link in deploy - ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}" -EOSUDO if [ "${ISAR_USE_CACHED_BASE_REPO}" != "1" ]; then deb_dl_dir_export "${WORKDIR}/dl_dir" "${BOOTSTRAP_BASE_DISTRO}-${BASE_DISTRO_CODENAME}" sudo rm -rf --one-file-system "${WORKDIR}/dl_dir" @@ -423,15 +410,15 @@ SSTATEPOSTINSTFUNCS += "bootstrap_sstate_finalize" bootstrap_sstate_prepare() { # this runs in SSTATE_BUILDDIR, which will be deleted automatically - sudo cp -a "$(dirname "${ROOTFSDIR}")/rootfs.tar.zst" ./bootstrap.tar.zst + sudo cp -a "${WORKDIR}/rootfs.tar.zst" ./bootstrap.tar.zst sudo chown $(id -u):$(id -g) bootstrap.tar.zst } bootstrap_sstate_finalize() { # this runs in SSTATE_INSTDIR if [ -f bootstrap.tar.zst ]; then - mv bootstrap.tar.zst "$(dirname "${ROOTFSDIR}")/rootfs.tar.zst" - sudo ln -Tfsr "$(dirname "${ROOTFSDIR}")/rootfs.tar.zst" \ + mv bootstrap.tar.zst "${WORKDIR}/rootfs.tar.zst" + sudo ln -Tfsr "${WORKDIR}/rootfs.tar.zst" \ "${DEPLOY_ISAR_BOOTSTRAP}.tar.zst" fi }