diff --git a/board/common/cleanups.sh b/board/common/cleanups.sh index 2df8a41740..cdfe2134a1 100755 --- a/board/common/cleanups.sh +++ b/board/common/cleanups.sh @@ -209,4 +209,4 @@ rm -f $TARGET/etc/init.d/S99motion # other unwanted dirs rm -rf $TARGET/data/* - +rm -rf $TARGET/run diff --git a/board/common/overlay/run b/board/common/overlay/run deleted file mode 120000 index 1c2f433de1..0000000000 --- a/board/common/overlay/run +++ /dev/null @@ -1 +0,0 @@ -tmp \ No newline at end of file diff --git a/board/common/postscript.sh b/board/common/postscript.sh index bc54ee45c9..2ed6014f59 100755 --- a/board/common/postscript.sh +++ b/board/common/postscript.sh @@ -15,6 +15,12 @@ if [ -x $BOARD_DIR/postscript.sh ]; then $BOARD_DIR/postscript.sh fi +# cleanups +$COMMON_DIR/cleanups.sh +if [ -x $BOARD_DIR/cleanups.sh ]; then + $BOARD_DIR/cleanups.sh +fi + # transform /var contents as needed rm -rf $TARGET/var/cache rm -rf $TARGET/var/lib @@ -31,12 +37,7 @@ ln -s /data/log $TARGET/var/log ln -s /tmp $TARGET/var/run ln -s /tmp $TARGET/var/spool ln -s /tmp $TARGET/var/tmp - -# cleanups -$COMMON_DIR/cleanups.sh -if [ -x $BOARD_DIR/cleanups.sh ]; then - $BOARD_DIR/cleanups.sh -fi +ln -s /tmp $TARGET/run # board-specific os.conf if [ -r $BOARD_DIR/os.conf ]; then diff --git a/package/skeleton-init-common/skeleton-init-common.mk b/package/skeleton-init-common/skeleton-init-common.mk index ca98f5cfd9..532173df45 100644 --- a/package/skeleton-init-common/skeleton-init-common.mk +++ b/package/skeleton-init-common/skeleton-init-common.mk @@ -43,9 +43,10 @@ SKELETON_INIT_COMMON_BIN_SH = $(call qstrip,$(BR2_SYSTEM_BIN_SH)) ifneq ($(SKELETON_INIT_COMMON_HOSTNAME),) define SKELETON_INIT_COMMON_SET_HOSTNAME mkdir -p $(TARGET_DIR)/etc - echo "$(SKELETON_INIT_COMMON_HOSTNAME)" > $(TARGET_DIR)/etc/hostname - test -f $(TARGET_DIR)/etc/hosts && $(SED) \ - '$$a \127.0.1.1\t$(SKELETON_INIT_COMMON_HOSTNAME)' \ + test -f $(TARGET_DIR)/etc/hostname && \ + echo "$(SKELETON_INIT_COMMON_HOSTNAME)" > $(TARGET_DIR)/etc/hostname || true + test -f $(TARGET_DIR)/etc/hosts && \ + $(SED) '$$a \127.0.1.1\t$(SKELETON_INIT_COMMON_HOSTNAME)' \ -e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts || true endef SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_SET_HOSTNAME