diff options
Diffstat (limited to 'remote/setup_target')
-rwxr-xr-x | remote/setup_target | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/remote/setup_target b/remote/setup_target index 77a9f62d..f76c7831 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -256,6 +256,7 @@ generate_target() { initial_checks + local DIR TARGET=$1 && shift TARGET_DIR="${MODE_DIR}/targets/${TARGET}" TARGET_BUILD_DIR="${MODE_DIR}/builds/${TARGET}" @@ -267,6 +268,10 @@ generate_target() { perror "Target directory cannot be named 'builds' or 'modules'." pdebug "Generating '$TARGET_BUILD_DIR' for '$TARGET'" + 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 "${TARGET_BUILD_DIR}/${DIR}" ] || ln -s "usr/${DIR}" "${TARGET_BUILD_DIR}/${DIR}" || perror "Could not symlink '${TARGET_BUILD_DIR}/${DIR}' to 'usr/${DIR}" + done # if no arguments assume all. if [ "x$1" = "x" -o "x$1" = "xall" ]; then @@ -366,6 +371,11 @@ process_module() { fi # Process module mkdir -p "${MODULE_BUILD_DIR}" || perror "Could not create build dir" + 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 "${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" read_config # Check if this module has a dependency that wasn't built yet: @@ -446,13 +456,6 @@ process_module() { post_process_target() { local TOOL_STR="$TOOL_STR post_process_target:" - if [ -d "${TARGET_BUILD_DIR}/lib/systemd" ]; then - pwarning "/lib/systemd exists in the generated target. It is not advisable to fetch existing" - pwarning "systemd service files from the template system, as it might conflict with generated" - pwarning "ones. In fact, some systems don't even use systemd so there might be no existing" - pwarning "service files. Please generate your own service file and place it in /etc/systemd." - pwarning "All files in /lib/systemd will be ignored." - fi # figure out all relevant ld-paths pinfo "Running ldconfig" @@ -562,7 +565,9 @@ strip_recursive() { # copies static data files from <MODULE>/data/ to <TARGET_BUILD_DIR> copy_static_data() { [ ! -d "${MODULE_DIR}/data" ] && pinfo "${MODULE} has no static 'data' directory." && return - cp -r "${MODULE_DIR}/data/"* ${TARGET_BUILD_DIR} || perror "Could not copy static data of ${MODULE}" + cd "${MODULE_DIR}/data/" || perror "could not cd to '${MODULE_DIR}/data/'" + tarcopy "$(find . -type f -o -type l)" "${TARGET_BUILD_DIR}" + cd - } # Copies files with their absolute paths in $REQUIRED_SYSTEM_FILES to $TARGET_BUILD_DIR |