Skip to contentSkip to conversation

classes/kernel: Use a copy of image for kernel*.rpm if fs doesn't support symlinks

PATCH Superseded Xu, Yanfei 3 participants 18 messages Jun 19, 2020 – Jul 3, 2020

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Xu, Yanfei

author
#0 lore raw

v3 cover classes/kernel: Use a copy of image for kernel*.rpm if fs doesn't support symlinks

From: Yanfei Xu <[email protected]>

v1->v2->v3:
1.Put the symlink creation at postinstall script instead of build time. 2.Add a postremove script for removing image created in postinstall.

Yanfei Xu (1):
classes/kernel: Use a copy of image for kernel*.rpm if fs doesn't
support symlinks

 meta/classes/kernel.bbclass | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
Signature · 1 line
2.18.2
author
#1 lore raw

PATCH v3 1/1 classes/kernel: Use a copy of image for kernel*.rpm if fs doesn't support symlinks

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure when you install or update the kernel rpm package. Now we use a copy of image for these filesystems instead of symlink.

---
 meta/classes/kernel.bbclass | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +16 -3
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
         d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower))
         d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
         d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
+        d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,typelower), """
+set +e
+ln -sf %s-${KERNEL_VERSION} ${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+    echo "Filesystem on ${KERNEL_IMAGEDEST}/ doesn't support symlinks, falling back to copied image (%s)."
+    install -m 0644 ${KERNEL_IMAGEDEST}/%s-${KERNEL_VERSION} ${KERNEL_IMAGEDEST}/%s 
+fi
+set -e
+""" % (type, type, type, type, type))
+        d.setVar('pkg_postrm_%s-image-%s' % (kname,typelower), """
+set +e
+if [ -f "${KERNEL_IMAGEDEST}/%s" -o -L "${KERNEL_IMAGEDEST}/%s" ]; then
+    rm -f ${KERNEL_IMAGEDEST}/%s  > /dev/null 2>&1
+fi
+set -e
+""" % (type, type, type))
 
     image = d.getVar('INITRAMFS_IMAGE')
     # If the INTIRAMFS_IMAGE is set but the INITRAMFS_IMAGE_BUNDLE is set to 0,
@@ -385,9 +401,6 @@ kernel_do_install() {
 	install -d ${D}/boot
 	for imageType in ${KERNEL_IMAGETYPES} ; do
 		install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} ${D}/${KERNEL_IMAGEDEST}/${imageType}-${KERNEL_VERSION}
-		if [ "${KERNEL_PACKAGE_NAME}" = "kernel" ]; then
-			ln -sf ${imageType}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${imageType}
-		fi
 	done
 	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
 	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
Signature · 1 line
2.18.2
#2 lore raw
Quoted 19 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure when you install or update the kernel rpm package. Now we use a copy of image for these filesystems instead of symlink.

---
 meta/classes/kernel.bbclass | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644

meta/classes/kernel.bbclass python __anonymous () { · line 97

Quoted 4 lines
meta/classes/kernel.bbclass +1 -0
@@ -94,6 +94,22 @@ python __anonymous () {
         d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower))
         d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
         d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
+        d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,typelower), """

You were previously concerned about boot issues if the unversioned image link/copy was deferred until boot. I don't see a summary of why that's no longer a concern in the v3 of the patch. Can you confirm that it isn't an issue ? Is it simply because the booted image isn't installed via this package, and hence we are fine ?

Quoted 19 lines
meta/classes/kernel.bbclass +15 -0
+set +e
+ln -sf %s-${KERNEL_VERSION} ${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+    echo "Filesystem on ${KERNEL_IMAGEDEST}/ doesn't support symlinks, falling back to copied image (%s)."
+    install -m 0644 ${KERNEL_IMAGEDEST}/%s-${KERNEL_VERSION} ${KERNEL_IMAGEDEST}/%s
+fi
+set -e
+""" % (type, type, type, type, type))
+        d.setVar('pkg_postrm_%s-image-%s' % (kname,typelower), """
+set +e
+if [ -f "${KERNEL_IMAGEDEST}/%s" -o -L "${KERNEL_IMAGEDEST}/%s" ]; then
+    rm -f ${KERNEL_IMAGEDEST}/%s  > /dev/null 2>&1
+fi
+set -e
+""" % (type, type, type))
 
     image = d.getVar('INITRAMFS_IMAGE')
     # If the INTIRAMFS_IMAGE is set but the INITRAMFS_IMAGE_BUNDLE is set to 0,

meta/classes/kernel.bbclass kernel_do_install() { · line 390

Quoted 6 lines
meta/classes/kernel.bbclass +0 -3
@@ -385,9 +401,6 @@ kernel_do_install() {
        install -d ${D}/boot
        for imageType in ${KERNEL_IMAGETYPES} ; do
                install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} ${D}/${KERNEL_IMAGEDEST}/${imageType}-${KERNEL_VERSION}
-               if [ "${KERNEL_PACKAGE_NAME}" = "kernel" ]; then
-                       ln -sf ${imageType}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${imageType}
-               fi

For on-target installs, this is what I was doing in the past as well. Make the symlink during package install, that way we are encapsulated in that unit.

That just leaves my boot question as the last remaining thing for the change.

Bruce

Quoted 6 lines
meta/classes/kernel.bbclass +0 -1
        done
        install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
        install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
--

2.18.2

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#3 lore raw
Quoted 27 lines · Bruce Ashfield
Quoted 26 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure when
you install or update the kernel rpm package. Now we use a copy of image for these filesystems instead of symlink.

---
 meta/classes/kernel.bbclass | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
         d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' %
 (kname, typelower))
         d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-
 %s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
         d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower),
 '1')
Quoted 8 lines
Quoted 2 lines
meta/classes/kernel.bbclass +1 -0
+        d.setVar('pkg_postinst_ontarget_%s-image-%s' %

(kname,typelower), """

You were previously concerned about boot issues if the unversioned image link/copy was deferred until boot. I don't see a summary of why that's no longer a concern in the v3 of the patch. Can you confirm that it isn't an issue ? Is it simply because the booted image isn't installed via this package, and hence we are fine ?

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Cheers,

Richard

author
#4 lore raw
Quoted 37 lines · Richard Purdie
Quoted 27 lines · Bruce Ashfield
Quoted 26 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure when
you install or update the kernel rpm package. Now we use a copy of image for these filesystems instead of symlink.

---
  meta/classes/kernel.bbclass | 19 ++++++++++++++++---
  1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
          d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' %
 (kname, typelower))
          d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-
 %s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
          d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower),
 '1')
Quoted 8 lines
Quoted 2 lines
meta/classes/kernel.bbclass +1 -0
+        d.setVar('pkg_postinst_ontarget_%s-image-%s' %

(kname,typelower), """

You were previously concerned about boot issues if the unversioned image link/copy was deferred until boot. I don't see a summary of why that's no longer a concern in the v3 of the patch. Can you confirm that it isn't an issue ? Is it simply because the booted image isn't installed via this package, and hence we are fine ?

Quoted 4 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Regards,
Yanfei

Quoted 4 lines

Cheers,

Richard

#5 lore raw
Quoted 49 lines · Yanfei
Quoted 47 lines · Richard Purdie
Quoted 45 lines · Bruce Ashfield
Quoted 26 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
  meta/classes/kernel.bbclass | 19 ++++++++++++++++---
  1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
          d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-

%s' %
(kname, typelower))

Quoted 8 lines
          d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
          d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname,

typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a summary of why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image isn't
installed via this package, and hence we are fine ?

Quoted 5 lines
Quoted 4 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

Cheers,

Richard

author
#6 lore raw
Quoted 50 lines · Richard Purdie
Quoted 49 lines · Yanfei
Quoted 47 lines · Richard Purdie
Quoted 45 lines · Bruce Ashfield
Quoted 26 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
   meta/classes/kernel.bbclass | 19 ++++++++++++++++---
   1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
           d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-

%s' %
(kname, typelower))

Quoted 8 lines
           d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
           d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname,

typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a summary of why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image isn't
installed via this package, and hence we are fine ?

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

OK, I am trying to analyse the log. But I haven't figured out what cause it fialed, and how to reproduce it on my mechine. I'd apprecate any information.

Regards,
Yanfei

Quoted 4 lines

Cheers,

Richard

#7 lore raw
Quoted 65 lines · Yanfei
Quoted 63 lines · Richard Purdie
Quoted 61 lines · Yanfei
Quoted 53 lines · Richard Purdie
Quoted 43 lines · Bruce Ashfield
Quoted 33 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy
of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
   meta/classes/kernel.bbclass | 19 ++++++++++++++++---
   1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
           d.appendVar('RDEPENDS_%s-image' % kname, ' %s-

image-
%s' %
(kname, typelower))

           d.setVar('PKG_%s-image-%s' % (kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
           d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname,
Quoted 4 lines

typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a

Quoted 8 lines

summary of
why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image
isn't
installed via this package, and hence we are fine ?

Quoted 5 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Quoted 7 lines
Quoted 3 lines

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

OK, I am trying to analyse the log. But I haven't figured out what cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any information.

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

Cheers,

Richard

author
#8 lore raw
Quoted 69 lines · Richard Purdie
Quoted 68 lines · Yanfei
Quoted 66 lines · Richard Purdie
Quoted 54 lines · Yanfei
Quoted 53 lines · Richard Purdie
Quoted 51 lines · Bruce Ashfield
Quoted 33 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy
of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
    meta/classes/kernel.bbclass | 19 ++++++++++++++++---
    1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
            d.appendVar('RDEPENDS_%s-image' % kname, ' %s-

image-
%s' %
(kname, typelower))

            d.setVar('PKG_%s-image-%s' % (kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname,
Quoted 4 lines

typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a summary of
why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image
isn't
installed via this package, and hence we are fine ?

Quoted 7 lines
Quoted 5 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

Quoted 9 lines
Quoted 4 lines

OK, I am trying to analyse the log. But I haven't figured out what cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any information.

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't contain no-versioned image. This result is different from the previous I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0 part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Hence we still should keep the no-versioned iamge in kernel-image*.rpm which is like the previous v2 patch.

Cheers,

Yanfei

Quoted 4 lines

Cheers,

Richard

author
#9 lore raw
Quoted 97 lines · Yanfei
Quoted 70 lines · Richard Purdie
Quoted 69 lines · Yanfei
Quoted 67 lines · Richard Purdie
Quoted 54 lines · Yanfei
Quoted 53 lines · Richard Purdie
Quoted 51 lines · Bruce Ashfield
Quoted 29 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy
of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
    meta/classes/kernel.bbclass | 19 ++++++++++++++++---

    1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {

            d.appendVar('RDEPENDS_%s-image' % kname, ' %s- image-
%s' %
(kname, typelower))
            d.setVar('PKG_%s-image-%s' % (kname,typelower),

Quoted 8 lines

'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower)) d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower),
'1')
+        d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a summary of
why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image
isn't
installed via this package, and hence we are fine ?

Quoted 8 lines
Quoted 6 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

Quoted 9 lines
Quoted 4 lines

OK, I am trying to analyse the log. But I haven't figured out what cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any information.

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't contain no-versioned image. This result is different from the previous I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 3 lines

Hence we still should keep the no-versioned iamge in kernel-image*.rpm which is like the previous v2 patch.

Any opinions? It does cause the kernel rpm larger. However, the kernel image is not always large, only a few MB. And it will be changed to symlink when installed on targe. So this patch's only negative effect is the little increasement about update payloads.

BTW, should I resend the v2 patch?

Cheers,

Yanfei

Quoted 8 lines

Cheers,

Yanfei

Quoted 4 lines

Cheers,

Richard

#10 lore raw
Quoted 102 lines · Yanfei
Quoted 98 lines · Yanfei
Quoted 70 lines · Richard Purdie
Quoted 69 lines · Yanfei
Quoted 67 lines · Richard Purdie
Quoted 54 lines · Yanfei
Quoted 53 lines · Richard Purdie
Quoted 51 lines · Bruce Ashfield
Quoted 33 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy
of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
    meta/classes/kernel.bbclass | 19 ++++++++++++++++---
    1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
            d.appendVar('RDEPENDS_%s-image' % kname, ' %s-

image-
%s' %
(kname, typelower))

            d.setVar('PKG_%s-image-%s' % (kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname,
Quoted 4 lines

typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a summary of
why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image
isn't
installed via this package, and hence we are fine ?

Quoted 8 lines
Quoted 6 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

Quoted 9 lines
Quoted 4 lines

OK, I am trying to analyse the log. But I haven't figured out what cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any information.

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't contain no-versioned image. This result is different from the previous I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is installed by rpm package. Blow is the wks used by 'oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 7 lines
Quoted 3 lines

Hence we still should keep the no-versioned iamge in kernel-image*.rpm which is like the previous v2 patch.

Any opinions? It does cause the kernel rpm larger. However, the kernel image is not always large, only a few MB. And it will be changed to symlink when installed on targe. So this patch's only negative effect is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time ? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink on boot).

Bruce

Quoted 15 lines

BTW, should I resend the v2 patch?

Cheers,

Yanfei

Quoted 8 lines

Cheers,

Yanfei

Quoted 4 lines

Cheers,

Richard

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

author
#11 lore raw
Quoted 122 lines · Bruce Ashfield
Quoted 102 lines · Yanfei
Quoted 98 lines · Yanfei
Quoted 70 lines · Richard Purdie
Quoted 69 lines · Yanfei
Quoted 67 lines · Richard Purdie
Quoted 54 lines · Yanfei
Quoted 53 lines · Richard Purdie
Quoted 51 lines · Bruce Ashfield
Quoted 33 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure
when
you install or update the kernel rpm package. Now we use a copy
of
image for these filesystems instead of symlink.

Suggested-by Richard Purdie <

[email protected]>

---
     meta/classes/kernel.bbclass | 19 ++++++++++++++++---
     1 file changed, 16 insertions(+), 3 deletions(-)
meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
             d.appendVar('RDEPENDS_%s-image' % kname, ' %s-

image-
%s' %
(kname, typelower))

             d.setVar('PKG_%s-image-%s' % (kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
             d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname,
Quoted 4 lines

typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the unversioned
image link/copy was deferred until boot. I don't see a summary of
why
that's no longer a concern in the v3 of the patch. Can you confirm
that it isn't an issue ? Is it simply because the booted image
isn't
installed via this package, and hence we are fine ?

Quoted 8 lines
Quoted 6 lines

I'm suspecting this patch is why we're seeing selftest failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Do you mean this patch has been applied? and introduce new issues?

Yes, I reverted it and retested and confirmed this patch causes the selftest failure in the link to the build above.

Quoted 9 lines
Quoted 4 lines

OK, I am trying to analyse the log. But I haven't figured out what cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any information.

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't contain no-versioned image. This result is different from the previous I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is installed by rpm package. Blow is the wks used by 'oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 7 lines
Quoted 3 lines

Hence we still should keep the no-versioned iamge in kernel-image*.rpm which is like the previous v2 patch.

Any opinions? It does cause the kernel rpm larger. However, the kernel image is not always large, only a few MB. And it will be changed to symlink when installed on targe. So this patch's only negative effect is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

Quoted 6 lines

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time ? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink on boot).

Sorry for the uncleared discription.

For the os-selftest failure: The failure happened at qemu booting with its wic image. Qemu could not find the unversioned kernel image in wic image for booting itself ,then caused the test failed.

Why the booted partition in wic image doesn't contain the unversioned kernel image? Cause the wks can decide where the unversioned kernel images in wic image comes from. For this test, it comes from ${IMAGE_ROOTFS}/boot which is installed by kernel rpm package. Actually it didn't get unversioned kernel image because the symlink(or copy fallback) is in an on-boot post install hook.

Hence we should keep a unversioned kernel image in kernel rpm package. And patch v2 did it.( v1 and v2 are similar, but v2 improves print messages.)

Yanfei

Quoted 23 lines

Bruce

Quoted 15 lines

BTW, should I resend the v2 patch?

Cheers,

Yanfei

Quoted 8 lines

Cheers,

Yanfei

Quoted 4 lines

Cheers,

Richard

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

#12 lore raw
Quoted 179 lines · Yanfei
Quoted 152 lines · Bruce Ashfield
Quoted 130 lines · Yanfei
Quoted 123 lines · Yanfei
Quoted 96 lines · Richard Purdie
Quoted 88 lines · Yanfei
Quoted 79 lines · Richard Purdie
Quoted 78 lines · Yanfei
Quoted 77 lines · Richard Purdie
Quoted 59 lines · Bruce Ashfield
Quoted 41 lines · On Fri, Jun 19, 2020 at 7:47 AM < [email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you
will get
failure
when
you install or update the kernel rpm package. Now
we use a
copy
of
image for these filesystems instead of symlink.

Suggested-by: Bruce Ashfield <
[email protected]>
Suggested-by: Richard Purdie <
[email protected]>

Quoted 1 line
---
     meta/classes/kernel.bbclass | 19
++++++++++++++++---
     1 file changed, 16 insertions(+), 3

deletions(-)

meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
             d.appendVar('RDEPENDS_%s-image' %

kname, ' %s-
image-
%s' %
(kname, typelower))

             d.setVar('PKG_%s-image-%s' %

(kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname,
typelower))

Quoted 7 lines
             d.setVar('ALLOW_EMPTY_%s-image-%s' %

(kname,
typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-
image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the
unversioned
image link/copy was deferred until boot. I don't see a
summary of
why

Quoted 8 lines

that's no longer a concern in the v3 of the patch. Can you
confirm
that it isn't an issue ? Is it simply because the booted
image
isn't
installed via this package, and hence we are fine ?

I'm suspecting this patch is why we're seeing
selftest
failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Quoted 8 lines
Quoted 3 lines

Do you mean this patch has been applied? and introduce new
issues?

Yes, I reverted it and retested and confirmed this patch causes the
selftest failure in the link to the build above.

Quoted 6 lines

OK, I am trying to analyse the log. But I haven't figured out what
cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any
information.

Quoted 4 lines

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't
contain no-versioned image. This result is different from the previous
I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r
efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 4 lines

Hence we still should keep the no-versioned iamge in kernel- image*.rpm
which is like the previous v2 patch.

Quoted 7 lines

Any opinions? It does cause the kernel rpm larger. However, the kernel
image is not always large, only a few MB. And it will be changed to
symlink when installed on targe. So this patch's only negative effect
is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is
in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

Quoted 8 lines

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time
? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink
on boot).

Sorry for the uncleared discription.

For the os-selftest failure: The failure happened at qemu booting with
its wic image. Qemu could not find the unversioned kernel image in wic
image for booting itself ,then caused the test failed.

Why the booted partition in wic image doesn't contain the unversioned kernel image? Cause the wks can decide where the unversioned kernel images in wic image comes from. For this test, it comes from ${IMAGE_ROOTFS}/boot which is installed by kernel rpm package. Actually
it didn't get unversioned kernel image because the symlink(or copy fallback) is in an on-boot post install hook.

Quoted 4 lines

Hence we should keep a unversioned kernel image in kernel rpm package.
And patch v2 did it.( v1 and v2 are similar, but v2 improves print messages.)

This does bring us to a bit of an impasse as I don't really like the idea of duplicating the kernel binaries twice in the packages just to work around fat filesystem limitations.

Today its this file, you could argue we have to replace a load more files with duplicate copies and postinstalls which would seem to be the wrong direction to go in.

Which tools does the extraction of the files onto this fat system? Could we ignore the symlink errors there and rely on a postinstall to create if not already created?

Cheers,

Richard

author
#13 lore raw
Quoted 185 lines · Richard Purdie
Quoted 179 lines · Yanfei
Quoted 152 lines · Bruce Ashfield
Quoted 130 lines · Yanfei
Quoted 123 lines · Yanfei
Quoted 96 lines · Richard Purdie
Quoted 88 lines · Yanfei
Quoted 79 lines · Richard Purdie
Quoted 78 lines · Yanfei
Quoted 77 lines · Richard Purdie
Quoted 59 lines · Bruce Ashfield
Quoted 41 lines · On Fri, Jun 19, 2020 at 7:47 AM < [email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you
will get
failure
when
you install or update the kernel rpm package. Now
we use a
copy
of
image for these filesystems instead of symlink.

Suggested-by: Bruce Ashfield <
[email protected]>
Suggested-by: Richard Purdie <
[email protected]>

Quoted 1 line
---
      meta/classes/kernel.bbclass | 19
++++++++++++++++---
      1 file changed, 16 insertions(+), 3

deletions(-)

meta/classes/kernel.bbclass +0 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
              d.appendVar('RDEPENDS_%s-image' %

kname, ' %s-
image-
%s' %
(kname, typelower))

              d.setVar('PKG_%s-image-%s' %

(kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname,
typelower))

Quoted 7 lines
              d.setVar('ALLOW_EMPTY_%s-image-%s' %

(kname,
typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-
image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the
unversioned
image link/copy was deferred until boot. I don't see a
summary of
why

Quoted 8 lines

that's no longer a concern in the v3 of the patch. Can you
confirm
that it isn't an issue ? Is it simply because the booted
image
isn't
installed via this package, and hence we are fine ?

I'm suspecting this patch is why we're seeing
selftest
failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Quoted 8 lines
Quoted 3 lines

Do you mean this patch has been applied? and introduce new
issues?

Yes, I reverted it and retested and confirmed this patch causes the
selftest failure in the link to the build above.

Quoted 6 lines

OK, I am trying to analyse the log. But I haven't figured out what
cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any
information.

Quoted 4 lines

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't
contain no-versioned image. This result is different from the previous
I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r
efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 4 lines

Hence we still should keep the no-versioned iamge in kernel- image*.rpm
which is like the previous v2 patch.

Quoted 7 lines

Any opinions? It does cause the kernel rpm larger. However, the kernel
image is not always large, only a few MB. And it will be changed to
symlink when installed on targe. So this patch's only negative effect
is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is
in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

Quoted 8 lines

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time
? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink
on boot).

Sorry for the uncleared discription.

For the os-selftest failure: The failure happened at qemu booting with
its wic image. Qemu could not find the unversioned kernel image in wic
image for booting itself ,then caused the test failed.

Why the booted partition in wic image doesn't contain the unversioned kernel image? Cause the wks can decide where the unversioned kernel images in wic image comes from. For this test, it comes from ${IMAGE_ROOTFS}/boot which is installed by kernel rpm package. Actually
it didn't get unversioned kernel image because the symlink(or copy fallback) is in an on-boot post install hook.

Quoted 4 lines

Hence we should keep a unversioned kernel image in kernel rpm package.
And patch v2 did it.( v1 and v2 are similar, but v2 improves print messages.)

Quoted 7 lines

This does bring us to a bit of an impasse as I don't really like the idea of duplicating the kernel binaries twice in the packages just to work around fat filesystem limitations.

Today its this file, you could argue we have to replace a load more files with duplicate copies and postinstalls which would seem to be the wrong direction to go in.

Yes, I agree that duplicate copies is not a good way to solve these symlink problems for normal rpm. Users should be awared the disadvantages of vfat filesystem. But kernel rpm maybe more important than others rpm? so we could make its compatibility more all-around?

Quoted 4 lines

Which tools does the extraction of the files onto this fat system? Could we ignore the symlink errors there and rely on a postinstall to create if not already created?

It may not. Cause if the extraction of the files runs failed, the postinstall of this rpm package won't excute. So...

Cheers,

Yanfei

Quoted 11 lines

Cheers,

Richard

#14 lore raw
Quoted 196 lines · Yanfei
Quoted 181 lines · Richard Purdie
Quoted 175 lines · Yanfei
Quoted 149 lines · Bruce Ashfield
Quoted 127 lines · Yanfei
Quoted 121 lines · Yanfei
Quoted 95 lines · Richard Purdie
Quoted 87 lines · Yanfei
Quoted 78 lines · Richard Purdie
Quoted 77 lines · Yanfei
Quoted 76 lines · Richard Purdie
Quoted 58 lines · Bruce Ashfield
Quoted 47 lines · On Fri, Jun 19, 2020 at 7:47 AM < [email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you
will get
failure
when
you install or update the kernel rpm package. Now
we use a
copy
of
image for these filesystems instead of symlink.

Suggested-by: Bruce Ashfield <
[email protected]>
Suggested-by: Richard Purdie <
[email protected]>
Signed-off-by: Yanfei Xu <[email protected]
---
meta/classes/kernel.bbclass | 19
++++++++++++++++---
1 file changed, 16 insertions(+), 3
deletions(-)

diff --git a/meta/classes/kernel.bbclass
b/meta/classes/kernel.bbclass
index 20a0135fc9..1269b54343 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -94,6 +94,22 @@ python __anonymous () {
d.appendVar('RDEPENDS_%s-image' %
kname, ' %s-
image-
%s' %
(kname, typelower))
d.setVar('PKG_%s-image-%s' %
(kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname,
typelower))
d.setVar('ALLOW_EMPTY_%s-image-%s' %
(kname,
typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-
image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the
unversioned
image link/copy was deferred until boot. I don't see a
summary of
why

Quoted 8 lines

that's no longer a concern in the v3 of the patch. Can you
confirm
that it isn't an issue ? Is it simply because the booted
image
isn't
installed via this package, and hence we are fine ?

I'm suspecting this patch is why we're seeing
selftest
failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Quoted 8 lines
Quoted 3 lines

Do you mean this patch has been applied? and introduce new
issues?

Yes, I reverted it and retested and confirmed this patch causes the
selftest failure in the link to the build above.

Quoted 6 lines

OK, I am trying to analyse the log. But I haven't figured out what
cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any
information.

Quoted 4 lines

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't
contain no-versioned image. This result is different from the previous
I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r
efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 4 lines

Hence we still should keep the no-versioned iamge in kernel- image*.rpm
which is like the previous v2 patch.

Quoted 7 lines

Any opinions? It does cause the kernel rpm larger. However, the kernel
image is not always large, only a few MB. And it will be changed to
symlink when installed on targe. So this patch's only negative effect
is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is
in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

Quoted 8 lines

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time
? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink
on boot).

Sorry for the uncleared discription.

For the os-selftest failure: The failure happened at qemu booting with
its wic image. Qemu could not find the unversioned kernel image in wic
image for booting itself ,then caused the test failed.

Why the booted partition in wic image doesn't contain the unversioned kernel image? Cause the wks can decide where the unversioned kernel images in wic image comes from. For this test, it comes from ${IMAGE_ROOTFS}/boot which is installed by kernel rpm package. Actually
it didn't get unversioned kernel image because the symlink(or copy fallback) is in an on-boot post install hook.

Quoted 4 lines

Hence we should keep a unversioned kernel image in kernel rpm package.
And patch v2 did it.( v1 and v2 are similar, but v2 improves print messages.)

Quoted 7 lines

This does bring us to a bit of an impasse as I don't really like the idea of duplicating the kernel binaries twice in the packages just to work around fat filesystem limitations.

Today its this file, you could argue we have to replace a load more files with duplicate copies and postinstalls which would seem to be the wrong direction to go in.

Yes, I agree that duplicate copies is not a good way to solve these symlink problems for normal rpm. Users should be awared the disadvantages of vfat filesystem. But kernel rpm maybe more important than others rpm? so we could make its compatibility more all-around?

Quoted 6 lines
Quoted 3 lines

Which tools does the extraction of the files onto this fat system? Could we ignore the symlink errors there and rely on a postinstall to create if not already created?

It may not. Cause if the extraction of the files runs failed, the postinstall of this rpm package won't excute. So...

I wonder if the preinst could check for vfat and do something like a temporary mount to work around the issue?

Cheers,

Richard

#15 lore raw
In reply to Xu, Yanfei
Quoted 203 lines · Yanfei
Quoted 185 lines · Richard Purdie
Quoted 179 lines · Yanfei
Quoted 152 lines · Bruce Ashfield
Quoted 130 lines · Yanfei
Quoted 123 lines · Yanfei
Quoted 96 lines · Richard Purdie
Quoted 88 lines · Yanfei
Quoted 79 lines · Richard Purdie
Quoted 78 lines · Yanfei
Quoted 77 lines · Richard Purdie
Quoted 59 lines · Bruce Ashfield
Quoted 48 lines · On Fri, Jun 19, 2020 at 7:47 AM < [email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you
will get
failure
when
you install or update the kernel rpm package. Now
we use a
copy
of
image for these filesystems instead of symlink.

Suggested-by: Bruce Ashfield <
[email protected]>
Suggested-by: Richard Purdie <
[email protected]>
Signed-off-by: Yanfei Xu <[email protected]

---
meta/classes/kernel.bbclass | 19
++++++++++++++++---
1 file changed, 16 insertions(+), 3
deletions(-)

diff --git a/meta/classes/kernel.bbclass
b/meta/classes/kernel.bbclass
index 20a0135fc9..1269b54343 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -94,6 +94,22 @@ python __anonymous () {
d.appendVar('RDEPENDS_%s-image' %
kname, ' %s-
image-
%s' %
(kname, typelower))
d.setVar('PKG_%s-image-%s' %
(kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname,
typelower))
d.setVar('ALLOW_EMPTY_%s-image-%s' %
(kname,
typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-
image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if the
unversioned
image link/copy was deferred until boot. I don't see a
summary of
why

Quoted 8 lines

that's no longer a concern in the v3 of the patch. Can you
confirm
that it isn't an issue ? Is it simply because the booted
image
isn't
installed via this package, and hence we are fine ?

I'm suspecting this patch is why we're seeing
selftest
failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Quoted 8 lines
Quoted 3 lines

Do you mean this patch has been applied? and introduce new
issues?

Yes, I reverted it and retested and confirmed this patch causes the
selftest failure in the link to the build above.

Quoted 6 lines

OK, I am trying to analyse the log. But I haven't figured out what
cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any
information.

Quoted 4 lines

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't
contain no-versioned image. This result is different from the previous
I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r
efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 4 lines

Hence we still should keep the no-versioned iamge in kernel- image*.rpm
which is like the previous v2 patch.

Quoted 7 lines

Any opinions? It does cause the kernel rpm larger. However, the kernel
image is not always large, only a few MB. And it will be changed to
symlink when installed on targe. So this patch's only negative effect
is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is
in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

Quoted 8 lines

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time
? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink
on boot).

Sorry for the uncleared discription.

For the os-selftest failure: The failure happened at qemu booting with
its wic image. Qemu could not find the unversioned kernel image in wic
image for booting itself ,then caused the test failed.

Why the booted partition in wic image doesn't contain the unversioned kernel image? Cause the wks can decide where the unversioned kernel images in wic image comes from. For this test, it comes from ${IMAGE_ROOTFS}/boot which is installed by kernel rpm package. Actually
it didn't get unversioned kernel image because the symlink(or copy fallback) is in an on-boot post install hook.

Quoted 4 lines

Hence we should keep a unversioned kernel image in kernel rpm package.
And patch v2 did it.( v1 and v2 are similar, but v2 improves print messages.)

Quoted 7 lines

This does bring us to a bit of an impasse as I don't really like the idea of duplicating the kernel binaries twice in the packages just to work around fat filesystem limitations.

Today its this file, you could argue we have to replace a load more files with duplicate copies and postinstalls which would seem to be the wrong direction to go in.

Yes, I agree that duplicate copies is not a good way to solve these symlink problems for normal rpm. Users should be awared the disadvantages of vfat filesystem. But kernel rpm maybe more important than others rpm? so we could make its compatibility more all-around?

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

Which tools does the extraction of the files onto this fat system? Could we ignore the symlink errors there and rely on a postinstall to create if not already created?

It may not. Cause if the extraction of the files runs failed, the postinstall of this rpm package won't excute. So...

Is that true even if it is a "normal" post install hook (not the on-target/boot one, just a standard package post install hook) ?

We can programatically create a package post install the same way the ontarget one was being created (or at least it was when I last checked). Wouldn't that make the /boot partition and filesystem available and before wic runs ? So we could have the "try symlink, fail to a copy" before anything ever looks for it. It would also cover the on-target package upgrade path. My apologies if we've already discussed that, and discarded it due to technical issues.

Bruce

Quoted 16 lines

Cheers,

Yanfei

Quoted 11 lines

Cheers,

Richard

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
author
#16 lore raw
Quoted 214 lines · Bruce Ashfield
Quoted 203 lines · Yanfei
Quoted 185 lines · Richard Purdie
Quoted 179 lines · Yanfei
Quoted 152 lines · Bruce Ashfield
Quoted 130 lines · Yanfei
Quoted 123 lines · Yanfei
Quoted 96 lines · Richard Purdie
Quoted 88 lines · Yanfei
Quoted 79 lines · Richard Purdie
Quoted 78 lines · Yanfei
Quoted 77 lines · Richard Purdie
Quoted 67 lines · Bruce Ashfield

On Fri, Jun 19, 2020 at 7:47 AM <
[email protected]>
wrote:
From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you
will get
failure
when
you install or update the kernel rpm package. Now
we use a
copy
of
image for these filesystems instead of symlink.

Suggested-by: Bruce Ashfield <
[email protected]>
Suggested-by: Richard Purdie <
[email protected]>
Signed-off-by: Yanfei Xu <[email protected]

---
meta/classes/kernel.bbclass | 19
++++++++++++++++---
1 file changed, 16 insertions(+), 3
deletions(-)

diff --git a/meta/classes/kernel.bbclass
b/meta/classes/kernel.bbclass
index 20a0135fc9..1269b54343 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -94,6 +94,22 @@ python __anonymous () {
d.appendVar('RDEPENDS_%s-image' %
kname, ' %s-
image-
%s' %
(kname, typelower))
d.setVar('PKG_%s-image-%s' %
(kname,typelower),
'%s-
image-
%s-${KERNEL_VERSION_PKG_NAME}' % (kname,
typelower))
d.setVar('ALLOW_EMPTY_%s-image-%s' %
(kname,
typelower),
'1')
+ d.setVar('pkg_postinst_ontarget_%s-
image-%s' %
(kname,typelower), """

You were previously concerned about boot issues if
the
unversioned
image link/copy was deferred until boot. I don't
see a
summary of
why
that's no longer a concern in the v3 of the patch.
Can you
confirm
that it isn't an issue ? Is it simply because the
booted
image
isn't
installed via this package, and hence we are fine ?

I'm suspecting this patch is why we're seeing
selftest
failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1055

Quoted 8 lines
Quoted 3 lines

Do you mean this patch has been applied? and introduce new
issues?

Yes, I reverted it and retested and confirmed this patch causes the
selftest failure in the link to the build above.

Quoted 6 lines

OK, I am trying to analyse the log. But I haven't figured out what
cause
it fialed, and how to reproduce it on my mechine. I'd apprecate any
information.

Quoted 4 lines

The command to reproduce should be:

oe-selftest -r efibootpartition.GenericEFITest.test_boot_efi

I've addressed this failure why due to boot partation in wic doesn't
contain no-versioned image. This result is different from the previous
I verified, because of the different configuraions in wks.

"--source" field in wks decides where the files in boot partation come
from. So no-versioned image may come from ${IMAGE_ROOTFS}/boot which is
installed by rpm package. Blow is the wks used by 'oe-selftest -r
efibootpartition.GenericEFITest.test_boot_efi'

bootloader --ptable gpt
part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/

Quoted 4 lines

Hence we still should keep the no-versioned iamge in kernel- image*.rpm
which is like the previous v2 patch.

Quoted 7 lines

Any opinions? It does cause the kernel rpm larger. However, the kernel
image is not always large, only a few MB. And it will be changed to
symlink when installed on targe. So this patch's only negative effect
is the little increasement about update payloads.

I'm trying to follow the description that you had about the oe-selftest and I'm missing something.

Can you describe it again ? In a way that someone not familiar with that the selftest is seeing as a failure can grok ?

i.e. in the selftest configuration are we not getting the (un)versioned kernel image because the symlink (or copy fallback) is
in an on-boot post install hook ? And the test is looking for the versioned/unversioned kernel image at image construction time ?

Quoted 8 lines

So that leaves us at either installing both the versioned and unversioned, or some sort of package install time testing of the target filesystem ? Does that partition exist at package install time
? Is that the approach we tried in v1 of the patch (I know v2 was keeping both as copies in the package, and converting it to a symlink
on boot).

Sorry for the uncleared discription.

For the os-selftest failure: The failure happened at qemu booting with
its wic image. Qemu could not find the unversioned kernel image in wic
image for booting itself ,then caused the test failed.

Why the booted partition in wic image doesn't contain the unversioned kernel image? Cause the wks can decide where the unversioned kernel images in wic image comes from. For this test, it comes from ${IMAGE_ROOTFS}/boot which is installed by kernel rpm package. Actually
it didn't get unversioned kernel image because the symlink(or copy fallback) is in an on-boot post install hook.

Quoted 4 lines

Hence we should keep a unversioned kernel image in kernel rpm package.
And patch v2 did it.( v1 and v2 are similar, but v2 improves print messages.)

Quoted 7 lines

This does bring us to a bit of an impasse as I don't really like the idea of duplicating the kernel binaries twice in the packages just to work around fat filesystem limitations.

Today its this file, you could argue we have to replace a load more files with duplicate copies and postinstalls which would seem to be the wrong direction to go in.

Yes, I agree that duplicate copies is not a good way to solve these symlink problems for normal rpm. Users should be awared the disadvantages of vfat filesystem. But kernel rpm maybe more important than others rpm? so we could make its compatibility more all-around?

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

Which tools does the extraction of the files onto this fat system? Could we ignore the symlink errors there and rely on a postinstall to create if not already created?

It may not. Cause if the extraction of the files runs failed, the postinstall of this rpm package won't excute. So...

Is that true even if it is a "normal" post install hook (not the on-target/boot one, just a standard package post install hook) ?

Quoted 7 lines

We can programatically create a package post install the same way the ontarget one was being created (or at least it was when I last checked). Wouldn't that make the /boot partition and filesystem available and before wic runs ? So we could have the "try symlink, fail to a copy" before anything ever looks for it. It would also cover the on-target package upgrade path. My apologies if we've already discussed that, and discarded it due to technical issues.

Good idea. I'll try it.

Yanfei

Quoted 25 lines

Bruce

Quoted 16 lines

Cheers,

Yanfei

Quoted 11 lines

Cheers,

Richard

author
#17 lore raw
In reply to Bruce Ashfield
Quoted 15 lines · Bruce Ashfield
Quoted 14 lines · On Fri, Jun 19, 2020 at 7:47 AM <[email protected]> wrote:

From: Yanfei Xu <[email protected]>

Some filesystems don't support symlink, then you will get failure when you install or update the kernel rpm package. Now we use a copy of image for these filesystems instead of symlink.

---
  meta/classes/kernel.bbclass | 19 ++++++++++++++++---
  1 file changed, 16 insertions(+), 3 deletions(-)
Quoted 16 lines

meta/classes/kernel.bbclass python __anonymous () { · line 97

Quoted 9 lines
meta/classes/kernel.bbclass +1 -0
index 20a0135fc9..1269b54343 100644
@@ -94,6 +94,22 @@ python __anonymous () {
          d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower))
          d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
          d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
+        d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,typelower), """

You were previously concerned about boot issues if the unversioned image link/copy was deferred until boot. I don't see a summary of why that's no longer a concern in the v3 of the patch. Can you confirm that it isn't an issue ? Is it simply because the booted image isn't installed via this package, and hence we are fine ?

Yes, it is. Previously I have a wrong thounght that the booted image in boot partation is installed via this package. Then I confirmed it isn't like that by compiling wic image with an empty kernel-image*.rpm(modify kernel.bbclass), the no-versioned iamge still be contained boot partation.
Hence we are fine.

Yanfei

Quoted 45 lines
Quoted 19 lines
meta/classes/kernel.bbclass +15 -0
+set +e
+ln -sf %s-${KERNEL_VERSION} ${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+    echo "Filesystem on ${KERNEL_IMAGEDEST}/ doesn't support symlinks, falling back to copied image (%s)."
+    install -m 0644 ${KERNEL_IMAGEDEST}/%s-${KERNEL_VERSION} ${KERNEL_IMAGEDEST}/%s
+fi
+set -e
+""" % (type, type, type, type, type))
+        d.setVar('pkg_postrm_%s-image-%s' % (kname,typelower), """
+set +e
+if [ -f "${KERNEL_IMAGEDEST}/%s" -o -L "${KERNEL_IMAGEDEST}/%s" ]; then
+    rm -f ${KERNEL_IMAGEDEST}/%s  > /dev/null 2>&1
+fi
+set -e
+""" % (type, type, type))
 
      image = d.getVar('INITRAMFS_IMAGE')
      # If the INTIRAMFS_IMAGE is set but the INITRAMFS_IMAGE_BUNDLE is set to 0,

meta/classes/kernel.bbclass kernel_do_install() { · line 390

Quoted 6 lines
meta/classes/kernel.bbclass +0 -3
@@ -385,9 +401,6 @@ kernel_do_install() {
         install -d ${D}/boot
         for imageType in ${KERNEL_IMAGETYPES} ; do
                 install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} ${D}/${KERNEL_IMAGEDEST}/${imageType}-${KERNEL_VERSION}
-               if [ "${KERNEL_PACKAGE_NAME}" = "kernel" ]; then
-                       ln -sf ${imageType}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${imageType}
-               fi

For on-target installs, this is what I was doing in the past as well. Make the symlink during package install, that way we are encapsulated in that unit.

That just leaves my boot question as the last remaining thing for the change.

Bruce

Quoted 6 lines
meta/classes/kernel.bbclass +0 -1
         done
         install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
         install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
--

2.18.2