diff options
Diffstat (limited to 'main/busybox')
-rw-r--r-- | main/busybox/0001-beep-the-d-option-takes-milliseconds-not-microsecond.patch | 25 | ||||
-rw-r--r-- | main/busybox/APKBUILD | 10 | ||||
-rw-r--r-- | main/busybox/busybox-1.16.0-wc.patch | 12 | ||||
-rw-r--r-- | main/busybox/busyboxconfig | 5 | ||||
-rw-r--r-- | main/busybox/flock-bb.patch | 183 |
5 files changed, 231 insertions, 4 deletions
diff --git a/main/busybox/0001-beep-the-d-option-takes-milliseconds-not-microsecond.patch b/main/busybox/0001-beep-the-d-option-takes-milliseconds-not-microsecond.patch new file mode 100644 index 0000000000..15d8e10927 --- /dev/null +++ b/main/busybox/0001-beep-the-d-option-takes-milliseconds-not-microsecond.patch @@ -0,0 +1,25 @@ +From 4d277601bdd3717ff304b2eef9823cc4c17134e2 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu, 11 Mar 2010 17:06:59 +0000 +Subject: [PATCH] beep: the -d option takes milliseconds not microseconds + +--- + miscutils/beep.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/miscutils/beep.c b/miscutils/beep.c +index c17cbfd..10768e7 100644 +--- a/miscutils/beep.c ++++ b/miscutils/beep.c +@@ -83,7 +83,7 @@ int beep_main(int argc, char **argv) + usleep(1000 * length); + ioctl(speaker, KIOCSOUND, (void*)0); + if (--rep) +- usleep(delay); ++ usleep(1000 * delay); + } + } + +-- +1.7.0.2 + diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD index 82d7e8b9ed..57487c0ff6 100644 --- a/main/busybox/APKBUILD +++ b/main/busybox/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=busybox pkgver=1.16.0 -pkgrel=4 +pkgrel=7 pkgdesc="Size optimized toolbox of many common UNIX utilities" url=http://busybox.net license="GPL-2" @@ -19,7 +19,10 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2 busybox-1.16.0-syslogd.patch busybox-1.16.0-tftp.patch busybox-1.16.0-usage.patch + busybox-1.16.0-wc.patch busybox-1.16.0-wget.patch + 0001-beep-the-d-option-takes-milliseconds-not-microsecond.patch + flock-bb.patch busyboxconfig" _builddir="$srcdir"/$pkgname-$pkgver @@ -71,5 +74,8 @@ f4758daa8023f000228e9509cceb02d1 busybox-1.16.0-md5_sha_compat.patch 86a27167971333a0ddad4f0e8bc0acc6 busybox-1.16.0-syslogd.patch e24dc9e56b5de4fff706cfbe5c75d9b2 busybox-1.16.0-tftp.patch 289c8ee19cc43fe175bbd7933c6b5cdf busybox-1.16.0-usage.patch +6520ca5ad3b2a13d100065c4f07e610a busybox-1.16.0-wc.patch 928ca5a26599cd1dbb80e08132140832 busybox-1.16.0-wget.patch -9743e7ecd48f37b0d420f64bef7fb2a8 busyboxconfig" +00b2aca448952eeb3b579792070712fd 0001-beep-the-d-option-takes-milliseconds-not-microsecond.patch +20d9beea7d0c0aaca14553a8f98fee12 flock-bb.patch +4bc85af9dd659cbb83c9a819b3481a47 busyboxconfig" diff --git a/main/busybox/busybox-1.16.0-wc.patch b/main/busybox/busybox-1.16.0-wc.patch new file mode 100644 index 0000000000..5116fe23f7 --- /dev/null +++ b/main/busybox/busybox-1.16.0-wc.patch @@ -0,0 +1,12 @@ +diff -urpN busybox-1.16.0/coreutils/wc.c busybox-1.16.0-wc/coreutils/wc.c +--- busybox-1.16.0/coreutils/wc.c 2010-03-08 22:49:32.000000000 +0100 ++++ busybox-1.16.0-wc/coreutils/wc.c 2010-03-08 22:51:29.310086707 +0100 +@@ -88,6 +88,8 @@ int wc_main(int argc UNUSED_PARAM, char + if (!argv[0]) { + *--argv = (char *) bb_msg_standard_input; + fname_fmt = "\n"; ++ } ++ if (!argv[1]) { /* zero or one filename? */ + if (!((print_type-1) & print_type)) /* exactly one option? */ + start_fmt = "%"COUNT_FMT; + } diff --git a/main/busybox/busyboxconfig b/main/busybox/busyboxconfig index 1ef0ad07c1..da18f038b4 100644 --- a/main/busybox/busyboxconfig +++ b/main/busybox/busyboxconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.16.0 -# Tue Jan 26 09:58:29 2010 +# Tue Mar 16 12:28:25 2010 # CONFIG_HAVE_DOT_CONFIG=y @@ -494,6 +494,7 @@ CONFIG_FEATURE_SUN_LABEL=y CONFIG_FEATURE_OSF_LABEL=y CONFIG_FEATURE_FDISK_ADVANCED=y CONFIG_FINDFS=y +CONFIG_FLOCK=y # CONFIG_FREERAMDISK is not set # CONFIG_FSCK_MINIX is not set # CONFIG_MKFS_EXT2 is not set @@ -733,7 +734,7 @@ CONFIG_NC_EXTRA=y CONFIG_NETSTAT=y CONFIG_FEATURE_NETSTAT_WIDE=y CONFIG_FEATURE_NETSTAT_PRG=y -# CONFIG_NSLOOKUP is not set +CONFIG_NSLOOKUP=y CONFIG_NTPD=y CONFIG_FEATURE_NTPD_SERVER=y CONFIG_PING=y diff --git a/main/busybox/flock-bb.patch b/main/busybox/flock-bb.patch new file mode 100644 index 0000000000..d97fbfcca2 --- /dev/null +++ b/main/busybox/flock-bb.patch @@ -0,0 +1,183 @@ +From: Timo Teras <timo.teras@iki.fi> +To: busybox@busybox.net +Subject: [PATCH] flock: new applet +Date: Tue, 16 Mar 2010 14:14:22 +0200 +Message-Id: <1268741663-8790-1-git-send-email-timo.teras@iki.fi> +X-Mailer: git-send-email 1.6.3.3 + +An utility to manage file locks from scripts. + +Signed-off-by: Timo Teras <timo.teras@iki.fi> +--- + include/applets.h | 1 + + include/usage.h | 11 ++++++ + util-linux/Config.in | 6 +++ + util-linux/Kbuild | 1 + + util-linux/flock.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 112 insertions(+), 0 deletions(-) + create mode 100644 util-linux/flock.c + +diff --git a/include/applets.h b/include/applets.h +index 2d784bd..83c1792 100644 +--- a/include/applets.h ++++ b/include/applets.h +@@ -161,6 +161,7 @@ IF_FLASH_ERASEALL(APPLET(flash_eraseall, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) + IF_FLASH_LOCK(APPLET_ODDNAME(flash_lock, flash_lock_unlock, _BB_DIR_USR_SBIN, _BB_SUID_DROP, flash_lock)) + IF_FLASH_UNLOCK(APPLET_ODDNAME(flash_unlock, flash_lock_unlock, _BB_DIR_USR_SBIN, _BB_SUID_DROP, flash_unlock)) + IF_FLASHCP(APPLET(flashcp, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) ++IF_FLOCK(APPLET(flock, _BB_DIR_USR_BIN, _BB_SUID_DROP)) + IF_FOLD(APPLET(fold, _BB_DIR_USR_BIN, _BB_SUID_DROP)) + IF_FREE(APPLET(free, _BB_DIR_USR_BIN, _BB_SUID_DROP)) + IF_FREERAMDISK(APPLET(freeramdisk, _BB_DIR_SBIN, _BB_SUID_DROP)) +diff --git a/include/usage.h b/include/usage.h +index f4259a1..cbf6bef 100644 +--- a/include/usage.h ++++ b/include/usage.h +@@ -1312,6 +1312,17 @@ + "\nOptions:" \ + "\n -v Verbose" \ + ++#define flock_trivial_usage \ ++ "[-sxun] [fd# | FILE] [-c] command" ++#define flock_full_usage "\n\n" \ ++ "Manage file locks from scripts\n" \ ++ "\nOptions:" \ ++ "\n -s Get a shared lock" \ ++ "\n -x Get an exclusive lock" \ ++ "\n -u Remove a lock (from fd#)" \ ++ "\n -n Fail rather than wait" \ ++ "\n -c Command to run" \ ++ + #define fold_trivial_usage \ + "[-bs] [-w WIDTH] [FILE]..." + #define fold_full_usage "\n\n" \ +diff --git a/util-linux/Config.in b/util-linux/Config.in +index f04511b..d0d8df3 100644 +--- a/util-linux/Config.in ++++ b/util-linux/Config.in +@@ -191,6 +191,12 @@ config FINDFS + WARNING: + With all submodules selected, it will add ~8k to busybox. + ++config FLOCK ++ bool "flock" ++ default y ++ help ++ Manage locks from shell scripts ++ + config FREERAMDISK + bool "freeramdisk" + default n +diff --git a/util-linux/Kbuild b/util-linux/Kbuild +index 72a2ef1..99e3efe 100644 +--- a/util-linux/Kbuild ++++ b/util-linux/Kbuild +@@ -13,6 +13,7 @@ lib-$(CONFIG_FDFLUSH) += freeramdisk.o + lib-$(CONFIG_FDFORMAT) += fdformat.o + lib-$(CONFIG_FDISK) += fdisk.o + lib-$(CONFIG_FINDFS) += findfs.o ++lib-$(CONFIG_FLOCK) += flock.o + lib-$(CONFIG_FREERAMDISK) += freeramdisk.o + lib-$(CONFIG_FSCK_MINIX) += fsck_minix.o + lib-$(CONFIG_GETOPT) += getopt.o +diff --git a/util-linux/flock.c b/util-linux/flock.c +new file mode 100644 +index 0000000..e9a22d5 +--- /dev/null ++++ b/util-linux/flock.c +@@ -0,0 +1,93 @@ ++/* ++ * Copyright (C) 2010 Timo Teras <timo.teras@iki.fi> ++ * ++ * This is free software, licensed under the GNU General Public License v2. ++ */ ++#include <sys/types.h> ++#include <sys/file.h> ++#include <sys/stat.h> ++#include <signal.h> ++#include <fcntl.h> ++#include <unistd.h> ++#include <stdio.h> ++#include "busybox.h" ++ ++int flock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; ++int flock_main(int argc, char **argv) ++{ ++ char *command = NULL; ++ int mode, opt, fd, status = 0; ++ enum { ++ OPT_s = (1 << 0), ++ OPT_x = (1 << 1), ++ OPT_u = (1 << 2), ++ OPT_n = (1 << 3), ++ OPT_c = (1 << 4), ++ }; ++ ++#if ENABLE_LONG_OPTS ++ static const char getopt_longopts[] ALIGN1 = ++ "shared\0" No_argument "s" ++ "exclusive\0" No_argument "x" ++ "unblock\0" No_argument "u" ++ "nonblock\0" No_argument "n" ++ "command\0" Required_argument "c" ++ ; ++ applet_long_options = getopt_longopts; ++#endif ++ ++ opt = getopt32(argv, "sxunc:", &command); ++ argv += optind; ++ argc -= optind; ++ ++ if (argv[0] == NULL) ++ bb_show_usage(); ++ ++ if (command != NULL || argc > 1) { ++ fd = open(argv[0], O_RDONLY|O_NOCTTY|O_CREAT, 0666); ++ if (fd < 0 && errno == EISDIR) ++ fd = open(argv[0], O_RDONLY|O_NOCTTY); ++ } else { ++ fd = atoi(argv[0]); ++ } ++ if (fd < 0) ++ bb_perror_msg_and_die("cannot open: '%s'", argv[0]); ++ ++ argv++; ++ if (command == NULL) ++ command = argv[0]; ++ ++ if (opt & OPT_u) ++ mode = LOCK_UN; ++ else if (opt & OPT_s) ++ mode = LOCK_SH; ++ else ++ mode = LOCK_EX; ++ ++ if (opt & OPT_n) ++ mode |= LOCK_NB; ++ ++ if (flock(fd, mode) && errno == EWOULDBLOCK) ++ return 1; ++ ++ if (command != NULL) { ++ pid_t pid; ++ ++ pid = fork(); ++ if (pid < 0) ++ bb_perror_msg_and_die("fork failed"); ++ if (pid == 0) { ++ execvp(command, argv); ++ exit(1); ++ } ++ waitpid(pid, &status, 0); ++ if (WIFEXITED(status)) ++ status = WEXITSTATUS(status); ++ else if (WIFSIGNALED(status)) ++ status = WTERMSIG(status) + 128; ++ else ++ status = 1; ++ } ++ ++ return status; ++} +-- +1.6.3.3 |