From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6558372643829972992 X-Received: by 2002:adf:e544:: with SMTP id z4-v6mr283380wrm.6.1527081982002; Wed, 23 May 2018 06:26:22 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:add5:: with SMTP id w79-v6ls517133wrc.10.gmail; Wed, 23 May 2018 06:26:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqc0GuWpyBRWPTg7eB3G+Xit0q6lfMEyLr6QZ7tDYQ6RvC300BjQ2X42c1AvQ8bHYzQsDyL X-Received: by 2002:adf:ab57:: with SMTP id r23-v6mr287039wrc.13.1527081981621; Wed, 23 May 2018 06:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527081981; cv=none; d=google.com; s=arc-20160816; b=jOhmnYxoXwsRocG56f8zY1uayJvtTbUamftWOJ+cg43X2a8SUAFfFvFJcCy1/tLXI/ hhW2Org0RiLHMc0UtDNkfQtdI1NZzbF2L/3zRy9HfaQKlpX8r/zCZ8uArDikipIiQokR nTvlXi/3zeQxLbdIe9lFll3wmInsqScjUGhFdsvIr83vGypPVTIlIrneF9e2Il4XTTKR FfBKe41WslekLI38+KBMdjR6rs1s0umHhe6yl8vLYXLQLLDFpGkVsvye/zX7UQvpttXp 3FmyT2aCvxxgUdKW5AUD5nMKN//47PvyPfDnTq2VVaaLpqzD3kDUbUhuLnkcbAD7u10/ Yvdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=mmQ0Gp/m6Ly3IxFq2Kwno+aNqFX0QhnzQ/DQ4ALaNRM=; b=J1fW4mzYQdd2yrgiU+BRCGrnuseeDYpbUbvhm2pMXf9VPmXS00jXfv7K5Va6VxOYVu CdgBUrtLO3d70Q+q4HKbJQsC+jc7jOCjQJT3zrLTmm5paHsYRLlOZdBSLwt1yAtkmFrH FpCcWg2lz10wh57guGi7JDMDX0cRyhwDh1O4KIk/mxod9t8swjL4rt1JWOLSgj49e/Vo tPewC9mGJ20IQAYBCIwebxZ4VwR+BjZV5T9uo0SdpYxmDm66jLAeBp6QPf2kTpx+jUxD JSvqe+nqEW7QDxVKJ3tK8xwUT29usTmOq0RJVI74KW7W6qjxyc8GFcb7DWO0ysBbMb/A 8fTg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id w14-v6si66370wmf.1.2018.05.23.06.26.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 06:26:21 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w4NDQK5p019887 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 May 2018 15:26:20 +0200 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.69.69]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w4NDQKH3030849; Wed, 23 May 2018 15:26:20 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [RFC PATCH v2 3/3] meta/isar-bootstrap: add 'do_restore_from_tarball' task Date: Wed, 23 May 2018 15:26:09 +0200 Message-Id: <20180523132609.408-4-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523132609.408-1-claudius.heine.ext@siemens.com> References: <20180523132609.408-1-claudius.heine.ext@siemens.com> In-Reply-To: <3467a5ec-182e-8c9a-cd19-7ad898323be7@siemens.com> References: <3467a5ec-182e-8c9a-cd19-7ad898323be7@siemens.com> X-TUID: 18tdY4TLviF7 From: Claudius Heine This new task 'do_restore_from_tarball' is deactivated by default ("noexec" flag is set) and is only activated if the 'ISAR_BOOTSTRAP_TARBALL' variable is set. The 'ISAR_BOOTSTRAP_TARBALL' variable should point the the isar-bootstrap tarball generated by a image-recipe. If this variable is set, tasks that are normally creating the isar-bootstrap root file system are deactivated and instead the 'do_restore_from_tarball' task is activated and restores the isar-bootstrap root file system from the tarball. Signed-off-by: Claudius Heine --- .../isar-bootstrap/isar-bootstrap.bb | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb index bb3992b..02c09aa 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb @@ -239,12 +239,38 @@ do_apt_update() { } addtask apt_update before do_build after do_apt_config_install do_set_locale +python() { + if d.getVar("ISAR_BOOTSTRAP_TARBALL", True): + d.setVarFlag("do_generate_keyring", "noexec", "1") + d.setVarFlag("do_apt_config_prepare", "noexec", "1") + d.setVarFlag("do_set_locale", "noexec", "1") + d.setVarFlag("do_bootstrap", "noexec", "1") + d.setVarFlag("do_apt_config_install", "noexec", "1") + d.setVarFlag("do_apt_update", "noexec", "1") + d.delVarFlag("do_restore_from_tarball", "noexec") +} + +do_restore_from_tarball[noexec] = "1" +do_restore_from_tarball[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" +do_restore_from_tarball() { + if [ -e "${ROOTFSDIR}" ]; then + sudo umount -l "${ROOTFSDIR}/dev" || true + sudo umount -l "${ROOTFSDIR}/proc" || true + sudo rm -rf "${ROOTFSDIR}" + fi + sudo mkdir -p "${ROOTFSDIR}" + sudo tar xf "${ISAR_BOOTSTRAP_TARBALL}" -C "${ROOTFSDIR}" + sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${ROOTFSDIR}/dev + sudo mount -t proc none ${ROOTFSDIR}/proc +} +addtask restore_from_tarball before do_build after do_unpack + do_deploy[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}" do_deploy() { ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${DISTRO_ARCH}" } -addtask deploy before do_build after do_apt_update +addtask deploy before do_build after do_apt_update do_restore_from_tarball CLEANFUNCS = "clean_deploy" clean_deploy() { -- 2.17.0