diff options
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" |
