1 TARGET_GENERIC_HOSTNAME
= $(call qstrip
,$(BR2_TARGET_GENERIC_HOSTNAME
))
2 TARGET_GENERIC_ISSUE
= $(call qstrip
,$(BR2_TARGET_GENERIC_ISSUE
))
3 TARGET_GENERIC_ROOT_PASSWD
= $(call qstrip
,$(BR2_TARGET_GENERIC_ROOT_PASSWD
))
4 TARGET_GENERIC_PASSWD_METHOD
= $(call qstrip
,$(BR2_TARGET_GENERIC_PASSWD_METHOD
))
5 TARGET_GENERIC_BIN_SH
= $(call qstrip
,$(BR2_SYSTEM_BIN_SH
))
6 TARGET_GENERIC_GETTY_PORT
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_PORT
))
7 TARGET_GENERIC_GETTY_BAUDRATE
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE
))
8 TARGET_GENERIC_GETTY_TERM
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_TERM
))
9 TARGET_GENERIC_GETTY_OPTIONS
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_OPTIONS
))
11 ifeq ($(BR2_TARGET_GENERIC_GETTY
),y
)
12 define SYSTEM_SECURETTY
13 grep
-q
'^$(TARGET_GENERIC_GETTY_PORT)$$' $(TARGET_DIR
)/etc
/securetty || \
14 echo
'$(TARGET_GENERIC_GETTY_PORT)' >> $(TARGET_DIR
)/etc
/securetty
16 TARGET_FINALIZE_HOOKS
+= SYSTEM_SECURETTY
19 ifneq ($(TARGET_GENERIC_HOSTNAME
),)
20 define SYSTEM_HOSTNAME
21 mkdir
-p
$(TARGET_DIR
)/etc
22 echo
"$(TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR
)/etc
/hostname
23 $(SED
) '$$a \127.0.1.1\t$(TARGET_GENERIC_HOSTNAME)' \
24 -e
'/^127.0.1.1/d' $(TARGET_DIR
)/etc
/hosts
26 TARGET_FINALIZE_HOOKS
+= SYSTEM_HOSTNAME
29 ifneq ($(TARGET_GENERIC_ISSUE
),)
31 mkdir
-p
$(TARGET_DIR
)/etc
32 echo
"$(TARGET_GENERIC_ISSUE)" > $(TARGET_DIR
)/etc
/issue
34 TARGET_FINALIZE_HOOKS
+= SYSTEM_ISSUE
37 ifneq ($(TARGET_GENERIC_ROOT_PASSWD
),)
38 TARGETS
+= host-mkpasswd
41 ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT
),y
)
43 define SYSTEM_ROOT_PASSWD
44 [ -n
"$(TARGET_GENERIC_ROOT_PASSWD)" ] && \
45 TARGET_GENERIC_ROOT_PASSWD_HASH
=$$($(MKPASSWD
) -m
"$(TARGET_GENERIC_PASSWD_METHOD)" "$(TARGET_GENERIC_ROOT_PASSWD)"); \
46 $(SED
) "s,^root:[^:]*:,root:$$TARGET_GENERIC_ROOT_PASSWD_HASH:," $(TARGET_DIR
)/etc
/shadow
48 TARGET_FINALIZE_HOOKS
+= SYSTEM_ROOT_PASSWD
50 ifeq ($(BR2_SYSTEM_BIN_SH_NONE
),y
)
52 rm -f
$(TARGET_DIR
)/bin
/sh
56 ln
-sf
$(TARGET_GENERIC_BIN_SH
) $(TARGET_DIR
)/bin
/sh
59 TARGET_FINALIZE_HOOKS
+= SYSTEM_BIN_SH
61 ifeq ($(BR2_TARGET_GENERIC_GETTY
),y
)
62 ifeq ($(BR2_PACKAGE_SYSVINIT
),y
)
63 # In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
64 # skip the "tty" part and keep only the remaining.
66 $(SED
) '/# GENERIC_SERIAL$$/s~^.*#~$(shell echo $(TARGET_GENERIC_GETTY_PORT) | tail -c+4)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY_OPTIONS) $(TARGET_GENERIC_GETTY_PORT) $(TARGET_GENERIC_GETTY_BAUDRATE) $(TARGET_GENERIC_GETTY_TERM) #~' \
67 $(TARGET_DIR
)/etc
/inittab
70 # Add getty to busybox inittab
72 $(SED
) '/# GENERIC_SERIAL$$/s~^.*#~$(TARGET_GENERIC_GETTY_PORT)::respawn:/sbin/getty -L $(TARGET_GENERIC_GETTY_OPTIONS) $(TARGET_GENERIC_GETTY_PORT) $(TARGET_GENERIC_GETTY_BAUDRATE) $(TARGET_GENERIC_GETTY_TERM) #~' \
73 $(TARGET_DIR
)/etc
/inittab
76 TARGET_FINALIZE_HOOKS
+= SYSTEM_GETTY
79 ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
),y
)
80 # Find commented line, if any, and remove leading '#'s
81 define SYSTEM_REMOUNT_RW
82 $(SED
) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR
)/etc
/inittab
85 # Find uncommented line, if any, and add a leading '#'
86 define SYSTEM_REMOUNT_RW
87 $(SED
) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR
)/etc
/inittab
90 TARGET_FINALIZE_HOOKS
+= SYSTEM_REMOUNT_RW
92 endif # BR2_ROOTFS_SKELETON_DEFAULT