diff options
author | Simon Rettberg | 2013-08-20 18:21:43 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-08-20 18:21:43 +0200 |
commit | 195dc51a5a5c489f634feaec532679039d123ab4 (patch) | |
tree | 67d25ee4a23fe14205c4d68aba7ce57fa882adc9 /remote/setup_target | |
parent | [stage32] fix "terminal not fuly functional" (less) etc. (diff) | |
download | tm-scripts-195dc51a5a5c489f634feaec532679039d123ab4.tar.gz tm-scripts-195dc51a5a5c489f634feaec532679039d123ab4.tar.xz tm-scripts-195dc51a5a5c489f634feaec532679039d123ab4.zip |
[setup_target] Make sure /var/run is just a symlink to /run
Diffstat (limited to 'remote/setup_target')
-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() { |