* [PATCH] Rebuild after cleaning does not work anymore, bugfix v2
@ 2022-12-06 23:10 Roberto A. Foglietta
2022-12-07 2:55 ` Roberto A. Foglietta
0 siblings, 1 reply; 3+ messages in thread
From: Roberto A. Foglietta @ 2022-12-06 23:10 UTC (permalink / raw)
To: isar-users
[-- Attachment #1: Type: text/plain, Size: 5845 bytes --]
>From 86db16c6fe44876ae63fa89c9f25b92f2d3cb34d Mon Sep 17 00:00:00 2001
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Date: Tue, 6 Dec 2022 23:55:00 +0100
Subject: [PATCH] Rebuild after cleaning does not work anymore, bugfix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bugfix, image and rootfs classes, fails in rebuilding - rebuild after cleaning
does not work anymore but it is required to remove manually all the directories
and this would take longer to rebuild. This patch fixes this new wrong
behaviour which happens when the kernel is not compiled but installed.
Reproducibility: this sequence of commands does not work anymore
kcbuild
./kas-container --isar clean
XOR/AND
sudo ./kas-container clean
kcbuild
It fails with error while the following still works
kcbuild
sudo rm -rf build/tmp build/sstate-cache
kcbuild
but it takes more time than the previous when it was working.
Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
meta/classes/image.bbclass | 9 +++++----
meta/classes/rootfs.bbclass | 3 +++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 813e1f3..d5c173b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -346,17 +346,18 @@ DTB_IMG =
"${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
do_copy_boot_files[lockfiles] += "${DEPLOY_DIR_IMAGE}/isar.lock"
do_copy_boot_files() {
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
+ set -x
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz] || true)"
if [ ! -f "$kernel" ]; then
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz] || true)"
fi
if [ -f "$kernel" ]; then
sudo cat "$kernel" > "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
fi
- initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img' || trFrom
86db16c6fe44876ae63fa89c9f25b92f2d3cb34d Mon Sep 17 00:00:00 2001
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Date: Tue, 6 Dec 2022 23:55:00 +0100
Subject: [PATCH] Rebuild after cleaning does not work anymore, bugfix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bugfix, image and roofs classes, fails in rebuilding - rebuild after cleaning
does not work anymore but it is required to remove manually all the directories
and this would take longer to rebuild. This patch fixes this new worng
behaviour which happens when the kernel is not compile but installed.
Reproducibility: this sequence of commands does not work anymore
kcbuild
./kas-container --isar clean
XOR/AND
sudo ./kas-container clean
kcbuild
It fails with error while the following still works
kcbuild
sudo rm -rf build/tmp build/sstate-cache
kcbuild
but it takes more time than the previous when it was working.
Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
meta/classes/image.bbclass | 9 +++++----
meta/classes/rootfs.bbclass | 3 +++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 813e1f3..d5c173b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -346,17 +346,18 @@ DTB_IMG =
"${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
do_copy_boot_files[lockfiles] += "${DEPLOY_DIR_IMAGE}/isar.lock"
do_copy_boot_files() {
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
+ set -x
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz] || true)"
if [ ! -f "$kernel" ]; then
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz] || true)"
fi
if [ -f "$kernel" ]; then
sudo cat "$kernel" > "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
fi
- initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img' || true)"
if [ ! -f "$initrd" ]; then
- initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img' || true)"
fi
if [ -f "$initrd" ]; then
cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}'
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index d19ac03..0d16754 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -33,6 +33,9 @@ rootfs_do_mounts[weight] = "3"
rootfs_do_mounts() {
sudo -s <<'EOSUDO'
set -e
+ for i in dev/shm dev/pts proc sys; do
+ mkdir -p '${ROOTFSDIR}/$i'
+ done
mountpoint -q '${ROOTFSDIR}/dev' || \
( mount -o bind,private /dev '${ROOTFSDIR}/dev' &&
mount -t tmpfs none '${ROOTFSDIR}/dev/shm' &&
--
2.34.1
ue)"
if [ ! -f "$initrd" ]; then
- initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img' || true)"
fi
if [ -f "$initrd" ]; then
cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}'
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index d19ac03..0d16754 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -33,6 +33,9 @@ rootfs_do_mounts[weight] = "3"
rootfs_do_mounts() {
sudo -s <<'EOSUDO'
set -e
+ for i in dev/shm dev/pts proc sys; do
+ mkdir -p '${ROOTFSDIR}/$i'
+ done
mountpoint -q '${ROOTFSDIR}/dev' || \
( mount -o bind,private /dev '${ROOTFSDIR}/dev' &&
mount -t tmpfs none '${ROOTFSDIR}/dev/shm' &&
--
2.34.1
[-- Attachment #2: 0001-Rebuild-after-cleaning-does-not-work-anymore-bugfix.patch --]
[-- Type: text/x-patch, Size: 2929 bytes --]
From 86db16c6fe44876ae63fa89c9f25b92f2d3cb34d Mon Sep 17 00:00:00 2001
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Date: Tue, 6 Dec 2022 23:55:00 +0100
Subject: [PATCH] Rebuild after cleaning does not work anymore, bugfix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bugfix, image and rootfs classes, fails in rebuilding - rebuild after cleaning
does not work anymore but it is required to remove manually all the directories
and this would take longer to rebuild. This patch fixes this new wrong
behaviour which happens when the kernel is not compiled but installed.
Reproducibility: this sequence of commands does not work anymore
kcbuild
./kas-container --isar clean
XOR/AND
sudo ./kas-container clean
kcbuild
It fails with error while the following still works
kcbuild
sudo rm -rf build/tmp build/sstate-cache
kcbuild
but it takes more time than the previous when it was working.
Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
meta/classes/image.bbclass | 9 +++++----
meta/classes/rootfs.bbclass | 3 +++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 813e1f3..d5c173b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -346,17 +346,18 @@ DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
do_copy_boot_files[lockfiles] += "${DEPLOY_DIR_IMAGE}/isar.lock"
do_copy_boot_files() {
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
+ set -x
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz] || true)"
if [ ! -f "$kernel" ]; then
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz] || true)"
fi
if [ -f "$kernel" ]; then
sudo cat "$kernel" > "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
fi
- initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img' || true)"
if [ ! -f "$initrd" ]; then
- initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img' || true)"
fi
if [ -f "$initrd" ]; then
cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}'
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index d19ac03..0d16754 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -33,6 +33,9 @@ rootfs_do_mounts[weight] = "3"
rootfs_do_mounts() {
sudo -s <<'EOSUDO'
set -e
+ for i in dev/shm dev/pts proc sys; do
+ mkdir -p '${ROOTFSDIR}/$i'
+ done
mountpoint -q '${ROOTFSDIR}/dev' || \
( mount -o bind,private /dev '${ROOTFSDIR}/dev' &&
mount -t tmpfs none '${ROOTFSDIR}/dev/shm' &&
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Rebuild after cleaning does not work anymore, bugfix v2
2022-12-06 23:10 [PATCH] Rebuild after cleaning does not work anymore, bugfix v2 Roberto A. Foglietta
@ 2022-12-07 2:55 ` Roberto A. Foglietta
0 siblings, 0 replies; 3+ messages in thread
From: Roberto A. Foglietta @ 2022-12-07 2:55 UTC (permalink / raw)
To: isar-users
On Wed, 7 Dec 2022 at 00:10, Roberto A. Foglietta
<roberto.foglietta@gmail.com> wrote:
>
Forget this, it was just a matter of dirty repositories
However, keep in consideration to append
--always --match || echo unknown
to ISAR_RELEASE_CMD_DEFAULT
Best Regards, R-
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Rebuild after cleaning does not work anymore, bugfix v2
@ 2022-12-06 23:11 roberto.foglietta
0 siblings, 0 replies; 3+ messages in thread
From: roberto.foglietta @ 2022-12-06 23:11 UTC (permalink / raw)
To: isar-users; +Cc: roberto.foglietta
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
bugfix, image and rootfs classes, fails in rebuilding - rebuild after cleaning
does not work anymore but it is required to remove manually all the directories
and this would take longer to rebuild. This patch fixes this new wrong
behaviour which happens when the kernel is not compiled but installed.
Reproducibility: this sequence of commands does not work anymore
kcbuild
./kas-container --isar clean
XOR/AND
sudo ./kas-container clean
kcbuild
It fails with error while the following still works
kcbuild
sudo rm -rf build/tmp build/sstate-cache
kcbuild
but it takes more time than the previous when it was working.
Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
meta/classes/image.bbclass | 9 +++++----
meta/classes/rootfs.bbclass | 3 +++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 813e1f3..d5c173b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -346,17 +346,18 @@ DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
do_copy_boot_files[lockfiles] += "${DEPLOY_DIR_IMAGE}/isar.lock"
do_copy_boot_files() {
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
+ set -x
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz] || true)"
if [ ! -f "$kernel" ]; then
- kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
+ kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz] || true)"
fi
if [ -f "$kernel" ]; then
sudo cat "$kernel" > "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"
fi
- initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img' || true)"
if [ ! -f "$initrd" ]; then
- initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img')"
+ initrd="$(realpath -q '${IMAGE_ROOTFS}/boot/initrd.img' || true)"
fi
if [ -f "$initrd" ]; then
cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}'
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index d19ac03..0d16754 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -33,6 +33,9 @@ rootfs_do_mounts[weight] = "3"
rootfs_do_mounts() {
sudo -s <<'EOSUDO'
set -e
+ for i in dev/shm dev/pts proc sys; do
+ mkdir -p '${ROOTFSDIR}/$i'
+ done
mountpoint -q '${ROOTFSDIR}/dev' || \
( mount -o bind,private /dev '${ROOTFSDIR}/dev' &&
mount -t tmpfs none '${ROOTFSDIR}/dev/shm' &&
--
2.34.1
https://16F0H.trk.elasticemail.com/tracking/unsubscribe?d=0BhLedwb8RnzpF9xsxE1N6U4M53j71ETTFG3t-ArDsB2YSL7TqPXb1srd7wQSlw-9_02R9Sqf44QPXwv8ekQNoU48QmMTmgH3YwRTOw-ffld0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-07 8:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 23:10 [PATCH] Rebuild after cleaning does not work anymore, bugfix v2 Roberto A. Foglietta
2022-12-07 2:55 ` Roberto A. Foglietta
2022-12-06 23:11 roberto.foglietta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox