summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-08-10 19:10:00 +0200
committerSimon Rettberg2023-08-10 19:10:00 +0200
commitb67e9ddb559ab72d9a19fdab2fb392dc034b04f3 (patch)
tree18c997960953e84d8bd35eb968e6200b3c4fbcd2
parentTry to get versioned targets and modules under control (diff)
downloadmltk-b67e9ddb559ab72d9a19fdab2fb392dc034b04f3.tar.gz
mltk-b67e9ddb559ab72d9a19fdab2fb392dc034b04f3.tar.xz
mltk-b67e9ddb559ab72d9a19fdab2fb392dc034b04f3.zip
fix shit
-rwxr-xr-xcore/bin/setup_target10
-rw-r--r--core/modules/nvidia-libs@/module.build10
2 files changed, 10 insertions, 10 deletions
diff --git a/core/bin/setup_target b/core/bin/setup_target
index 735b28ff..df70412e 100755
--- a/core/bin/setup_target
+++ b/core/bin/setup_target
@@ -413,7 +413,7 @@ generate_target_real() {
[[ "$TARGET" == "builds" || "$TARGET" == "modules" ]] && \
perror "Target directory cannot be named 'builds' or 'modules'."
- pdebug "Generating '$TARGET_BUILD_DIR' for '$TARGET'"
+ pdebug "Generating '$TARGET_BUILD_DIR' for '$TARGET' $TARGET_VERSION"
mkdir -p "$TARGET_BUILD_DIR" || perror "Failed to create $TARGET_BUILD_DIR"
prepare_usr_split "${TARGET_BUILD_DIR}"
@@ -497,7 +497,7 @@ process_module() {
fi
local MODULE_BUILD_DIR="${MODULE_WORK_DIR}/build"
local MODULE_META_DIR="${MODULE_WORK_DIR}/meta"
- local TOOL_STR="[${MODULE}]"
+ local TOOL_STR="[${MODULE}${TARGET_VERSION}]"
local SOURCE_FLAG="${MODULE_META_DIR}/fetched_source.flag"
local BUILD_FLAG="${MODULE_META_DIR}/build_complete.flag"
local COPY_FLAG="${MODULE_META_DIR}/copy_complete.flag"
@@ -736,8 +736,8 @@ clean_modules() {
done
cde "$TARGET_DIR"
for module in "$@"; do
- if [[ "$MODULE" == *@ ]]; then
- [ -z "$TARGET_VERSIONS" ] && perror "Found versioned module $MODULE in non-versioned target $TARGET"
+ if [[ "$module" == *@ ]]; then
+ [ -z "$TARGET_VERSIONS" ] && perror "Found versioned module $module in non-versioned target $TARGET"
for TARGET_VERSION in ${TARGET_VERSIONS}; do
TARGET_BUILD_DIR="${TARGET_BUILD_BASE}@${TARGET_VERSION}"
clean_module "${module}"
@@ -752,7 +752,7 @@ clean_modules() {
clean_module() {
[ -z "$1" ] && perror "No module given on clean_module()"
[ -z "$TARGET" ] && perror "clean_module called with no active target"
- pinfo "## clean_module $TARGET -> $1"
+ pinfo "## clean_module $TARGET $1$TARGET_VERSION"
local MODULE=$1
local MODULE_DIR="${MODULE_PATHS["${MODULE}"]}"
diff --git a/core/modules/nvidia-libs@/module.build b/core/modules/nvidia-libs@/module.build
index d738d22f..c721cfda 100644
--- a/core/modules/nvidia-libs@/module.build
+++ b/core/modules/nvidia-libs@/module.build
@@ -1,12 +1,12 @@
#!/bin/bash
pre_exec() {
- [ -z "$MODULE_VERSION" ] && perror "Not run from an @ target"
+ [ -z "$TARGET_VERSION" ] && perror "Not run from an @ target"
local SRC SZ
- SRC="${ROOT_DIR}/tmp/work/nvidia-common/build/$MODULE_VERSION"
- [ -d "$SRC" ] || perror "nvidia-common did not build $MODULE_VERSION"
+ SRC="${ROOT_DIR}/tmp/work/nvidia-common/build/$TARGET_VERSION"
+ [ -d "$SRC" ] || perror "nvidia-common did not build $TARGET_VERSION"
SZ=$( du -sk "$SRC" | awk '{print $1}' )
- (( SZ < 200000 )) && perror "nvidia-common for $MODULE_VERSION is less than 200MB, fishy"
+ (( SZ < 200000 )) && perror "nvidia-common for $TARGET_VERSION is less than 200MB, fishy"
# XXX Now we override the MODULE_BUILD_DIR, where mltk will then grab alle the required files from
MODULE_BUILD_DIR="$SRC"
}
@@ -15,7 +15,7 @@ post_copy() {
# generate addon-required for this version
cat <<-EOF > "${TARGET_BUILD_DIR}/addon-required"
#!/bin/ash
- [ "\$( cat /sys/module/nvidia/version )" = "$MODULE_VERSION" ]
+ [ "\$( cat /sys/module/nvidia/version )" = "$TARGET_VERSION" ]
EOF
chmod +x "${TARGET_BUILD_DIR}/addon-required"
}