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_GETTY_PORT
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_PORT
))
6 TARGET_GENERIC_GETTY_BAUDRATE
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE
))
7 TARGET_GENERIC_GETTY_TERM
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_TERM
))
8 TARGET_GENERIC_GETTY_OPTIONS
= $(call qstrip
,$(BR2_TARGET_GENERIC_GETTY_OPTIONS
))
10 ifeq ($(BR2_TARGET_GENERIC_GETTY
),y
)
11 define SYSTEM_SECURETTY
12 grep
-q
'^$(TARGET_GENERIC_GETTY_PORT)$$' $(TARGET_DIR
)/etc
/securetty || \
13 echo
'$(TARGET_GENERIC_GETTY_PORT)' >> $(TARGET_DIR
)/etc
/securetty
15 TARGET_FINALIZE_HOOKS
+= SYSTEM_SECURETTY
18 ifneq ($(TARGET_GENERIC_HOSTNAME
),)
19 define SYSTEM_HOSTNAME
20 mkdir
-p
$(TARGET_DIR
)/etc
21 echo
"$(TARGET_GENERIC_HOSTNAME)" > $(TARGET_DIR
)/etc
/hostname
22 $(SED
) '$$a \127.0.1.1\t$(TARGET_GENERIC_HOSTNAME)' \
23 -e
'/^127.0.1.1/d' $(TARGET_DIR
)/etc
/hosts
25 TARGET_FINALIZE_HOOKS
+= SYSTEM_HOSTNAME
28 ifneq ($(TARGET_GENERIC_ISSUE
),)
30 mkdir
-p
$(TARGET_DIR
)/etc
31 echo
"$(TARGET_GENERIC_ISSUE)" > $(TARGET_DIR
)/etc
/issue
33 TARGET_FINALIZE_HOOKS
+= SYSTEM_ISSUE
36 ifneq ($(TARGET_GENERIC_ROOT_PASSWD
),)
37 TARGETS
+= host-mkpasswd
40 ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT
),y
)
42 define SYSTEM_ROOT_PASSWD
43 [ -n
"$(TARGET_GENERIC_ROOT_PASSWD)" ] && \
44 TARGET_GENERIC_ROOT_PASSWD_HASH
=$$($(MKPASSWD
) -m
"$(TARGET_GENERIC_PASSWD_METHOD)" "$(TARGET_GENERIC_ROOT_PASSWD)"); \
45 $(SED
) "s,^root:[^:]*:,root:$$TARGET_GENERIC_ROOT_PASSWD_HASH:," $(TARGET_DIR
)/etc
/shadow
47 TARGET_FINALIZE_HOOKS
+= SYSTEM_ROOT_PASSWD
49 ifeq ($(BR2_TARGET_GENERIC_GETTY
),y
)
50 ifeq ($(BR2_PACKAGE_SYSVINIT
),y
)
51 # In sysvinit inittab, the "id" must not be longer than 4 bytes, so we
52 # skip the "tty" part and keep only the remaining.
54 $(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) #~' \
55 $(TARGET_DIR
)/etc
/inittab
58 # Add getty to busybox inittab
60 $(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) #~' \
61 $(TARGET_DIR
)/etc
/inittab
64 TARGET_FINALIZE_HOOKS
+= SYSTEM_GETTY
67 ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
),y
)
68 # Find commented line, if any, and remove leading '#'s
69 define SYSTEM_REMOUNT_RW
70 $(SED
) '/^#.*# REMOUNT_ROOTFS_RW$$/s~^#\+~~' $(TARGET_DIR
)/etc
/inittab
73 # Find uncommented line, if any, and add a leading '#'
74 define SYSTEM_REMOUNT_RW
75 $(SED
) '/^[^#].*# REMOUNT_ROOTFS_RW$$/s~^~#~' $(TARGET_DIR
)/etc
/inittab
78 TARGET_FINALIZE_HOOKS
+= SYSTEM_REMOUNT_RW
80 endif # BR2_ROOTFS_SKELETON_DEFAULT