* [PATCH 3/6] sfdisk: previously undocumented options to usage
From: Sami Kerola @ 2011-06-06 19:07 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
In-Reply-To: <1307387239-9022-1-git-send-email-kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
fdisk/sfdisk.c | 71 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 50 insertions(+), 21 deletions(-)
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index 1b35f66..d4dbcca 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -2319,26 +2319,43 @@ static void usage(FILE * out)
fprintf(out, _("\nOptions:\n"
" -s, --show-size list size of a partition\n"
" -c, --id change or print partition Id\n"
+ " --change-id change Id\n"
+ " --print-id print Id\n"
" -l, --list list partitions of each device\n"
" -d, --dump idem, but in a format suitable for later input\n"
" -i, --increment number cylinders etc. from 1 instead of from 0\n"
" -u, --unit=[SBCM] units in sectors, blocks, cylinders or MB\n"
+ " -1, --one-only reserved option that does nothing currently\n"
" -T, --list-types list the known partition types\n"
" -D, --DOS for DOS-compatibility: waste a little space\n"
+ " -E, --DOS-extended DOS extended partition compatibility\n"
" -R, --re-read make kernel reread partition table\n"
" -N=NUM change only the partition with number NUM\n"
" -n do not actually write to disk\n"
" -O FILE save the sectors that will be overwritten to file\n"
" -I FILE restore sectors from file\n"
+ " -V, --verify check that listed partition is reasonable\n"
" -v, --version print version\n"
" -h, --help print this message\n"));
fprintf(out, _("\nDangerous options:\n"
" -f, --force disable all consistency checking\n"
" -g, --show-geometry print the kernel's idea of the geometry\n"
+ " -A, --activate[=device] activate bootable flag\n"
" -G, --show-pt-geometry print geometry guessed from the partition table\n"
+ " -U, --unhide[=device] set partition unhidden\n"
+ " --no-reread skip partition re-read at boot\n"
" -x, --show-extended also list extended partitions on output\n"
" or expect descriptors for them on input\n"
+ " --leave-last do not allocate the last cylinder\n"
+ " --IBM same as --leave-last\n"
+ " --in-order partitions are in order\n"
+ " --not-in-order partitions are not in order\n"
+ " --inside-order all logicals inside outermost extended\n"
+ " --not-inside-order not all logicals inside outermost extended\n"
+ " --nested every partition is disjoint from all others\n"
+ " --chained like nested, but extended partitions may lie outside\n"
+ " --onesector partitions are mutually disjoint\n"
" -L, --Linux do not complain about things irrelevant for Linux\n"
" -q, --quiet suppress warning messages\n"
"\n Override the detected geometry using:\n"
@@ -2369,6 +2386,18 @@ static const char short_opts[] = "cdfghilnqsu:vx1A::C:DGH:I:LN:O:RS:TU::V";
#define PRINT_ID 0400
#define CHANGE_ID 01000
+enum {
+ OPT_NO_REREAD = CHAR_MAX + 1,
+ OPT_LEAVE_LAST,
+ OPT_IN_ORDER,
+ OPT_NOT_IN_ORDER,
+ OPT_INSIDE_OUTER,
+ OPT_NOT_INSIDE_OUTER,
+ OPT_NESTED,
+ OPT_CHAINED,
+ OPT_ONESECTOR
+};
+
static const struct option long_opts[] = {
{ "change-id", no_argument, NULL, 'c' + CHANGE_ID },
{ "print-id", no_argument, NULL, 'c' + PRINT_ID },
@@ -2396,17 +2425,17 @@ static const struct option long_opts[] = {
{ "re-read", no_argument, NULL, 'R' },
{ "list-types", no_argument, NULL, 'T' },
{ "unhide", optional_argument, NULL, 'U' },
- { "no-reread", no_argument, NULL, 160 },
- { "IBM", no_argument, NULL, 161 },
- { "leave-last", no_argument, NULL, 161 },
-/* undocumented flags - not all completely implemented */
- { "in-order", no_argument, NULL, 128 },
- { "not-in-order", no_argument, NULL, 129 },
- { "inside-outer", no_argument, NULL, 130 },
- { "not-inside-outer", no_argument, NULL, 131 },
- { "nested", no_argument, NULL, 132 },
- { "chained", no_argument, NULL, 133 },
- { "onesector", no_argument, NULL, 134 },
+ { "no-reread", no_argument, NULL, OPT_NO_REREAD },
+ { "IBM", no_argument, NULL, OPT_LEAVE_LAST },
+ { "leave-last", no_argument, NULL, OPT_LEAVE_LAST },
+/* dangerous flags - not all completely implemented */
+ { "in-order", no_argument, NULL, OPT_IN_ORDER },
+ { "not-in-order", no_argument, NULL, OPT_NOT_IN_ORDER },
+ { "inside-outer", no_argument, NULL, OPT_INSIDE_OUTER },
+ { "not-inside-outer", no_argument, NULL, OPT_NOT_INSIDE_OUTER },
+ { "nested", no_argument, NULL, OPT_NESTED },
+ { "chained", no_argument, NULL, OPT_CHAINED },
+ { "onesector", no_argument, NULL, OPT_ONESECTOR },
{ NULL, 0, NULL, 0 }
};
@@ -2598,26 +2627,26 @@ main(int argc, char **argv) {
default:
usage(stderr); break;
- /* undocumented flags */
- case 128:
+ /* dangerous flags */
+ case OPT_IN_ORDER:
partitions_in_order = 1; break;
- case 129:
+ case OPT_NOT_IN_ORDER:
partitions_in_order = 0; break;
- case 130:
+ case OPT_INSIDE_OUTER:
all_logicals_inside_outermost_extended = 1; break;
- case 131:
+ case OPT_NOT_INSIDE_OUTER:
all_logicals_inside_outermost_extended = 0; break;
- case 132:
+ case OPT_NESTED:
boxes = NESTED; break;
- case 133:
+ case OPT_CHAINED:
boxes = CHAINED; break;
- case 134:
+ case OPT_ONESECTOR:
boxes = ONESECTOR; break;
/* more flags */
- case 160:
+ case OPT_NO_REREAD:
no_reread = 1; break;
- case 161:
+ case OPT_LEAVE_LAST:
leave_last = 1; break;
}
}
--
1.7.5.2
^ permalink raw reply related
* [PATCH 4/6] docs: sfdisk manual update
From: Sami Kerola @ 2011-06-06 19:07 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
In-Reply-To: <1307387239-9022-1-git-send-email-kerolasa@iki.fi>
Add to manual page previously unmentioned options and few missing
long options.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
fdisk/sfdisk.8 | 53 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 42 insertions(+), 11 deletions(-)
diff --git a/fdisk/sfdisk.8 b/fdisk/sfdisk.8
index f6e98c1..c3f06b3 100644
--- a/fdisk/sfdisk.8
+++ b/fdisk/sfdisk.8
@@ -165,7 +165,7 @@ Print version number of
.B sfdisk
and exit immediately.
.TP
-.BR \-? " or " \-\-help
+.BR \-h " or " \-\-help
Print a usage message and exit immediately.
.TP
.BR \-T " or " \-\-list\-types
@@ -184,7 +184,7 @@ the partition table.
.BR \-l " or " \-\-list
List the partitions of a device.
.TP
-.BR \-d
+.BR \-d " or " \-\-dump
Dump the partitions of a device in a format useful as input
to sfdisk. For example,
.br
@@ -218,7 +218,7 @@ and change nothing else. (Probably this fifth partition
is called /dev/hdb5, but you are free to call it something else,
like `/my_equipment/disks/2/5' or so).
.TP
-.BI \-A " number"
+.BI \-A " or " \-\-activate " number"
Make the indicated partition(s) active, and all others inactive.
.TP
.BI \-c "\fR or " \-\-id " number [Id]"
@@ -238,22 +238,22 @@ For example:
.fi
first reports that /dev/hdb5 has Id 6, and then changes that into 83.
.TP
-.BR \-uS " or " \-uB " or " \-uC " or " \-uM
-Accept or report in units of sectors (blocks, cylinders, megabytes,
-respectively). The default is cylinders, at least when the geometry
-is known.
+.BR \-u " or " \-\-unit " SBCM"
+Accept as input, or when reporting show, in units of Sectors
+(Blocks, Cylinders, Megabytes, respectively). The default is
+cylinders, at least when the geometry is known.
.TP
.BR \-x " or " \-\-show\-extended
Also list non-primary extended partitions on output,
and expect descriptors for them on input.
.TP
-.BI \-C " cylinders"
+.BI \-C " or " \-\-cylinders " cylinders"
Specify the number of cylinders, possibly overriding what the kernel thinks.
.TP
-.BI \-H " heads"
+.BI \-H " or " \-\-heads " heads"
Specify the number of heads, possibly overriding what the kernel thinks.
.TP
-.BI \-S " sectors"
+.BI \-S " or " \-\-sectors " sectors"
Specify the number of sectors, possibly overriding what the kernel thinks.
.TP
.BR \-f " or " \-\-force
@@ -301,7 +301,7 @@ Sometimes the last cylinder contains a bad sector table.
.B \-n
Go through all the motions, but do not actually write to disk.
.TP
-.B \-R
+.B \-R " or " \-\-re-read
Only execute the BLKRRPART ioctl (to make the kernel re-read
the partition table). This can be useful for checking in advance
that the final BLKRRPART will be successful, and also when you
@@ -316,6 +316,33 @@ is not mounted, or in use as a swap device, and refuses to continue
if it is. This option suppresses the test. (On the other hand, the \-f
option would force sfdisk to continue even when this test fails.)
.TP
+.B \-\-in\-order
+Caution, see warning section. To be documented.
+.TP
+.B \-\-not\-in\-order
+Caution, see warning section. To be documented.
+.TP
+.B \-\-inside\-order
+Caution, see warning section. Chaining order.
+.TP
+.B \-\-not\-inside\-order
+Caution, see warning section. Chaining order.
+.TP
+.B \-\-nested
+Caution, see warning section. Every partition is contained in the
+surrounding partitions and is disjoint from all others.
+.TP
+.B \-\-chained
+Caution, see warning section. Every data partition is contained in
+the surrounding partitions and disjoint from all others, but
+extended partitions may lie outside (insofar as allowed by
+all_logicals_inside_outermost_extended).
+.TP
+.B \-\-onesector
+Caution, see warning section. All data partitions are mutually
+disjoint; extended partitions each use one sector only (except
+perhaps for the outermost one).
+.TP
.BI \-O " file"
Just before writing the new partition, output the sectors
that are going to be overwritten to
@@ -479,7 +506,11 @@ and terminate with end-of-file (^D).
.B sfdisk
will assume that your input line represents the first of four,
that the second one is extended, and the 3rd and 4th are empty.)
+.SH "CAUTION WARNIGNS"
+The options marked with caution in the manual page are dangerous.
+For example all functionality is not completely implemented,
+which can be a reason for unexpected results.
.SH "DOS 6.x WARNING"
The DOS 6.x FORMAT command looks for some information in the first
--
1.7.5.2
^ permalink raw reply related
* [PATCH 5/6] sfdisk: fix implicit overflow
From: Sami Kerola @ 2011-06-06 19:07 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
In-Reply-To: <1307387239-9022-1-git-send-email-kerolasa@iki.fi>
sfdisk.c:1650:6: warning: overflow in implicit constant conversion [-Woverflow]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
fdisk/sfdisk.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index d4dbcca..afecb93 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -1647,7 +1647,7 @@ write_partitions(char *dev, int fd, struct disk_desc *z) {
if (p->ptype == DOS_TYPE) {
copy_from_part(&(p->p), s->data + p->offset);
s->data[510] = 0x55;
- s->data[511] = 0xaa;
+ s->data[511] = (unsigned char) 0xaa;
}
}
if (save_sector_file) {
--
1.7.5.2
^ permalink raw reply related
* [PATCH 6/6] sfdisk: fix for data type mismatches
From: Sami Kerola @ 2011-06-06 19:07 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
In-Reply-To: <1307387239-9022-1-git-send-email-kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
fdisk/sfdisk.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index afecb93..d761032 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -1409,7 +1409,7 @@ extended_partition(char *dev, int fd, struct part_desc *ep, struct disk_desc *z)
cp = s->data + 0x1be;
- if (pno+4 >= ARRAY_SIZE(z->partitions)) {
+ if ((unsigned long) pno+4 >= ARRAY_SIZE(z->partitions)) {
do_warn(_("too many partitions - ignoring those past nr (%d)\n"),
pno-1);
break;
@@ -1486,7 +1486,7 @@ bsd_partition(char *dev, int fd, struct part_desc *ep, struct disk_desc *z) {
bp = bp0 = &l->d_partitions[0];
while (bp - bp0 < BSD_MAXPARTITIONS && bp - bp0 < l->d_npartitions) {
- if (pno+1 >= ARRAY_SIZE(z->partitions)) {
+ if ((unsigned long) pno+1 >= ARRAY_SIZE(z->partitions)) {
do_warn(_("too many partitions - ignoring those "
"past nr (%d)\n"), pno-1);
break;
@@ -1762,7 +1762,7 @@ read_stdin(char **fields, char *line, int fieldssize, int linesize) {
ip++;
if (*ip == 0)
return fno;
- for(d = dumpflds; d-dumpflds < ARRAY_SIZE(dumpflds); d++) {
+ for(d = dumpflds; d-dumpflds < (long) ARRAY_SIZE(dumpflds); d++) {
if (!strncmp(ip, d->fldname, strlen(d->fldname))) {
ip += strlen(d->fldname);
while(isspace(*ip))
@@ -1957,7 +1957,7 @@ compute_start_sect(struct part_desc *p, struct part_desc *ep) {
p->size += delta;
if (is_extended(p->p.sys_type) && boxes == ONESECTOR)
p->size = inc;
- else if (old_size <= -delta) {
+ else if ((ssize_t) old_size <= (ssize_t) -delta) {
my_warn(_("no room for partition descriptor\n"));
return 0;
}
@@ -2256,7 +2256,7 @@ read_partition_chain(char *dev, int interactive, struct part_desc *ep,
eob = 0;
while (1) {
base = z->partno;
- if (base+4 > ARRAY_SIZE(z->partitions)) {
+ if ((unsigned long) base+4 > ARRAY_SIZE(z->partitions)) {
do_warn(_("too many partitions\n"));
break;
}
@@ -2285,7 +2285,7 @@ read_input(char *dev, int interactive, struct disk_desc *z) {
int i;
struct part_desc *partitions = &(z->partitions[0]), *ep;
- for (i=0; i < ARRAY_SIZE(z->partitions); i++)
+ for (i=0; (unsigned long) i < ARRAY_SIZE(z->partitions); i++)
partitions[i] = zero_part_desc;
z->partno = 0;
--
1.7.5.2
^ permalink raw reply related
* mount: if mount -a crashes on one partition, remaining should be probed
From: Marek Otahal @ 2011-06-07 9:51 UTC (permalink / raw)
To: util-linux
[-- Attachment #1: Type: Text/Plain, Size: 5644 bytes --]
Hi,
I reported this bug on my distribution (Archlinux) but as we just call mount -a , I'm sending it upstream. (orig bug: https://bugs.archlinux.org/task/24598 )
Description:
with 2.6.39 kernel I can get in conditions when mounting a btrfs partition segfaults (I already reported upstream - http://article.gmane.org/gmane.comp.file-systems.btrfs/11135 ).
After this, the boot process continues, the issue is: after the crash, other partitions from fstab don't get mounted. Though there's no error on them and I can flawlessly mount them manually.
What I think happens: the mount process stops (crashes?)
What should happen: mounting the corrupted partition should fail (/home in my case), but other partitions should be probed normally (/var /tmp ...)
Steps to reproduce:
during boot, ensure mounting one partition crashes :P, then other parts are not mounted.
Thanks, Mark
PS sorry if double post, i got mail delivery failure.
dmesg follows:
[ 56.994241] loop: module loaded
[ 57.172283] Btrfs loaded
[ 57.191655] device label store devid 1 transid 26106 /dev/dm-3
[ 57.218783] device label home devid 1 transid 450932 /dev/dm-2
[ 57.459448] scsi 4:0:0:0: Direct-Access Generic- Multi-Card 1.00 PQ: 0 ANSI: 0 CCS
[ 57.460293] sd 4:0:0:0: Attached scsi generic sg1 type 0
[ 57.467030] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[ 61.585618] EXT4-fs (sda4): warning: checktime reached, running e2fsck is recommended
[ 61.671534] EXT4-fs (sda4): re-mounted. Opts: (null)
[ 62.211037] device label home devid 1 transid 450932 /dev/mapper/homeDevice
[ 62.212058] btrfs: force lzo compression
[ 65.335194] ------------[ cut here ]------------
[ 65.335308] kernel BUG at fs/btrfs/inode.c:4676!
[ 65.335406] invalid opcode: 0000 [#1] PREEMPT SMP
[ 65.335532] last sysfs file: /sys/devices/virtual/bdi/btrfs-1/uevent
[ 65.337833] Modules linked in: btrfs zlib_deflate crc32c libcrc32c loop uas ums_realtek uvcvideo usb_storage msr videodev media btusb bluetooth sbs sbshc arc4 ecb b43 mac80211 joydev cfg80211 ssb mmc_core pcmcia sg fuse tg3 uhci_hcd ideapad_laptop evdev sparse_keymap psmouse pcspkr snd_hda_codec_realtek iTCO_wdt iTCO_vendor_support rfkill serio_raw ehci_hcd snd_hda_intel pcmcia_core i2c_i801 libphy usbcore ac wmi battery thermal snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc acpi_cpufreq freq_table processor mperf sha256_generic sha512_generic ext4 mbcache jbd2 crc16 cryptd aes_i586 aes_generic xts gf128mul dm_crypt dm_mod sd_mod ata_piix libata scsi_mod i915 drm_kms_helper drm i2c_algo_bit button i2c_core video intel_agp intel_gtt agpgart
[ 65.337833]
[ 65.337833] Pid: 883, comm: mount Not tainted 2.6.39-ARCH #1 LENOVO 41875QG /Kuril
[ 65.337833] EIP: 0060:[<f9604072>] EFLAGS: 00010282 CPU: 1
[ 65.337833] EIP is at btrfs_add_link+0x172/0x200 [btrfs]
[ 65.337833] EAX: ffffffef EBX: ef448908 ECX: 00000119 EDX: 00000111
[ 65.337833] ESI: 004255d9 EDI: 00000020 EBP: eec77ba4 ESP: eec77b48
[ 65.337833] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 65.337833] Process mount (pid: 883, ti=eec76000 task=f4c8c450 task.ti=eec76000)
[ 65.337833] Stack:
[ 65.396712] 00000020 004255d9 00000000 eec77b87 00000001 0000e55e 00000000 f960d6f8
[ 65.396712] eec77b88 eec77b8c eec77b90 eec77b94 ef472000 f5076800 ef448ba8 6f43c090
[ 65.396712] 000046ab 01000000 00000000 00000000 00000000 0046ab6f 00000000 eec77c0c
[ 65.396712] Call Trace:
[ 65.396712] [<f960d6f8>] ? btrfs_inode_ref_index+0xd8/0xe0 [btrfs]
[ 65.396712] [<f962cfcf>] add_inode_ref+0x28f/0x320 [btrfs]
[ 65.396712] [<f962de69>] replay_one_buffer+0x239/0x320 [btrfs]
[ 65.396712] [<f961cc97>] ? alloc_extent_buffer+0x77/0x3a0 [btrfs]
[ 65.396712] [<f962b7a9>] walk_down_log_tree+0x1d9/0x370 [btrfs]
[ 65.396712] [<f962b9d9>] walk_log_tree+0x99/0x1c0 [btrfs]
[ 65.396712] [<f962f2fa>] btrfs_recover_log_trees+0x1da/0x2a0 [btrfs]
[ 65.396712] [<f962dc30>] ? replay_one_dir_item+0xb0/0xb0 [btrfs]
[ 65.396712] [<f95f6749>] open_ctree+0x1129/0x1490 [btrfs]
[ 65.396712] [<c11ac7a9>] ? strlcpy+0x39/0x50
[ 65.396712] [<f95d756b>] btrfs_mount+0x4ab/0x5b0 [btrfs]
[ 65.396712] [<c1109d31>] mount_fs+0x31/0x170
[ 65.396712] [<c11207ac>] vfs_kern_mount+0x4c/0x90
[ 65.396712] [<c1120b49>] do_kern_mount+0x39/0xd0
[ 65.396712] [<c1121e31>] do_mount+0x161/0x700
[ 65.396712] [<c11226f6>] sys_mount+0x66/0xa0
[ 65.396712] [<c1330edf>] sysenter_do_call+0x12/0x28
[ 65.396712] Code: 44 24 08 00 00 00 00 89 4c 24 0c 8b 4d 08 89 34 24 e8 73 cc fe ff 85 c0 0f 84 f0 fe ff ff 8b 5d f4 8b 75 f8 8b 7d fc 89 ec 5d c3 <0f> 0b 8b 81 d8 fe ff ff 8d 55 e3 b9 11 00 00 00 89 d7 05 03 01
[ 65.396712] EIP: [<f9604072>] btrfs_add_link+0x172/0x200 [btrfs] SS:ESP 0068:eec77b48
[ 65.397464] ---[ end trace 5f278c10a67bc917 ]---
[ 65.519660] Adding 2561304k swap on /dev/mapper/swapDevice. Priority:-1 extents:1 across:2561304k
[ 67.243199] microcode: CPU0 sig=0x106c2, pf=0x4, revision=0x20a
[ 67.292031] microcode: CPU1 sig=0x106c2, pf=0x4, revision=0x20a
[ 67.298402] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[ 67.305857] microcode: CPU0 updated to revision 0x218, date = 2009-04-10
[ 67.315268] microcode: CPU1 updated to revision 0x218, date = 2009-04-10
[ 70.985116] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 71.152025] Bluetooth: RFCOMM TTY layer initialized
[ 71.156497] Bluetooth: RFCOMM socket layer initialized
[ 71.160691] Bluetooth: RFCOMM ver 1.11
[ 118.324105] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 118.574729] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
--
Marek Otahal :o)
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* support for PARTUUID in blkid
From: KESHAV P.R. @ 2011-06-07 13:47 UTC (permalink / raw)
To: util-linux
Hi,
Is it possible to add support for PARTUUID to device name
conversion in blkid similar to FS UUID. The PARTUUID mentioned here is
the ID_PART_ENTRY_UUID output of 'blkid -p -i -o udev /dev/sda1' (for
example). What I want is the support for PARTUUID in 'blkid -U
<PARTUUID>' (not exactly -U , a similar command). Is it possible to
implement? Sorry I am not a programmer. This request is mainly to
support https://github.com/falconindy/geninit/commit/72272da8a855d9551c04de9ba502f3befb2a91d5
. Thanks in advance.
Regards.
Keshav
^ permalink raw reply
* Re: Fwd: [PATCH 00/13]: text-utils fixes
From: Karel Zak @ 2011-06-08 9:17 UTC (permalink / raw)
To: kerolasa; +Cc: util-linux
In-Reply-To: <BANLkTindk_vPdnzXmL8dkzeQj+WdG3cnFw@mail.gmail.com>
On Sun, Jun 05, 2011 at 08:47:48PM +0200, Sami Kerola wrote:
> I amend the fixes, and pushed with force to repository.
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: [PATCH] tests: add lscpu dumps from three Dell's & a Xen
From: Karel Zak @ 2011-06-08 11:11 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux, Sami Kerola
In-Reply-To: <1306866685-2507-1-git-send-email-kerolasa@iki.fi>
On Tue, May 31, 2011 at 08:31:25PM +0200, Sami Kerola wrote:
> tests/expected/lscpu/lscpu-x86_64-dell_e4310 | 28 ++++++++++++++
> .../expected/lscpu/lscpu-x86_64-dell_poweredge1950 | 23 +++++++++++
> .../expected/lscpu/lscpu-x86_64-dell_poweredgeR610 | 40 ++++++++++++++++++++
> tests/expected/lscpu/lscpu-x86_64-el5xen | 30 +++++++++++++++
> tests/ts/lscpu/dumps/x86_64-dell_e4310.tar.gz | Bin 0 -> 12933 bytes
> .../lscpu/dumps/x86_64-dell_poweredge1950.tar.gz | Bin 0 -> 1492 bytes
> .../lscpu/dumps/x86_64-dell_poweredgeR610.tar.gz | Bin 0 -> 14095 bytes
> tests/ts/lscpu/dumps/x86_64-el5xen.tar.gz | Bin 0 -> 7296 bytes
> 8 files changed, 121 insertions(+), 0 deletions(-)
> create mode 100644 tests/expected/lscpu/lscpu-x86_64-dell_e4310
> create mode 100644 tests/expected/lscpu/lscpu-x86_64-dell_poweredge1950
> create mode 100644 tests/expected/lscpu/lscpu-x86_64-dell_poweredgeR610
> create mode 100644 tests/expected/lscpu/lscpu-x86_64-el5xen
> create mode 100644 tests/ts/lscpu/dumps/x86_64-dell_e4310.tar.gz
> create mode 100644 tests/ts/lscpu/dumps/x86_64-dell_poweredge1950.tar.gz
> create mode 100644 tests/ts/lscpu/dumps/x86_64-dell_poweredgeR610.tar.gz
> create mode 100644 tests/ts/lscpu/dumps/x86_64-el5xen.tar.gz
Applied, thanks
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: [PATCH] fstrim, setarch: replace error() with err()
From: Karel Zak @ 2011-06-08 11:11 UTC (permalink / raw)
To: Francesco Cosoleto; +Cc: util-linux
In-Reply-To: <1307042277-8282-1-git-send-email-cosoleto@gmail.com>
On Thu, Jun 02, 2011 at 09:17:57PM +0200, Francesco Cosoleto wrote:
> sys-utils/fstrim.c | 10 +++-------
> sys-utils/setarch.c | 17 ++++++++---------
> 2 files changed, 11 insertions(+), 16 deletions(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: [PATCH 1/3] minix: add common functionality
From: Karel Zak @ 2011-06-08 11:11 UTC (permalink / raw)
To: Davidlohr Bueso; +Cc: util-linux
In-Reply-To: <1307368350.2006.2.camel@offworld>
> disk-utils/minix.h | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: [PATCH] simpleinit: remove NLS support
From: Karel Zak @ 2011-06-08 11:35 UTC (permalink / raw)
To: Francesco Cosoleto; +Cc: util-linux
In-Reply-To: <1307042126-7242-1-git-send-email-cosoleto@gmail.com>
On Thu, Jun 02, 2011 at 09:15:26PM +0200, Francesco Cosoleto wrote:
> About 50 messages to translate less.
>
> shutdown(1) is deprecated since July 2007, simpleinit(1), initctl(1)
> are deprecated since December 2010. They are marked as deprecated why
> nobody uses these implementations.
I have committed something completely different:
commit 0ff9e65ea30ee7e3548d11992a180d95d0a02fe9
Author: Karel Zak <kzak@redhat.com>
Date: Wed Jun 8 13:20:37 2011 +0200
simpleinit: remove this deprecated set of utils
Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am | 6 +-
configure.ac | 9 -
simpleinit/.gitignore | 3 -
simpleinit/Makefile.am | 27 -
simpleinit/fastboot.8 | 1 -
simpleinit/fasthalt.8 | 1 -
simpleinit/halt.8 | 1 -
simpleinit/initctl.8 | 110 -----
simpleinit/initctl.c | 217 --------
simpleinit/reboot.8 | 1 -
simpleinit/shutdown.8 | 169 -------
simpleinit/shutdown.c | 747 ----------------------------
simpleinit/simpleinit.8 | 180 -------
simpleinit/simpleinit.c | 1251 -----------------------------------------------
simpleinit/simpleinit.h | 28 -
15 files changed, 1 insertions(+), 2750 deletions(-)
:-)
Karel
^ permalink raw reply
* Re: [PATCH] mkfs.minix: use inode wrappers
From: Karel Zak @ 2011-06-08 11:43 UTC (permalink / raw)
To: Davidlohr Bueso; +Cc: util-linux
In-Reply-To: <1307056305.4909.1.camel@offworld>
On Thu, Jun 02, 2011 at 07:11:45PM -0400, Davidlohr Bueso wrote:
> disk-utils/mkfs.minix.c | 32 +++++++++++++++++++++-----------
> 1 files changed, 21 insertions(+), 11 deletions(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: support for PARTUUID in blkid
From: Karel Zak @ 2011-06-08 12:09 UTC (permalink / raw)
To: KESHAV P.R.; +Cc: util-linux
In-Reply-To: <BANLkTikcxGrwfoTDbphnW16s52dqKcgSBg@mail.gmail.com>
On Tue, Jun 07, 2011 at 07:17:01PM +0530, KESHAV P.R. wrote:
> Hi,
> Is it possible to add support for PARTUUID to device name
> conversion in blkid similar to FS UUID. The PARTUUID mentioned here is
> the ID_PART_ENTRY_UUID output of 'blkid -p -i -o udev /dev/sda1' (for
> example). What I want is the support for PARTUUID in 'blkid -U
> <PARTUUID>' (not exactly -U , a similar command). Is it possible to
> implement? Sorry I am not a programmer. This request is mainly to
> support https://github.com/falconindy/geninit/commit/72272da8a855d9551c04de9ba502f3befb2a91d5
This is on my TODO list for long time :-) Maybe Iill have time to
implement it for 2.21 (the end of this year).
It would be nice to support the UUIDs in mount and fsck. Then we can
use it in projects like dracut or in /etc/fstab, etc.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* [PATCH] uuidgen: print warning if uuidd isn't running
From: Ludwig Nussel @ 2011-06-08 13:35 UTC (permalink / raw)
To: util-linux; +Cc: Ludwig Nussel
---
misc-utils/uuidgen.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
index 3cf6ec9..47f8e8f 100644
--- a/misc-utils/uuidgen.c
+++ b/misc-utils/uuidgen.c
@@ -59,7 +59,9 @@ main (int argc, char *argv[])
switch (do_type) {
case DO_TYPE_TIME:
- uuid_generate_time(uu);
+ if (uuid_generate_time_safe(uu)) {
+ fprintf(stderr, _("Warning: uuidd not running or not operational. Time based uuid may not be unique.\n"));
+ }
break;
case DO_TYPE_RANDOM:
uuid_generate_random(uu);
--
1.7.3.4
^ permalink raw reply related
* [PATCH 0/6] Build with musl libc
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
I was trying to build util-linux with the musl libc (http://www.etalabs.net/musl/),
and found that a few patches were needed. These seem to just be some minor cleanups
in most cases. I'm a bit dubious of the hwclock patch, though, as it seems at least
a little bit hackish.
Josiah Worcester (6):
fdisk, display, hexdump.h: Use standard C types instead of u_int,
u_char, u_long, etc.
fsck, checktty, flock: Use more portable includes.
checktty: Use NGROUPS_MAX instead of NGROUPS
lib/tt.c: Fix mbs_width macro for systems without WIDECHAR
test_sysinfo: Use CHAR_BIT*sizeof(void*) instead of __WORDSIZE.
hwclock: Don't use asm/io.h if sys/io.h can't be found
fdisk/fdiskbsdlabel.c | 34 +++++++++++++++++-----------------
fsck/fsck.c | 2 +-
hwclock/cmos.c | 7 ++++++-
lib/tt.c | 2 +-
login-utils/checktty.c | 7 +++++--
sys-utils/flock.c | 2 ++
tests/helpers/test_sysinfo.c | 2 +-
text-utils/display.c | 32 ++++++++++++++++----------------
text-utils/hexdump.h | 4 ++--
9 files changed, 51 insertions(+), 41 deletions(-)
--
1.7.5.3
^ permalink raw reply
* [PATCH 1/6] fdisk, display, hexdump.h: Use standard C types instead of u_int, u_char, u_long, etc.
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
In-Reply-To: <1307573568-23643-1-git-send-email-josiahw@gmail.com>
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
---
fdisk/fdiskbsdlabel.c | 34 +++++++++++++++++-----------------
text-utils/display.c | 32 ++++++++++++++++----------------
text-utils/hexdump.h | 4 ++--
3 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/fdisk/fdiskbsdlabel.c b/fdisk/fdiskbsdlabel.c
index 0c3810d..d379b70 100644
--- a/fdisk/fdiskbsdlabel.c
+++ b/fdisk/fdiskbsdlabel.c
@@ -71,7 +71,7 @@ static void xbsd_change_fstype (void);
static int xbsd_get_part_index (int max);
static int xbsd_check_new_partition (int *i);
static void xbsd_list_types (void);
-static u_short xbsd_dkcksum (struct xbsd_disklabel *lp);
+static unsigned short xbsd_dkcksum (struct xbsd_disklabel *lp);
static int xbsd_initlabel (struct partition *p, struct xbsd_disklabel *d,
int pindex);
static int xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d);
@@ -463,28 +463,28 @@ xbsd_edit_disklabel (void)
d = &xbsd_dlabel;
#if defined (__alpha__) || defined (__ia64__)
- d -> d_secsize = (u_long) edit_int ((u_long) d -> d_secsize ,_("bytes/sector"));
- d -> d_nsectors = (u_long) edit_int ((u_long) d -> d_nsectors ,_("sectors/track"));
- d -> d_ntracks = (u_long) edit_int ((u_long) d -> d_ntracks ,_("tracks/cylinder"));
- d -> d_ncylinders = (u_long) edit_int ((u_long) d -> d_ncylinders ,_("cylinders"));
+ d -> d_secsize = (unsigned long) edit_int ((unsigned long) d -> d_secsize ,_("bytes/sector"));
+ d -> d_nsectors = (unsigned long) edit_int ((unsigned long) d -> d_nsectors ,_("sectors/track"));
+ d -> d_ntracks = (unsigned long) edit_int ((unsigned long) d -> d_ntracks ,_("tracks/cylinder"));
+ d -> d_ncylinders = (unsigned long) edit_int ((unsigned long) d -> d_ncylinders ,_("cylinders"));
#endif
/* d -> d_secpercyl can be != d -> d_nsectors * d -> d_ntracks */
while (1)
{
- d -> d_secpercyl = (u_long) edit_int ((u_long) d -> d_nsectors * d -> d_ntracks,
+ d -> d_secpercyl = (unsigned long) edit_int ((unsigned long) d -> d_nsectors * d -> d_ntracks,
_("sectors/cylinder"));
if (d -> d_secpercyl <= d -> d_nsectors * d -> d_ntracks)
break;
printf (_("Must be <= sectors/track * tracks/cylinder (default).\n"));
}
- d -> d_rpm = (u_short) edit_int ((u_short) d -> d_rpm ,_("rpm"));
- d -> d_interleave = (u_short) edit_int ((u_short) d -> d_interleave,_("interleave"));
- d -> d_trackskew = (u_short) edit_int ((u_short) d -> d_trackskew ,_("trackskew"));
- d -> d_cylskew = (u_short) edit_int ((u_short) d -> d_cylskew ,_("cylinderskew"));
- d -> d_headswitch = (u_long) edit_int ((u_long) d -> d_headswitch ,_("headswitch"));
- d -> d_trkseek = (u_long) edit_int ((u_long) d -> d_trkseek ,_("track-to-track seek"));
+ d -> d_rpm = (unsigned short) edit_int ((unsigned short) d -> d_rpm ,_("rpm"));
+ d -> d_interleave = (unsigned short) edit_int ((unsigned short) d -> d_interleave,_("interleave"));
+ d -> d_trackskew = (unsigned short) edit_int ((unsigned short) d -> d_trackskew ,_("trackskew"));
+ d -> d_cylskew = (unsigned short) edit_int ((unsigned short) d -> d_cylskew ,_("cylinderskew"));
+ d -> d_headswitch = (unsigned long) edit_int ((unsigned long) d -> d_headswitch ,_("headswitch"));
+ d -> d_trkseek = (unsigned long) edit_int ((unsigned long) d -> d_trkseek ,_("track-to-track seek"));
d -> d_secperunit = d -> d_secpercyl * d -> d_ncylinders;
}
@@ -638,13 +638,13 @@ xbsd_list_types (void) {
list_types (xbsd_fstypes);
}
-static u_short
+static unsigned short
xbsd_dkcksum (struct xbsd_disklabel *lp) {
- u_short *start, *end;
- u_short sum = 0;
+ unsigned short *start, *end;
+ unsigned short sum = 0;
- start = (u_short *) lp;
- end = (u_short *) &lp->d_partitions[lp->d_npartitions];
+ start = (unsigned short *) lp;
+ end = (unsigned short *) &lp->d_partitions[lp->d_npartitions];
while (start < end)
sum ^= *start++;
return sum;
diff --git a/text-utils/display.c b/text-utils/display.c
index 01805a2..c700b02 100644
--- a/text-utils/display.c
+++ b/text-utils/display.c
@@ -55,11 +55,11 @@ static off_t address; /* address/offset in stream */
static off_t eaddress; /* end address */
static inline void
-print(PR *pr, u_char *bp) {
+print(PR *pr, unsigned char *bp) {
switch(pr->flags) {
case F_ADDRESS:
- (void)printf(pr->fmt, (quad_t)address);
+ (void)printf(pr->fmt, (int64_t)address);
break;
case F_BPAD:
(void)printf(pr->fmt, "");
@@ -90,23 +90,23 @@ print(PR *pr, u_char *bp) {
{
short sval; /* int16_t */
int ival; /* int32_t */
- long long Lval; /* int64_t, quad_t */
+ long long Lval; /* int64_t, int64_t */
switch(pr->bcnt) {
case 1:
- (void)printf(pr->fmt, (quad_t)*bp);
+ (void)printf(pr->fmt, (int64_t)*bp);
break;
case 2:
memmove(&sval, bp, sizeof(sval));
- (void)printf(pr->fmt, (quad_t)sval);
+ (void)printf(pr->fmt, (int64_t)sval);
break;
case 4:
memmove(&ival, bp, sizeof(ival));
- (void)printf(pr->fmt, (quad_t)ival);
+ (void)printf(pr->fmt, (int64_t)ival);
break;
case 8:
memmove(&Lval, bp, sizeof(Lval));
- (void)printf(pr->fmt, (quad_t)Lval);
+ (void)printf(pr->fmt, (int64_t)Lval);
break;
}
break;
@@ -127,23 +127,23 @@ print(PR *pr, u_char *bp) {
{
unsigned short sval; /* u_int16_t */
unsigned int ival; /* u_int32_t */
- unsigned long long Lval;/* u_int64_t, u_quad_t */
+ unsigned long long Lval;/* u_int64_t, u_int64_t */
switch(pr->bcnt) {
case 1:
- (void)printf(pr->fmt, (u_quad_t)*bp);
+ (void)printf(pr->fmt, (uint64_t)*bp);
break;
case 2:
memmove(&sval, bp, sizeof(sval));
- (void)printf(pr->fmt, (u_quad_t)sval);
+ (void)printf(pr->fmt, (uint64_t)sval);
break;
case 4:
memmove(&ival, bp, sizeof(ival));
- (void)printf(pr->fmt, (u_quad_t)ival);
+ (void)printf(pr->fmt, (uint64_t)ival);
break;
case 8:
memmove(&Lval, bp, sizeof(Lval));
- (void)printf(pr->fmt, (u_quad_t)Lval);
+ (void)printf(pr->fmt, (uint64_t)Lval);
break;
}
break;
@@ -174,9 +174,9 @@ void display(void)
register FU *fu;
register PR *pr;
register int cnt;
- register u_char *bp;
+ register unsigned char *bp;
off_t saveaddress;
- u_char savech = 0, *savebp;
+ unsigned char savech = 0, *savebp;
while ((bp = get()) != NULL)
for (fs = fshead, savebp = bp, saveaddress = address; fs;
@@ -212,7 +212,7 @@ void display(void)
for (pr = endfu->nextpr; pr; pr = pr->nextpr)
switch(pr->flags) {
case F_ADDRESS:
- (void)printf(pr->fmt, (quad_t)eaddress);
+ (void)printf(pr->fmt, (int64_t)eaddress);
break;
case F_TEXT:
(void)printf("%s", pr->fmt);
@@ -261,7 +261,7 @@ get(void)
eaddress = address + nread;
return(curp);
}
- n = fread((char *)curp + nread, sizeof(u_char),
+ n = fread((char *)curp + nread, sizeof(unsigned char),
length == -1 ? need : MIN(length, need), stdin);
if (!n) {
if (ferror(stdin))
diff --git a/text-utils/hexdump.h b/text-utils/hexdump.h
index 3df8629..52a64bf 100644
--- a/text-utils/hexdump.h
+++ b/text-utils/hexdump.h
@@ -46,7 +46,7 @@ typedef struct _pr {
#define F_U 0x100 /* %_u */
#define F_UINT 0x200 /* %[ouXx] */
#define F_TEXT 0x400 /* no conversions */
- u_int flags; /* flag values */
+ unsigned int flags; /* flag values */
int bcnt; /* byte count */
char *cchar; /* conversion character */
char *fmt; /* printf format */
@@ -58,7 +58,7 @@ typedef struct _fu {
struct _pr *nextpr; /* next print unit */
#define F_IGNORE 0x01 /* %_A */
#define F_SETREP 0x02 /* rep count set, not default */
- u_int flags; /* flag values */
+ unsigned int flags; /* flag values */
int reps; /* repetition count */
int bcnt; /* byte count */
char *fmt; /* format string */
--
1.7.5.3
^ permalink raw reply related
* [PATCH 2/6] fsck, checktty, flock: Use more portable includes.
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
In-Reply-To: <1307573568-23643-1-git-send-email-josiahw@gmail.com>
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
---
fsck/fsck.c | 2 +-
login-utils/checktty.c | 3 +++
sys-utils/flock.c | 2 ++
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 0d5feda..9153367 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <sys/wait.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <fcntl.h>
diff --git a/login-utils/checktty.c b/login-utils/checktty.c
index f849057..518b701 100644
--- a/login-utils/checktty.c
+++ b/login-utils/checktty.c
@@ -22,7 +22,10 @@
#include <malloc.h>
#include <netdb.h>
#include <sys/syslog.h>
+#include <sys/socket.h>
#include <ctype.h>
+#include <limits.h>
+#include <netinet/in.h>
#include "nls.h"
#include <sys/sysmacros.h>
diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 20004ca..c7fb70e 100644
--- a/sys-utils/flock.c
+++ b/sys-utils/flock.c
@@ -39,6 +39,8 @@
#include <sys/file.h>
#include <sys/time.h>
#include <sys/wait.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include "nls.h"
--
1.7.5.3
^ permalink raw reply related
* [PATCH 3/6] checktty: Use NGROUPS_MAX instead of NGROUPS
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
In-Reply-To: <1307573568-23643-1-git-send-email-josiahw@gmail.com>
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
---
login-utils/checktty.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/login-utils/checktty.c b/login-utils/checktty.c
index 518b701..a8c5247 100644
--- a/login-utils/checktty.c
+++ b/login-utils/checktty.c
@@ -42,7 +42,7 @@
#define TTY_MAJOR 4
#endif
-static gid_t mygroups[NGROUPS];
+static gid_t mygroups[NGROUPS_MAX];
static int num_groups;
#define NAMELEN 128
@@ -83,7 +83,7 @@ am_in_group(char *group)
static void
find_groups(gid_t defgrp, const char *user)
{
- num_groups = getgroups(NGROUPS, mygroups);
+ num_groups = getgroups(NGROUPS_MAX, mygroups);
}
static struct ttyclass *
--
1.7.5.3
^ permalink raw reply related
* [PATCH 4/6] lib/tt.c: Fix mbs_width macro for systems without WIDECHAR
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
In-Reply-To: <1307573568-23643-1-git-send-email-josiahw@gmail.com>
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
---
lib/tt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/tt.c b/lib/tt.c
index 7cbbce3..1929a48 100644
--- a/lib/tt.c
+++ b/lib/tt.c
@@ -52,7 +52,7 @@ static const struct tt_symbols utf8_tt_symbols = {
};
#else /* !HAVE_WIDECHAR */
-# define mbs_width strlen(_s)
+# define mbs_width(_s) strlen(_s)
#endif /* !HAVE_WIDECHAR */
#define is_last_column(_tb, _cl) \
--
1.7.5.3
^ permalink raw reply related
* [PATCH 5/6] test_sysinfo: Use CHAR_BIT*sizeof(void*) instead of __WORDSIZE.
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
In-Reply-To: <1307573568-23643-1-git-send-email-josiahw@gmail.com>
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
---
tests/helpers/test_sysinfo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/helpers/test_sysinfo.c b/tests/helpers/test_sysinfo.c
index cb7b66b..a8d80d8 100644
--- a/tests/helpers/test_sysinfo.c
+++ b/tests/helpers/test_sysinfo.c
@@ -28,7 +28,7 @@ typedef struct {
int
hlp_wordsize(void)
{
- printf("%d\n", __WORDSIZE);
+ printf("%d\n", CHAR_BIT*sizeof(void*));
return 0;
}
--
1.7.5.3
^ permalink raw reply related
* [PATCH 6/6] hwclock: Don't use asm/io.h if sys/io.h can't be found
From: Josiah Worcester @ 2011-06-08 22:52 UTC (permalink / raw)
To: util-linux; +Cc: Josiah Worcester
In-Reply-To: <1307573568-23643-1-git-send-email-josiahw@gmail.com>
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
---
hwclock/cmos.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/hwclock/cmos.c b/hwclock/cmos.c
index 947b21b..b5169a1 100644
--- a/hwclock/cmos.c
+++ b/hwclock/cmos.c
@@ -53,7 +53,12 @@
#ifdef HAVE_SYS_IO_H
#include <sys/io.h>
#else
-#include <asm/io.h> /* for inb, outb */
+/* Disable cmos access; we can no longer use asm/io.h, since
+ * the kernel does not export that header.
+ */
+#undef __i386__
+void outb(int a, int b){}
+int inb(int c){ return 0; }
#endif
#elif defined(__alpha__)
/* <asm/io.h> fails to compile, probably because of u8 etc */
--
1.7.5.3
^ permalink raw reply related
* Re: [PATCH 6/6] hwclock: Don't use asm/io.h if sys/io.h can't be found
From: Mike Frysinger @ 2011-06-09 0:58 UTC (permalink / raw)
To: Josiah Worcester; +Cc: util-linux
In-Reply-To: <1307573568-23643-7-git-send-email-josiahw@gmail.com>
[-- Attachment #1: Type: Text/Plain, Size: 367 bytes --]
On Wednesday, June 08, 2011 18:52:48 Josiah Worcester wrote:
> -#include <asm/io.h> /* for inb, outb */
> +/* Disable cmos access; we can no longer use asm/io.h, since
> + * the kernel does not export that header.
> + */
> +#undef __i386__
> +void outb(int a, int b){}
> +int inb(int c){ return 0; }
probably should be turned into a header check in configure
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH 1/2] mkfs.minix: standardize superblock attribute settings
From: Davidlohr Bueso @ 2011-06-09 16:48 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
From: Davidlohr Bueso <dave@gnu.org>
Date: Thu, 9 Jun 2011 12:01:09 -0400
Because of the dependence of fs_version, some superblock attributes will vary, so simplify the logic of assigning values to maxsize and the amount of zones related to each filesystem, thus making setup_tables() more readable.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
disk-utils/mkfs.minix.c | 32 +++++++++++++++++++++++++++-----
1 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index d2d800f..1cebcda 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -370,6 +370,29 @@ static void make_root_inode(void)
return make_root_inode_v2();
}
+static void super_set_nzones(void)
+{
+ switch (fs_version) {
+ case 2:
+ Super.s_zones = BLOCKS;
+ break;
+ default: /* v1 */
+ Super.s_nzones = BLOCKS;
+ break;
+ }
+}
+
+static void super_init_maxsize(void)
+{
+ switch (fs_version) {
+ case 2:
+ Super.s_max_size = 0x7fffffff;
+ default: /* v1 */
+ Super.s_max_size = (7+512+512*512)*1024;
+ break;
+ }
+}
+
static void setup_tables(void) {
int i;
unsigned long inodes, zmaps, imaps, zones;
@@ -382,12 +405,11 @@ static void setup_tables(void) {
memset(boot_block_buffer,0,512);
Super.s_magic = magic;
Super.s_log_zone_size = 0;
- Super.s_max_size = version2 ? 0x7fffffff : (7+512+512*512)*1024;
- if (fs_version == 2)
- zones = Super.s_zones = BLOCKS;
- else
- zones = Super.s_nzones = BLOCKS;
+ super_init_maxsize();
+ super_set_nzones();
+ zones = get_nzones();
+
/* some magic nrs: 1 inode / 3 blocks */
if ( req_nr_inodes == 0 )
inodes = BLOCKS/3;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/2] mkfs.minix: add fs version options
From: Davidlohr Bueso @ 2011-06-09 16:48 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
From: Davidlohr Bueso <dave@gnu.org>
Date: Thu, 9 Jun 2011 12:41:12 -0400
Like the original minix mkfs, add the -1 and -2 argument options to specify the version of the filesystem to create.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
disk-utils/mkfs.minix.8 | 5 ++++-
disk-utils/mkfs.minix.c | 8 ++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/disk-utils/mkfs.minix.8 b/disk-utils/mkfs.minix.8
index 9359106..2c180e5 100644
--- a/disk-utils/mkfs.minix.8
+++ b/disk-utils/mkfs.minix.8
@@ -59,7 +59,10 @@ Read the bad blocks list from
The file has one bad block number per line. The count of bad blocks read
is printed.
.TP
-.B \-v
+.B \-1
+Make a Minix version 1 filesystem.
+.TP
+.B \-2,\-v
Make a Minix version 2 filesystem.
.SH "EXIT CODES"
The exit code returned by
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 1cebcda..bd773b2 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -586,7 +586,7 @@ int main(int argc, char ** argv) {
errx(MKFS_ERROR, _("%s: bad inode size"), device_name);
opterr = 0;
- while ((i = getopt(argc, argv, "ci:l:n:v")) != -1)
+ while ((i = getopt(argc, argv, "ci:l:n:v12")) != -1)
switch (i) {
case 'c':
check=1; break;
@@ -608,7 +608,11 @@ int main(int argc, char ** argv) {
namelen = i;
dirsize = i+2;
break;
- case 'v':
+ case '1':
+ fs_version = 1;
+ break;
+ case '2':
+ case 'v': /* kept for backwards compatiblitly */
fs_version = 2;
version2 = 1;
break;
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH 3/6] checktty: Use NGROUPS_MAX instead of NGROUPS
From: Sami Kerola @ 2011-06-09 19:31 UTC (permalink / raw)
To: Josiah Worcester; +Cc: util-linux
In-Reply-To: <1307573568-23643-4-git-send-email-josiahw@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 344 bytes --]
On Thu, Jun 9, 2011 at 00:52, Josiah Worcester <josiahw@gmail.com> wrote:
> -static gid_t mygroups[NGROUPS];
> +static gid_t mygroups[NGROUPS_MAX];
That might fix issue with musl libc, but is that truly an enhancement?
How about using sysconf(_SC_NGROUPS_MAX), e.g. see attachment.
--
Sami Kerola
http://www.iki.fi/kerolasa/
[-- Attachment #2: 0001-checktty-NGROUP-sysconf.txt --]
[-- Type: text/plain, Size: 1383 bytes --]
From bf4382f2f49c99f8cb3db360b54d8825525c153d Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
Date: Thu, 9 Jun 2011 21:23:13 +0200
Subject: [PATCH] checktty: NGROUP -> sysconf
Use sysconf return value instead of NGROUP definition to determine size of
grouplist array.
http://pubs.opengroup.org/onlinepubs/009695399/functions/getgroups.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
login-utils/checktty.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/login-utils/checktty.c b/login-utils/checktty.c
index f849057..e39d1e2 100644
--- a/login-utils/checktty.c
+++ b/login-utils/checktty.c
@@ -33,13 +33,14 @@
#include "pathnames.h"
#include "login.h"
#include "strutils.h"
+#include "xalloc.h"
#include "c.h"
#ifndef TTY_MAJOR
#define TTY_MAJOR 4
#endif
-static gid_t mygroups[NGROUPS];
+static gid_t *mygroups;
static int num_groups;
#define NAMELEN 128
@@ -311,6 +312,7 @@ main(int argc, char **argv)
{ NULL, NULL }
}, *item;
+ mygroups = xmalloc(sizeof(gid_t) * sysconf(_SC_NGROUPS_MAX));
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_NUMERICHOST | AI_PASSIVE | AI_ADDRCONFIG;
@@ -342,6 +344,7 @@ main(int argc, char **argv)
printf("getaddrinfo() failed\n");
}
+ free(mygroups);
return EXIT_SUCCESS;
}
#endif /* MAIN_TEST_CHECKTTY */
--
1.7.5.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox