diff options
| -rwxr-xr-x | remote/setup_target | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/remote/setup_target b/remote/setup_target index 60cf23b5..8160de3e 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -408,6 +408,20 @@ 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() { |
