mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
skeleton-init-commom: do not assume /etc/hosts and /etc/shadow exist
This commit is contained in:
parent
670925a6a5
commit
89851a1334
@ -44,8 +44,9 @@ ifneq ($(SKELETON_INIT_COMMON_HOSTNAME),)
|
|||||||
define SKELETON_INIT_COMMON_SET_HOSTNAME
|
define SKELETON_INIT_COMMON_SET_HOSTNAME
|
||||||
mkdir -p $(TARGET_DIR)/etc
|
mkdir -p $(TARGET_DIR)/etc
|
||||||
echo "$(SKELETON_INIT_COMMON_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
|
echo "$(SKELETON_INIT_COMMON_HOSTNAME)" > $(TARGET_DIR)/etc/hostname
|
||||||
$(SED) '$$a \127.0.1.1\t$(SKELETON_INIT_COMMON_HOSTNAME)' \
|
test -f $(TARGET_DIR)/etc/hosts && $(SED) \
|
||||||
-e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts
|
'$$a \127.0.1.1\t$(SKELETON_INIT_COMMON_HOSTNAME)' \
|
||||||
|
-e '/^127.0.1.1/d' $(TARGET_DIR)/etc/hosts || true
|
||||||
endef
|
endef
|
||||||
SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_SET_HOSTNAME
|
SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_SET_HOSTNAME
|
||||||
endif
|
endif
|
||||||
@ -70,7 +71,7 @@ else # !BR2_TARGET_ENABLE_ROOT_LOGIN
|
|||||||
SKELETON_INIT_COMMON_ROOT_PASSWORD = "*"
|
SKELETON_INIT_COMMON_ROOT_PASSWORD = "*"
|
||||||
endif
|
endif
|
||||||
define SKELETON_INIT_COMMON_SET_ROOT_PASSWD
|
define SKELETON_INIT_COMMON_SET_ROOT_PASSWD
|
||||||
$(SED) s,^root:[^:]*:,root:$(SKELETON_INIT_COMMON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
|
test -f $(TARGET_DIR)/etc/shadow && $(SED) s,^root:[^:]*:,root:$(SKELETON_INIT_COMMON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow || true
|
||||||
endef
|
endef
|
||||||
SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_SET_ROOT_PASSWD
|
SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_SET_ROOT_PASSWD
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user