aboutsummaryrefslogtreecommitdiffstats
path: root/classes/usr-merge.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/usr-merge.bbclass')
-rw-r--r--classes/usr-merge.bbclass42
1 files changed, 42 insertions, 0 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
+}
+