* [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing
@ 2024-07-02 15:18 Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 1/3] package/atftp: add sysvinit script Brandon Maier via buildroot
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Brandon Maier via buildroot @ 2024-07-02 15:18 UTC (permalink / raw)
To: buildroot; +Cc: Brandon Maier
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
Brandon Maier (3):
package/atftp: add sysvinit script
support/testing: add atftp test
DEVELOPERS: add myself for package/atftp
DEVELOPERS | 1 +
package/atftp/S80atftpd | 44 +++++++++++++++++++++++++++++
package/atftp/atftp.mk | 5 ++++
support/testing/tests/package/test_atftp.py | 28 ++++++++++++++++++
4 files changed, 78 insertions(+)
---
base-commit: 55c8c2328e73725e9ab41c8dc566b09f49f2aad5
change-id: 20240701-atftp-sysvinit-5f8486a01eb5
Best regards,
--
Brandon Maier <brandon.maier@collins.com>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/3] package/atftp: add sysvinit script
2024-07-02 15:18 [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Brandon Maier via buildroot
@ 2024-07-02 15:18 ` Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 2/3] support/testing: add atftp test Brandon Maier via buildroot
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Brandon Maier via buildroot @ 2024-07-02 15:18 UTC (permalink / raw)
To: buildroot; +Cc: Brandon Maier
Add a script to launch the atftp daemon at boot.
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
package/atftp/S80atftpd | 44 ++++++++++++++++++++++++++++++++++++++++++++
package/atftp/atftp.mk | 5 +++++
2 files changed, 49 insertions(+)
diff --git a/package/atftp/S80atftpd b/package/atftp/S80atftpd
new file mode 100644
index 0000000000..8cd0e035e6
--- /dev/null
+++ b/package/atftp/S80atftpd
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+DAEMON="atftpd"
+PIDFILE="/var/run/$DAEMON.pid"
+ATFTPD_ARGS="--user root.root /tftpboot"
+
+# shellcheck disable=SC1090
+[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
+
+start() {
+ printf 'Starting %s: ' "$DAEMON"
+ # shellcheck disable=SC2086
+ if start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" -- \
+ --daemon --pidfile="$PIDFILE" $ATFTPD_ARGS; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+}
+
+stop() {
+ printf 'Stopping %s: ' "$DAEMON"
+ if start-stop-daemon -K -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON"; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+restart|reload)
+ stop
+ start
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
diff --git a/package/atftp/atftp.mk b/package/atftp/atftp.mk
index d41178cac4..c71a70cd5d 100644
--- a/package/atftp/atftp.mk
+++ b/package/atftp/atftp.mk
@@ -36,4 +36,9 @@ else
ATFTP_CONF_OPTS += --disable-libpcre
endif
+define ATFTP_INSTALL_INIT_SYSV
+ $(INSTALL) -m 755 -D package/atftp/S80atftpd \
+ $(TARGET_DIR)/etc/init.d/S80atftpd
+endef
+
$(eval $(autotools-package))
--
2.45.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 2/3] support/testing: add atftp test
2024-07-02 15:18 [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 1/3] package/atftp: add sysvinit script Brandon Maier via buildroot
@ 2024-07-02 15:18 ` Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 3/3] DEVELOPERS: add myself for package/atftp Brandon Maier via buildroot
2024-07-09 20:25 ` [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Thomas Petazzoni via buildroot
3 siblings, 0 replies; 5+ messages in thread
From: Brandon Maier via buildroot @ 2024-07-02 15:18 UTC (permalink / raw)
To: buildroot; +Cc: Brandon Maier
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
support/testing/tests/package/test_atftp.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/support/testing/tests/package/test_atftp.py b/support/testing/tests/package/test_atftp.py
new file mode 100644
index 0000000000..95e76c07cb
--- /dev/null
+++ b/support/testing/tests/package/test_atftp.py
@@ -0,0 +1,28 @@
+import os
+
+import infra.basetest
+
+
+class TestAtftp(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_ATFTP=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ BR2_TARGET_ROOTFS_CPIO=y
+ """
+
+ def test_run(self):
+ cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+ self.emulator.boot(arch="armv7",
+ kernel="builtin",
+ options=["-initrd", cpio_file])
+
+ self.emulator.login()
+
+ self.assertRunOk("mkdir -p /tftpboot")
+ self.assertRunOk("echo 'Hello World' >/tftpboot/test_atftp.txt")
+
+ # atftpd is launched by /etc/init.d/S80atftpd
+ self.assertRunOk("atftp -g -r test_atftp.txt -l /tmp/test_atftp.txt localhost")
+ output, exit_code = self.emulator.run("cat /tmp/test_atftp.txt")
+ self.assertEqual("".join(output), "Hello World")
--
2.45.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 3/3] DEVELOPERS: add myself for package/atftp
2024-07-02 15:18 [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 1/3] package/atftp: add sysvinit script Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 2/3] support/testing: add atftp test Brandon Maier via buildroot
@ 2024-07-02 15:18 ` Brandon Maier via buildroot
2024-07-09 20:25 ` [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Thomas Petazzoni via buildroot
3 siblings, 0 replies; 5+ messages in thread
From: Brandon Maier via buildroot @ 2024-07-02 15:18 UTC (permalink / raw)
To: buildroot; +Cc: Brandon Maier
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
DEVELOPERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/DEVELOPERS b/DEVELOPERS
index 6d9fcd97df..7f0af07247 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -542,6 +542,7 @@ F: package/ncdu/
N: Brandon Maier <brandon.maier@collins.com>
F: board/freescale/ls1046a-frwy/
F: configs/ls1046a-frwy_defconfig
+F: package/atftp/
F: package/bats-assert/
F: package/bats-file/
F: package/bats-support/
--
2.45.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing
2024-07-02 15:18 [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Brandon Maier via buildroot
` (2 preceding siblings ...)
2024-07-02 15:18 ` [Buildroot] [PATCH 3/3] DEVELOPERS: add myself for package/atftp Brandon Maier via buildroot
@ 2024-07-09 20:25 ` Thomas Petazzoni via buildroot
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-09 20:25 UTC (permalink / raw)
To: Brandon Maier via buildroot; +Cc: Brandon Maier
On Tue, 02 Jul 2024 15:18:43 +0000
Brandon Maier via buildroot <buildroot@buildroot.org> wrote:
> Brandon Maier (3):
> package/atftp: add sysvinit script
> support/testing: add atftp test
> DEVELOPERS: add myself for package/atftp
Thanks, series applied. On PATCH 1/3, I did some small tweaks to make
your init script look more like our canonical example in the Buildroot
manual. Also on PATCH 2/3, I added an entry in the DEVELOPERS to have
you as the maintainer of the atftp test.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-09 20:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 15:18 [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 1/3] package/atftp: add sysvinit script Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 2/3] support/testing: add atftp test Brandon Maier via buildroot
2024-07-02 15:18 ` [Buildroot] [PATCH 3/3] DEVELOPERS: add myself for package/atftp Brandon Maier via buildroot
2024-07-09 20:25 ` [Buildroot] [PATCH 0/3] package/atftp: add init script and support/testing Thomas Petazzoni via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.