Skip to content

Commit c23b9c2

Browse files
committed
package/finit: fix missing default hostname
The string variable handling in configuring Finit did not follow the Buildroot best practises. This patch adds stripping quotes from all string variables before adding them as configure arguments. This fixes issue with, e.g., this sneaky bastard: configure --with-rtc-date=""2024-10-12 12:34:56"" Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 5261e4f commit c23b9c2

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

package/finit/finit.mk

+16-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ FINIT_D = $(TARGET_DIR)/etc/finit.d
1919
#FINIT_AUTORECONF = YES
2020
#FINIT_DEPENDENCIES += host-automake host-autoconf host-libtool
2121

22+
# Strip "" from variables
23+
FINIT_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
24+
FINIT_GROUP = $(call qstrip,$(BR2_PACKAGE_FINIT_INITCTL_GROUP))
25+
FINIT_FSTAB = $(call qstrip,$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB))
26+
FINIT_RTC_DATE = $(call qstrip,$(BR2_PACKAGE_FINIT_RTC_DATE))
27+
2228
# Buildroot defaults to /usr for both prefix and exec-prefix, this we
2329
# must override because we want to install into /sbin and /bin for the
2430
# finit and initctl programs, respectively. The expected plugin path is
@@ -31,7 +37,7 @@ FINIT_CONF_OPTS = \
3137
--disable-contrib \
3238
--disable-rescue \
3339
--disable-silent-rules \
34-
--with-group=$(BR2_PACKAGE_FINIT_INITCTL_GROUP)
40+
--with-group="$(FINIT_GROUP)"
3541

3642
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
3743
FINIT_CONF_OPTS += --exec-prefix=/usr
@@ -40,8 +46,8 @@ FINIT_CONF_OPTS += --exec-prefix=
4046
endif
4147

4248
ifeq ($(BR2_PACKAGE_FINIT_ADVANCED),y)
43-
ifneq ($(BR2_PACKAGE_FINIT_CUSTOM_FSTAB),)
44-
FINIT_CONF_OPTS += --with-fstab=$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB)
49+
ifneq ($(FINIT_FSTAB),)
50+
FINIT_CONF_OPTS += --with-fstab="$(FINIT_FSTAB)"
4551
else
4652
FINIT_CONF_OPTS += --without-fstab
4753
endif
@@ -101,8 +107,8 @@ else
101107
FINIT_CONF_OPTS += --disable-rtc-plugin
102108
endif
103109

104-
ifeq ($(BR2_PACKAGE_FINIT_RTC_DATE),y)
105-
FINIT_CONF_OPTS += --with-rtc-date="$(BR2_PACKAGE_FINIT_RTC_DATE)"
110+
ifneq ($(FINIT_RTC_DATE),)
111+
FINIT_CONF_OPTS += --with-rtc-date="$(FINIT_RTC_DATE)"
106112
else
107113
FINIT_CONF_OPTS += --without-rtc-date
108114
endif
@@ -119,8 +125,11 @@ else
119125
FINIT_CONF_OPTS += --disable-urandom-plugin
120126
endif
121127

122-
ifneq ($(SKELETON_INIT_COMMON_HOSTNAME),)
123-
FINIT_CONF_OPTS += --with-hostname="$(SKELETON_INIT_COMMON_HOSTNAME)"
128+
129+
ifneq ($(FINIT_HOSTNAME),)
130+
FINIT_CONF_OPTS += --with-hostname="$(FINIT_HOSTNAME)"
131+
else
132+
FINIT_CONF_OPTS += --without-hostname
124133
endif
125134

126135
# Disable/Enable features depending on other packages

0 commit comments

Comments
 (0)