diff mbox

[3/4] busybox: Add useflag to set tftpd inetd command

Message ID f666a7abdcea2ec4b1c52cdf31a9a5d5566f2f74.1399459420.git.christian.braunersorensen@prevas.dk
State Changes Requested
Delegated to: Esben Haabendal
Headers show

Commit Message

christian.braunersorensen@prevas.dk May 7, 2014, 10:44 a.m. UTC
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

USE_tftpd_inetdcmd: Default not set. Set if to an inetd command you wish
to include of the busybox tftpd daemon is enabled.

Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
---
 recipes/busybox/busybox-configure.inc | 3 ++-
 recipes/busybox/busybox-install.inc   | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Esben Haabendal May 13, 2014, 12:08 p.m. UTC | #1
<christian.braunersorensen@prevas.dk> writes:

> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>
> USE_tftpd_inetdcmd: Default not set. Set if to an inetd command you wish
> to include of the busybox tftpd daemon is enabled.
>
> Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
> ---
>  recipes/busybox/busybox-configure.inc | 3 ++-
>  recipes/busybox/busybox-install.inc   | 4 ++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/recipes/busybox/busybox-configure.inc b/recipes/busybox/busybox-configure.inc
> index 3504da1..06588d6 100644
> --- a/recipes/busybox/busybox-configure.inc
> +++ b/recipes/busybox/busybox-configure.inc
> @@ -373,8 +373,9 @@ CONFIG_FEATURE_TFTP_GET,\
>  CONFIG_FEATURE_TFTP_PUT,\
>  CONFIG_FEATURE_TFTP_BLOCKSIZE"
>  # USE flag: tftp daemon root folder
> -RECIPE_FLAGS += "busybox_tftpd_dir"
> +RECIPE_FLAGS += "busybox_tftpd_dir busybox_tftpd_inetdcmd"
>  DEFAULT_USE_busybox_tftpd_dir = "${servicedir}/tftp"
> +DEFAULT_USE_busybox_tftpd_inetdcmd = "0"
>  
>  # USE flag: enable ftp server
>  BUSYBOX_SIMPLE_USE_FLAGS += "ftpd:service/ftp:\
> diff --git a/recipes/busybox/busybox-install.inc b/recipes/busybox/busybox-install.inc
> index 9928506..01f5677 100644
> --- a/recipes/busybox/busybox-install.inc
> +++ b/recipes/busybox/busybox-install.inc
> @@ -51,8 +51,12 @@ do_install () {
>  			# put it where inetd class finds it, so it can be merged
>  			# with inetd.conf when generating image
>  			inetd_conf=${INETD_CONF_FILES}
> +			if [ -n "$USE_busybox_tftpd_inetdcmd" ]; then
> +				echo $USE_busybox_tftpd_inetdcmd >> $inetd_conf
> +			else
>  				echo "tftp dgram udp nowait root tftpd tftpd -c ${USE_busybox_tftpd_dir}" \
>  				>> $inetd_conf
> +			fi

Why not just set the default value of to the current inetd.conf line?

>  		fi
>  		install -d ${D}${USE_busybox_tftpd_dir}
>  	fi

/Esben
christian.braunersorensen@prevas.dk July 28, 2014, 7:11 a.m. UTC | #2
True. Makes it abit easier.

Will resend patch.

/Christian
diff mbox

Patch

diff --git a/recipes/busybox/busybox-configure.inc b/recipes/busybox/busybox-configure.inc
index 3504da1..06588d6 100644
--- a/recipes/busybox/busybox-configure.inc
+++ b/recipes/busybox/busybox-configure.inc
@@ -373,8 +373,9 @@  CONFIG_FEATURE_TFTP_GET,\
 CONFIG_FEATURE_TFTP_PUT,\
 CONFIG_FEATURE_TFTP_BLOCKSIZE"
 # USE flag: tftp daemon root folder
-RECIPE_FLAGS += "busybox_tftpd_dir"
+RECIPE_FLAGS += "busybox_tftpd_dir busybox_tftpd_inetdcmd"
 DEFAULT_USE_busybox_tftpd_dir = "${servicedir}/tftp"
+DEFAULT_USE_busybox_tftpd_inetdcmd = "0"
 
 # USE flag: enable ftp server
 BUSYBOX_SIMPLE_USE_FLAGS += "ftpd:service/ftp:\
diff --git a/recipes/busybox/busybox-install.inc b/recipes/busybox/busybox-install.inc
index 9928506..01f5677 100644
--- a/recipes/busybox/busybox-install.inc
+++ b/recipes/busybox/busybox-install.inc
@@ -51,8 +51,12 @@  do_install () {
 			# put it where inetd class finds it, so it can be merged
 			# with inetd.conf when generating image
 			inetd_conf=${INETD_CONF_FILES}
+			if [ -n "$USE_busybox_tftpd_inetdcmd" ]; then
+				echo $USE_busybox_tftpd_inetdcmd >> $inetd_conf
+			else
 				echo "tftp dgram udp nowait root tftpd tftpd -c ${USE_busybox_tftpd_dir}" \
 				>> $inetd_conf
+			fi
 		fi
 		install -d ${D}${USE_busybox_tftpd_dir}
 	fi