From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6558372643829972992 X-Received: by 2002:a1c:d18f:: with SMTP id i137-v6mr368746wmg.8.1527057166455; Tue, 22 May 2018 23:32:46 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:7613:: with SMTP id r19-v6ls2706906wmc.3.canary-gmail; Tue, 22 May 2018 23:32:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqV4Ajw1Ap9AswYjuNPfOAftCGOJXp1zzNRWr7Wyww+9LrKpbtgdq/x3G/vlGbHFuvlPHOF X-Received: by 2002:a1c:eb07:: with SMTP id j7-v6mr419331wmh.19.1527057166167; Tue, 22 May 2018 23:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527057166; cv=none; d=google.com; s=arc-20160816; b=V+QUMPiEFYnQW4clsSqWYZkmjAsJIOdTwx7qJQ7Rvrc5l1DI5sKjSQfCUuq3bD/8ff MxKjTIniRmXTSOxk+jsRhKAhDM0atB5+H5Ri9Q2a8SJpjUgQRZjBCYlg7266ipH1lV3m ZvN1JiU2TImmJ3rC5ZK2EV3dG5zk8F1rzMSGWfLegE/3iIGtKbhkgINpD0cq/V9Wx6Fi buQd7H+QgKOfkjrN64/0AhZ4mK7YM6qva36KNlnGFkOKopFrV1WFHT6TAHY6waf73dke hrdRpj3OjGVRs42egoHFEnktIWlA1/4mE9QaTmZRCHVOfvYUCWutRPfr0j6aT8Q3wTIl Gp3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=omhJJd7jd5r84eGeVA7ceEPmGEbKu+1lIP4797KnQmA=; b=VTf9KTAKpYsHo9Tr8w+XqlK0olxAcOHSFEvjfsfxcTHPLyjYOrYjoXEZR4Ws4Zz2sb eDIPC3Q86Jj3DtZZOmyykEnjJ5NN0dpoWHHp3d9rZlbPcEC0BJwyAya2xXdzXRmb8BGl O/xlaGTPqdQ9CLEI8xXxmQLRv+mfxa5QyO1T9soflsj6pQcLXYdz4QXzXQQkeHWZwyp8 UQ5N7kEYcDU5IXsKOQW0TqVR8whcSgis2cC2ECS1z+EmdrB+V+uXpzAJSIDw3AfiIq6D jtLue6KdhNc2OrmbKFL6zFdeA0nLVRS2MpwhlqmD+9taFn+vy1KznNNlLslEdj92Dt3K LdTw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id 31-v6si262213wre.1.2018.05.22.23.32.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 23:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w4N6WjpK011461 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 May 2018 08:32:45 +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 w4N6Wfgw031123; Wed, 23 May 2018 08:32:44 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [RFC PATCH 3/3] meta/isar-bootstrap: add 'do_restore_from_tarball' task Date: Wed, 23 May 2018 08:32:06 +0200 Message-Id: <20180523063206.29180-4-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523063206.29180-1-claudius.heine.ext@siemens.com> References: <20180523063206.29180-1-claudius.heine.ext@siemens.com> X-TUID: K62Qq/RJKRrB 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 | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb index 2089386..998113d 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb @@ -229,12 +229,37 @@ do_apt_update() { } addtask apt_update before do_build after do_apt_config_install +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_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