* [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions
@ 2017-10-17 19:23 Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 1/2] meta-isar: Drop hardcoded kernel versions Alexander Smirnov
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Alexander Smirnov @ 2017-10-17 19:23 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
Hello all,
IMPORTANT: lets try to review this series ASAP, becuase Isar build is
broken again due to recent update of Raspbian kernel version in apt.
Instead of yet-another-version update I'd like to commit proper
solution.
In current Isar implementation, multiconfig file contains hardcoded
version for boot files: kernel and initrd. This is used for both:
- Add respective package to multistrap config.
- Copy boot files to deploy directory.
This series drops this hardcoded versions, so now Isar is able to
determine version of boot files during building.
Changes since v1:
- Differentiate 'do_copy_boot_files' stamps.
- Update start_vm script accordingly.
- Check if symlinks 'vmlinuz' and 'initrd.img' exist before reading
them. If symlink doesn't exist, this function skips it.
With best regards,
Alex
*** BLURB HERE ***
Alexander Smirnov (2):
meta-isar: Drop hardcoded kernel versions
meta-isar: Rework boot files copying
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 5 +----
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 5 +----
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 5 +----
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 5 +----
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 5 +----
meta-isar/conf/multiconfig/qemui386-jessie.conf | 5 +----
meta-isar/conf/multiconfig/qemui386-stretch.conf | 5 +----
meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
meta/classes/ext4-img.bbclass | 8 --------
meta/classes/image.bbclass | 24 ++++++++++++++++++++---
scripts/start_vm | 8 ++++++--
11 files changed, 34 insertions(+), 44 deletions(-)
--
2.9.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [URGENT][PATCH v2 1/2] meta-isar: Drop hardcoded kernel versions
2017-10-17 19:23 [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Alexander Smirnov
@ 2017-10-17 19:23 ` Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 2/2] meta-isar: Rework boot files copying Alexander Smirnov
2017-10-18 14:06 ` [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Henning Schild
2 siblings, 0 replies; 10+ messages in thread
From: Alexander Smirnov @ 2017-10-17 19:23 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Frank Lenormand
Use meta packages for rootfs creation instead of numbered kernel ones.
Signed-off-by: Frank Lenormand <lenormf@gmail.com>
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-stretch.conf | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index 5926ddc..d9473f3 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -6,7 +6,7 @@ MACHINE ?= "qemuamd64"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "amd64"
-IMAGE_PREINSTALL += "linux-image-3.16.0-4-amd64"
+IMAGE_PREINSTALL += "linux-image-amd64"
KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-amd64"
INITRD_IMAGE ?= "initrd.img-3.16.0-4-amd64"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index c2bf21c..5ac25d9 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -8,7 +8,7 @@ DISTRO_ARCH ?= "amd64"
IMAGE_PREINSTALL += " \
init \
- linux-image-4.9.0-4-amd64 \
+ linux-image-amd64 \
"
KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-amd64"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index f2bacd8..3dd33f2 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -13,7 +13,7 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "armhf"
-IMAGE_PREINSTALL += "linux-image-3.16.0-4-armmp"
+IMAGE_PREINSTALL += "linux-image-armmp"
KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-armmp"
INITRD_IMAGE ?= "initrd.img-3.16.0-4-armmp"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index 8b55a2f..f3636f6 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -8,7 +8,7 @@ DISTRO_ARCH ?= "armhf"
IMAGE_PREINSTALL += " \
init \
- linux-image-4.9.0-4-armmp \
+ linux-image-armmp \
"
KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-armmp"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 92cffbd..3a23692 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -13,7 +13,7 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-wheezy"
DISTRO_ARCH ?= "armhf"
-IMAGE_PREINSTALL += "linux-image-3.2.0-4-vexpress"
+IMAGE_PREINSTALL += "linux-image-vexpress"
KERNEL_IMAGE ?= "vmlinuz-3.2.0-4-vexpress"
INITRD_IMAGE ?= "initrd.img-3.2.0-4-vexpress"
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index 3ccce91..55cb172 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -6,7 +6,7 @@ MACHINE ?= "qemui386"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "i386"
-IMAGE_PREINSTALL += "linux-image-3.16.0-4-686-pae"
+IMAGE_PREINSTALL += "linux-image-686-pae"
KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-686-pae"
INITRD_IMAGE ?= "initrd.img-3.16.0-4-686-pae"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index 7749bf2..c0285b4 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -8,7 +8,7 @@ DISTRO_ARCH ?= "i386"
IMAGE_PREINSTALL += " \
init \
- linux-image-4.9.0-4-686-pae \
+ linux-image-686-pae \
"
KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-686-pae"
--
2.9.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [URGENT][PATCH v2 2/2] meta-isar: Rework boot files copying
2017-10-17 19:23 [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 1/2] meta-isar: Drop hardcoded kernel versions Alexander Smirnov
@ 2017-10-17 19:23 ` Alexander Smirnov
2017-10-18 14:06 ` [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Henning Schild
2 siblings, 0 replies; 10+ messages in thread
From: Alexander Smirnov @ 2017-10-17 19:23 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Frank Lenormand
Currently there are two variables that contains hardcoded filenames
with versions for kernel and initrd images. Isar uses them to copy these
files to deploy directory. Moreover this is performed in ext4 class,
what is logically wrong.
This patch implements a new way which doesn't rely on hardcoded versioned
filenames. Also it drops this copying from ext4 class.
Signed-off-by: Frank Lenormand <lenormf@gmail.com>
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 3 ---
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 3 ---
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 3 ---
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 3 ---
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 3 ---
meta-isar/conf/multiconfig/qemui386-jessie.conf | 3 ---
meta-isar/conf/multiconfig/qemui386-stretch.conf | 3 ---
meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
meta/classes/ext4-img.bbclass | 8 --------
meta/classes/image.bbclass | 24 ++++++++++++++++++++---
scripts/start_vm | 8 ++++++--
11 files changed, 27 insertions(+), 37 deletions(-)
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index d9473f3..51d39b6 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -8,9 +8,6 @@ DISTRO_ARCH ?= "amd64"
IMAGE_PREINSTALL += "linux-image-amd64"
-KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-amd64"
-INITRD_IMAGE ?= "initrd.img-3.16.0-4-amd64"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "x86_64"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index 5ac25d9..c59876a 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -11,9 +11,6 @@ IMAGE_PREINSTALL += " \
linux-image-amd64 \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-amd64"
-INITRD_IMAGE ?= "initrd.img-4.9.0-4-amd64"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "x86_64"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index 3dd33f2..ed84c6c 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -15,9 +15,6 @@ DISTRO_ARCH ?= "armhf"
IMAGE_PREINSTALL += "linux-image-armmp"
-KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-armmp"
-INITRD_IMAGE ?= "initrd.img-3.16.0-4-armmp"
-
ROOTFS_DEV ?= "vda"
QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index f3636f6..1cce97a 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -11,9 +11,6 @@ IMAGE_PREINSTALL += " \
linux-image-armmp \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-armmp"
-INITRD_IMAGE ?= "initrd.img-4.9.0-4-armmp"
-
ROOTFS_DEV ?= "vda"
QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 3a23692..38ea191 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -15,9 +15,6 @@ DISTRO_ARCH ?= "armhf"
IMAGE_PREINSTALL += "linux-image-vexpress"
-KERNEL_IMAGE ?= "vmlinuz-3.2.0-4-vexpress"
-INITRD_IMAGE ?= "initrd.img-3.2.0-4-vexpress"
-
ROOTFS_DEV ?= "mmcblk0"
QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index 55cb172..d589661 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -8,9 +8,6 @@ DISTRO_ARCH ?= "i386"
IMAGE_PREINSTALL += "linux-image-686-pae"
-KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-686-pae"
-INITRD_IMAGE ?= "initrd.img-3.16.0-4-686-pae"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "i386"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index c0285b4..40239e4 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -11,9 +11,6 @@ IMAGE_PREINSTALL += " \
linux-image-686-pae \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-686-pae"
-INITRD_IMAGE ?= "initrd.img-4.9.0-4-686-pae"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "i386"
diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
index 82b38d2..d1dd9d9 100644
--- a/meta-isar/conf/multiconfig/rpi-jessie.conf
+++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
@@ -31,7 +31,4 @@ IMAGE_PREINSTALL += " \
vim \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-3-rpi"
-INITRD_IMAGE ?= "initrd.img-4.9.0-3-rpi"
-
ROOTFS_DEV ?= "mmcblk0p2"
diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 9fa9aa5..277f3f3 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -24,14 +24,6 @@ do_ext4_image() {
sudo cp -r ${IMAGE_ROOTFS}/* ${WORKDIR}/mnt
sudo umount ${WORKDIR}/mnt
rm -r ${WORKDIR}/mnt
-
- if [ -n "${KERNEL_IMAGE}" ]; then
- cp ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
- fi
-
- if [ -n "${INITRD_IMAGE}" ]; then
- cp ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
- fi
}
addtask ext4_image before do_build after do_rootfs
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 9ef8bee..85c2f53 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -1,9 +1,6 @@
# This software is a part of ISAR.
# Copyright (C) 2015-2017 ilbers GmbH
-KERNEL_IMAGE ?= ""
-INITRD_IMAGE ?= ""
-
IMAGE_INSTALL ?= ""
IMAGE_TYPE ?= "ext4-img"
IMAGE_ROOTFS = "${WORKDIR}/rootfs"
@@ -76,3 +73,24 @@ do_populate() {
addtask populate before do_build
do_populate[deptask] = "do_deploy_deb"
+
+do_copy_boot_files() {
+ if [ -z "${KERNEL_IMAGE}" ] && [ -h "${IMAGE_ROOTFS}/vmlinuz" ]; then
+ KERNEL_IMAGE=$(readlink ${IMAGE_ROOTFS}/vmlinuz)
+ fi
+
+ if [ -n "${KERNEL_IMAGE}" ]; then
+ cp ${IMAGE_ROOTFS}/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
+ fi
+
+ if [ -z "${INITRD_IMAGE}" ] && [ -h "${IMAGE_ROOTFS}/initrd.img" ]; then
+ INITRD_IMAGE=$(readlink ${IMAGE_ROOTFS}/initrd.img)
+ fi
+
+ if [ -n "${INITRD_IMAGE}" ]; then
+ cp ${IMAGE_ROOTFS}/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
+ fi
+}
+
+addtask copy_boot_files before do_build after do_rootfs
+do_copy_boot_files[stamp-extra-info] = "${DISTRO}-${MACHINE}"
diff --git a/scripts/start_vm b/scripts/start_vm
index 400484a..c8605b0 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -114,6 +114,11 @@ do
done
readonly IMAGE_DIR=$BUILD_DIR/tmp/deploy/images
+readonly ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img
+
+eval $(bitbake -e multiconfig:qemu$ARCH-jessie:isar-image-base | grep WORKDIR=)
+readonly KERNEL_IMAGE=$(basename $(readlink $WORKDIR/rootfs/vmlinuz))
+readonly INITRD_IMAGE=$(basename $(readlink $WORKDIR/rootfs/initrd.img))
readonly ISARROOT="$(dirname "$0")"/..
@@ -121,8 +126,7 @@ readonly MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf
eval "$(egrep 'MACHINE_SERIAL' $MACHINE_CONF |bb2sh)"
readonly CONFIG_CONF=$ISARROOT/meta-isar/conf/multiconfig/qemu$ARCH-$DISTRO.conf
-eval "$(egrep '(KERNEL|INITRD)_IMAGE|ROOTFS_DEV|QEMU_' $CONFIG_CONF |bb2sh)"
-readonly ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img
+eval "$(egrep 'ROOTFS_DEV|QEMU_' $CONFIG_CONF |bb2sh)"
QCPU=
[ -n "$QEMU_CPU" ] && QCPU="-cpu $QEMU_CPU"
--
2.9.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions
2017-10-17 19:23 [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 1/2] meta-isar: Drop hardcoded kernel versions Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 2/2] meta-isar: Rework boot files copying Alexander Smirnov
@ 2017-10-18 14:06 ` Henning Schild
2017-10-19 16:00 ` Henning Schild
2 siblings, 1 reply; 10+ messages in thread
From: Henning Schild @ 2017-10-18 14:06 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
I have not tested these patches, but they look good to me. The whole
readlink thing is not too important.
Henning
On Tue, 17 Oct 2017 22:23:06 +0300
Alexander Smirnov <asmirnov@ilbers.de> wrote:
> Hello all,
>
> IMPORTANT: lets try to review this series ASAP, becuase Isar build is
> broken again due to recent update of Raspbian kernel version in apt.
> Instead of yet-another-version update I'd like to commit proper
> solution.
>
> In current Isar implementation, multiconfig file contains hardcoded
> version for boot files: kernel and initrd. This is used for both:
>
> - Add respective package to multistrap config.
> - Copy boot files to deploy directory.
>
> This series drops this hardcoded versions, so now Isar is able to
> determine version of boot files during building.
>
> Changes since v1:
> - Differentiate 'do_copy_boot_files' stamps.
> - Update start_vm script accordingly.
> - Check if symlinks 'vmlinuz' and 'initrd.img' exist before reading
> them. If symlink doesn't exist, this function skips it.
>
> With best regards,
> Alex
>
>
> *** BLURB HERE ***
>
> Alexander Smirnov (2):
> meta-isar: Drop hardcoded kernel versions
> meta-isar: Rework boot files copying
>
> meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 5 +----
> meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 5 +----
> meta-isar/conf/multiconfig/qemuarm-jessie.conf | 5 +----
> meta-isar/conf/multiconfig/qemuarm-stretch.conf | 5 +----
> meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 5 +----
> meta-isar/conf/multiconfig/qemui386-jessie.conf | 5 +----
> meta-isar/conf/multiconfig/qemui386-stretch.conf | 5 +----
> meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
> meta/classes/ext4-img.bbclass | 8 --------
> meta/classes/image.bbclass | 24
> ++++++++++++++++++++---
> scripts/start_vm | 8 ++++++-- 11
> files changed, 34 insertions(+), 44 deletions(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions
2017-10-18 14:06 ` [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Henning Schild
@ 2017-10-19 16:00 ` Henning Schild
2017-10-19 16:08 ` Henning Schild
2017-10-19 19:13 ` [PATCH v4] meta-isar: Rework boot files copying Alexander Smirnov
0 siblings, 2 replies; 10+ messages in thread
From: Henning Schild @ 2017-10-19 16:00 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
On Wed, 18 Oct 2017 16:06:40 +0200
"[ext] Henning Schild" <henning.schild@siemens.com> wrote:
> I have not tested these patches, but they look good to me. The whole
> readlink thing is not too important.
Just tested them and they break wic because the two variables are not
part of any config. Would require the eval(bitbake) stuff that is done
in start_vm. Probably not the best idea to do that over and over, maybe
the code should append that to local.conf or write it to a file that
everyone can read.
Why are they on top of next in git and not on master? Would the urgent
not suggest we should test them on top of master and take them on the
fast lane before next?
Setting the two guys back to what they where in multiconfig does not
work because the code would now look for /vmlinuz-4.9....
Setting them to "boot/vmlinuz-4.9..." creates wic trouble again.
I think a wic use-case needs to be added to CI, but since wic is not
integrated in bitbake i am afraid i can not send patches because the
change needs to happen in your CI.
Henning
> Henning
>
> On Tue, 17 Oct 2017 22:23:06 +0300
> Alexander Smirnov <asmirnov@ilbers.de> wrote:
>
> > Hello all,
> >
> > IMPORTANT: lets try to review this series ASAP, becuase Isar build
> > is broken again due to recent update of Raspbian kernel version in
> > apt. Instead of yet-another-version update I'd like to commit proper
> > solution.
> >
> > In current Isar implementation, multiconfig file contains hardcoded
> > version for boot files: kernel and initrd. This is used for both:
> >
> > - Add respective package to multistrap config.
> > - Copy boot files to deploy directory.
> >
> > This series drops this hardcoded versions, so now Isar is able to
> > determine version of boot files during building.
> >
> > Changes since v1:
> > - Differentiate 'do_copy_boot_files' stamps.
> > - Update start_vm script accordingly.
> > - Check if symlinks 'vmlinuz' and 'initrd.img' exist before reading
> > them. If symlink doesn't exist, this function skips it.
> >
> > With best regards,
> > Alex
> >
> >
> > *** BLURB HERE ***
> >
> > Alexander Smirnov (2):
> > meta-isar: Drop hardcoded kernel versions
> > meta-isar: Rework boot files copying
> >
> > meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 5 +----
> > meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 5 +----
> > meta-isar/conf/multiconfig/qemuarm-jessie.conf | 5 +----
> > meta-isar/conf/multiconfig/qemuarm-stretch.conf | 5 +----
> > meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 5 +----
> > meta-isar/conf/multiconfig/qemui386-jessie.conf | 5 +----
> > meta-isar/conf/multiconfig/qemui386-stretch.conf | 5 +----
> > meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
> > meta/classes/ext4-img.bbclass | 8 --------
> > meta/classes/image.bbclass | 24
> > ++++++++++++++++++++---
> > scripts/start_vm | 8 ++++++-- 11
> > files changed, 34 insertions(+), 44 deletions(-)
> >
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions
2017-10-19 16:00 ` Henning Schild
@ 2017-10-19 16:08 ` Henning Schild
2017-10-19 19:18 ` Alexander Smirnov
2017-10-19 19:13 ` [PATCH v4] meta-isar: Rework boot files copying Alexander Smirnov
1 sibling, 1 reply; 10+ messages in thread
From: Henning Schild @ 2017-10-19 16:08 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
On Thu, 19 Oct 2017 18:00:51 +0200
"[ext] Henning Schild" <henning.schild@siemens.com> wrote:
> On Wed, 18 Oct 2017 16:06:40 +0200
> "[ext] Henning Schild" <henning.schild@siemens.com> wrote:
>
> > I have not tested these patches, but they look good to me. The whole
> > readlink thing is not too important.
>
> Just tested them and they break wic because the two variables are not
> part of any config. Would require the eval(bitbake) stuff that is done
> in start_vm. Probably not the best idea to do that over and over,
> maybe the code should append that to local.conf or write it to a file
> that everyone can read.
>
> Why are they on top of next in git and not on master? Would the urgent
> not suggest we should test them on top of master and take them on the
> fast lane before next?
>
> Setting the two guys back to what they where in multiconfig does not
> work because the code would now look for /vmlinuz-4.9....
>
> Setting them to "boot/vmlinuz-4.9..." creates wic trouble again.
>
> I think a wic use-case needs to be added to CI, but since wic is not
> integrated in bitbake i am afraid i can not send patches because the
> change needs to happen in your CI.
All that being said, go ahead and merge them to master. If wic is not
part of CI, wic users can carry fixes for the new issues in their
branches for now.
Henning
> Henning
>
> > Henning
> >
> > On Tue, 17 Oct 2017 22:23:06 +0300
> > Alexander Smirnov <asmirnov@ilbers.de> wrote:
> >
> > > Hello all,
> > >
> > > IMPORTANT: lets try to review this series ASAP, becuase Isar build
> > > is broken again due to recent update of Raspbian kernel version in
> > > apt. Instead of yet-another-version update I'd like to commit
> > > proper solution.
> > >
> > > In current Isar implementation, multiconfig file contains
> > > hardcoded version for boot files: kernel and initrd. This is used
> > > for both:
> > >
> > > - Add respective package to multistrap config.
> > > - Copy boot files to deploy directory.
> > >
> > > This series drops this hardcoded versions, so now Isar is able to
> > > determine version of boot files during building.
> > >
> > > Changes since v1:
> > > - Differentiate 'do_copy_boot_files' stamps.
> > > - Update start_vm script accordingly.
> > > - Check if symlinks 'vmlinuz' and 'initrd.img' exist before
> > > reading them. If symlink doesn't exist, this function skips it.
> > >
> > > With best regards,
> > > Alex
> > >
> > >
> > > *** BLURB HERE ***
> > >
> > > Alexander Smirnov (2):
> > > meta-isar: Drop hardcoded kernel versions
> > > meta-isar: Rework boot files copying
> > >
> > > meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 5 +----
> > > meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 5 +----
> > > meta-isar/conf/multiconfig/qemuarm-jessie.conf | 5 +----
> > > meta-isar/conf/multiconfig/qemuarm-stretch.conf | 5 +----
> > > meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 5 +----
> > > meta-isar/conf/multiconfig/qemui386-jessie.conf | 5 +----
> > > meta-isar/conf/multiconfig/qemui386-stretch.conf | 5 +----
> > > meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
> > > meta/classes/ext4-img.bbclass | 8 --------
> > > meta/classes/image.bbclass | 24
> > > ++++++++++++++++++++---
> > > scripts/start_vm | 8 ++++++-- 11
> > > files changed, 34 insertions(+), 44 deletions(-)
> > >
> >
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v4] meta-isar: Rework boot files copying
2017-10-19 16:00 ` Henning Schild
2017-10-19 16:08 ` Henning Schild
@ 2017-10-19 19:13 ` Alexander Smirnov
2017-10-19 19:39 ` Alexander Smirnov
2017-10-20 16:11 ` Henning Schild
1 sibling, 2 replies; 10+ messages in thread
From: Alexander Smirnov @ 2017-10-19 19:13 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Frank Lenormand
8<--
Changes since v3:
- Restored KERNEL_IMAGE and INITRD_IMAGE variables to support wic
images creation.
8<--
Currently there are two variables that contains hardcoded filenames
with versions for kernel and initrd images. Isar uses them to copy these
files to deploy directory. Moreover this is performed in ext4 class,
what is logically wrong.
This patch implements a new way which doesn't rely on hardcoded versioned
filenames. Also it drops this copying from ext4 class.
Signed-off-by: Frank Lenormand <lenormf@gmail.com>
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 3 ---
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 3 ---
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 3 ---
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 3 ---
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 3 ---
meta-isar/conf/multiconfig/qemui386-jessie.conf | 3 ---
meta-isar/conf/multiconfig/qemui386-stretch.conf | 3 ---
meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
meta/classes/ext4-img.bbclass | 14 ++--------
meta/classes/image.bbclass | 31 ++++++++++++++++++++---
scripts/start_vm | 8 ++++--
11 files changed, 35 insertions(+), 42 deletions(-)
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index d9473f3..51d39b6 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -8,9 +8,6 @@ DISTRO_ARCH ?= "amd64"
IMAGE_PREINSTALL += "linux-image-amd64"
-KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-amd64"
-INITRD_IMAGE ?= "initrd.img-3.16.0-4-amd64"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "x86_64"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index 5ac25d9..c59876a 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -11,9 +11,6 @@ IMAGE_PREINSTALL += " \
linux-image-amd64 \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-amd64"
-INITRD_IMAGE ?= "initrd.img-4.9.0-4-amd64"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "x86_64"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index 3dd33f2..ed84c6c 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -15,9 +15,6 @@ DISTRO_ARCH ?= "armhf"
IMAGE_PREINSTALL += "linux-image-armmp"
-KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-armmp"
-INITRD_IMAGE ?= "initrd.img-3.16.0-4-armmp"
-
ROOTFS_DEV ?= "vda"
QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index f3636f6..1cce97a 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -11,9 +11,6 @@ IMAGE_PREINSTALL += " \
linux-image-armmp \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-armmp"
-INITRD_IMAGE ?= "initrd.img-4.9.0-4-armmp"
-
ROOTFS_DEV ?= "vda"
QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 3a23692..38ea191 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -15,9 +15,6 @@ DISTRO_ARCH ?= "armhf"
IMAGE_PREINSTALL += "linux-image-vexpress"
-KERNEL_IMAGE ?= "vmlinuz-3.2.0-4-vexpress"
-INITRD_IMAGE ?= "initrd.img-3.2.0-4-vexpress"
-
ROOTFS_DEV ?= "mmcblk0"
QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index 55cb172..d589661 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -8,9 +8,6 @@ DISTRO_ARCH ?= "i386"
IMAGE_PREINSTALL += "linux-image-686-pae"
-KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-686-pae"
-INITRD_IMAGE ?= "initrd.img-3.16.0-4-686-pae"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "i386"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index c0285b4..40239e4 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -11,9 +11,6 @@ IMAGE_PREINSTALL += " \
linux-image-686-pae \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-686-pae"
-INITRD_IMAGE ?= "initrd.img-4.9.0-4-686-pae"
-
ROOTFS_DEV ?= "sda"
QEMU_ARCH ?= "i386"
diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
index 82b38d2..d1dd9d9 100644
--- a/meta-isar/conf/multiconfig/rpi-jessie.conf
+++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
@@ -31,7 +31,4 @@ IMAGE_PREINSTALL += " \
vim \
"
-KERNEL_IMAGE ?= "vmlinuz-4.9.0-3-rpi"
-INITRD_IMAGE ?= "initrd.img-4.9.0-3-rpi"
-
ROOTFS_DEV ?= "mmcblk0p2"
diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 9fa9aa5..18a74ca 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -1,5 +1,5 @@
# This software is a part of ISAR.
-# Copyright (C) 2015-2016 ilbers GmbH
+# Copyright (C) 2015-2017 ilbers GmbH
# Extra space for rootfs in MB
ROOTFS_EXTRA ?= "64"
@@ -10,8 +10,6 @@ do_ext4_image[stamp-extra-info] = "${DISTRO}-${MACHINE}"
# Generate ext4 filesystem image
do_ext4_image() {
- mkdir -p ${DEPLOY_DIR_IMAGE}
-
rm -f ${EXT4_IMAGE_FILE}
ROOTFS_SIZE=`sudo du -sm ${IMAGE_ROOTFS} | awk '{print $1 + ${ROOTFS_EXTRA};}'`
@@ -24,14 +22,6 @@ do_ext4_image() {
sudo cp -r ${IMAGE_ROOTFS}/* ${WORKDIR}/mnt
sudo umount ${WORKDIR}/mnt
rm -r ${WORKDIR}/mnt
-
- if [ -n "${KERNEL_IMAGE}" ]; then
- cp ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
- fi
-
- if [ -n "${INITRD_IMAGE}" ]; then
- cp ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
- fi
}
-addtask ext4_image before do_build after do_rootfs
+addtask ext4_image before do_build after do_copy_boot_files
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3049657..e05c490 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -1,15 +1,22 @@
# This software is a part of ISAR.
# Copyright (C) 2015-2017 ilbers GmbH
-KERNEL_IMAGE ?= ""
-INITRD_IMAGE ?= ""
-
IMAGE_INSTALL ?= ""
IMAGE_TYPE ?= "ext4-img"
IMAGE_ROOTFS = "${WORKDIR}/rootfs"
-inherit ${IMAGE_TYPE}
+def get_image_name(d, name_link):
+ S = d.getVar("IMAGE_ROOTFS", True)
+ path_link = os.path.join(S, name_link)
+ if os.path.lexists(path_link):
+ return os.path.basename(os.path.realpath(path_link))
+ return ""
+
+# These variables are used by wic and start_vm
+KERNEL_IMAGE ?= "${@get_image_name(d, 'vmlinuz')}"
+INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')}"
+inherit ${IMAGE_TYPE}
call_reprepro() {
for i in $(seq 1 ${REPREPRO_LOCK_ATTEMPTS}); do
# According to `sh` manual page, shell exit statuses fall between
@@ -76,3 +83,19 @@ do_populate() {
addtask populate before do_build after do_unpack
do_populate[deptask] = "do_deploy_deb"
+
+do_copy_boot_files() {
+ KERNEL_IMAGE=${@get_image_name(d, 'vmlinuz')}
+ if [ -n "${KERNEL_IMAGE}" ]; then
+ cp -f ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
+ fi
+
+ INITRD_IMAGE=${@get_image_name(d, 'initrd.img')}
+ if [ -n "${INITRD_IMAGE}" ]; then
+ cp -f ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
+ fi
+}
+
+addtask copy_boot_files before do_build after do_rootfs
+do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
+do_copy_boot_files[stamp-extra-info] = "${DISTRO}-${MACHINE}"
diff --git a/scripts/start_vm b/scripts/start_vm
index 400484a..81e4dc9 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -114,6 +114,11 @@ do
done
readonly IMAGE_DIR=$BUILD_DIR/tmp/deploy/images
+readonly ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img
+
+eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep "^WORKDIR=")
+eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep "^KERNEL_IMAGE=")
+eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep "^INITRD_IMAGE=")
readonly ISARROOT="$(dirname "$0")"/..
@@ -121,8 +126,7 @@ readonly MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf
eval "$(egrep 'MACHINE_SERIAL' $MACHINE_CONF |bb2sh)"
readonly CONFIG_CONF=$ISARROOT/meta-isar/conf/multiconfig/qemu$ARCH-$DISTRO.conf
-eval "$(egrep '(KERNEL|INITRD)_IMAGE|ROOTFS_DEV|QEMU_' $CONFIG_CONF |bb2sh)"
-readonly ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img
+eval "$(egrep 'ROOTFS_DEV|QEMU_' $CONFIG_CONF |bb2sh)"
QCPU=
[ -n "$QEMU_CPU" ] && QCPU="-cpu $QEMU_CPU"
--
2.1.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions
2017-10-19 16:08 ` Henning Schild
@ 2017-10-19 19:18 ` Alexander Smirnov
0 siblings, 0 replies; 10+ messages in thread
From: Alexander Smirnov @ 2017-10-19 19:18 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 10/19/2017 07:08 PM, Henning Schild wrote:
> On Thu, 19 Oct 2017 18:00:51 +0200
> "[ext] Henning Schild" <henning.schild@siemens.com> wrote:
>
>> On Wed, 18 Oct 2017 16:06:40 +0200
>> "[ext] Henning Schild" <henning.schild@siemens.com> wrote:
>>
>>> I have not tested these patches, but they look good to me. The whole
>>> readlink thing is not too important.
>>
>> Just tested them and they break wic because the two variables are not
>> part of any config. Would require the eval(bitbake) stuff that is done
>> in start_vm. Probably not the best idea to do that over and over,
>> maybe the code should append that to local.conf or write it to a file
>> that everyone can read.
>>
>> Why are they on top of next in git and not on master? Would the urgent
>> not suggest we should test them on top of master and take them on the
>> fast lane before next?
>>
>> Setting the two guys back to what they where in multiconfig does not
>> work because the code would now look for /vmlinuz-4.9....
>>
>> Setting them to "boot/vmlinuz-4.9..." creates wic trouble again.
>>
>> I think a wic use-case needs to be added to CI, but since wic is not
>> integrated in bitbake i am afraid i can not send patches because the
>> change needs to happen in your CI.
Good idea, thanks.
Alex
>
> All that being said, go ahead and merge them to master. If wic is not
> part of CI, wic users can carry fixes for the new issues in their
> branches for now.
>
> Henning
>
>> Henning
>>
>>> Henning
>>>
>>> On Tue, 17 Oct 2017 22:23:06 +0300
>>> Alexander Smirnov <asmirnov@ilbers.de> wrote:
>>>
>>>> Hello all,
>>>>
>>>> IMPORTANT: lets try to review this series ASAP, becuase Isar build
>>>> is broken again due to recent update of Raspbian kernel version in
>>>> apt. Instead of yet-another-version update I'd like to commit
>>>> proper solution.
>>>>
>>>> In current Isar implementation, multiconfig file contains
>>>> hardcoded version for boot files: kernel and initrd. This is used
>>>> for both:
>>>>
>>>> - Add respective package to multistrap config.
>>>> - Copy boot files to deploy directory.
>>>>
>>>> This series drops this hardcoded versions, so now Isar is able to
>>>> determine version of boot files during building.
>>>>
>>>> Changes since v1:
>>>> - Differentiate 'do_copy_boot_files' stamps.
>>>> - Update start_vm script accordingly.
>>>> - Check if symlinks 'vmlinuz' and 'initrd.img' exist before
>>>> reading them. If symlink doesn't exist, this function skips it.
>>>>
>>>> With best regards,
>>>> Alex
>>>>
>>>>
>>>> *** BLURB HERE ***
>>>>
>>>> Alexander Smirnov (2):
>>>> meta-isar: Drop hardcoded kernel versions
>>>> meta-isar: Rework boot files copying
>>>>
>>>> meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 5 +----
>>>> meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 5 +----
>>>> meta-isar/conf/multiconfig/qemuarm-jessie.conf | 5 +----
>>>> meta-isar/conf/multiconfig/qemuarm-stretch.conf | 5 +----
>>>> meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 5 +----
>>>> meta-isar/conf/multiconfig/qemui386-jessie.conf | 5 +----
>>>> meta-isar/conf/multiconfig/qemui386-stretch.conf | 5 +----
>>>> meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
>>>> meta/classes/ext4-img.bbclass | 8 --------
>>>> meta/classes/image.bbclass | 24
>>>> ++++++++++++++++++++---
>>>> scripts/start_vm | 8 ++++++-- 11
>>>> files changed, 34 insertions(+), 44 deletions(-)
>>>>
>>>
>>
>
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v4] meta-isar: Rework boot files copying
2017-10-19 19:13 ` [PATCH v4] meta-isar: Rework boot files copying Alexander Smirnov
@ 2017-10-19 19:39 ` Alexander Smirnov
2017-10-20 16:11 ` Henning Schild
1 sibling, 0 replies; 10+ messages in thread
From: Alexander Smirnov @ 2017-10-19 19:39 UTC (permalink / raw)
To: isar-users
> 8<--
> Changes since v3:
> - Restored KERNEL_IMAGE and INITRD_IMAGE variables to support wic
> images creation.
> 8<--
>
> Currently there are two variables that contains hardcoded filenames
> with versions for kernel and initrd images. Isar uses them to copy these
> files to deploy directory. Moreover this is performed in ext4 class,
> what is logically wrong.
>
> This patch implements a new way which doesn't rely on hardcoded versioned
> filenames. Also it drops this copying from ext4 class.
>
> Signed-off-by: Frank Lenormand <lenormf@gmail.com>
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>
Applied to next to start CI build. Will rework it if some issue will be
found.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v4] meta-isar: Rework boot files copying
2017-10-19 19:13 ` [PATCH v4] meta-isar: Rework boot files copying Alexander Smirnov
2017-10-19 19:39 ` Alexander Smirnov
@ 2017-10-20 16:11 ` Henning Schild
1 sibling, 0 replies; 10+ messages in thread
From: Henning Schild @ 2017-10-20 16:11 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users, Frank Lenormand
Looks good, i will be out of office for a while and can not test that.
But if it passes your tests, i am confident it will work.
Thanks,
Henning
Am Thu, 19 Oct 2017 22:13:57 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> 8<--
> Changes since v3:
> - Restored KERNEL_IMAGE and INITRD_IMAGE variables to support wic
> images creation.
> 8<--
>
> Currently there are two variables that contains hardcoded filenames
> with versions for kernel and initrd images. Isar uses them to copy
> these files to deploy directory. Moreover this is performed in ext4
> class, what is logically wrong.
>
> This patch implements a new way which doesn't rely on hardcoded
> versioned filenames. Also it drops this copying from ext4 class.
>
> Signed-off-by: Frank Lenormand <lenormf@gmail.com>
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> ---
> meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 3 ---
> meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 3 ---
> meta-isar/conf/multiconfig/qemuarm-jessie.conf | 3 ---
> meta-isar/conf/multiconfig/qemuarm-stretch.conf | 3 ---
> meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 3 ---
> meta-isar/conf/multiconfig/qemui386-jessie.conf | 3 ---
> meta-isar/conf/multiconfig/qemui386-stretch.conf | 3 ---
> meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ---
> meta/classes/ext4-img.bbclass | 14 ++--------
> meta/classes/image.bbclass | 31
> ++++++++++++++++++++---
> scripts/start_vm | 8 ++++-- 11
> files changed, 35 insertions(+), 42 deletions(-)
>
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
> b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf index
> d9473f3..51d39b6 100644 ---
> a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf +++
> b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf @@ -8,9 +8,6 @@
> DISTRO_ARCH ?= "amd64"
> IMAGE_PREINSTALL += "linux-image-amd64"
>
> -KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-amd64"
> -INITRD_IMAGE ?= "initrd.img-3.16.0-4-amd64"
> -
> ROOTFS_DEV ?= "sda"
>
> QEMU_ARCH ?= "x86_64"
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
> b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf index
> 5ac25d9..c59876a 100644 ---
> a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf +++
> b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf @@ -11,9 +11,6 @@
> IMAGE_PREINSTALL += " \ linux-image-amd64 \
> "
>
> -KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-amd64"
> -INITRD_IMAGE ?= "initrd.img-4.9.0-4-amd64"
> -
> ROOTFS_DEV ?= "sda"
>
> QEMU_ARCH ?= "x86_64"
> diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
> b/meta-isar/conf/multiconfig/qemuarm-jessie.conf index
> 3dd33f2..ed84c6c 100644 ---
> a/meta-isar/conf/multiconfig/qemuarm-jessie.conf +++
> b/meta-isar/conf/multiconfig/qemuarm-jessie.conf @@ -15,9 +15,6 @@
> DISTRO_ARCH ?= "armhf"
> IMAGE_PREINSTALL += "linux-image-armmp"
>
> -KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-armmp"
> -INITRD_IMAGE ?= "initrd.img-3.16.0-4-armmp"
> -
> ROOTFS_DEV ?= "vda"
>
> QEMU_ARCH ?= "arm"
> diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
> b/meta-isar/conf/multiconfig/qemuarm-stretch.conf index
> f3636f6..1cce97a 100644 ---
> a/meta-isar/conf/multiconfig/qemuarm-stretch.conf +++
> b/meta-isar/conf/multiconfig/qemuarm-stretch.conf @@ -11,9 +11,6 @@
> IMAGE_PREINSTALL += " \ linux-image-armmp \
> "
>
> -KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-armmp"
> -INITRD_IMAGE ?= "initrd.img-4.9.0-4-armmp"
> -
> ROOTFS_DEV ?= "vda"
>
> QEMU_ARCH ?= "arm"
> diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
> b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf index
> 3a23692..38ea191 100644 ---
> a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf +++
> b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf @@ -15,9 +15,6 @@
> DISTRO_ARCH ?= "armhf"
> IMAGE_PREINSTALL += "linux-image-vexpress"
>
> -KERNEL_IMAGE ?= "vmlinuz-3.2.0-4-vexpress"
> -INITRD_IMAGE ?= "initrd.img-3.2.0-4-vexpress"
> -
> ROOTFS_DEV ?= "mmcblk0"
>
> QEMU_ARCH ?= "arm"
> diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf
> b/meta-isar/conf/multiconfig/qemui386-jessie.conf index
> 55cb172..d589661 100644 ---
> a/meta-isar/conf/multiconfig/qemui386-jessie.conf +++
> b/meta-isar/conf/multiconfig/qemui386-jessie.conf @@ -8,9 +8,6 @@
> DISTRO_ARCH ?= "i386"
> IMAGE_PREINSTALL += "linux-image-686-pae"
>
> -KERNEL_IMAGE ?= "vmlinuz-3.16.0-4-686-pae"
> -INITRD_IMAGE ?= "initrd.img-3.16.0-4-686-pae"
> -
> ROOTFS_DEV ?= "sda"
>
> QEMU_ARCH ?= "i386"
> diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf
> b/meta-isar/conf/multiconfig/qemui386-stretch.conf index
> c0285b4..40239e4 100644 ---
> a/meta-isar/conf/multiconfig/qemui386-stretch.conf +++
> b/meta-isar/conf/multiconfig/qemui386-stretch.conf @@ -11,9 +11,6 @@
> IMAGE_PREINSTALL += " \ linux-image-686-pae \
> "
>
> -KERNEL_IMAGE ?= "vmlinuz-4.9.0-4-686-pae"
> -INITRD_IMAGE ?= "initrd.img-4.9.0-4-686-pae"
> -
> ROOTFS_DEV ?= "sda"
>
> QEMU_ARCH ?= "i386"
> diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf
> b/meta-isar/conf/multiconfig/rpi-jessie.conf index 82b38d2..d1dd9d9
> 100644 --- a/meta-isar/conf/multiconfig/rpi-jessie.conf
> +++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
> @@ -31,7 +31,4 @@ IMAGE_PREINSTALL += " \
> vim \
> "
>
> -KERNEL_IMAGE ?= "vmlinuz-4.9.0-3-rpi"
> -INITRD_IMAGE ?= "initrd.img-4.9.0-3-rpi"
> -
> ROOTFS_DEV ?= "mmcblk0p2"
> diff --git a/meta/classes/ext4-img.bbclass
> b/meta/classes/ext4-img.bbclass index 9fa9aa5..18a74ca 100644
> --- a/meta/classes/ext4-img.bbclass
> +++ b/meta/classes/ext4-img.bbclass
> @@ -1,5 +1,5 @@
> # This software is a part of ISAR.
> -# Copyright (C) 2015-2016 ilbers GmbH
> +# Copyright (C) 2015-2017 ilbers GmbH
>
> # Extra space for rootfs in MB
> ROOTFS_EXTRA ?= "64"
> @@ -10,8 +10,6 @@ do_ext4_image[stamp-extra-info] =
> "${DISTRO}-${MACHINE}"
> # Generate ext4 filesystem image
> do_ext4_image() {
> - mkdir -p ${DEPLOY_DIR_IMAGE}
> -
> rm -f ${EXT4_IMAGE_FILE}
>
> ROOTFS_SIZE=`sudo du -sm ${IMAGE_ROOTFS} | awk '{print $1 +
> ${ROOTFS_EXTRA};}'` @@ -24,14 +22,6 @@ do_ext4_image() {
> sudo cp -r ${IMAGE_ROOTFS}/* ${WORKDIR}/mnt
> sudo umount ${WORKDIR}/mnt
> rm -r ${WORKDIR}/mnt
> -
> - if [ -n "${KERNEL_IMAGE}" ]; then
> - cp ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
> - fi
> -
> - if [ -n "${INITRD_IMAGE}" ]; then
> - cp ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
> - fi
> }
>
> -addtask ext4_image before do_build after do_rootfs
> +addtask ext4_image before do_build after do_copy_boot_files
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 3049657..e05c490 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -1,15 +1,22 @@
> # This software is a part of ISAR.
> # Copyright (C) 2015-2017 ilbers GmbH
>
> -KERNEL_IMAGE ?= ""
> -INITRD_IMAGE ?= ""
> -
> IMAGE_INSTALL ?= ""
> IMAGE_TYPE ?= "ext4-img"
> IMAGE_ROOTFS = "${WORKDIR}/rootfs"
>
> -inherit ${IMAGE_TYPE}
> +def get_image_name(d, name_link):
> + S = d.getVar("IMAGE_ROOTFS", True)
> + path_link = os.path.join(S, name_link)
> + if os.path.lexists(path_link):
> + return os.path.basename(os.path.realpath(path_link))
> + return ""
> +
> +# These variables are used by wic and start_vm
> +KERNEL_IMAGE ?= "${@get_image_name(d, 'vmlinuz')}"
> +INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')}"
>
> +inherit ${IMAGE_TYPE}
> call_reprepro() {
> for i in $(seq 1 ${REPREPRO_LOCK_ATTEMPTS}); do
> # According to `sh` manual page, shell exit statuses fall
> between @@ -76,3 +83,19 @@ do_populate() {
>
> addtask populate before do_build after do_unpack
> do_populate[deptask] = "do_deploy_deb"
> +
> +do_copy_boot_files() {
> + KERNEL_IMAGE=${@get_image_name(d, 'vmlinuz')}
> + if [ -n "${KERNEL_IMAGE}" ]; then
> + cp -f ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE}
> ${DEPLOY_DIR_IMAGE}
> + fi
> +
> + INITRD_IMAGE=${@get_image_name(d, 'initrd.img')}
> + if [ -n "${INITRD_IMAGE}" ]; then
> + cp -f ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE}
> ${DEPLOY_DIR_IMAGE}
> + fi
> +}
> +
> +addtask copy_boot_files before do_build after do_rootfs
> +do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
> +do_copy_boot_files[stamp-extra-info] = "${DISTRO}-${MACHINE}"
> diff --git a/scripts/start_vm b/scripts/start_vm
> index 400484a..81e4dc9 100755
> --- a/scripts/start_vm
> +++ b/scripts/start_vm
> @@ -114,6 +114,11 @@ do
> done
>
> readonly IMAGE_DIR=$BUILD_DIR/tmp/deploy/images
> +readonly
> ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img +
> +eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base |
> grep "^WORKDIR=") +eval $(bitbake -e
> multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep
> "^KERNEL_IMAGE=") +eval $(bitbake -e
> multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep
> "^INITRD_IMAGE=") readonly ISARROOT="$(dirname "$0")"/..
> @@ -121,8 +126,7 @@ readonly
> MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf eval
> "$(egrep 'MACHINE_SERIAL' $MACHINE_CONF |bb2sh)"
> readonly
> CONFIG_CONF=$ISARROOT/meta-isar/conf/multiconfig/qemu$ARCH-$DISTRO.conf
> -eval "$(egrep '(KERNEL|INITRD)_IMAGE|ROOTFS_DEV|QEMU_' $CONFIG_CONF
> |bb2sh)" -readonly
> ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img +eval
> "$(egrep 'ROOTFS_DEV|QEMU_' $CONFIG_CONF |bb2sh)" QCPU=
> [ -n "$QEMU_CPU" ] && QCPU="-cpu $QEMU_CPU"
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-10-20 16:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 19:23 [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 1/2] meta-isar: Drop hardcoded kernel versions Alexander Smirnov
2017-10-17 19:23 ` [URGENT][PATCH v2 2/2] meta-isar: Rework boot files copying Alexander Smirnov
2017-10-18 14:06 ` [URGENT][PATCH v2 0/2] Correctly determine kernel and initrd versions Henning Schild
2017-10-19 16:00 ` Henning Schild
2017-10-19 16:08 ` Henning Schild
2017-10-19 19:18 ` Alexander Smirnov
2017-10-19 19:13 ` [PATCH v4] meta-isar: Rework boot files copying Alexander Smirnov
2017-10-19 19:39 ` Alexander Smirnov
2017-10-20 16:11 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox