summaryrefslogtreecommitdiffstats
path: root/remote/setup_target
diff options
context:
space:
mode:
Diffstat (limited to 'remote/setup_target')
-rwxr-xr-xremote/setup_target10
1 files changed, 9 insertions, 1 deletions
diff --git a/remote/setup_target b/remote/setup_target
index 60cf23b5..c19113df 100755
--- a/remote/setup_target
+++ b/remote/setup_target
@@ -65,19 +65,23 @@ initial_checks () {
case "$SYS_DISTRIBUTION" in
ubuntu|debian)
PACKET_MANAGER="apt"
+ PACKET_HANDLER="dpkg"
;;
opensuse)
PACKET_MANAGER="zypper"
+ PACKET_HANDLER="rpm"
;;
scientific)
PACKET_MANAGER="yum"
+ PACKET_HANDLER="rpm"
;;
*)
perror "Unknown Distribution: $SYS_DISTRIBUTION - Please specify its packet manager in remote/setup_target"
;;
esac
# Get version - we mangle this quite a bit. first make sure it has no spaces, then split version at period (.), underscore (_) and dash (-)
- local VERSION=$(lsb_release -rs | tolower | sed -r 's/\s//g;s/[\._]/ /g;s/-//g')
+ SYS_VERSION=$(lsb_release -rs | tolower)
+ local VERSION=$(echo $SYS_VERSION | sed -r 's/\s//g;s/[\._]/ /g;s/-//g')
local STRTMP=""
PRINT_SYS_VERSIONS="*.conf.$SYS_DISTRIBUTION"
SYS_VERSIONS="$SYS_DISTRIBUTION"
@@ -362,6 +366,10 @@ process_module() {
copy_static_data
pinfo "## Post copy"
post_copy
+ # Sanity checks
+ [ -e "$TARGET_BUILD_DIR/var/run" -a ! -L "$TARGET_BUILD_DIR/var/run" ] && perror "Messup datected: $TARGET_BUILD_DIR/var/run exists and is not a symlink!"
+ [ -e "$TARGET_BUILD_DIR/var/lock" -a ! -L "$TARGET_BUILD_DIR/var/lock" ] && perror "Messup datected: $TARGET_BUILD_DIR/var/lock exists and is not a symlink!"
+ [ -n "$(ls -A "$TARGET_BUILD_DIR/run")" ] && perror "Messup detected: $TARGET_BUILD_DIR/run is not empty. You cannot place static files there, use /etc/tmpfiles.d instead!"
# set MODULE_BUILD_SIZE
calc_size
pinfo "Module completed. Total size: ${MODULE_BUILD_SIZE}"