diff options
Diffstat (limited to 'remote/setup_target')
| -rwxr-xr-x | remote/setup_target | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/remote/setup_target b/remote/setup_target index 8160de3e..1b857eda 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -362,6 +362,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}" @@ -408,20 +412,6 @@ post_process_target() { ldconfig -v -r "${TARGET_BUILD_DIR}" -f "/ldconf-temp" unlink "$LDTEMP" - # Hacky way of making sure /run and /var/run are actually the same directory - local DIR_RUN="$TARGET_BUILD_DIR/run" - local DIR_VAR_RUN="$TARGET_BUILD_DIR/var/run" - [ -L "$DIR_RUN" ] && perror "$DIR_RUN is a symbolic link, refusing to work!" - if [ -d "$DIR_RUN" -o -d "$DIR_VAR_RUN" ]; then - mkdir -p "$DIR_RUN" || perror "Could not create $DIR_RUN" - if [ -d "$DIR_VAR_RUN" -a ! -L "$DIR_VAR_RUN" ]; then - mv "$DIR_VAR_RUN/"* "$DIR_RUN/" || perror "Could not move contents of $DIR_VAR_RUN to $DIR_RUN" - rmdir "$DIR_VAR_RUN" || perror "Could not delete $DIR_VAR_RUN after moving contents to $DIR_RUN" - fi - if [ ! -L "$DIR_VAR_RUN" ]; then - ln -sf "../run" "$DIR_VAR_RUN" || perror "Could not create symbolic link $DIR_VAR_RUN to ../run" - fi - fi } clean_modules() { |
