summaryrefslogtreecommitdiffstats
path: root/remote/setup_target
diff options
context:
space:
mode:
authorSimon Rettberg2014-07-04 14:46:20 +0200
committerSimon Rettberg2014-07-04 14:46:20 +0200
commitd1f5aedd76df437a08f3283fa00bc8a9dab7fa2b (patch)
tree8c046eeaf8e874b479b95964b2bf410365cff438 /remote/setup_target
parentremove hardcoded /bin/rm call. Relative calls work in services files (diff)
downloadtm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.tar.gz
tm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.tar.xz
tm-scripts-d1f5aedd76df437a08f3283fa00bc8a9dab7fa2b.zip
"Fedora Support", step 1 ->
Several changes: 1) Make sure /bin /sbin /lib and /lib64 are ALWAYS symlinks to /usr/XXX, no matter what the current distribution does. 2) Make sure nobody and nogroup exist. 3) Fix various modules making assumptions that are not true on every distro. 4) Add symlinks to kdm module since fedora is looking for kdmrc in yet another spot. 5) Add detection of fedora, support its package manager What still breaks: dnbd3 Other distros might not work now, they need adaption to changed logic in some modules.
Diffstat (limited to 'remote/setup_target')
-rwxr-xr-xremote/setup_target21
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