diff options
| author | Jörg Sommer <joerg.sommer@navimatix.de> | 2024-06-09 16:59:07 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-08-01 06:08:09 -0700 |
| commit | b285f6d0feea2e252e3403e4e08d048ac120f6ac (patch) | |
| tree | fb4bf1036aa75c6138fa495e85cf5b4b6c3985b8 /meta | |
| parent | 1935e4e8df5d5825a668202cf185628353cea930 (diff) | |
| download | poky-b285f6d0feea2e252e3403e4e08d048ac120f6ac.tar.gz | |
classes/kernel: No symlink in postinst without KERNEL_IMAGETYPE_SYMLINK
The commit “Use a copy of image for kernel*.rpm if fs doesn't support
symlinks” [1] added postinst and postrm scripts to the kernel package which
create a symlink after package installation. This should not happen if
`KERNEL_IMAGETYPE_SYMLINK` is not `1`.
Background: The u-boot implementation of jffs2 does not support symlinks.
Using a hardlink or removing `${KERNEL_VERSION}` from the file name fails,
because the current postinst script replaces the file with the symlink.
[1] 8b6b95106a5d4f1f6d34209ec5c475c900270ecd
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Yanfei Xu <yanfei.xu@windriver.com>
(From OE-Core rev: 6916c19c8a09d8d0334c957ae541aafcbbcf92df)
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 6a763401862d9ee96749ad18378b6344778c2c66)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes-recipe/kernel.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index c0a2056fec..4c1cb89a46 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass | |||
| @@ -115,7 +115,9 @@ python __anonymous () { | |||
| 115 | 115 | ||
| 116 | d.setVar('PKG:%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower)) | 116 | d.setVar('PKG:%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower)) |
| 117 | d.setVar('ALLOW_EMPTY:%s-image-%s' % (kname, typelower), '1') | 117 | d.setVar('ALLOW_EMPTY:%s-image-%s' % (kname, typelower), '1') |
| 118 | d.prependVar('pkg_postinst:%s-image-%s' % (kname,typelower), """set +e | 118 | |
| 119 | if d.getVar('KERNEL_IMAGETYPE_SYMLINK') == '1': | ||
| 120 | d.prependVar('pkg_postinst:%s-image-%s' % (kname,typelower), """set +e | ||
| 119 | if [ -n "$D" ]; then | 121 | if [ -n "$D" ]; then |
| 120 | ln -sf %s-${KERNEL_VERSION} $D/${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1 | 122 | ln -sf %s-${KERNEL_VERSION} $D/${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1 |
| 121 | else | 123 | else |
| @@ -127,7 +129,7 @@ else | |||
| 127 | fi | 129 | fi |
| 128 | set -e | 130 | set -e |
| 129 | """ % (type, type, type, type, type, type, type)) | 131 | """ % (type, type, type, type, type, type, type)) |
| 130 | d.setVar('pkg_postrm:%s-image-%s' % (kname,typelower), """set +e | 132 | d.setVar('pkg_postrm:%s-image-%s' % (kname,typelower), """set +e |
| 131 | if [ -f "${KERNEL_IMAGEDEST}/%s" -o -L "${KERNEL_IMAGEDEST}/%s" ]; then | 133 | if [ -f "${KERNEL_IMAGEDEST}/%s" -o -L "${KERNEL_IMAGEDEST}/%s" ]; then |
| 132 | rm -f ${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1 | 134 | rm -f ${KERNEL_IMAGEDEST}/%s > /dev/null 2>&1 |
| 133 | fi | 135 | fi |
