From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6607733288662466560 X-Received: by 2002:a7b:c082:: with SMTP id r2-v6mr2281363wmh.1.1538482797561; Tue, 02 Oct 2018 05:19:57 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:3442:: with SMTP id b63-v6ls189595wma.12.canary-gmail; Tue, 02 Oct 2018 05:19:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV63nJUJPict1qkwpXNp0iq9l1OiT4HxzrngMW5+u7+mzmJoJ/LrFAdBy5KeuHvOHRHnHWDuI X-Received: by 2002:a1c:b457:: with SMTP id d84-v6mr241522wmf.5.1538482797163; Tue, 02 Oct 2018 05:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482797; cv=none; d=google.com; s=arc-20160816; b=gm39W2worlPblkaQIIyvYp/kCrjoIZXJ4uzqYKHXpVGbblydl9wH9dsbG11tl2oYr9 zwdTd1pxXqpnzgG7c62GsDDPDgcUJsqSfc73LPtNaW6/85o5RmHAuaCQRvw3EiCfs5Rk RP+CeDN/47yLMm6X+eDm+VgDd7bYc6xnPAuK1kTUdqjqmRNjHwIESunscSqqN+3llh3c RGbel2n2hPDYmrH6nBomly1f3OFlUWE6+s3efbDOJTb8uROF0wYXQu3moi9zRh8yvt/4 W/f2u4+fy25DraPPNOfIDQfPHblLFd1cYNtXmxDNlwgq7/Cs/lQw9M/uDA8bur4a+Y1o wpew== 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:to:from; bh=i6nYKAyC+b3OMcaqBVWyUGytGr83cbfeXydbDpfNZzY=; b=BhBI7dkEWbycuGPXSQbWvVHhS6INGqAokdl92UNkEfilpsgLELYYaI7oaF22ZJy/JR ZW+9OSncC8l1TlExkgmpun8NfEs2ALqZenm++Qs93i705UFppaFjU6ude3teA3yoR3qp xMJgQ0RsW81Klw+0Hvo3o0WlDpXcHpdog8o3WX1DF6nleiYC3zxI1Fb9UvS4trX9ET2D V2I9kArj6AKAOLY6GsaJ+GLdJQSauYC/BK4iqae/op2MV4Uii1JRZ2iCjDlIQaf4rGmI eu07x8F5HazaBWBskY9f8ouWVVY603DV7q47DS1bIm3Ky3P45nfdnscZO8Lhb/WkheN5 yF7A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id z14-v6si508311wrh.4.2018.10.02.05.19.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 05:19:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from azat.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w92CJ7Ld013178 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Tue, 2 Oct 2018 14:19:56 +0200 From: "Maxim Yu. Osipov" To: isar-users@googlegroups.com Subject: [PATCH 5/9] isar-bootstrap: Make possible to reuse the cache Date: Tue, 2 Oct 2018 14:19:03 +0200 Message-Id: <20181002121907.18476-6-mosipov@ilbers.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181002121907.18476-1-mosipov@ilbers.de> References: <20181002121907.18476-1-mosipov@ilbers.de> X-TUID: lPxz37SPH9We From: Alexander Smirnov Signed-off-by: Alexander Smirnov Signed-off-by: Maxim Yu. Osipov --- .../isar-bootstrap/files/base-apt-sources | 1 + .../recipes-core/isar-bootstrap/isar-bootstrap.inc | 32 ++++++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 meta/recipes-core/isar-bootstrap/files/base-apt-sources diff --git a/meta/recipes-core/isar-bootstrap/files/base-apt-sources b/meta/recipes-core/isar-bootstrap/files/base-apt-sources new file mode 100644 index 0000000..594db56 --- /dev/null +++ b/meta/recipes-core/isar-bootstrap/files/base-apt-sources @@ -0,0 +1 @@ +deb file:///base-apt/debian {DISTRO} main diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index cfad136..9b5a894 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -12,18 +12,24 @@ SRC_URI = " \ file://isar-apt.conf \ file://isar-apt-fallback.conf \ file://locale \ - file://chroot-setup.sh" + file://chroot-setup.sh \ + file://base-apt-sources" PV = "1.0" DEBOOTSTRAP ?= "qemu-debootstrap" ROOTFSDIR = "${WORKDIR}/rootfs" APTPREFS = "${WORKDIR}/apt-preferences" APTSRCS = "${WORKDIR}/apt-sources" +BASEAPTSRCS = "${WORKDIR}/base-apt-sources" APTKEYFILES = "" APTKEYRING = "${WORKDIR}/apt-keyring.gpg" DEBOOTSTRAP_KEYRING = "" DEPLOY_ISAR_BOOTSTRAP ?= "" +DISTRO_APT_PREMIRRORS ?= "${@ "http://ftp\.(\S+\.)?debian.org file:///${BASE_APT_DIR} \n" if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')) else "" }" + +inherit base-apt-helper + python () { from urllib.parse import urlparse distro_apt_keys = d.getVar("DISTRO_APT_KEYS", False) @@ -171,6 +177,10 @@ isar_bootstrap() { esac shift done + debootstrap_args="--verbose --variant=minbase --include=locales " + if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then + debootstrap_args="$debootstrap_args --no-check-gpg" + fi E="${@bb.utils.export_proxies(d)}" sudo -E flock "${ISAR_BOOTSTRAP_LOCK}" -c "\ set -e @@ -181,9 +191,7 @@ isar_bootstrap() { rm -rf "${ROOTFSDIR}" fi if [ ${IS_HOST} ]; then - ${DEBOOTSTRAP} --verbose \ - --variant=minbase \ - --include=locales \ + ${DEBOOTSTRAP} $debootstrap_args \ ${@get_distro_components_argument(d, True)} \ ${DEBOOTSTRAP_KEYRING} \ "${@get_distro_suite(d, True)}" \ @@ -191,10 +199,8 @@ isar_bootstrap() { "${@get_distro_source(d, True)}" else - "${DEBOOTSTRAP}" --verbose \ - --variant=minbase \ + "${DEBOOTSTRAP}" $debootstrap_args \ --arch="${DISTRO_ARCH}" \ - --include=locales \ ${@get_distro_components_argument(d, False)} \ ${DEBOOTSTRAP_KEYRING} \ "${@get_distro_suite(d, False)}" \ @@ -207,8 +213,16 @@ isar_bootstrap() { install -v -m644 "${APTPREFS}" \ "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap" mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d" - install -v -m644 "${APTSRCS}" \ - "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" + if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then + sed -i -e "s#{DISTRO}#"${DISTRO_SUITE}"#g" ${BASEAPTSRCS} + mkdir -p ${ROOTFSDIR}/base-apt + sudo mount --bind ${BASE_APT_DIR} ${ROOTFSDIR}/base-apt + install -v -m644 "${BASEAPTSRCS}" \ + "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list" + else + install -v -m644 "${APTSRCS}" \ + "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" + fi rm -f "${ROOTFSDIR}/etc/apt/sources.list" mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d" install -v -m644 "${WORKDIR}/isar-apt.conf" \ -- 2.11.0