[LEDE-DEV] [PATCH RFC 2/3] busybox: convert lock applet to "new style" applet definitions

Magnus Kroken mkroken at gmail.com
Wed Jan 4 14:54:52 PST 2017


Signed-off-by: Magnus Kroken <mkroken at gmail.com>
---
 .../utils/busybox/patches/220-add_lock_util.patch  | 54 ++++++----------------
 1 file changed, 15 insertions(+), 39 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index c60f5db..4e46b74 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -1,46 +1,25 @@
---- a/include/applets.src.h
-+++ b/include/applets.src.h
-@@ -196,6 +196,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
- IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
- IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
- IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
-+IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP))
- IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname))
- IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP))
- IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls))
---- a/miscutils/Config.src
-+++ b/miscutils/Config.src
-@@ -375,6 +375,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA
- 	help
- 	  Enables the 'hdparm -d' option to get/set using_dma flag.
- 
-+config LOCK
-+	bool "lock"
-+	default n
-+	help
-+	  Small utility for using locks in scripts
-+
- config MAKEDEVS
- 	bool "makedevs"
- 	default y
---- a/miscutils/Kbuild.src
-+++ b/miscutils/Kbuild.src
-@@ -33,6 +33,7 @@ lib-$(CONFIG_LAST)        += last.o
- endif
- 
- lib-$(CONFIG_LESS)        += less.o
-+lib-$(CONFIG_LOCK)        += lock.o
- lib-$(CONFIG_MAKEDEVS)    += makedevs.o
- lib-$(CONFIG_MAN)         += man.o
- lib-$(CONFIG_MICROCOM)    += microcom.o
 --- /dev/null
 +++ b/miscutils/lock.c
-@@ -0,0 +1,144 @@
+@@ -0,0 +1,155 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau <nbd at nbd.name>
 + *
 + * This is free software, licensed under the GNU General Public License v2.
 + */
++
++//config:config LOCK
++//config:	bool "lock"
++//config:	default n
++//config:	help
++//config:	  Small utility for using locks in scripts
++
++//applet:IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP))
++
++//kbuild:lib-$(CONFIG_LOCK) += lock.o
++
++//usage:#define lock_trivial_usage NOUSAGE_STR
++//usage:#define lock_full_usage ""
++
 +#include <sys/types.h>
 +#include <sys/file.h>
 +#include <sys/stat.h>
@@ -50,9 +29,6 @@
 +#include <stdio.h>
 +#include "busybox.h"
 +
-+//usage:#define lock_trivial_usage NOUSAGE_STR
-+//usage:#define lock_full_usage ""
-+
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
-- 
2.1.4




More information about the Lede-dev mailing list