On 6/23/20 10:31 PM, Bruce Ashfield wrote:
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 ?
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
+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
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
done
install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
--
2.18.2
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#139872):
https://lists.openembedded.org/g/openembedded-core/message/139872
Mute This Topic: https://lists.openembedded.org/mt/74977721/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-