From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6812695221159067648 Date: Tue, 1 Sep 2020 22:30:30 -0700 (PDT) From: "vijaikumar....@gmail.com" To: isar-users Message-Id: In-Reply-To: <20200901195405.32162-1-ibr@radix50.net> References: <20200406201648.26945-4-henning.schild@siemens.com> <20200901195405.32162-1-ibr@radix50.net> Subject: Re: [PATCH v2 3/3] CI: test the exclude-path feature of wic MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_706_1373104416.1599024630203" X-TUID: uc5KUCRH8NYl ------=_Part_706_1373104416.1599024630203 Content-Type: multipart/alternative; boundary="----=_Part_707_385296870.1599024630203" ------=_Part_707_385296870.1599024630203 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Wednesday, September 2, 2020 at 1:24:13 AM UTC+5:30 i...@radix50.net wrote: > From: Henning Schild > > Signed-off-by: Henning Schild > --- > scripts/ci_build.sh | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh > index d2c707b..af996d1 100755 > --- a/scripts/ci_build.sh > +++ b/scripts/ci_build.sh > @@ -212,3 +212,15 @@ echo -e "do_fetch_append() {\n\n}" >> > "${ISARROOT}/meta/classes/dpkg-base.bbclas > bitbake $BB_ARGS mc:qemuamd64-stretch:isar-image-base > > mv "${ISARROOT}/meta/classes/dpkg-base.bbclass.ci-backup" > "${ISARROOT}/meta/classes/dpkg-base.bbclass" > + > +# Test wic --exclude-path > +cp -a "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks" > "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks.ci-backup" > > +mv > ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img > \ > + > ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img.ci-backup > > +sed -i -e 's/part \/ /part \/ --exclude-path usr /g' > "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks" > + > +bitbake $BB_ARGS mc:qemuamd64-stretch:isar-image-base > + > +mv > "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks.ci-backup" > "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks" > +mv > ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img.ci-backup > \ > + > ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img > > The only problem I see is the CI actually doesnot validate the image to see if /usr is excluded. It validates the code-path for errors but doesnot validate the feature itself. We could mount and check though. Once the new wic is integrated this should be easy with the "wic ls" feature. We could list the contents of the partition using "wic ls" and validate if /usr is excluded. Thanks, Vijai Kumar K -- > 2.20.1 > > ------=_Part_707_385296870.1599024630203 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On Wednesday, September 2, 2020 at 1:24:13 AM UTC+5:30 i...@radix50.net wrote:
From: Henning Schild <henning...@siemens.com>

Signed-off-by: Henning Schild <henning...@siemens.com>
---
scripts/ci_build.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index d2c707b..af996d1 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -212,3 +212,15 @@ echo -e "do_fetch_append() {\n\n}" >> "${ISARROOT}/meta/classes/dpkg-base.bbclas
bitbake $BB_ARGS mc:qemuamd64-stretch:isar-image-base

mv "${ISARROOT}/meta/classes/dpkg-base.bbclass.ci-backup" "${ISARROOT}/meta/classes/dpkg-base.bbclass"
+
+# Test wic --exclude-path
+cp -a "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks" "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks.ci-backup"
+mv ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img \
+ ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img.ci-backup
+sed -i -e 's/part \/ /part \/ --exclude-path usr /g' "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks"
+
+bitbake $BB_ARGS mc:qemuamd64-stretch:isar-image-base
+
+mv "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks.ci-backup" "${ISARROOT}/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks"
+mv ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img.ci-backup \
+ ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img

The only problem I see is the CI actually doesnot validate the image to see if /usr is excluded. It validates the code-path for errors but
doesnot validate the feature itself. We could mount and check though.
Once the new wic is integrated this should be easy with the "wic ls" feature. We could list the contents of the partition using
"wic ls" and validate if /usr is excluded.

Thanks,
Vijai Kumar K

--
2.20.1

------=_Part_707_385296870.1599024630203-- ------=_Part_706_1373104416.1599024630203--