diff options
| author | Amarnath Valluri <amarnath.valluri@intel.com> | 2017-06-14 14:30:45 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-06 14:38:15 +0100 |
| commit | 66cf94e74073fffc40b6317ba706f59a0d7b2502 (patch) | |
| tree | e7e44855f14073498ff74773aa972311c7e50d99 | |
| parent | 4525708784bcd2de44c1ea71ccc4d8115ab02570 (diff) | |
| download | poky-66cf94e74073fffc40b6317ba706f59a0d7b2502.tar.gz | |
image: create symlinks needed for merged /usr
Prepare the symlinks required for merged /usr at the time of rootfs creation.
The links created in rootfs are:
/bin --> /usr/sbin
/sbin --> /usr/sbin
/lib --> /usr/lib
/lib64 --> /usr/lib64
We cannot make these symlinks as part of 'base-files' or some other package.
Because at rootfs creation, installation of the package(say kernel) that depends
on these root folders/links fails, if package manager installs this package
prior to base-files.
These symbolic links in top level folder should be present as long as
- kernel tools use /lib/{module,firmware}
- shell scripts uses "#!/bin/sh"
(From OE-Core rev: 3f978f24ae2cf831bd2b82270f6353edda6364a5)
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/image.bbclass | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 6e30b96745..6e5a8ba7fb 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
| @@ -617,3 +617,24 @@ do_bundle_initramfs () { | |||
| 617 | : | 617 | : |
| 618 | } | 618 | } |
| 619 | addtask bundle_initramfs after do_image_complete | 619 | addtask bundle_initramfs after do_image_complete |
| 620 | |||
| 621 | # Prepare the root links to point to the /usr counterparts. | ||
| 622 | create_merged_usr_symlinks() { | ||
| 623 | install -d ${IMAGE_ROOTFS}${base_bindir} ${IMAGE_ROOTFS}${base_sbindir} ${IMAGE_ROOTFS}${base_libdir} | ||
| 624 | lnr ${IMAGE_ROOTFS}${base_bindir} ${IMAGE_ROOTFS}/bin | ||
| 625 | lnr ${IMAGE_ROOTFS}${base_sbindir} ${IMAGE_ROOTFS}/sbin | ||
| 626 | lnr ${IMAGE_ROOTFS}${base_libdir} ${IMAGE_ROOTFS}/${baselib} | ||
| 627 | |||
| 628 | if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then | ||
| 629 | install -d ${IMAGE_ROOTFS}${nonarch_base_libdir} | ||
| 630 | lnr ${IMAGE_ROOTFS}${nonarch_base_libdir} ${IMAGE_ROOTFS}/lib | ||
| 631 | fi | ||
| 632 | |||
| 633 | # create base links for multilibs | ||
| 634 | multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}" | ||
| 635 | for d in $multi_libdirs; do | ||
| 636 | install -d ${IMAGE_ROOTFS}${exec_prefix}/$d | ||
| 637 | lnr ${IMAGE_ROOTFS}${exec_prefix}/$d ${IMAGE_ROOTFS}/$d | ||
| 638 | done | ||
| 639 | } | ||
| 640 | ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks; ', '',d)}" | ||
