diff options
author | Andrei Gherzan <andrei.gherzan@windriver.com> | 2012-05-10 14:15:24 +0300 |
---|---|---|
committer | Florin Sarbu <florin.sarbu@windriver.com> | 2012-05-16 20:16:45 +0300 |
commit | f88487553fca72e36660e74a3bd677016f09bcf0 (patch) | |
tree | 6d57b35ea9ec5879cf54606d4b6e613741ad4ce3 | |
parent | b1abd9ec7e65b04db81f7411a3f5f1927d1ab1bd (diff) | |
download | meta-ivi-f88487553fca72e36660e74a3bd677016f09bcf0.tar.gz meta-ivi-f88487553fca72e36660e74a3bd677016f09bcf0.tar.bz2 meta-ivi-f88487553fca72e36660e74a3bd677016f09bcf0.zip |
usr-merge.bbclass: Define class to implement first (dirty) usr merge
This class is inherited by discovery-image and the usr_merge function added
to ROOTFS_POSTPROCESS_COMMAND.
Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
-rw-r--r-- | classes/usr-merge.bbclass | 42 | ||||
-rw-r--r-- | recipes-yocto-ivi/images/discovery-image.bb | 5 |
2 files changed, 46 insertions, 1 deletions
diff --git a/classes/usr-merge.bbclass b/classes/usr-merge.bbclass new file mode 100644 index 0000000..17deaee --- /dev/null +++ b/classes/usr-merge.bbclass @@ -0,0 +1,42 @@ +# +# Copyright (c) 2012 Wind River Systems, Inc. +# +# The right to copy, distribute, modify, or otherwise make use +# of this software may be licensed only pursuant to the terms +# of an applicable Wind River license agreement. +# + +# http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge +# /bin → /usr/bin +# /sbin → /usr/sbin +# /lib → /usr/lib +# /lib64 → /usr/lib64 + +usr_merge() { + echo /usr merge stage ... + if [ -d $INSTALL_ROOTFS_RPM/sbin -a -d $INSTALL_ROOTFS_RPM/usr/sbin ]; then + echo "Moving /sbin and /usr/sbin ..." + cp -r $INSTALL_ROOTFS_RPM/sbin/* $INSTALL_ROOTFS_RPM/usr/sbin/ + rm -rf $INSTALL_ROOTFS_RPM/sbin + ln -sf ./usr/sbin $INSTALL_ROOTFS_RPM/sbin + fi + if [ -d $INSTALL_ROOTFS_RPM/bin -a -d $INSTALL_ROOTFS_RPM/usr/bin ]; then + echo "Moving /bin and /usr/bin ..." + cp -r $INSTALL_ROOTFS_RPM/bin/* $INSTALL_ROOTFS_RPM/usr/bin/ + rm -rf $INSTALL_ROOTFS_RPM/bin + ln -sf ./usr/bin $INSTALL_ROOTFS_RPM/bin + fi + if [ -d $INSTALL_ROOTFS_RPM/lib -a -d $INSTALL_ROOTFS_RPM/usr/lib ]; then + echo "Moving /lib and /usr/lib ..." + cp -r $INSTALL_ROOTFS_RPM/lib/* $INSTALL_ROOTFS_RPM/usr/lib/ + rm -rf $INSTALL_ROOTFS_RPM/lib + ln -sf ./usr/lib $INSTALL_ROOTFS_RPM/lib + fi + if [ -d $INSTALL_ROOTFS_RPM/lib64 -a -d $INSTALL_ROOTFS_RPM/usr/lib64 ]; then + echo "Moving /lib64 and /usr/lib64 ..." + cp -r $INSTALL_ROOTFS_RPM/lib64/* $INSTALL_ROOTFS_RPM/usr/lib64/ + rm -rf $INSTALL_ROOTFS_RPM/lib64 + ln -sf ./usr/lib64 $INSTALL_ROOTFS_RPM/lib64 + fi +} + diff --git a/recipes-yocto-ivi/images/discovery-image.bb b/recipes-yocto-ivi/images/discovery-image.bb index 4585567..878a3e4 100644 --- a/recipes-yocto-ivi/images/discovery-image.bb +++ b/recipes-yocto-ivi/images/discovery-image.bb @@ -9,7 +9,7 @@ LICENSE = "MIT" # Check if image should be created IMAGE_SD = '${@base_contains("IMAGE_FSTYPES", "sdimg", "sd", "core", d)}' -inherit ${IMAGE_SD}-image +inherit ${IMAGE_SD}-image usr-merge IMAGE_ROOTFS_SIZE = "8192" @@ -18,3 +18,6 @@ ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; " # Create SD image symlink currectly IMAGE_POSTPROCESS_COMMAND_imx53qsb += "rename_symlink ; " + +# /usr Merge +ROOTFS_POSTPROCESS_COMMAND += "usr_merge ; " |