diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2016-09-23 23:29:41 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2016-09-23 23:29:41 +0300 |
commit | 4dc6a89732061e64a8bd5c3b24b793559b95a87d (patch) | |
tree | e1ecfc667d36c1c4d326a9b6649d5e9c32ac181d /protostar | |
parent | 78ae3b6c1fc8453d1ec7bab01fdde1099cfb6429 (diff) | |
download | live-4dc6a89732061e64a8bd5c3b24b793559b95a87d.tar.gz |
Automatically move libs
Diffstat (limited to 'protostar')
-rwxr-xr-x | protostar | 51 |
1 files changed, 18 insertions, 33 deletions
@@ -212,39 +212,6 @@ mkdir -p "${BOOTARCH}/cdrom" touch "${BOOTARCH}/reconfigure" pushd "${ROOT}" - -# We use 32-bit installgrub, but is not required to boot ;-) -if [ -e lib32 ]; then - mkdir -p usr/lib32 - mv lib32/* usr/lib32/ - ln -sf usr/lib32 $BOOTARCH/lib32 -fi - -# Move some critical libs: -march=`dpkg-architecture -qDEB_HOST_MULTIARCH` -mkdir -p lib/$march -for lib in \ - libbrand \ - libdiskmgt \ - libexacct \ - libfmevent \ - libidmap \ - libipmi \ - liblzma \ - libpool \ - libproject \ - libsmbios \ - libsqlite \ - libsunavl \ - libtecla \ - libtopo \ - libxml2 \ - libzonecfg \ - ; do - mv -v -f usr/lib/$march/$lib.so.* lib/$march/ || \ - mv -v -f usr/lib/$lib.so.* lib/$march/ -done - # Moving some files from usr to usr1 # and creating symlinks from usr to usr1 usr_symlink_move usr/bin/cat @@ -263,6 +230,24 @@ usr_symlink_move usr/sbin/dladm usr_symlink_move usr/sbin/ipadm usr_symlink_move usr/sbin/lofiadm +bins=$(find usr1/*bin sbin usr1/lib lib/svc -type f) +libs=$(chroot . /usr/bin/ldd $bins 2>/dev/null | sed -rn '/=>/ s,.*=>\s*(/usr/\S*),\1,p' | sort -u || true) +for lib in $libs; do + usrdir=$(dirname "$lib") + rootdir=${usrdir/\/usr\//} + mkdir -p "$rootdir" + mv -v -f "./$lib"* "$rootdir/" +done +march=`dpkg-architecture -qDEB_HOST_MULTIARCH` +mv -fv ./lib/lib*.so* "./lib/$march/" || true + +# We use 32-bit installgrub, but it is not required to boot ;-) +if [ -e lib32 ]; then + rm -rf usr/lib32 + mv lib32 usr/lib32 + ln -sf usr/lib32 $BOOTARCH/lib32 +fi + # usr2 will be packed and stored on CD: mv usr usr2 |