diff options
author | Ron Yorston <rmy@pobox.com> | 2017-07-29 09:55:08 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-07-29 09:55:08 +0100 |
commit | 86d60bb0ceb277e500a8daabd995bc713bbdadc9 (patch) | |
tree | 3e439f92d5a3fec2546d526579cc85e98f066e40 /util-linux | |
parent | b30c60a9786a1608211a96755996bd6c02951a27 (diff) | |
parent | 69be994de69d794f038f10a3e7a67519b2006581 (diff) | |
download | busybox-w32-86d60bb0ceb277e500a8daabd995bc713bbdadc9.tar.gz busybox-w32-86d60bb0ceb277e500a8daabd995bc713bbdadc9.tar.bz2 busybox-w32-86d60bb0ceb277e500a8daabd995bc713bbdadc9.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/blkid.c | 2 | ||||
-rw-r--r-- | util-linux/findfs.c | 2 | ||||
-rw-r--r-- | util-linux/getopt.c | 2 | ||||
-rw-r--r-- | util-linux/mdev.c | 2 | ||||
-rw-r--r-- | util-linux/mount.c | 10 | ||||
-rw-r--r-- | util-linux/rdate.c | 9 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 11 | ||||
-rw-r--r-- | util-linux/umount.c | 2 | ||||
-rw-r--r-- | util-linux/volume_id/get_devname.c | 1 | ||||
-rw-r--r-- | util-linux/volume_id/minix.c (renamed from util-linux/volume_id/unused_minix.c) | 59 | ||||
-rw-r--r-- | util-linux/volume_id/volume_id.c | 1 | ||||
-rw-r--r-- | util-linux/volume_id/volume_id_internal.h | 2 |
12 files changed, 57 insertions, 46 deletions
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 @@ | |||
13 | //config: select VOLUMEID | 13 | //config: select VOLUMEID |
14 | //config: help | 14 | //config: help |
15 | //config: Lists labels and UUIDs of all filesystems. | 15 | //config: Lists labels and UUIDs of all filesystems. |
16 | //config: WARNING: | ||
17 | //config: With all submodules selected, it will add ~8k to busybox. | ||
18 | //config: | 16 | //config: |
19 | //config:config FEATURE_BLKID_TYPE | 17 | //config:config FEATURE_BLKID_TYPE |
20 | //config: bool "Print filesystem type" | 18 | //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 @@ | |||
14 | //config: select VOLUMEID | 14 | //config: select VOLUMEID |
15 | //config: help | 15 | //config: help |
16 | //config: Prints the name of a filesystem with given label or UUID. | 16 | //config: Prints the name of a filesystem with given label or UUID. |
17 | //config: WARNING: | ||
18 | //config: With all submodules selected, it will add ~8k to busybox. | ||
19 | 17 | ||
20 | /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ | 18 | /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ |
21 | //applet:IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) | 19 | //applet:IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) |
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 @@ | |||
41 | //config: wisely leave this disabled. | 41 | //config: wisely leave this disabled. |
42 | //config: | 42 | //config: |
43 | //config:config FEATURE_GETOPT_LONG | 43 | //config:config FEATURE_GETOPT_LONG |
44 | //config: bool "Support option -l" | 44 | //config: bool "Support -l LONGOPTs" |
45 | //config: default y if LONG_OPTS | 45 | //config: default y if LONG_OPTS |
46 | //config: depends on GETOPT | 46 | //config: depends on GETOPT |
47 | //config: help | 47 | //config: help |
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 @@ | |||
56 | //config: For more information, please see docs/mdev.txt | 56 | //config: For more information, please see docs/mdev.txt |
57 | //config: | 57 | //config: |
58 | //config:config FEATURE_MDEV_LOAD_FIRMWARE | 58 | //config:config FEATURE_MDEV_LOAD_FIRMWARE |
59 | //config: bool "Support loading of firmwares" | 59 | //config: bool "Support loading of firmware" |
60 | //config: default y | 60 | //config: default y |
61 | //config: depends on MDEV | 61 | //config: depends on MDEV |
62 | //config: help | 62 | //config: help |
diff --git a/util-linux/mount.c b/util-linux/mount.c index 1a39da2db..4d5c2243a 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -26,18 +26,17 @@ | |||
26 | //config: tree. The 'mount' utility is used to graft a filesystem onto a | 26 | //config: tree. The 'mount' utility is used to graft a filesystem onto a |
27 | //config: particular part of the tree. A filesystem can either live on a block | 27 | //config: particular part of the tree. A filesystem can either live on a block |
28 | //config: device, or it can be accessible over the network, as is the case with | 28 | //config: device, or it can be accessible over the network, as is the case with |
29 | //config: NFS filesystems. Most people using BusyBox will also want to enable | 29 | //config: NFS filesystems. |
30 | //config: the 'mount' utility. | ||
31 | //config: | 30 | //config: |
32 | //config:config FEATURE_MOUNT_FAKE | 31 | //config:config FEATURE_MOUNT_FAKE |
33 | //config: bool "Support option -f" | 32 | //config: bool "Support -f (fake mount)" |
34 | //config: default y | 33 | //config: default y |
35 | //config: depends on MOUNT | 34 | //config: depends on MOUNT |
36 | //config: help | 35 | //config: help |
37 | //config: Enable support for faking a file system mount. | 36 | //config: Enable support for faking a file system mount. |
38 | //config: | 37 | //config: |
39 | //config:config FEATURE_MOUNT_VERBOSE | 38 | //config:config FEATURE_MOUNT_VERBOSE |
40 | //config: bool "Support option -v" | 39 | //config: bool "Support -v (verbose)" |
41 | //config: default y | 40 | //config: default y |
42 | //config: depends on MOUNT | 41 | //config: depends on MOUNT |
43 | //config: help | 42 | //config: help |
@@ -65,7 +64,6 @@ | |||
65 | //config: help | 64 | //config: help |
66 | //config: This allows for specifying a device by label or uuid, rather than by | 65 | //config: This allows for specifying a device by label or uuid, rather than by |
67 | //config: name. This feature utilizes the same functionality as blkid/findfs. | 66 | //config: name. This feature utilizes the same functionality as blkid/findfs. |
68 | //config: This also enables label or uuid support for swapon. | ||
69 | //config: | 67 | //config: |
70 | //config:config FEATURE_MOUNT_NFS | 68 | //config:config FEATURE_MOUNT_NFS |
71 | //config: bool "Support mounting NFS file systems on Linux < 2.6.23" | 69 | //config: bool "Support mounting NFS file systems on Linux < 2.6.23" |
@@ -100,7 +98,7 @@ | |||
100 | //config: | 98 | //config: |
101 | //config:config FEATURE_MOUNT_FSTAB | 99 | //config:config FEATURE_MOUNT_FSTAB |
102 | //config: depends on MOUNT | 100 | //config: depends on MOUNT |
103 | //config: bool "Support /etc/fstab and -a" | 101 | //config: bool "Support /etc/fstab and -a (mount all)" |
104 | //config: default y | 102 | //config: default y |
105 | //config: help | 103 | //config: help |
106 | //config: Support mount all and looking for files in /etc/fstab. | 104 | //config: Support mount all and looking for files in /etc/fstab. |
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) | |||
41 | uint32_t nett; | 41 | uint32_t nett; |
42 | int fd; | 42 | int fd; |
43 | 43 | ||
44 | /* Add a timeout for dead or inaccessible servers */ | 44 | /* Timeout for dead or inaccessible servers */ |
45 | alarm(10); | 45 | alarm(10); |
46 | signal(SIGALRM, socket_timeout); | 46 | signal(SIGALRM, socket_timeout); |
47 | 47 | ||
@@ -53,9 +53,8 @@ static time_t askremotedate(const char *host) | |||
53 | close(fd); | 53 | close(fd); |
54 | 54 | ||
55 | /* Convert from network byte order to local byte order. | 55 | /* Convert from network byte order to local byte order. |
56 | * RFC 868 time is the number of seconds | 56 | * RFC 868 time is seconds since 1900-01-01 00:00 GMT. |
57 | * since 00:00 (midnight) 1 January 1900 GMT | 57 | * RFC 868 time 2,208,988,800 corresponds to 1970-01-01 00:00 GMT. |
58 | * the RFC 868 time 2,208,988,800 corresponds to 00:00 1 Jan 1970 GMT | ||
59 | * Subtract the RFC 868 time to get Linux epoch. | 58 | * Subtract the RFC 868 time to get Linux epoch. |
60 | */ | 59 | */ |
61 | nett = ntohl(nett) - RFC_868_BIAS; | 60 | nett = ntohl(nett) - RFC_868_BIAS; |
@@ -66,7 +65,7 @@ static time_t askremotedate(const char *host) | |||
66 | * current time cur = 0x123ffffffff. | 65 | * current time cur = 0x123ffffffff. |
67 | * Assuming our time is not some 40 years off, | 66 | * Assuming our time is not some 40 years off, |
68 | * remote time must be 0x12400000001. | 67 | * remote time must be 0x12400000001. |
69 | * Need to adjust out time by (int32_t)(nett - cur). | 68 | * Need to adjust our time by (int32_t)(nett - cur). |
70 | */ | 69 | */ |
71 | time_t cur = time(NULL); | 70 | time_t cur = time(NULL); |
72 | int32_t adjust = (int32_t)(nett - (uint32_t)cur); | 71 | int32_t adjust = (int32_t)(nett - (uint32_t)cur); |
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 @@ | |||
37 | //config: bool "swapoff (4.3 kb)" | 37 | //config: bool "swapoff (4.3 kb)" |
38 | //config: default y | 38 | //config: default y |
39 | //config: select PLATFORM_LINUX | 39 | //config: select PLATFORM_LINUX |
40 | //config: | ||
41 | //config:config FEATURE_SWAPONOFF_LABEL | ||
42 | //config: bool "Support specifying devices by label or UUID" | ||
43 | //config: default y | ||
44 | //config: depends on SWAPON || SWAPOFF | ||
45 | //config: select VOLUMEID | ||
46 | //config: help | ||
47 | //config: This allows for specifying a device by label or uuid, rather than by | ||
48 | //config: name. This feature utilizes the same functionality as blkid/findfs. | ||
40 | 49 | ||
41 | // APPLET_ODDNAME:name main location suid_type help | 50 | // APPLET_ODDNAME:name main location suid_type help |
42 | //applet:IF_SWAPON( APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) | 51 | //applet:IF_SWAPON( APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) |
@@ -72,7 +81,7 @@ | |||
72 | # include <sys/swap.h> | 81 | # include <sys/swap.h> |
73 | #endif | 82 | #endif |
74 | 83 | ||
75 | #if ENABLE_FEATURE_MOUNT_LABEL | 84 | #if ENABLE_FEATURE_SWAPONOFF_LABEL |
76 | # include "volume_id.h" | 85 | # include "volume_id.h" |
77 | #else | 86 | #else |
78 | # define resolve_mount_spec(fsname) ((void)0) | 87 | # define resolve_mount_spec(fsname) ((void)0) |
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 @@ | |||
18 | //config: utility, you almost certainly also want to enable 'umount'. | 18 | //config: utility, you almost certainly also want to enable 'umount'. |
19 | //config: | 19 | //config: |
20 | //config:config FEATURE_UMOUNT_ALL | 20 | //config:config FEATURE_UMOUNT_ALL |
21 | //config: bool "Support option -a" | 21 | //config: bool "Support -a (unmount all)" |
22 | //config: default y | 22 | //config: default y |
23 | //config: depends on UMOUNT | 23 | //config: depends on UMOUNT |
24 | //config: help | 24 | //config: help |
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 @@ | |||
11 | //kbuild:lib-$(CONFIG_BLKID) += get_devname.o | 11 | //kbuild:lib-$(CONFIG_BLKID) += get_devname.o |
12 | //kbuild:lib-$(CONFIG_FINDFS) += get_devname.o | 12 | //kbuild:lib-$(CONFIG_FINDFS) += get_devname.o |
13 | //kbuild:lib-$(CONFIG_FEATURE_MOUNT_LABEL) += get_devname.o | 13 | //kbuild:lib-$(CONFIG_FEATURE_MOUNT_LABEL) += get_devname.o |
14 | //kbuild:lib-$(CONFIG_FEATURE_SWAPONOFF_LABEL) += get_devname.o | ||
14 | 15 | ||
15 | #include <sys/mount.h> /* BLKGETSIZE64 */ | 16 | #include <sys/mount.h> /* BLKGETSIZE64 */ |
16 | #if !defined(BLKGETSIZE64) | 17 | #if !defined(BLKGETSIZE64) |
diff --git a/util-linux/volume_id/unused_minix.c b/util-linux/volume_id/minix.c index 443dbc272..c934f9ead 100644 --- a/util-linux/volume_id/unused_minix.c +++ b/util-linux/volume_id/minix.c | |||
@@ -17,13 +17,12 @@ | |||
17 | * License along with this library; if not, write to the Free Software | 17 | * License along with this library; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | //config:config FEATURE_VOLUMEID_MINIX | ||
21 | //config: bool "minix filesystem" | ||
22 | //config: default y | ||
23 | //config: depends on VOLUMEID | ||
20 | 24 | ||
21 | //kbuild:### lib-$(CONFIG_FEATURE_VOLUMEID_MINIX) += minix.o | 25 | //kbuild:lib-$(CONFIG_FEATURE_VOLUMEID_MINIX) += minix.o |
22 | |||
23 | //config:### config FEATURE_VOLUMEID_MINIX | ||
24 | //config:### bool "minix filesystem" | ||
25 | //config:### default y | ||
26 | //config:### depends on VOLUMEID | ||
27 | 26 | ||
28 | #include "volume_id_internal.h" | 27 | #include "volume_id_internal.h" |
29 | 28 | ||
@@ -40,43 +39,53 @@ struct minix_super_block { | |||
40 | uint32_t s_zones; | 39 | uint32_t s_zones; |
41 | } PACKED; | 40 | } PACKED; |
42 | 41 | ||
43 | #define MINIX_SUPERBLOCK_OFFSET 0x400 | 42 | /* V3 minix super-block data on disk */ |
43 | struct minix3_super_block { | ||
44 | uint32_t s_ninodes; | ||
45 | uint16_t s_pad0; | ||
46 | uint16_t s_imap_blocks; | ||
47 | uint16_t s_zmap_blocks; | ||
48 | uint16_t s_firstdatazone; | ||
49 | uint16_t s_log_zone_size; | ||
50 | uint16_t s_pad1; | ||
51 | uint32_t s_max_size; | ||
52 | uint32_t s_zones; | ||
53 | uint16_t s_magic; | ||
54 | uint16_t s_pad2; | ||
55 | uint16_t s_blocksize; | ||
56 | uint8_t s_disk_version; | ||
57 | } PACKED; | ||
58 | |||
59 | #define MINIX_SUPERBLOCK_OFFSET 0x400 | ||
44 | 60 | ||
45 | int FAST_FUNC volume_id_probe_minix(struct volume_id *id, uint64_t off) | 61 | int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*, uint64_t off*/) |
46 | { | 62 | { |
63 | #define off ((uint64_t)0) | ||
47 | struct minix_super_block *ms; | 64 | struct minix_super_block *ms; |
65 | struct minix3_super_block *ms3; | ||
48 | 66 | ||
49 | dbg("probing at offset 0x%llx", (unsigned long long) off); | 67 | dbg("probing at offset 0x%llx", (unsigned long long) off); |
50 | 68 | ||
51 | ms = volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200); | 69 | ms = volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200); |
52 | if (ms == NULL) | 70 | if (ms == NULL) |
53 | return -1; | 71 | return -1; |
54 | 72 | if (ms->s_magic == cpu_to_le16(0x137F)) /* minix V1 fs, 14 char names */ | |
55 | if (ms->s_magic == cpu_to_le16(0x137f)) { | ||
56 | // id->type_version[0] = '1'; | ||
57 | goto found; | 73 | goto found; |
58 | } | 74 | if (ms->s_magic == cpu_to_le16(0x138F)) /* minix V1 fs, 30 char names */ |
59 | |||
60 | if (ms->s_magic == cpu_to_le16(0x1387)) { | ||
61 | // id->type_version[0] = '1'; | ||
62 | goto found; | 75 | goto found; |
63 | } | 76 | if (ms->s_magic == cpu_to_le16(0x2468)) /* minix V2 fs, 14 char names */ |
64 | 77 | goto found; | |
65 | if (ms->s_magic == cpu_to_le16(0x2468)) { | 78 | if (ms->s_magic == cpu_to_le16(0x2478)) /* minix V2 fs, 30 char names */ |
66 | // id->type_version[0] = '2'; | ||
67 | goto found; | 79 | goto found; |
68 | } | ||
69 | 80 | ||
70 | if (ms->s_magic == cpu_to_le16(0x2478)) { | 81 | ms3 = (void*)ms; |
71 | // id->type_version[0] = '2'; | 82 | if (ms3->s_magic == cpu_to_le16(0x4d5a)) /* minix V3 fs, 60 char names */ |
72 | goto found; | 83 | goto found; |
73 | } | ||
74 | 84 | ||
75 | return -1; | 85 | return -1; |
76 | 86 | ||
77 | found: | 87 | found: |
78 | // id->type_version[1] = '\0'; | ||
79 | // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); | 88 | // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); |
80 | // id->type = "minix"; | 89 | IF_FEATURE_BLKID_TYPE(id->type = "minix";) |
81 | return 0; | 90 | return 0; |
82 | } | 91 | } |
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 @@ | |||
42 | #define ENABLE_FEATURE_VOLUMEID_VIARAID 0 | 42 | #define ENABLE_FEATURE_VOLUMEID_VIARAID 0 |
43 | 43 | ||
44 | /* These filesystems also have no label or uuid: */ | 44 | /* These filesystems also have no label or uuid: */ |
45 | #define ENABLE_FEATURE_VOLUMEID_MINIX 0 | ||
46 | #define ENABLE_FEATURE_VOLUMEID_HPFS 0 | 45 | #define ENABLE_FEATURE_VOLUMEID_HPFS 0 |
47 | #define ENABLE_FEATURE_VOLUMEID_UFS 0 | 46 | #define ENABLE_FEATURE_VOLUMEID_UFS 0 |
48 | 47 | ||
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*/); | |||
193 | 193 | ||
194 | //int FAST_FUNC volume_id_probe_mac_partition_map(struct volume_id *id /*,uint64_t off*/); | 194 | //int FAST_FUNC volume_id_probe_mac_partition_map(struct volume_id *id /*,uint64_t off*/); |
195 | 195 | ||
196 | //int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*,uint64_t off*/); | 196 | int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*, uint64_t off*/); |
197 | 197 | ||
198 | //int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id /*,uint64_t off*/); | 198 | //int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id /*,uint64_t off*/); |
199 | 199 | ||