package/libsoxr: cleanup configure options
[buildroot-gz.git] / system / system.mk
blobe4a3160e5142e7e3bdb0ef8de1d7975d29099f68
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
15 endef
16 TARGET_FINALIZE_HOOKS += SYSTEM_SECURETTY
17 endif
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
25 endef
26 TARGET_FINALIZE_HOOKS += SYSTEM_HOSTNAME
27 endif
29 ifneq ($(TARGET_GENERIC_ISSUE),)
30 define SYSTEM_ISSUE
31 mkdir -p $(TARGET_DIR)/etc
32 echo "$(TARGET_GENERIC_ISSUE)" > $(TARGET_DIR)/etc/issue
33 endef
34 TARGET_FINALIZE_HOOKS += SYSTEM_ISSUE
35 endif
37 ifneq ($(TARGET_GENERIC_ROOT_PASSWD),)
38 TARGETS += host-mkpasswd
39 endif
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
47 endef
48 TARGET_FINALIZE_HOOKS += SYSTEM_ROOT_PASSWD
50 ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y)
51 define SYSTEM_BIN_SH
52 rm -f $(TARGET_DIR)/bin/sh
53 endef
54 else
55 define SYSTEM_BIN_SH
56 ln -sf $(TARGET_GENERIC_BIN_SH) $(TARGET_DIR)/bin/sh
57 endef
58 endif
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.
65 define SYSTEM_GETTY
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
68 endef
69 else
70 # Add getty to busybox inittab
71 define SYSTEM_GETTY
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
74 endef
75 endif
76 TARGET_FINALIZE_HOOKS += SYSTEM_GETTY
77 endif
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
83 endef
84 else
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
88 endef
89 endif
90 TARGET_FINALIZE_HOOKS += SYSTEM_REMOUNT_RW
92 endif # BR2_ROOTFS_SKELETON_DEFAULT