diff options
author | Jonathan Bauer | 2014-07-09 14:24:58 +0200 |
---|---|---|
committer | Jonathan Bauer | 2014-07-09 14:24:58 +0200 |
commit | ee9c50f95da7d2733a3d14ff69fe364a9a445f61 (patch) | |
tree | b38fc67e9eebdff05f04c54bd1473a5878defd33 /remote | |
parent | [rfs-s32] added openvswitch to REQUIRED_KERNEL_MODULES (diff) | |
download | tm-scripts-ee9c50f95da7d2733a3d14ff69fe364a9a445f61.tar.gz tm-scripts-ee9c50f95da7d2733a3d14ff69fe364a9a445f61.tar.xz tm-scripts-ee9c50f95da7d2733a3d14ff69fe364a9a445f61.zip |
[setup_target] only link /{lib,bin} to /usr/{lib,bin} if it is that way on the current system
Diffstat (limited to 'remote')
-rwxr-xr-x | remote/setup_target | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/remote/setup_target b/remote/setup_target index 11e1d5be..8e7f7a36 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -267,8 +267,13 @@ generate_target() { perror "Target directory cannot be named 'builds' or 'modules'." pdebug "Generating '$TARGET_BUILD_DIR' for '$TARGET'" + + # here we need to check if the current system has "true" /bin, /sbin and /lib* folders + # or if they are symlinked. If they are, we take over that structure. + for DIR in lib lib64 bin sbin; do mkdir -p "${TARGET_BUILD_DIR}/usr/${DIR}" || perror "Could not create '${TARGET_BUILD_DIR}/usr/${DIR}'" + [ ! -L "/${DIR}" ] && continue [ -L "${TARGET_BUILD_DIR}/${DIR}" ] || ln -s "usr/${DIR}" "${TARGET_BUILD_DIR}/${DIR}" || perror "Could not symlink '${TARGET_BUILD_DIR}/${DIR}' to 'usr/${DIR}" done @@ -373,6 +378,7 @@ process_module() { local DIR for DIR in lib lib64 bin sbin; do mkdir -p "${MODULE_BUILD_DIR}/usr/${DIR}" || perror "Could not create '${MODULE_BUILD_DIR}/usr/${DIR}'" + [ ! -L "/$DIR" ] && continue [ -L "${MODULE_BUILD_DIR}/${DIR}" ] || ln -s "usr/${DIR}" "${MODULE_BUILD_DIR}/${DIR}" || perror "Could not symlink '${MODULE_BUILD_DIR}/${DIR}' to 'usr/${DIR}" done pdebug "## Reading config of $MODULE" |