From 73c47f6c41c97fb452b4747088543f2c2166830a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 25 Jul 2017 14:22:08 +0200 Subject: volume_id: enable minix detection function old new delta volume_id_probe_minix - 87 +87 fs2 64 68 +4 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 1/0 up/down: 91/0) Total: 91 bytes Patch by wdlkmpx Signed-off-by: Denys Vlasenko --- util-linux/volume_id/minix.c | 91 +++++++++++++++++++++++++++++++ util-linux/volume_id/unused_minix.c | 82 ---------------------------- util-linux/volume_id/volume_id.c | 1 - util-linux/volume_id/volume_id_internal.h | 2 +- 4 files changed, 92 insertions(+), 84 deletions(-) create mode 100644 util-linux/volume_id/minix.c delete mode 100644 util-linux/volume_id/unused_minix.c (limited to 'util-linux') diff --git a/util-linux/volume_id/minix.c b/util-linux/volume_id/minix.c new file mode 100644 index 000000000..c934f9ead --- /dev/null +++ b/util-linux/volume_id/minix.c @@ -0,0 +1,91 @@ +/* + * volume_id - reads filesystem label and uuid + * + * Copyright (C) 2005 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +//config:config FEATURE_VOLUMEID_MINIX +//config: bool "minix filesystem" +//config: default y +//config: depends on VOLUMEID + +//kbuild:lib-$(CONFIG_FEATURE_VOLUMEID_MINIX) += minix.o + +#include "volume_id_internal.h" + +struct minix_super_block { + uint16_t s_ninodes; + uint16_t s_nzones; + uint16_t s_imap_blocks; + uint16_t s_zmap_blocks; + uint16_t s_firstdatazone; + uint16_t s_log_zone_size; + uint32_t s_max_size; + uint16_t s_magic; + uint16_t s_state; + uint32_t s_zones; +} PACKED; + +/* V3 minix super-block data on disk */ +struct minix3_super_block { + uint32_t s_ninodes; + uint16_t s_pad0; + uint16_t s_imap_blocks; + uint16_t s_zmap_blocks; + uint16_t s_firstdatazone; + uint16_t s_log_zone_size; + uint16_t s_pad1; + uint32_t s_max_size; + uint32_t s_zones; + uint16_t s_magic; + uint16_t s_pad2; + uint16_t s_blocksize; + uint8_t s_disk_version; +} PACKED; + +#define MINIX_SUPERBLOCK_OFFSET 0x400 + +int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*, uint64_t off*/) +{ +#define off ((uint64_t)0) + struct minix_super_block *ms; + struct minix3_super_block *ms3; + + dbg("probing at offset 0x%llx", (unsigned long long) off); + + ms = volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200); + if (ms == NULL) + return -1; + if (ms->s_magic == cpu_to_le16(0x137F)) /* minix V1 fs, 14 char names */ + goto found; + if (ms->s_magic == cpu_to_le16(0x138F)) /* minix V1 fs, 30 char names */ + goto found; + if (ms->s_magic == cpu_to_le16(0x2468)) /* minix V2 fs, 14 char names */ + goto found; + if (ms->s_magic == cpu_to_le16(0x2478)) /* minix V2 fs, 30 char names */ + goto found; + + ms3 = (void*)ms; + if (ms3->s_magic == cpu_to_le16(0x4d5a)) /* minix V3 fs, 60 char names */ + goto found; + + return -1; + + found: +// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); + IF_FEATURE_BLKID_TYPE(id->type = "minix";) + return 0; +} diff --git a/util-linux/volume_id/unused_minix.c b/util-linux/volume_id/unused_minix.c deleted file mode 100644 index 443dbc272..000000000 --- a/util-linux/volume_id/unused_minix.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -//kbuild:### lib-$(CONFIG_FEATURE_VOLUMEID_MINIX) += minix.o - -//config:### config FEATURE_VOLUMEID_MINIX -//config:### bool "minix filesystem" -//config:### default y -//config:### depends on VOLUMEID - -#include "volume_id_internal.h" - -struct minix_super_block { - uint16_t s_ninodes; - uint16_t s_nzones; - uint16_t s_imap_blocks; - uint16_t s_zmap_blocks; - uint16_t s_firstdatazone; - uint16_t s_log_zone_size; - uint32_t s_max_size; - uint16_t s_magic; - uint16_t s_state; - uint32_t s_zones; -} PACKED; - -#define MINIX_SUPERBLOCK_OFFSET 0x400 - -int FAST_FUNC volume_id_probe_minix(struct volume_id *id, uint64_t off) -{ - struct minix_super_block *ms; - - dbg("probing at offset 0x%llx", (unsigned long long) off); - - ms = volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200); - if (ms == NULL) - return -1; - - if (ms->s_magic == cpu_to_le16(0x137f)) { -// id->type_version[0] = '1'; - goto found; - } - - if (ms->s_magic == cpu_to_le16(0x1387)) { -// id->type_version[0] = '1'; - goto found; - } - - if (ms->s_magic == cpu_to_le16(0x2468)) { -// id->type_version[0] = '2'; - goto found; - } - - if (ms->s_magic == cpu_to_le16(0x2478)) { -// id->type_version[0] = '2'; - goto found; - } - - return -1; - - found: -// id->type_version[1] = '\0'; -// volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); -// id->type = "minix"; - return 0; -} diff --git a/util-linux/volume_id/volume_id.c b/util-linux/volume_id/volume_id.c index 5bb95994b..85315ced6 100644 --- a/util-linux/volume_id/volume_id.c +++ b/util-linux/volume_id/volume_id.c @@ -42,7 +42,6 @@ #define ENABLE_FEATURE_VOLUMEID_VIARAID 0 /* These filesystems also have no label or uuid: */ -#define ENABLE_FEATURE_VOLUMEID_MINIX 0 #define ENABLE_FEATURE_VOLUMEID_HPFS 0 #define ENABLE_FEATURE_VOLUMEID_UFS 0 diff --git a/util-linux/volume_id/volume_id_internal.h b/util-linux/volume_id/volume_id_internal.h index 759a832e6..0eaea9b34 100644 --- a/util-linux/volume_id/volume_id_internal.h +++ b/util-linux/volume_id/volume_id_internal.h @@ -193,7 +193,7 @@ int FAST_FUNC volume_id_probe_luks(struct volume_id *id /*,uint64_t off*/); //int FAST_FUNC volume_id_probe_mac_partition_map(struct volume_id *id /*,uint64_t off*/); -//int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*,uint64_t off*/); +int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*, uint64_t off*/); //int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id /*,uint64_t off*/); -- cgit v1.2.3-55-g6feb From 68b653b66b0db6b1554806650fb0bebd7af9ef3b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 27 Jul 2017 10:53:09 +0200 Subject: config: trim/improve item names and help texts, take 2 Signed-off-by: Denys Vlasenko --- editors/awk.c | 3 +- loginutils/login.c | 2 +- loginutils/passwd.c | 2 +- loginutils/vlock.c | 2 +- miscutils/crontab.c | 2 +- networking/ftpd.c | 13 ++++++-- networking/ifupdown.c | 4 +-- networking/ip.c | 18 +++++----- networking/telnetd.c | 2 +- networking/tftp.c | 16 ++++----- networking/udhcp/Config.src | 80 ++++++++++++++++++++++++--------------------- networking/udhcp/d6_dhcpc.c | 2 +- util-linux/blkid.c | 2 -- util-linux/findfs.c | 2 -- util-linux/mdev.c | 2 +- util-linux/mount.c | 3 +- 16 files changed, 81 insertions(+), 74 deletions(-) (limited to 'util-linux') diff --git a/editors/awk.c b/editors/awk.c index aa927db1a..cc17ad438 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -11,8 +11,7 @@ //config: bool "awk (22 kb)" //config: default y //config: help -//config: Awk is used as a pattern scanning and processing language. This is -//config: the BusyBox implementation of that programming language. +//config: Awk is used as a pattern scanning and processing language. //config: //config:config FEATURE_AWK_LIBM //config: bool "Enable math functions (requires libm)" diff --git a/loginutils/login.c b/loginutils/login.c index 39f703f07..381468d81 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -9,7 +9,7 @@ //config: help //config: login is used when signing onto a system. //config: -//config: Note that Busybox binary must be setuid root for this applet to +//config: Note that busybox binary must be setuid root for this applet to //config: work properly. //config: //config:config LOGIN_SESSION_AS_CHILD diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 03f8ad0a4..3e1ef9abf 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c @@ -12,7 +12,7 @@ //config: may change the password for any account. The administrator of a group //config: may change the password for the group. //config: -//config: Note that Busybox binary must be setuid root for this applet to +//config: Note that busybox binary must be setuid root for this applet to //config: work properly. //config: //config:config FEATURE_PASSWD_WEAK_CHECK diff --git a/loginutils/vlock.c b/loginutils/vlock.c index f22abd3aa..bf46d085c 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c @@ -21,7 +21,7 @@ //config: help //config: Build the "vlock" applet which allows you to lock (virtual) terminals. //config: -//config: Note that Busybox binary must be setuid root for this applet to +//config: Note that busybox binary must be setuid root for this applet to //config: work properly. //applet:/* Needs to be run by root or be suid root - needs to change uid and gid: */ diff --git a/miscutils/crontab.c b/miscutils/crontab.c index 23cb54887..804cb57f2 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c @@ -15,7 +15,7 @@ //config: help //config: Crontab manipulates the crontab for a particular user. Only //config: the superuser may specify a different user and/or crontab directory. -//config: Note that Busybox binary must be setuid root for this applet to +//config: Note that busybox binary must be setuid root for this applet to //config: work properly. /* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */ diff --git a/networking/ftpd.c b/networking/ftpd.c index aee00e1c3..c562c2886 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c @@ -18,11 +18,12 @@ //config: Simple FTP daemon. You have to run it via inetd. //config: //config:config FEATURE_FTPD_WRITE -//config: bool "Enable upload commands" +//config: bool "Enable -w (upload commands)" //config: default y //config: depends on FTPD //config: help -//config: Enable all kinds of FTP upload commands (-w option) +//config: Enable -w option. "ftpd -w" will accept upload commands +//config: such as STOR, STOU, APPE, DELE, MKD, RMD, rename commands. //config: //config:config FEATURE_FTPD_ACCEPT_BROKEN_LIST //config: bool "Enable workaround for RFC-violating clients" @@ -40,7 +41,13 @@ //config: default y //config: depends on FTPD //config: help -//config: Enable basic system login as seen in telnet etc. +//config: Require login, and change to logged in user's UID:GID before +//config: accessing any files. Option "-a USER" allows "anonymous" +//config: logins (treats them as if USER logged in). +//config: +//config: If this option is not selected, ftpd runs with the rights +//config: of the user it was started under, and does not require login. +//config: Take care to not launch it under root. //applet:IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) diff --git a/networking/ifupdown.c b/networking/ifupdown.c index f8c29ab00..c2cfe82ec 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -59,11 +59,11 @@ //config: than the default of using the older "ifconfig" and "route" utilities. //config: //config: If Y: you must install either the full-blown iproute2 package -//config: or enable "ip" applet in Busybox, or the "ifup" and "ifdown" applets +//config: or enable "ip" applet in busybox, or the "ifup" and "ifdown" applets //config: will not work. //config: //config: If N: you must install either the full-blown ifconfig and route -//config: utilities, or enable these applets in Busybox. +//config: utilities, or enable these applets in busybox. //config: //config:config FEATURE_IFUPDOWN_IPV4 //config: bool "Support IPv4" diff --git a/networking/ip.c b/networking/ip.c index cca7cbe12..8aaeef0db 100644 --- a/networking/ip.c +++ b/networking/ip.c @@ -14,8 +14,10 @@ //config: select PLATFORM_LINUX //config: help //config: The "ip" applet is a TCP/IP interface configuration and routing -//config: utility. You generally don't need "ip" to use busybox with -//config: TCP/IP. +//config: utility. +//config: Short forms (enabled below) are busybox-specific extensions. +//config: The standard "ip" utility does not provide them. If you are +//config: trying to be portable, it's better to use "ip CMD" forms. //config: //config:config IPADDR //config: bool "ipaddr (14 kb)" @@ -23,7 +25,7 @@ //config: select FEATURE_IP_ADDRESS //config: select PLATFORM_LINUX //config: help -//config: Support short form of ip addr: ipaddr +//config: Short form of "ip addr" //config: //config:config IPLINK //config: bool "iplink (16 kb)" @@ -31,7 +33,7 @@ //config: select FEATURE_IP_LINK //config: select PLATFORM_LINUX //config: help -//config: Support short form of ip link: iplink +//config: Short form of "ip link" //config: //config:config IPROUTE //config: bool "iproute (15 kb)" @@ -39,7 +41,7 @@ //config: select FEATURE_IP_ROUTE //config: select PLATFORM_LINUX //config: help -//config: Support short form of ip route: iproute +//config: Short form of "ip route" //config: //config:config IPTUNNEL //config: bool "iptunnel (9.6 kb)" @@ -47,7 +49,7 @@ //config: select FEATURE_IP_TUNNEL //config: select PLATFORM_LINUX //config: help -//config: Support short form of ip tunnel: iptunnel +//config: Short form of "ip tunnel" //config: //config:config IPRULE //config: bool "iprule (10 kb)" @@ -55,7 +57,7 @@ //config: select FEATURE_IP_RULE //config: select PLATFORM_LINUX //config: help -//config: Support short form of ip rule: iprule +//config: Short form of "ip rule" //config: //config:config IPNEIGH //config: bool "ipneigh (8.3 kb)" @@ -63,7 +65,7 @@ //config: select FEATURE_IP_NEIGH //config: select PLATFORM_LINUX //config: help -//config: Support short form of ip neigh: ipneigh +//config: Short form of "ip neigh" //config: //config:config FEATURE_IP_ADDRESS //config: bool "ip address" diff --git a/networking/telnetd.c b/networking/telnetd.c index 6e12de07a..16c572e8d 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -54,7 +54,7 @@ //config: //config: You need to be sure that busybox has LOGIN and //config: FEATURE_SUID enabled. And finally, you should make -//config: certain that Busybox has been installed setuid root: +//config: certain that busybox has been installed setuid root: //config: //config: chown root.root /bin/busybox //config: chmod 4755 /bin/busybox diff --git a/networking/tftp.c b/networking/tftp.c index 947e65169..5baa80448 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -22,15 +22,20 @@ //config: bool "tftp (12 kb)" //config: default y //config: help -//config: This enables the Trivial File Transfer Protocol client program. TFTP -//config: is usually used for simple, small transfers such as a root image +//config: Trivial File Transfer Protocol client. TFTP is usually used +//config: for simple, small transfers such as a root image //config: for a network-enabled bootloader. //config: +//config:config FEATURE_TFTP_PROGRESS_BAR +//config: bool "Enable progress bar" +//config: default y +//config: depends on TFTP +//config: //config:config TFTPD //config: bool "tftpd (10 kb)" //config: default y //config: help -//config: This enables the Trivial File Transfer Protocol server program. +//config: Trivial File Transfer Protocol server. //config: It expects that stdin is a datagram socket and a packet //config: is already pending on it. It will exit after one transfer. //config: In other words: it should be run from inetd in nowait mode, @@ -68,11 +73,6 @@ //config: Allow tftp to specify block size, and tftpd to understand //config: "blksize" and "tsize" options. //config: -//config:config FEATURE_TFTP_PROGRESS_BAR -//config: bool "Enable progress bar" -//config: default y -//config: depends on TFTP && FEATURE_TFTP_BLOCKSIZE -//config: //config:config TFTP_DEBUG //config: bool "Enable debug" //config: default n diff --git a/networking/udhcp/Config.src b/networking/udhcp/Config.src index af2fe1835..8ab8d30ce 100644 --- a/networking/udhcp/Config.src +++ b/networking/udhcp/Config.src @@ -3,26 +3,14 @@ # see scripts/kbuild/config-language.txt. # -INSERT - config UDHCPD - bool "udhcpd (DHCP server)" + bool "udhcpd" default y select PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. -config FEATURE_UDHCPD_WRITE_LEASES_EARLY - bool "Rewrite the lease file at every new acknowledge" - default y - depends on UDHCPD - help - If selected, udhcpd will write a new file with leases every - time a new lease has been accepted, thus eliminating the need - to send SIGUSR1 for the initial writing or updating. Any timed - rewriting remains undisturbed. - config FEATURE_UDHCPD_BASE_IP_ON_MAC bool "Select IP address based on client MAC" default n @@ -37,6 +25,16 @@ config FEATURE_UDHCPD_BASE_IP_ON_MAC for the same client to (almost always) contain the same IP address. +config FEATURE_UDHCPD_WRITE_LEASES_EARLY + bool "Rewrite lease file at every new acknowledge" + default y + depends on UDHCPD + help + If selected, udhcpd will write a new file with leases every + time a new lease has been accepted, thus eliminating the need + to send SIGUSR1 for the initial writing or updating. Any timed + rewriting remains undisturbed. + config DHCPD_LEASES_FILE string "Absolute path to lease file" default "/var/lib/misc/udhcpd.leases" @@ -57,12 +55,12 @@ config DHCPRELAY bool "dhcprelay (5.8 kb)" default y help - dhcprelay listens for dhcp requests on one or more interfaces - and forwards these requests to a different interface or dhcp + dhcprelay listens for DHCP requests on one or more interfaces + and forwards these requests to a different interface or DHCP server. config UDHCPC - bool "udhcpc (DHCP client)" + bool "udhcpc" default y select PLATFORM_LINUX help @@ -102,19 +100,25 @@ config UDHCPC_DEFAULT_SCRIPT examples/udhcp for a working example. Normally it is safe to leave this untouched. +# udhcpc6 config is inserted here: +INSERT + +comment "Common options for DHCP applets" + depends on UDHCPD || UDHCPC || UDHCPC6 || DHCPRELAY + config FEATURE_UDHCP_PORT bool "Enable '-P port' option for udhcpd and udhcpc" default n - depends on UDHCPD || UDHCPC + depends on UDHCPD || UDHCPC || UDHCPC6 help At the cost of ~300 bytes, enables -P port option. This feature is typically not needed. config UDHCP_DEBUG - int "Maximum verbosity level for udhcp applets (0..9)" + int "Maximum verbosity level (0..9)" default 9 range 0 9 - depends on UDHCPD || UDHCPC || DHCPRELAY + depends on UDHCPD || UDHCPC || UDHCPC6 || DHCPRELAY help Verbosity can be increased with multiple -v options. This option controls how high it can be cranked up. @@ -122,23 +126,6 @@ config UDHCP_DEBUG Bigger values result in bigger code. Levels above 1 are very verbose and useful for debugging only. -config FEATURE_UDHCP_RFC3397 - bool "Support RFC3397 domain search (experimental)" - default y - depends on UDHCPD || UDHCPC - help - If selected, both client and server will support passing of domain - search lists via option 119, specified in RFC 3397, - and SIP servers option 120, specified in RFC 3361. - -config FEATURE_UDHCP_8021Q - bool "Support 802.1Q VLAN parameters" - default y - depends on UDHCPD || UDHCPC - help - If selected, both client and server will support passing of VLAN - ID and priority via options 132 and 133 as per 802.1Q. - config UDHCPC_SLACK_FOR_BUGGY_SERVERS int "DHCP options slack buffer size" default 80 @@ -149,10 +136,10 @@ config UDHCPC_SLACK_FOR_BUGGY_SERVERS field larger than we expect (which might also be considered a buffer overflow attempt). These packets are normally discarded. If circumstances beyond your control force you to support such - servers, this may help. The upper limit (924) makes dhcpc accept + servers, this may help. The upper limit (924) makes udhcpc accept even 1500 byte packets (maximum-sized ethernet packets). - This option does not make dhcp[cd] emit non-standard + This option does not make udhcp[cd] emit non-standard sized packets. Known buggy DHCP servers: @@ -161,3 +148,20 @@ config UDHCPC_SLACK_FOR_BUGGY_SERVERS maximum size of entire IP packet, and sends packets which are 28 bytes too large. Seednet (ISP) VDSL: sends packets 2 bytes too large. + +config FEATURE_UDHCP_RFC3397 + bool "Support RFC 3397 domain search options" + default y + depends on UDHCPD || UDHCPC + help + If selected, both client and server will support passing of domain + search lists via option 119, specified in RFC 3397, + and SIP servers option 120, specified in RFC 3361. + +config FEATURE_UDHCP_8021Q + bool "Support 802.1Q VLAN parameters options" + default y + depends on UDHCPD || UDHCPC + help + If selected, both client and server will support passing of VLAN + ID and priority via options 132 and 133 as per 802.1Q. diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 5ebd05d01..43081efca 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c @@ -10,7 +10,7 @@ */ //config:config UDHCPC6 -//config: bool "udhcpc6 (DHCPv6 client, EXPERIMENTAL)" +//config: bool "udhcpc6" //config: default n # not yet ready //config: depends on FEATURE_IPV6 //config: help diff --git a/util-linux/blkid.c b/util-linux/blkid.c index f353cf248..0bd701aae 100644 --- a/util-linux/blkid.c +++ b/util-linux/blkid.c @@ -13,8 +13,6 @@ //config: select VOLUMEID //config: help //config: Lists labels and UUIDs of all filesystems. -//config: WARNING: -//config: With all submodules selected, it will add ~8k to busybox. //config: //config:config FEATURE_BLKID_TYPE //config: bool "Print filesystem type" diff --git a/util-linux/findfs.c b/util-linux/findfs.c index 359da581f..1102eeff5 100644 --- a/util-linux/findfs.c +++ b/util-linux/findfs.c @@ -14,8 +14,6 @@ //config: select VOLUMEID //config: help //config: Prints the name of a filesystem with given label or UUID. -//config: WARNING: -//config: With all submodules selected, it will add ~8k to busybox. /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ //applet:IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 23b6f8285..8acc4d21d 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c @@ -56,7 +56,7 @@ //config: For more information, please see docs/mdev.txt //config: //config:config FEATURE_MDEV_LOAD_FIRMWARE -//config: bool "Support loading of firmwares" +//config: bool "Support loading of firmware" //config: default y //config: depends on MDEV //config: help diff --git a/util-linux/mount.c b/util-linux/mount.c index 1a39da2db..823b7c13b 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -26,8 +26,7 @@ //config: tree. The 'mount' utility is used to graft a filesystem onto a //config: particular part of the tree. A filesystem can either live on a block //config: device, or it can be accessible over the network, as is the case with -//config: NFS filesystems. Most people using BusyBox will also want to enable -//config: the 'mount' utility. +//config: NFS filesystems. //config: //config:config FEATURE_MOUNT_FAKE //config: bool "Support option -f" -- cgit v1.2.3-55-g6feb From 8cae43c5d732e86b8a668013b957fdb6363c8388 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 27 Jul 2017 10:58:08 +0200 Subject: swapon: do not use FEATURE_MOUNT_LABEL, have your own FEATURE_SWAPONOFF_LABEL Signed-off-by: Denys Vlasenko --- util-linux/mount.c | 1 - util-linux/swaponoff.c | 11 ++++++++++- util-linux/volume_id/get_devname.c | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'util-linux') diff --git a/util-linux/mount.c b/util-linux/mount.c index 823b7c13b..5f030607c 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -64,7 +64,6 @@ //config: help //config: This allows for specifying a device by label or uuid, rather than by //config: name. This feature utilizes the same functionality as blkid/findfs. -//config: This also enables label or uuid support for swapon. //config: //config:config FEATURE_MOUNT_NFS //config: bool "Support mounting NFS file systems on Linux < 2.6.23" diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index bda0687d6..f432ce180 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -37,6 +37,15 @@ //config: bool "swapoff (4.3 kb)" //config: default y //config: select PLATFORM_LINUX +//config: +//config:config FEATURE_SWAPONOFF_LABEL +//config: bool "Support specifying devices by label or UUID" +//config: default y +//config: depends on SWAPON || SWAPOFF +//config: select VOLUMEID +//config: help +//config: This allows for specifying a device by label or uuid, rather than by +//config: name. This feature utilizes the same functionality as blkid/findfs. // APPLET_ODDNAME:name main location suid_type help //applet:IF_SWAPON( APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) @@ -72,7 +81,7 @@ # include #endif -#if ENABLE_FEATURE_MOUNT_LABEL +#if ENABLE_FEATURE_SWAPONOFF_LABEL # include "volume_id.h" #else # define resolve_mount_spec(fsname) ((void)0) diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c index b64d28ceb..34f5d119f 100644 --- a/util-linux/volume_id/get_devname.c +++ b/util-linux/volume_id/get_devname.c @@ -11,6 +11,7 @@ //kbuild:lib-$(CONFIG_BLKID) += get_devname.o //kbuild:lib-$(CONFIG_FINDFS) += get_devname.o //kbuild:lib-$(CONFIG_FEATURE_MOUNT_LABEL) += get_devname.o +//kbuild:lib-$(CONFIG_FEATURE_SWAPONOFF_LABEL) += get_devname.o #include /* BLKGETSIZE64 */ #if !defined(BLKGETSIZE64) -- cgit v1.2.3-55-g6feb From e9a5a6985ca7f484df60df1f9bdc8b62eac88f2e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 27 Jul 2017 14:31:59 +0200 Subject: rdate: tweak comments, no code changes Signed-off-by: Denys Vlasenko --- util-linux/rdate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'util-linux') diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 66b877e24..14ce591e9 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -41,7 +41,7 @@ static time_t askremotedate(const char *host) uint32_t nett; int fd; - /* Add a timeout for dead or inaccessible servers */ + /* Timeout for dead or inaccessible servers */ alarm(10); signal(SIGALRM, socket_timeout); @@ -53,9 +53,8 @@ static time_t askremotedate(const char *host) close(fd); /* Convert from network byte order to local byte order. - * RFC 868 time is the number of seconds - * since 00:00 (midnight) 1 January 1900 GMT - * the RFC 868 time 2,208,988,800 corresponds to 00:00 1 Jan 1970 GMT + * RFC 868 time is seconds since 1900-01-01 00:00 GMT. + * RFC 868 time 2,208,988,800 corresponds to 1970-01-01 00:00 GMT. * Subtract the RFC 868 time to get Linux epoch. */ nett = ntohl(nett) - RFC_868_BIAS; @@ -66,7 +65,7 @@ static time_t askremotedate(const char *host) * current time cur = 0x123ffffffff. * Assuming our time is not some 40 years off, * remote time must be 0x12400000001. - * Need to adjust out time by (int32_t)(nett - cur). + * Need to adjust our time by (int32_t)(nett - cur). */ time_t cur = time(NULL); int32_t adjust = (int32_t)(nett - (uint32_t)cur); -- cgit v1.2.3-55-g6feb From 5b3cbe3a535db27302d979bddefa28ca492647e9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 27 Jul 2017 14:45:25 +0200 Subject: config: more tweaking of help texts Signed-off-by: Denys Vlasenko --- miscutils/crond.c | 2 +- util-linux/getopt.c | 2 +- util-linux/mount.c | 6 +++--- util-linux/umount.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'util-linux') diff --git a/miscutils/crond.c b/miscutils/crond.c index 5ae0ff084..48e429976 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -22,7 +22,7 @@ //config: 40 4 * * * /etc/cron/daily > /dev/null 2>&1 //config: //config:config FEATURE_CROND_D -//config: bool "Support option -d to redirect output to stderr" +//config: bool "Support -d (redirect output to stderr)" //config: depends on CROND //config: default y //config: help diff --git a/util-linux/getopt.c b/util-linux/getopt.c index cd5679cff..cf1bc592f 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -41,7 +41,7 @@ //config: wisely leave this disabled. //config: //config:config FEATURE_GETOPT_LONG -//config: bool "Support option -l" +//config: bool "Support -l LONGOPTs" //config: default y if LONG_OPTS //config: depends on GETOPT //config: help diff --git a/util-linux/mount.c b/util-linux/mount.c index 5f030607c..4d5c2243a 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -29,14 +29,14 @@ //config: NFS filesystems. //config: //config:config FEATURE_MOUNT_FAKE -//config: bool "Support option -f" +//config: bool "Support -f (fake mount)" //config: default y //config: depends on MOUNT //config: help //config: Enable support for faking a file system mount. //config: //config:config FEATURE_MOUNT_VERBOSE -//config: bool "Support option -v" +//config: bool "Support -v (verbose)" //config: default y //config: depends on MOUNT //config: help @@ -98,7 +98,7 @@ //config: //config:config FEATURE_MOUNT_FSTAB //config: depends on MOUNT -//config: bool "Support /etc/fstab and -a" +//config: bool "Support /etc/fstab and -a (mount all)" //config: default y //config: help //config: Support mount all and looking for files in /etc/fstab. diff --git a/util-linux/umount.c b/util-linux/umount.c index 31bf671c1..122c0f579 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -18,7 +18,7 @@ //config: utility, you almost certainly also want to enable 'umount'. //config: //config:config FEATURE_UMOUNT_ALL -//config: bool "Support option -a" +//config: bool "Support -a (unmount all)" //config: default y //config: depends on UMOUNT //config: help -- cgit v1.2.3-55-g6feb