From cb4679ff2e73da3673aeb65fcc1baf9c7a55e94c Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 29 Sep 2009 07:13:57 +0000 Subject: [PATCH 01/16] Initialize branch F-12 for util-linux-ng --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..06de2d2 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-12 From cfb90b9408b47a0b899ea0faf09f277254dbf278 Mon Sep 17 00:00:00 2001 From: kzak Date: Fri, 2 Oct 2009 19:24:34 +0000 Subject: [PATCH 02/16] - #514413 - Extra spaces at the end of CD mount point --- util-linux-ng-2.16-libblkid-joliet.patch | 118 +++++++++++++++++++++++ util-linux-ng.spec | 8 +- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 util-linux-ng-2.16-libblkid-joliet.patch diff --git a/util-linux-ng-2.16-libblkid-joliet.patch b/util-linux-ng-2.16-libblkid-joliet.patch new file mode 100644 index 0000000..74d063e --- /dev/null +++ b/util-linux-ng-2.16-libblkid-joliet.patch @@ -0,0 +1,118 @@ +diff -up util-linux-ng-2.16/shlibs/blkid/src/probe.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probe.c +--- util-linux-ng-2.16/shlibs/blkid/src/probe.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probe.c 2009-10-02 20:53:33.000000000 +0200 +@@ -685,10 +685,27 @@ static int blkid_probe_set_usage(blkid_p + return blkid_probe_set_value(pr, "USAGE", (unsigned char *) u, strlen(u) + 1); + } + ++ ++/* Removes whitespace from the right-hand side of a string (trailing ++ * whitespace). ++ * ++ * Returns size of the new string (without \0). ++ */ ++static size_t blkid_rtrim_whitespace(unsigned char *str) ++{ ++ size_t i = strlen((char *) str); ++ ++ while (i--) { ++ if (!isspace(str[i])) ++ break; ++ } ++ str[++i] = '\0'; ++ return i; ++} ++ + int blkid_probe_set_label(blkid_probe pr, unsigned char *label, size_t len) + { + struct blkid_prval *v; +- int i; + + if (len > BLKID_PROBVAL_BUFSIZ) + len = BLKID_PROBVAL_BUFSIZ; +@@ -704,15 +721,7 @@ int blkid_probe_set_label(blkid_probe pr + + memcpy(v->data, label, len); + v->data[len] = '\0'; +- +- /* remove trailing whitespace */ +- i = strnlen((char *) v->data, len); +- while (i--) { +- if (!isspace(v->data[i])) +- break; +- } +- v->data[++i] = '\0'; +- v->len = i + 1; ++ v->len = blkid_rtrim_whitespace(v->data) + 1; + return 0; + } + +@@ -765,7 +774,8 @@ int blkid_probe_set_utf8label(blkid_prob + if (!v) + return -1; + +- v->len = encode_to_utf8(enc, v->data, sizeof(v->data), label, len); ++ encode_to_utf8(enc, v->data, sizeof(v->data), label, len); ++ v->len = blkid_rtrim_whitespace(v->data) + 1; + return 0; + } + +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c 2009-10-02 20:54:43.000000000 +0200 +@@ -19,6 +19,7 @@ + + #include "blkidP.h" + ++/* PVD - Primary volume descriptor */ + struct iso_volume_descriptor { + unsigned char vd_type; + unsigned char vd_id[5]; +@@ -48,6 +49,20 @@ struct high_sierra_volume_descriptor { + unsigned char volume_id[32]; + }; + ++/* returns 1 if the begin of @ascii is equal to @utf16 string. ++ */ ++static int ascii_eq_utf16be(unsigned char *ascii, ++ unsigned char *utf16, size_t len) ++{ ++ int a, u; ++ ++ for (a = 0, u = 0; u < len; a++, u += 2) { ++ if (utf16[u] != 0x0 || ascii[a] != utf16[u + 1]) ++ return 0; ++ } ++ return 1; ++} ++ + /* old High Sierra format */ + static int probe_iso9660_hsfs(blkid_probe pr, const struct blkid_idmag *mag) + { +@@ -82,8 +97,6 @@ static int probe_iso9660(blkid_probe pr, + /* Joliet Extension */ + off = ISO_VD_OFFSET; + for (i = 0; i < ISO_VD_MAX; i++) { +- uint8_t svd_label[64]; +- + iso = (struct iso_volume_descriptor *) + blkid_probe_get_buffer(pr, + off, +@@ -98,9 +111,16 @@ static int probe_iso9660(blkid_probe pr, + memcmp(iso->escape_sequences, "%/C", 3) == 0 || + memcmp(iso->escape_sequences, "%/E", 3) == 0) { + ++ /* Is the Joliet (UTF16BE) label equal to the label in ++ * the PVD? If yes, use PVD label. The Jolied version ++ * of the label could be trimed (because UTF16..). ++ */ ++ if (ascii_eq_utf16be(label, iso->volume_id, 32)) ++ break; ++ + blkid_probe_set_utf8label(pr, + iso->volume_id, +- sizeof(svd_label), ++ sizeof(iso->volume_id), + BLKID_ENC_UTF16BE); + + blkid_probe_set_version(pr, "Joliet Extension"); diff --git a/util-linux-ng.spec b/util-linux-ng.spec index ff059b5..c505a3c 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16 -Release: 10%{?dist} +Release: 10.1%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -114,6 +114,8 @@ Patch10: util-linux-ng-2.16-libblkid-compression.patch Patch11: util-linux-ng-2.14-sfdisk-dump.patch # Swsuspend does not work Patch12: util-linux-ng-2.16-blkid-swsuspend.patch +# 514413 - Extra spaces at the end of CD mount point +Patch13: util-linux-ng-2.16-libblkid-joliet.patch %description The util-linux-ng package contains a large variety of low-level system @@ -212,6 +214,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 %build unset LINGUAS || : @@ -722,6 +725,9 @@ fi %changelog +* Fri Oct 2 2009 Karel Zak 2.16-10.1 +- #514413 - Extra spaces at the end of CD mount point + * Wed Sep 16 2009 Tomas Mraz - 2.16-10 - use password-auth common PAM configuration instead of system-auth and drop pam_console.so call from the remote PAM config file From b73954c18c2210b63c96788a5bc439161439e196 Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 5 Oct 2009 15:22:39 +0000 Subject: [PATCH 03/16] - fix #519237 - bash: cannot set terminal process group (-1): Inappropriate ioctl for device --- util-linux-ng-2.16-switchroot-tty.patch | 17 +++++++++++++++++ util-linux-ng.spec | 8 +++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 util-linux-ng-2.16-switchroot-tty.patch diff --git a/util-linux-ng-2.16-switchroot-tty.patch b/util-linux-ng-2.16-switchroot-tty.patch new file mode 100644 index 0000000..14ee89f --- /dev/null +++ b/util-linux-ng-2.16-switchroot-tty.patch @@ -0,0 +1,17 @@ +diff -up util-linux-ng-2.16/sys-utils/switch_root.c.kzak util-linux-ng-2.16/sys-utils/switch_root.c +--- util-linux-ng-2.16/sys-utils/switch_root.c.kzak 2009-10-01 21:01:31.000000000 +0200 ++++ util-linux-ng-2.16/sys-utils/switch_root.c 2009-10-01 21:01:52.000000000 +0200 +@@ -267,13 +267,6 @@ int main(int argc, char *argv[]) + if (access(init, X_OK)) + warn("cannot access %s", init); + +- /* get session leader */ +- setsid(); +- +- /* set controlling terminal */ +- if (ioctl (0, TIOCSCTTY, 1)) +- warn("failed to TIOCSCTTY"); +- + execv(init, initargs); + err(EXIT_FAILURE, "failed to execute %s", init); + } diff --git a/util-linux-ng.spec b/util-linux-ng.spec index c505a3c..b0208c3 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16 -Release: 10.1%{?dist} +Release: 10.2%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -116,6 +116,8 @@ Patch11: util-linux-ng-2.14-sfdisk-dump.patch Patch12: util-linux-ng-2.16-blkid-swsuspend.patch # 514413 - Extra spaces at the end of CD mount point Patch13: util-linux-ng-2.16-libblkid-joliet.patch +# 519237 - bash: cannot set terminal process group (-1): Inappropriate ioctl for device +Patch14: util-linux-ng-2.16-switchroot-tty.patch %description The util-linux-ng package contains a large variety of low-level system @@ -215,6 +217,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build unset LINGUAS || : @@ -725,6 +728,9 @@ fi %changelog +* Mon Oct 5 2009 Karel Zak 2.16-10.2 +- fix #519237 - bash: cannot set terminal process group (-1): Inappropriate ioctl for device + * Fri Oct 2 2009 Karel Zak 2.16-10.1 - #514413 - Extra spaces at the end of CD mount point From 7dda70690df66fe315e4efc6aab2f62bc33ea22e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:16:35 +0000 Subject: [PATCH 04/16] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c0f296d..c5d5fa9 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: util-linux-ng -# $Id$ +# $Id: Makefile,v 1.1 2007/08/17 21:07:02 wtogami Exp $ NAME := util-linux-ng SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From a2ebc32935a90f732bb21f84457cedb9e266761b Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 30 Nov 2009 11:19:21 +0000 Subject: [PATCH 05/16] - fix #539325 - fix VIA RAID detection - fix #541708 - libblkid does not recognize ufs partitions --- util-linux-ng-2.16-libblkid-packed.patch | 382 +++++++++++++++++++++++ util-linux-ng.spec | 10 +- 2 files changed, 391 insertions(+), 1 deletion(-) create mode 100644 util-linux-ng-2.16-libblkid-packed.patch diff --git a/util-linux-ng-2.16-libblkid-packed.patch b/util-linux-ng-2.16-libblkid-packed.patch new file mode 100644 index 0000000..9b22608 --- /dev/null +++ b/util-linux-ng-2.16-libblkid-packed.patch @@ -0,0 +1,382 @@ + + This is based on upstream commits: + + e7fee5520542fcfc6375e4ec1ffc1601971c937c - libblkid: fix UFS detection + 11854e2eff8b15411bbbc35c95dc77d6a722cc6b - libblkid: add missing packed attributes + + +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c 2009-11-30 12:06:14.000000000 +0100 +@@ -67,7 +67,7 @@ struct adaptec_metadata { + uint32_t raidtbl; + uint16_t raidline; + uint8_t res9[0xF6]; +-}; ++} __attribute__((packed)); + + #define AD_SIGNATURE "DPTM" + #define AD_MAGIC 0x37FC4D1E +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -30,9 +30,9 @@ struct cramfs_super + uint32_t edition; + uint32_t blocks; + uint32_t files; +- } info; ++ } __attribute__((packed)) info; + uint8_t name[16]; +-}; ++} __attribute__((packed)); + + static int probe_cramfs(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c.kzak 2009-11-30 11:59:36.000000000 +0100 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c 2009-11-30 12:06:14.000000000 +0100 +@@ -76,7 +76,7 @@ struct ext2_super_block { + uint64_t s_mmp_block; + uint32_t s_raid_stripe_width; + uint32_t s_reserved[163]; +-}; ++} __attribute__((packed)); + + /* magic string */ + #define EXT_SB_MAGIC "\123\357" +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -56,7 +56,7 @@ struct gfs2_sb { + struct gfs2_inum __pad3; /* Was quota inode in gfs1 */ + struct gfs2_inum __pad4; /* Was licence inode in gfs1 */ + uint8_t sb_uuid[16]; /* The UUID maybe 0 for backwards compat */ +-}; ++} __attribute__((packed)); + + static int probe_gfs(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -39,20 +39,20 @@ struct hpfs_boot_block + uint8_t sig_hpfs[8]; + uint8_t pad[448]; + uint8_t magic[2]; +-}; ++} __attribute__((packed)); + + struct hpfs_super_block + { + uint8_t magic[4]; + uint8_t magic1[4]; + uint8_t version; +-}; ++} __attribute__((packed)); + + struct hpfs_spare_super + { + uint8_t magic[4]; + uint8_t magic1[4]; +-}; ++} __attribute__((packed)); + + + #define HPFS_SB_OFFSET 0x2000 +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak 2009-11-30 11:59:36.000000000 +0100 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c 2009-11-30 12:06:14.000000000 +0100 +@@ -30,7 +30,7 @@ struct iso_volume_descriptor { + unsigned char unused[8]; + unsigned char space_size[8]; + unsigned char escape_sequences[8]; +-}; ++} __attribute__((packed)); + + #define ISO_SUPERBLOCK_OFFSET 0x8000 + #define ISO_SECTOR_SIZE 0x800 +@@ -47,7 +47,7 @@ struct high_sierra_volume_descriptor { + unsigned char unused1; + unsigned char system_id[32]; + unsigned char volume_id[32]; +-}; ++} __attribute__((packed)); + + /* returns 1 if the begin of @ascii is equal to @utf16 string. + */ +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c 2009-11-30 12:06:14.000000000 +0100 +@@ -37,7 +37,7 @@ struct luks_phdr { + uint8_t mkDigestSalt[LUKS_SALTSIZE]; + uint32_t mkDigestIterations; + uint8_t uuid[UUID_STRING_L]; +-}; ++} __attribute__((packed)); + + static int probe_luks(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -27,7 +27,7 @@ struct ntfs_super_block { + uint8_t reserved2[3]; + uint64_t volume_serial; + uint16_t checksum; +-}; ++} __attribute__((packed)); + + struct master_file_table_record { + uint32_t magic; +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c 2009-11-30 12:06:14.000000000 +0100 +@@ -21,7 +21,7 @@ struct nv_metadata { + uint32_t size; + uint32_t chksum; + uint16_t version; +-}; ++} __attribute__((packed)); + + #define NVIDIA_SIGNATURE "NVIDIA" + +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -28,7 +28,7 @@ struct reiserfs_super_block { + uint32_t rs_dummy4[5]; + unsigned char rs_uuid[16]; + char rs_label[16]; +-}; ++} __attribute__((packed)); + + struct reiser4_super_block { + unsigned char rs4_magic[16]; +@@ -36,7 +36,7 @@ struct reiser4_super_block { + unsigned char rs4_uuid[16]; + unsigned char rs4_label[16]; + uint64_t rs4_dummy2; +-}; ++} __attribute__((packed)); + + static int probe_reiser(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -21,7 +21,7 @@ struct romfs_super_block { + unsigned char ros_magic[8]; + uint32_t ros_dummy1[2]; + unsigned char ros_volume[16]; +-}; ++} __attribute__((packed)); + + static int probe_romfs(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c 2009-11-30 12:06:14.000000000 +0100 +@@ -35,7 +35,7 @@ struct silicon_metadata { + uint16_t vendor_id; + uint16_t minor_ver; + uint16_t major_ver; +-}; ++} __attribute__((packed)); + + #define SILICON_MAGIC 0x2F000000 + +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -26,7 +26,7 @@ struct sqsh_super_block { + uint32_t directory_table_start_2; + uint16_t s_major; + uint16_t s_minor; +-}; ++} __attribute__((packed)); + + static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c.kzak 2009-11-30 11:59:36.000000000 +0100 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c 2009-11-30 12:06:14.000000000 +0100 +@@ -28,7 +28,7 @@ struct swap_header_v1_2 { + unsigned char volume[16]; + uint32_t padding[117]; + uint32_t badpages[1]; +-}; ++} __attribute__((packed)); + + #define PAGESIZE_MIN 0xff6 /* 4086 (arm, i386, ...) */ + #define PAGESIZE_MAX 0xfff6 /* 65526 (ia64) */ +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c 2009-11-30 12:06:14.000000000 +0100 +@@ -39,7 +39,7 @@ struct xenix_super_block { + uint8_t s_fill[371]; + uint32_t s_magic; + uint32_t s_type; +-}; ++} __attribute__((packed)); + + + #define SYSV_NICINOD 100 +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c 2009-11-30 12:06:14.000000000 +0100 +@@ -28,28 +28,32 @@ struct volume_descriptor { + uint16_t crc; + uint16_t crc_len; + uint32_t location; +- } tag; ++ } __attribute__((packed)) tag; ++ + union { + struct anchor_descriptor { + uint32_t length; + uint32_t location; +- } anchor; ++ } __attribute__((packed)) anchor; ++ + struct primary_descriptor { + uint32_t seq_num; + uint32_t desc_num; + struct dstring { + uint8_t clen; + uint8_t c[31]; +- } ident; +- } primary; +- } type; +-}; ++ } __attribute__((packed)) ident; ++ } __attribute__((packed)) primary; ++ ++ } __attribute__((packed)) type; ++ ++} __attribute__((packed)); + + struct volume_structure_descriptor { + uint8_t type; + uint8_t id[5]; + uint8_t version; +-}; ++} __attribute__((packed)); + + #define UDF_VSD_OFFSET 0x8000 + +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c.kzak 2009-07-04 01:20:03.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c 2009-11-30 12:06:50.000000000 +0100 +@@ -117,7 +117,7 @@ struct ufs_super_block { + uint64_t fs_csaddr; + int64_t fs_pendingblocks; + int32_t fs_pendinginodes; +- } fs_u2; ++ } __attribute__((packed)) fs_u2; + } fs_u11; + union { + struct { +@@ -153,17 +153,22 @@ struct ufs_super_block { + int32_t fs_rotbloff; + uint32_t fs_magic; + uint8_t fs_space[1]; +-}; ++} __attribute__((packed)); + + #define UFS_MAGIC 0x00011954 + #define UFS2_MAGIC 0x19540119 + #define UFS_MAGIC_FEA 0x00195612 + #define UFS_MAGIC_LFN 0x00095014 ++#define UFS_MAGIC_SEC 0x00612195 ++#define UFS_MAGIC_4GB 0x05231994 + + static int probe_ufs(blkid_probe pr, const struct blkid_idmag *mag) + { + int offsets[] = { 0, 8, 64, 256 }; +- int mags[] = { UFS2_MAGIC, UFS_MAGIC, UFS_MAGIC_FEA, UFS_MAGIC_LFN }; ++ int mags[] = { ++ UFS2_MAGIC, UFS_MAGIC, UFS_MAGIC_FEA, UFS_MAGIC_LFN, ++ UFS_MAGIC_SEC, UFS_MAGIC_4GB ++ }; + int i; + uint32_t magic; + struct ufs_super_block *ufs; +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c 2009-11-30 12:06:14.000000000 +0100 +@@ -47,7 +47,7 @@ struct vfat_super_block { + /* 52*/ unsigned char vs_magic[8]; + /* 5a*/ unsigned char vs_dummy2[164]; + /*1fe*/ unsigned char vs_pmagic[2]; +-}; ++} __attribute__((packed)); + + /* Yucky misaligned values */ + struct msdos_super_block { +@@ -71,7 +71,7 @@ struct msdos_super_block { + /* 36*/ unsigned char ms_magic[8]; + /* 3d*/ unsigned char ms_dummy2[192]; + /*1fe*/ unsigned char ms_pmagic[2]; +-}; ++} __attribute__((packed)); + + struct vfat_dir_entry { + uint8_t name[11]; +@@ -85,7 +85,7 @@ struct vfat_dir_entry { + uint16_t date_write; + uint16_t cluster_low; + uint32_t size; +-}; ++} __attribute__((packed)); + + struct fat32_fsinfo { + uint8_t signature1[4]; +@@ -94,7 +94,7 @@ struct fat32_fsinfo { + uint32_t free_clusters; + uint32_t next_cluster; + uint32_t reserved2[4]; +-}; ++} __attribute__((packed)); + + /* maximum number of clusters */ + #define FAT12_MAX 0xFF4 +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c 2009-11-30 12:06:14.000000000 +0100 +@@ -27,10 +27,10 @@ struct via_metadata { + uint32_t capacity_low; + uint32_t capacity_high; + uint32_t serial_checksum; +- } array; ++ } __attribute__((packed)) array; + uint32_t serial_checksum[8]; + uint8_t checksum; +-}; ++} __attribute__((packed)); + + #define VIA_SIGNATURE 0xAA55 + +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -32,7 +32,7 @@ struct xfs_super_block { + uint64_t xs_icount; + uint64_t xs_ifree; + uint64_t xs_fdblocks; +-}; ++} __attribute__((packed)); + + static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag) + { +diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c +--- util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 ++++ util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c 2009-11-30 12:06:14.000000000 +0100 +@@ -24,7 +24,7 @@ struct zfs_uberblock { + uint64_t ub_guid_sum; /* sum of all vdev guids */ + uint64_t ub_timestamp; /* UTC time of last sync */ + /*blkptr_t ub_rootbp;*/ /* MOS objset_phys_t */ +-}; ++} __attribute__((packed)); + + static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag) + { diff --git a/util-linux-ng.spec b/util-linux-ng.spec index b0208c3..96cdce7 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16 -Release: 10.2%{?dist} +Release: 10.3%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -118,6 +118,9 @@ Patch12: util-linux-ng-2.16-blkid-swsuspend.patch Patch13: util-linux-ng-2.16-libblkid-joliet.patch # 519237 - bash: cannot set terminal process group (-1): Inappropriate ioctl for device Patch14: util-linux-ng-2.16-switchroot-tty.patch +# 539325 - fix VIA RAID detection +# 541708 - libblkid does not recognize ufs partitions +Patch15: util-linux-ng-2.16-libblkid-packed.patch %description The util-linux-ng package contains a large variety of low-level system @@ -218,6 +221,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 %build unset LINGUAS || : @@ -728,6 +732,10 @@ fi %changelog +* Mon Nov 30 2009 Karel Zak 2.16-10.3 +- fix #539325 - fix VIA RAID detection +- fix #541708 - libblkid does not recognize ufs partitions + * Mon Oct 5 2009 Karel Zak 2.16-10.2 - fix #519237 - bash: cannot set terminal process group (-1): Inappropriate ioctl for device From 7cf27511292f70b616786b69e9a392dbe5873a0f Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 7 Dec 2009 08:58:40 +0000 Subject: [PATCH 06/16] - upgrade to 2.16.2 (removes 7 patches) ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.2-Releas eNotes - fix #531992 - not prompted for passphrase --- .cvsignore | 2 +- sources | 2 +- util-linux-ng-2.14-sfdisk-dump.patch | 54 --- util-linux-ng-2.16-blkid-crypto.path | 41 ++ util-linux-ng-2.16-blkid-swsuspend.patch | 26 -- util-linux-ng-2.16-libblkid-compression.patch | 57 --- util-linux-ng-2.16-libblkid-ext2.patch | 51 --- util-linux-ng-2.16-libblkid-joliet.patch | 118 ------ util-linux-ng-2.16-libblkid-packed.patch | 382 ------------------ util-linux-ng-2.16-switchroot-tty.patch | 17 - util-linux-ng.spec | 33 +- 11 files changed, 52 insertions(+), 731 deletions(-) delete mode 100644 util-linux-ng-2.14-sfdisk-dump.patch create mode 100644 util-linux-ng-2.16-blkid-crypto.path delete mode 100644 util-linux-ng-2.16-blkid-swsuspend.patch delete mode 100644 util-linux-ng-2.16-libblkid-compression.patch delete mode 100644 util-linux-ng-2.16-libblkid-ext2.patch delete mode 100644 util-linux-ng-2.16-libblkid-joliet.patch delete mode 100644 util-linux-ng-2.16-libblkid-packed.patch delete mode 100644 util-linux-ng-2.16-switchroot-tty.patch diff --git a/.cvsignore b/.cvsignore index df25c4e..f38fe5c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ -util-linux-ng-2.16.tar.bz2 +util-linux-ng-2.16.2.tar.bz2 floppy-0.16.tar.bz2 diff --git a/sources b/sources index f0be7b2..22eb2d3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -9623380641b0c2e0449f5b1ecc567663 util-linux-ng-2.16.tar.bz2 +edd1f7a82fd388cc0e1e3d2d1e7ea55a util-linux-ng-2.16.2.tar.bz2 7eeb9a6f7a258174bf0fa80f1370788d floppy-0.16.tar.bz2 diff --git a/util-linux-ng-2.14-sfdisk-dump.patch b/util-linux-ng-2.14-sfdisk-dump.patch deleted file mode 100644 index 89a644c..0000000 --- a/util-linux-ng-2.14-sfdisk-dump.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 1f1614f6a89de4b06e1843d0fadbca3f8a5521fe Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Fri, 11 Sep 2009 14:00:50 +0200 -Subject: [PATCH 1/2] sfdisk: dump has to be $LANG insensitive - -This stupid bug has been introduced by: - - commit add5133f4ad5136aac3ce7627e615d14893d0aeb - Author: Pedro Ribeiro - Date: Fri Oct 3 08:52:35 2008 +0200 - fdisk: several strings without gettext calls - -... so it shows that we need to improve our review process... :-( - -Address-Red-Hat-Bug: #522718 -Signed-off-by: Karel Zak ---- - fdisk/sfdisk.c | 10 +++++----- - 1 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c -index 8fae5bb..427cb40 100644 ---- a/fdisk/sfdisk.c -+++ b/fdisk/sfdisk.c -@@ -930,8 +930,8 @@ get_disksize(int format) { - static void - out_partition_header(char *dev, int format, struct geometry G) { - if (dump) { -- printf(_("# partition table of %s\n"), dev); -- printf(_("unit: sectors\n\n")); -+ printf("# partition table of %s\n", dev); -+ printf("unit: sectors\n\n"); - return; - } - -@@ -1059,12 +1059,12 @@ out_partition(char *dev, int format, struct part_desc *p, - size = p->size; - - if (dump) { -- printf(_(" start=%9lu"), start); -- printf(_(", size=%9lu"), size); -+ printf(" start=%9lu", start); -+ printf(", size=%9lu", size); - if (p->ptype == DOS_TYPE) { - printf(", Id=%2x", p->p.sys_type); - if (p->p.bootable == 0x80) -- printf(_(", bootable")); -+ printf(", bootable"); - } - printf("\n"); - return; --- -1.6.2.5 - diff --git a/util-linux-ng-2.16-blkid-crypto.path b/util-linux-ng-2.16-blkid-crypto.path new file mode 100644 index 0000000..65d6c10 --- /dev/null +++ b/util-linux-ng-2.16-blkid-crypto.path @@ -0,0 +1,41 @@ +From: Scott James Remnant +Subject: [PATCH] libblkid: return first detected crypto device + +Crypto devices may sometimes have multiple additional prober matches, +however just like RAID, there's no danger of activating the wrong one +since special help is needed to activate the block device before it +can be used. + +Thus modify blkid_do_safeprobe() to break out of the loop when a +crypto device is detected, as it does already for RAID. + +[kzak@redhar.com: - backport to 2.16.2 for Fedora-12] + +Signed-off-by: Scott James Remnant +Signed-off-by: Karel Zak + +diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probe.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probe.c +--- util-linux-ng-2.16.2/shlibs/blkid/src/probe.c.kzak 2009-12-07 09:44:46.000000000 +0100 ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probe.c 2009-12-07 09:47:12.000000000 +0100 +@@ -538,9 +538,9 @@ int blkid_do_probe(blkid_probe pr) + * (cannot be used in while()) and checks for ambivalen results (more + * filesystems on the device) -- in such case returns -2. + * +- * The function does not check for filesystems when a RAID signature is +- * detected. The function also does not check for collision between RAIDs. The +- * first detected RAID is returned. ++ * The function does not check for filesystems when a RAID or crypto signature ++ * is detected. The function also does not check for collision between RAIDs ++ * and crypto devices. The first detected RAID or crypto device is returned. + */ + int blkid_do_safeprobe(blkid_probe pr) + { +@@ -558,7 +558,7 @@ int blkid_do_safeprobe(blkid_probe pr) + } + count++; + +- if (idinfos[pr->idx]->usage & BLKID_USAGE_RAID) ++ if (idinfos[pr->idx]->usage & (BLKID_USAGE_RAID | BLKID_USAGE_CRYPTO)) + break; + if (!(idinfos[pr->idx]->flags & BLKID_IDINFO_TOLERANT)) + intol++; diff --git a/util-linux-ng-2.16-blkid-swsuspend.patch b/util-linux-ng-2.16-blkid-swsuspend.patch deleted file mode 100644 index f9f4bf1..0000000 --- a/util-linux-ng-2.16-blkid-swsuspend.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 71cd5d8a775d98e93f7583210a5b53c52b4ec34f Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Mon, 14 Sep 2009 10:24:07 +0200 -Subject: [PATCH] libblkid: fix typo (swsupend -> swsuspend) - -Signed-off-by: Karel Zak ---- - shlibs/blkid/src/probers/swap.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/shlibs/blkid/src/probers/swap.c b/shlibs/blkid/src/probers/swap.c -index 86eb94c..c289488 100644 ---- a/shlibs/blkid/src/probers/swap.c -+++ b/shlibs/blkid/src/probers/swap.c -@@ -118,7 +118,7 @@ const struct blkid_idinfo swap_idinfo = - - const struct blkid_idinfo swsuspend_idinfo = - { -- .name = "swsupend", -+ .name = "swsuspend", - .usage = BLKID_USAGE_OTHER, - .probefunc = probe_swsuspend, - .magics = --- -1.6.2.5 - diff --git a/util-linux-ng-2.16-libblkid-compression.patch b/util-linux-ng-2.16-libblkid-compression.patch deleted file mode 100644 index 111d793..0000000 --- a/util-linux-ng-2.16-libblkid-compression.patch +++ /dev/null @@ -1,57 +0,0 @@ -From e94e99523d8a3d0218fe16b0a7a2c5886ccbc652 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Sun, 23 Aug 2009 20:33:10 +0200 -Subject: [PATCH] libblkid: add *.ko.gz support to modules.dep parser - -Address-Red-Hat-Bug: #518572 -Signed-off-by: Karel Zak ---- - shlibs/blkid/src/probers/ext.c | 18 +++++++++--------- - 1 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/shlibs/blkid/src/probers/ext.c b/shlibs/blkid/src/probers/ext.c -index a4d35d1..c27411d 100644 ---- a/shlibs/blkid/src/probers/ext.c -+++ b/shlibs/blkid/src/probers/ext.c -@@ -224,8 +224,8 @@ static int check_for_modules(const char *fs_name) - #ifdef __linux__ - struct utsname uts; - FILE *f; -- char buf[1024], *cp, *t; -- int i; -+ char buf[1024], *cp; -+ int namesz; - - if (uname(&uts)) - return 0; -@@ -234,6 +234,9 @@ static int check_for_modules(const char *fs_name) - f = fopen(buf, "r"); - if (!f) - return 0; -+ -+ namesz = strlen(fs_name); -+ - while (!feof(f)) { - if (!fgets(buf, sizeof(buf), f)) - break; -@@ -244,13 +247,10 @@ static int check_for_modules(const char *fs_name) - if ((cp = strrchr(buf, '/')) == NULL) - continue; - cp++; -- i = strlen(cp); -- if (i > 3) { -- t = cp + i - 3; -- if (!strcmp(t, ".ko")) -- *t = 0; -- } -- if (!strcmp(cp, fs_name)) { -+ -+ if (!strncmp(cp, fs_name, namesz) && -+ (!strcmp(cp + namesz, ".ko") || -+ !strcmp(cp + namesz, ".ko.gz"))) { - fclose(f); - return 1; - } --- -1.6.2.5 - diff --git a/util-linux-ng-2.16-libblkid-ext2.patch b/util-linux-ng-2.16-libblkid-ext2.patch deleted file mode 100644 index 85cb6e0..0000000 --- a/util-linux-ng-2.16-libblkid-ext2.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 92cf3ab964266603cf36272d0eec96cd07fa083c Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 13 Aug 2009 21:55:43 +0200 -Subject: [PATCH] libblkid: fix ext2 detection on systems with ext4 only - -Address-Red-Hat-Bug: #513104 -Signed-off-by: Karel Zak ---- - shlibs/blkid/src/probers/ext.c | 12 ++++++------ - 1 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/shlibs/blkid/src/probers/ext.c b/shlibs/blkid/src/probers/ext.c -index 671e556..a4d35d1 100644 ---- a/shlibs/blkid/src/probers/ext.c -+++ b/shlibs/blkid/src/probers/ext.c -@@ -483,11 +483,6 @@ static int probe_ext4(blkid_probe pr, const struct blkid_idmag *mag) - if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) - return -BLKID_ERR_PARAM; - -- /* Ext4 has at least one feature which ext3 doesn't understand */ -- if (!(frc & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) && -- !(fi & EXT3_FEATURE_INCOMPAT_UNSUPPORTED)) -- return -BLKID_ERR_PARAM; -- - /* - * If the filesystem does not have a journal and ext2 is not - * present, then force this to be detected as an ext2 -@@ -498,6 +493,12 @@ static int probe_ext4(blkid_probe pr, const struct blkid_idmag *mag) - get_linux_version() >= EXT4_SUPPORTS_EXT2) - goto force_ext4; - -+ /* Ext4 has at least one feature which ext3 doesn't understand */ -+ if (!(frc & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) && -+ !(fi & EXT3_FEATURE_INCOMPAT_UNSUPPORTED)) -+ return -BLKID_ERR_PARAM; -+ -+force_ext4: - /* - * If the filesystem is a OK for use by in-development - * filesystem code, and ext4dev is supported or ext4 is not -@@ -513,7 +514,6 @@ static int probe_ext4(blkid_probe pr, const struct blkid_idmag *mag) - return -BLKID_ERR_PARAM; - } - --force_ext4: - ext_get_info(pr, 4, es); - return 0; - } --- -1.6.2.5 - diff --git a/util-linux-ng-2.16-libblkid-joliet.patch b/util-linux-ng-2.16-libblkid-joliet.patch deleted file mode 100644 index 74d063e..0000000 --- a/util-linux-ng-2.16-libblkid-joliet.patch +++ /dev/null @@ -1,118 +0,0 @@ -diff -up util-linux-ng-2.16/shlibs/blkid/src/probe.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probe.c ---- util-linux-ng-2.16/shlibs/blkid/src/probe.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probe.c 2009-10-02 20:53:33.000000000 +0200 -@@ -685,10 +685,27 @@ static int blkid_probe_set_usage(blkid_p - return blkid_probe_set_value(pr, "USAGE", (unsigned char *) u, strlen(u) + 1); - } - -+ -+/* Removes whitespace from the right-hand side of a string (trailing -+ * whitespace). -+ * -+ * Returns size of the new string (without \0). -+ */ -+static size_t blkid_rtrim_whitespace(unsigned char *str) -+{ -+ size_t i = strlen((char *) str); -+ -+ while (i--) { -+ if (!isspace(str[i])) -+ break; -+ } -+ str[++i] = '\0'; -+ return i; -+} -+ - int blkid_probe_set_label(blkid_probe pr, unsigned char *label, size_t len) - { - struct blkid_prval *v; -- int i; - - if (len > BLKID_PROBVAL_BUFSIZ) - len = BLKID_PROBVAL_BUFSIZ; -@@ -704,15 +721,7 @@ int blkid_probe_set_label(blkid_probe pr - - memcpy(v->data, label, len); - v->data[len] = '\0'; -- -- /* remove trailing whitespace */ -- i = strnlen((char *) v->data, len); -- while (i--) { -- if (!isspace(v->data[i])) -- break; -- } -- v->data[++i] = '\0'; -- v->len = i + 1; -+ v->len = blkid_rtrim_whitespace(v->data) + 1; - return 0; - } - -@@ -765,7 +774,8 @@ int blkid_probe_set_utf8label(blkid_prob - if (!v) - return -1; - -- v->len = encode_to_utf8(enc, v->data, sizeof(v->data), label, len); -+ encode_to_utf8(enc, v->data, sizeof(v->data), label, len); -+ v->len = blkid_rtrim_whitespace(v->data) + 1; - return 0; - } - -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c 2009-10-02 20:54:43.000000000 +0200 -@@ -19,6 +19,7 @@ - - #include "blkidP.h" - -+/* PVD - Primary volume descriptor */ - struct iso_volume_descriptor { - unsigned char vd_type; - unsigned char vd_id[5]; -@@ -48,6 +49,20 @@ struct high_sierra_volume_descriptor { - unsigned char volume_id[32]; - }; - -+/* returns 1 if the begin of @ascii is equal to @utf16 string. -+ */ -+static int ascii_eq_utf16be(unsigned char *ascii, -+ unsigned char *utf16, size_t len) -+{ -+ int a, u; -+ -+ for (a = 0, u = 0; u < len; a++, u += 2) { -+ if (utf16[u] != 0x0 || ascii[a] != utf16[u + 1]) -+ return 0; -+ } -+ return 1; -+} -+ - /* old High Sierra format */ - static int probe_iso9660_hsfs(blkid_probe pr, const struct blkid_idmag *mag) - { -@@ -82,8 +97,6 @@ static int probe_iso9660(blkid_probe pr, - /* Joliet Extension */ - off = ISO_VD_OFFSET; - for (i = 0; i < ISO_VD_MAX; i++) { -- uint8_t svd_label[64]; -- - iso = (struct iso_volume_descriptor *) - blkid_probe_get_buffer(pr, - off, -@@ -98,9 +111,16 @@ static int probe_iso9660(blkid_probe pr, - memcmp(iso->escape_sequences, "%/C", 3) == 0 || - memcmp(iso->escape_sequences, "%/E", 3) == 0) { - -+ /* Is the Joliet (UTF16BE) label equal to the label in -+ * the PVD? If yes, use PVD label. The Jolied version -+ * of the label could be trimed (because UTF16..). -+ */ -+ if (ascii_eq_utf16be(label, iso->volume_id, 32)) -+ break; -+ - blkid_probe_set_utf8label(pr, - iso->volume_id, -- sizeof(svd_label), -+ sizeof(iso->volume_id), - BLKID_ENC_UTF16BE); - - blkid_probe_set_version(pr, "Joliet Extension"); diff --git a/util-linux-ng-2.16-libblkid-packed.patch b/util-linux-ng-2.16-libblkid-packed.patch deleted file mode 100644 index 9b22608..0000000 --- a/util-linux-ng-2.16-libblkid-packed.patch +++ /dev/null @@ -1,382 +0,0 @@ - - This is based on upstream commits: - - e7fee5520542fcfc6375e4ec1ffc1601971c937c - libblkid: fix UFS detection - 11854e2eff8b15411bbbc35c95dc77d6a722cc6b - libblkid: add missing packed attributes - - -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/adaptec_raid.c 2009-11-30 12:06:14.000000000 +0100 -@@ -67,7 +67,7 @@ struct adaptec_metadata { - uint32_t raidtbl; - uint16_t raidline; - uint8_t res9[0xF6]; --}; -+} __attribute__((packed)); - - #define AD_SIGNATURE "DPTM" - #define AD_MAGIC 0x37FC4D1E -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/cramfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -30,9 +30,9 @@ struct cramfs_super - uint32_t edition; - uint32_t blocks; - uint32_t files; -- } info; -+ } __attribute__((packed)) info; - uint8_t name[16]; --}; -+} __attribute__((packed)); - - static int probe_cramfs(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c.kzak 2009-11-30 11:59:36.000000000 +0100 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/ext.c 2009-11-30 12:06:14.000000000 +0100 -@@ -76,7 +76,7 @@ struct ext2_super_block { - uint64_t s_mmp_block; - uint32_t s_raid_stripe_width; - uint32_t s_reserved[163]; --}; -+} __attribute__((packed)); - - /* magic string */ - #define EXT_SB_MAGIC "\123\357" -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/gfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -56,7 +56,7 @@ struct gfs2_sb { - struct gfs2_inum __pad3; /* Was quota inode in gfs1 */ - struct gfs2_inum __pad4; /* Was licence inode in gfs1 */ - uint8_t sb_uuid[16]; /* The UUID maybe 0 for backwards compat */ --}; -+} __attribute__((packed)); - - static int probe_gfs(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/hpfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -39,20 +39,20 @@ struct hpfs_boot_block - uint8_t sig_hpfs[8]; - uint8_t pad[448]; - uint8_t magic[2]; --}; -+} __attribute__((packed)); - - struct hpfs_super_block - { - uint8_t magic[4]; - uint8_t magic1[4]; - uint8_t version; --}; -+} __attribute__((packed)); - - struct hpfs_spare_super - { - uint8_t magic[4]; - uint8_t magic1[4]; --}; -+} __attribute__((packed)); - - - #define HPFS_SB_OFFSET 0x2000 -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c.kzak 2009-11-30 11:59:36.000000000 +0100 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/iso9660.c 2009-11-30 12:06:14.000000000 +0100 -@@ -30,7 +30,7 @@ struct iso_volume_descriptor { - unsigned char unused[8]; - unsigned char space_size[8]; - unsigned char escape_sequences[8]; --}; -+} __attribute__((packed)); - - #define ISO_SUPERBLOCK_OFFSET 0x8000 - #define ISO_SECTOR_SIZE 0x800 -@@ -47,7 +47,7 @@ struct high_sierra_volume_descriptor { - unsigned char unused1; - unsigned char system_id[32]; - unsigned char volume_id[32]; --}; -+} __attribute__((packed)); - - /* returns 1 if the begin of @ascii is equal to @utf16 string. - */ -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/luks.c 2009-11-30 12:06:14.000000000 +0100 -@@ -37,7 +37,7 @@ struct luks_phdr { - uint8_t mkDigestSalt[LUKS_SALTSIZE]; - uint32_t mkDigestIterations; - uint8_t uuid[UUID_STRING_L]; --}; -+} __attribute__((packed)); - - static int probe_luks(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/ntfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -27,7 +27,7 @@ struct ntfs_super_block { - uint8_t reserved2[3]; - uint64_t volume_serial; - uint16_t checksum; --}; -+} __attribute__((packed)); - - struct master_file_table_record { - uint32_t magic; -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/nvidia_raid.c 2009-11-30 12:06:14.000000000 +0100 -@@ -21,7 +21,7 @@ struct nv_metadata { - uint32_t size; - uint32_t chksum; - uint16_t version; --}; -+} __attribute__((packed)); - - #define NVIDIA_SIGNATURE "NVIDIA" - -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/reiserfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -28,7 +28,7 @@ struct reiserfs_super_block { - uint32_t rs_dummy4[5]; - unsigned char rs_uuid[16]; - char rs_label[16]; --}; -+} __attribute__((packed)); - - struct reiser4_super_block { - unsigned char rs4_magic[16]; -@@ -36,7 +36,7 @@ struct reiser4_super_block { - unsigned char rs4_uuid[16]; - unsigned char rs4_label[16]; - uint64_t rs4_dummy2; --}; -+} __attribute__((packed)); - - static int probe_reiser(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/romfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -21,7 +21,7 @@ struct romfs_super_block { - unsigned char ros_magic[8]; - uint32_t ros_dummy1[2]; - unsigned char ros_volume[16]; --}; -+} __attribute__((packed)); - - static int probe_romfs(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/silicon_raid.c 2009-11-30 12:06:14.000000000 +0100 -@@ -35,7 +35,7 @@ struct silicon_metadata { - uint16_t vendor_id; - uint16_t minor_ver; - uint16_t major_ver; --}; -+} __attribute__((packed)); - - #define SILICON_MAGIC 0x2F000000 - -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/squashfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -26,7 +26,7 @@ struct sqsh_super_block { - uint32_t directory_table_start_2; - uint16_t s_major; - uint16_t s_minor; --}; -+} __attribute__((packed)); - - static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c.kzak 2009-11-30 11:59:36.000000000 +0100 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/swap.c 2009-11-30 12:06:14.000000000 +0100 -@@ -28,7 +28,7 @@ struct swap_header_v1_2 { - unsigned char volume[16]; - uint32_t padding[117]; - uint32_t badpages[1]; --}; -+} __attribute__((packed)); - - #define PAGESIZE_MIN 0xff6 /* 4086 (arm, i386, ...) */ - #define PAGESIZE_MAX 0xfff6 /* 65526 (ia64) */ -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/sysv.c 2009-11-30 12:06:14.000000000 +0100 -@@ -39,7 +39,7 @@ struct xenix_super_block { - uint8_t s_fill[371]; - uint32_t s_magic; - uint32_t s_type; --}; -+} __attribute__((packed)); - - - #define SYSV_NICINOD 100 -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/udf.c 2009-11-30 12:06:14.000000000 +0100 -@@ -28,28 +28,32 @@ struct volume_descriptor { - uint16_t crc; - uint16_t crc_len; - uint32_t location; -- } tag; -+ } __attribute__((packed)) tag; -+ - union { - struct anchor_descriptor { - uint32_t length; - uint32_t location; -- } anchor; -+ } __attribute__((packed)) anchor; -+ - struct primary_descriptor { - uint32_t seq_num; - uint32_t desc_num; - struct dstring { - uint8_t clen; - uint8_t c[31]; -- } ident; -- } primary; -- } type; --}; -+ } __attribute__((packed)) ident; -+ } __attribute__((packed)) primary; -+ -+ } __attribute__((packed)) type; -+ -+} __attribute__((packed)); - - struct volume_structure_descriptor { - uint8_t type; - uint8_t id[5]; - uint8_t version; --}; -+} __attribute__((packed)); - - #define UDF_VSD_OFFSET 0x8000 - -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c.kzak 2009-07-04 01:20:03.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/ufs.c 2009-11-30 12:06:50.000000000 +0100 -@@ -117,7 +117,7 @@ struct ufs_super_block { - uint64_t fs_csaddr; - int64_t fs_pendingblocks; - int32_t fs_pendinginodes; -- } fs_u2; -+ } __attribute__((packed)) fs_u2; - } fs_u11; - union { - struct { -@@ -153,17 +153,22 @@ struct ufs_super_block { - int32_t fs_rotbloff; - uint32_t fs_magic; - uint8_t fs_space[1]; --}; -+} __attribute__((packed)); - - #define UFS_MAGIC 0x00011954 - #define UFS2_MAGIC 0x19540119 - #define UFS_MAGIC_FEA 0x00195612 - #define UFS_MAGIC_LFN 0x00095014 -+#define UFS_MAGIC_SEC 0x00612195 -+#define UFS_MAGIC_4GB 0x05231994 - - static int probe_ufs(blkid_probe pr, const struct blkid_idmag *mag) - { - int offsets[] = { 0, 8, 64, 256 }; -- int mags[] = { UFS2_MAGIC, UFS_MAGIC, UFS_MAGIC_FEA, UFS_MAGIC_LFN }; -+ int mags[] = { -+ UFS2_MAGIC, UFS_MAGIC, UFS_MAGIC_FEA, UFS_MAGIC_LFN, -+ UFS_MAGIC_SEC, UFS_MAGIC_4GB -+ }; - int i; - uint32_t magic; - struct ufs_super_block *ufs; -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/vfat.c 2009-11-30 12:06:14.000000000 +0100 -@@ -47,7 +47,7 @@ struct vfat_super_block { - /* 52*/ unsigned char vs_magic[8]; - /* 5a*/ unsigned char vs_dummy2[164]; - /*1fe*/ unsigned char vs_pmagic[2]; --}; -+} __attribute__((packed)); - - /* Yucky misaligned values */ - struct msdos_super_block { -@@ -71,7 +71,7 @@ struct msdos_super_block { - /* 36*/ unsigned char ms_magic[8]; - /* 3d*/ unsigned char ms_dummy2[192]; - /*1fe*/ unsigned char ms_pmagic[2]; --}; -+} __attribute__((packed)); - - struct vfat_dir_entry { - uint8_t name[11]; -@@ -85,7 +85,7 @@ struct vfat_dir_entry { - uint16_t date_write; - uint16_t cluster_low; - uint32_t size; --}; -+} __attribute__((packed)); - - struct fat32_fsinfo { - uint8_t signature1[4]; -@@ -94,7 +94,7 @@ struct fat32_fsinfo { - uint32_t free_clusters; - uint32_t next_cluster; - uint32_t reserved2[4]; --}; -+} __attribute__((packed)); - - /* maximum number of clusters */ - #define FAT12_MAX 0xFF4 -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/via_raid.c 2009-11-30 12:06:14.000000000 +0100 -@@ -27,10 +27,10 @@ struct via_metadata { - uint32_t capacity_low; - uint32_t capacity_high; - uint32_t serial_checksum; -- } array; -+ } __attribute__((packed)) array; - uint32_t serial_checksum[8]; - uint8_t checksum; --}; -+} __attribute__((packed)); - - #define VIA_SIGNATURE 0xAA55 - -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/xfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -32,7 +32,7 @@ struct xfs_super_block { - uint64_t xs_icount; - uint64_t xs_ifree; - uint64_t xs_fdblocks; --}; -+} __attribute__((packed)); - - static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag) - { -diff -up util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c.kzak util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c ---- util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c.kzak 2009-07-04 01:20:02.000000000 +0200 -+++ util-linux-ng-2.16/shlibs/blkid/src/probers/zfs.c 2009-11-30 12:06:14.000000000 +0100 -@@ -24,7 +24,7 @@ struct zfs_uberblock { - uint64_t ub_guid_sum; /* sum of all vdev guids */ - uint64_t ub_timestamp; /* UTC time of last sync */ - /*blkptr_t ub_rootbp;*/ /* MOS objset_phys_t */ --}; -+} __attribute__((packed)); - - static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag) - { diff --git a/util-linux-ng-2.16-switchroot-tty.patch b/util-linux-ng-2.16-switchroot-tty.patch deleted file mode 100644 index 14ee89f..0000000 --- a/util-linux-ng-2.16-switchroot-tty.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -up util-linux-ng-2.16/sys-utils/switch_root.c.kzak util-linux-ng-2.16/sys-utils/switch_root.c ---- util-linux-ng-2.16/sys-utils/switch_root.c.kzak 2009-10-01 21:01:31.000000000 +0200 -+++ util-linux-ng-2.16/sys-utils/switch_root.c 2009-10-01 21:01:52.000000000 +0200 -@@ -267,13 +267,6 @@ int main(int argc, char *argv[]) - if (access(init, X_OK)) - warn("cannot access %s", init); - -- /* get session leader */ -- setsid(); -- -- /* set controlling terminal */ -- if (ioctl (0, TIOCSCTTY, 1)) -- warn("failed to TIOCSCTTY"); -- - execv(init, initargs); - err(EXIT_FAILURE, "failed to execute %s", init); - } diff --git a/util-linux-ng.spec b/util-linux-ng.spec index 96cdce7..40d6767 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -1,8 +1,8 @@ ### Header Summary: A collection of basic system utilities Name: util-linux-ng -Version: 2.16 -Release: 10.3%{?dist} +Version: 2.16.2 +Release: 1%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -105,22 +105,8 @@ Patch7: util-linux-ng-2.13-login-lastlog.patch Patch8: util-linux-ng-2.15-ipcs-32bit.patch ### Upstream patches -### -# 513104 - blkid returns no fstype for ext2 device when ext2 module not loaded -Patch9: util-linux-ng-2.16-libblkid-ext2.patch -# 518572 - blkid requires ext2.ko to be decompressed on installation media -Patch10: util-linux-ng-2.16-libblkid-compression.patch -# 522718 - sfdisk -d /dev/xxx | sfdisk --force /dev/yyy fails when LANG is set -Patch11: util-linux-ng-2.14-sfdisk-dump.patch -# Swsuspend does not work -Patch12: util-linux-ng-2.16-blkid-swsuspend.patch -# 514413 - Extra spaces at the end of CD mount point -Patch13: util-linux-ng-2.16-libblkid-joliet.patch -# 519237 - bash: cannot set terminal process group (-1): Inappropriate ioctl for device -Patch14: util-linux-ng-2.16-switchroot-tty.patch -# 539325 - fix VIA RAID detection -# 541708 - libblkid does not recognize ufs partitions -Patch15: util-linux-ng-2.16-libblkid-packed.patch +# 531992 - not prompted for passphrase +Patch9: util-linux-ng-2.16-blkid-crypto.path %description The util-linux-ng package contains a large variety of low-level system @@ -216,12 +202,6 @@ cp %{SOURCE8} %{SOURCE9} . %patch7 -p1 %patch8 -p1 %patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 %build unset LINGUAS || : @@ -732,6 +712,11 @@ fi %changelog +* Mon Dec 7 2009 Karel Zak 2.16.2-1 +- upgrade to 2.16.2 (removes 7 patches) + ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.2-ReleaseNotes +- fix #531992 - not prompted for passphrase + * Mon Nov 30 2009 Karel Zak 2.16-10.3 - fix #539325 - fix VIA RAID detection - fix #541708 - libblkid does not recognize ufs partitions From eacf3d56edf9984eda78daf5e5287894542160e8 Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 7 Dec 2009 09:43:23 +0000 Subject: [PATCH 07/16] - fix #536797 - ntfs volume labels are not correct in hal --- util-linux-ng-2.16-blkid-ntfs.path | 65 ++++++++++++++++++++++++++++++ util-linux-ng.spec | 8 +++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 util-linux-ng-2.16-blkid-ntfs.path diff --git a/util-linux-ng-2.16-blkid-ntfs.path b/util-linux-ng-2.16-blkid-ntfs.path new file mode 100644 index 0000000..e0dab70 --- /dev/null +++ b/util-linux-ng-2.16-blkid-ntfs.path @@ -0,0 +1,65 @@ + + Backport from upstream to Fedora-12, original patch: + + commit 832b3f2eb6a6c5f2e7d8db422767404320e45ced + Author: Karel Zak + Date: Fri Nov 13 00:10:48 2009 +0100 + + libblkid: fix NTFS non-ASCII labels + + Addresses-Red-Hat-Bug: #536797 + Signed-off-by: Karel Zak + + + +diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c +--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c.kzak 2009-11-30 12:43:13.000000000 +0100 ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c 2009-12-07 10:34:10.000000000 +0100 +@@ -65,10 +65,9 @@ static int probe_ntfs(blkid_probe pr, co + struct ntfs_super_block *ns; + struct master_file_table_record *mft; + struct file_attribute *attr; +- unsigned char label_str[129], *cp; + int bytes_per_sector, sectors_per_cluster; + int mft_record_size, attr_off, attr_len; +- unsigned int i, attr_type, val_len; ++ unsigned int attr_type, val_len; + int val_off; + uint64_t nr_clusters; + blkid_loff_t off; +@@ -128,7 +127,6 @@ static int probe_ntfs(blkid_probe pr, co + mft = (struct master_file_table_record *) buf_mft; + + attr_off = le16_to_cpu(mft->attrs_offset); +- label_str[0] = 0; + + while (1) { + attr = (struct file_attribute *) (buf_mft + attr_off); +@@ -147,16 +145,8 @@ static int probe_ntfs(blkid_probe pr, co + break; + + if (attr_type == MFT_RECORD_ATTR_VOLUME_NAME) { +- if (val_len > sizeof(label_str)) +- val_len = sizeof(label_str)-1; +- +- for (i=0, cp=label_str; i < val_len; i+=2,cp++) { +- val = ((uint8_t *) attr) + val_off + i; +- *cp = val[0]; +- if (val[1]) +- *cp = '?'; +- } +- *cp = 0; ++ val = ((uint8_t *) attr) + val_off; ++ blkid_probe_set_utf8label(pr, val, val_len, BLKID_ENC_UTF16LE); + } + } + +@@ -164,8 +154,6 @@ static int probe_ntfs(blkid_probe pr, co + (unsigned char *) &ns->volume_serial, + sizeof(ns->volume_serial), + "%016" PRIX64, le64_to_cpu(ns->volume_serial)); +- if (label_str[0]) +- blkid_probe_set_label(pr, label_str, strlen((char *)label_str)); + return 0; + } + diff --git a/util-linux-ng.spec b/util-linux-ng.spec index 40d6767..ea70e3d 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -107,6 +107,8 @@ Patch8: util-linux-ng-2.15-ipcs-32bit.patch ### Upstream patches # 531992 - not prompted for passphrase Patch9: util-linux-ng-2.16-blkid-crypto.path +# 536797 - ntfs volume labels are not correct in hal +Patch10: util-linux-ng-2.16-blkid-ntfs.path %description The util-linux-ng package contains a large variety of low-level system @@ -202,6 +204,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 %build unset LINGUAS || : @@ -712,6 +715,9 @@ fi %changelog +* Mon Dec 7 2009 Karel Zak 2.16.2-2 +- fix #536797 - ntfs volume labels are not correct in hal + * Mon Dec 7 2009 Karel Zak 2.16.2-1 - upgrade to 2.16.2 (removes 7 patches) ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.2-ReleaseNotes From 43b042be2b179e9f0fab859642df8235181844b6 Mon Sep 17 00:00:00 2001 From: kzak Date: Wed, 9 Dec 2009 20:58:54 +0000 Subject: [PATCH 08/16] - fix typo in spec file --- ...-crypto.path => util-linux-ng-2.16-blkid-crypto.patch | 0 ...lkid-ntfs.path => util-linux-ng-2.16-blkid-ntfs.patch | 0 util-linux-ng.spec | 9 ++++++--- 3 files changed, 6 insertions(+), 3 deletions(-) rename util-linux-ng-2.16-blkid-crypto.path => util-linux-ng-2.16-blkid-crypto.patch (100%) rename util-linux-ng-2.16-blkid-ntfs.path => util-linux-ng-2.16-blkid-ntfs.patch (100%) diff --git a/util-linux-ng-2.16-blkid-crypto.path b/util-linux-ng-2.16-blkid-crypto.patch similarity index 100% rename from util-linux-ng-2.16-blkid-crypto.path rename to util-linux-ng-2.16-blkid-crypto.patch diff --git a/util-linux-ng-2.16-blkid-ntfs.path b/util-linux-ng-2.16-blkid-ntfs.patch similarity index 100% rename from util-linux-ng-2.16-blkid-ntfs.path rename to util-linux-ng-2.16-blkid-ntfs.patch diff --git a/util-linux-ng.spec b/util-linux-ng.spec index ea70e3d..857cb0b 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -106,9 +106,9 @@ Patch8: util-linux-ng-2.15-ipcs-32bit.patch ### Upstream patches # 531992 - not prompted for passphrase -Patch9: util-linux-ng-2.16-blkid-crypto.path +Patch9: util-linux-ng-2.16-blkid-crypto.patch # 536797 - ntfs volume labels are not correct in hal -Patch10: util-linux-ng-2.16-blkid-ntfs.path +Patch10: util-linux-ng-2.16-blkid-ntfs.patch %description The util-linux-ng package contains a large variety of low-level system @@ -715,6 +715,9 @@ fi %changelog +* Wed Dec 9 2009 Karel Zak 2.16.2-3 +- fix typo in spec file + * Mon Dec 7 2009 Karel Zak 2.16.2-2 - fix #536797 - ntfs volume labels are not correct in hal From 7aec78fd0d9961ee2bc831577568ce0338b7294e Mon Sep 17 00:00:00 2001 From: kzak Date: Thu, 10 Dec 2009 14:25:08 +0000 Subject: [PATCH 09/16] - fix typo in spec file - add Requires: libblkid and libuuid (bz#531992 comment #38) --- util-linux-ng.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util-linux-ng.spec b/util-linux-ng.spec index 857cb0b..e931297 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -75,6 +75,8 @@ Requires(post): /sbin/install-info Requires(post): coreutils Requires: pam >= 1.0.90, /etc/pam.d/system-auth Requires: audit-libs >= 1.0.6 +Requires: libuuid = %{version}-%{release} +Requires: libblkid = %{version}-%{release} %if %{include_raw} Requires: udev %endif @@ -715,8 +717,9 @@ fi %changelog -* Wed Dec 9 2009 Karel Zak 2.16.2-3 +* Thu Dec 10 2009 Karel Zak 2.16.2-3 - fix typo in spec file +- add Requires: libblkid and libuuid (bz#531992 comment #38) * Mon Dec 7 2009 Karel Zak 2.16.2-2 - fix #536797 - ntfs volume labels are not correct in hal From 45c4f71208d2258a95c9c1f85c4aea203044e802 Mon Sep 17 00:00:00 2001 From: kzak Date: Thu, 10 Dec 2009 14:37:50 +0000 Subject: [PATCH 10/16] increment release number, fix changelog --- util-linux-ng.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util-linux-ng.spec b/util-linux-ng.spec index e931297..58d8f35 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -717,10 +717,12 @@ fi %changelog -* Thu Dec 10 2009 Karel Zak 2.16.2-3 -- fix typo in spec file +* Thu Dec 10 2009 Karel Zak 2.16.2-4 - add Requires: libblkid and libuuid (bz#531992 comment #38) +* Wed Dec 9 2009 Karel Zak 2.16.2-3 +- fix typo in spec file + * Mon Dec 7 2009 Karel Zak 2.16.2-2 - fix #536797 - ntfs volume labels are not correct in hal From 62111d14ce21192775954c6ad799ede063370f99 Mon Sep 17 00:00:00 2001 From: kzak Date: Tue, 15 Dec 2009 13:39:10 +0000 Subject: [PATCH 11/16] - fix #547245 - blkid does not recognize Adaptec HostRAID members --- util-linux-ng-2.16-blkid-ataraid.patch | 69 ++++++++++++++++++++++++++ util-linux-ng.spec | 8 ++- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 util-linux-ng-2.16-blkid-ataraid.patch diff --git a/util-linux-ng-2.16-blkid-ataraid.patch b/util-linux-ng-2.16-blkid-ataraid.patch new file mode 100644 index 0000000..e0657e6 --- /dev/null +++ b/util-linux-ng-2.16-blkid-ataraid.patch @@ -0,0 +1,69 @@ +diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c +--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c.kzak 2009-11-30 12:43:13.000000000 +0100 ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c 2009-12-15 14:18:10.000000000 +0100 +@@ -16,6 +16,7 @@ + #include "blkidP.h" + + struct adaptec_metadata { ++ + uint32_t b0idcode; + uint8_t lunsave[8]; + uint16_t sdtype; +@@ -63,13 +64,13 @@ struct adaptec_metadata { + uint32_t fwTestMagic; + uint32_t fwTestSeqNum; + uint8_t fwTestRes[8]; +- uint8_t smagic[4]; ++ uint32_t smagic; + uint32_t raidtbl; + uint16_t raidline; + uint8_t res9[0xF6]; + } __attribute__((packed)); + +-#define AD_SIGNATURE "DPTM" ++#define AD_SIGNATURE 0x4450544D /* "DPTM" */ + #define AD_MAGIC 0x37FC4D1E + + static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag) +@@ -87,7 +88,7 @@ static int probe_adraid(blkid_probe pr, + sizeof(struct adaptec_metadata)); + if (!ad) + return -1; +- if (memcmp(ad->smagic, AD_SIGNATURE, sizeof(AD_SIGNATURE)) != 0) ++ if (ad->smagic != be32_to_cpu(AD_SIGNATURE)) + return -1; + if (ad->b0idcode != be32_to_cpu(AD_MAGIC)) + return -1; +diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c +--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c.kzak 2009-11-30 12:37:08.000000000 +0100 ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c 2009-12-15 14:18:10.000000000 +0100 +@@ -45,18 +45,25 @@ static int probe_highpoint45x(blkid_prob + } + + const struct blkid_idinfo highpoint45x_idinfo = { +- .name = "highpoint_raid_member", ++ .name = "hpt45x_raid_member", + .usage = BLKID_USAGE_RAID, + .probefunc = probe_highpoint45x, + .magics = BLKID_NONE_MAGIC + }; + + const struct blkid_idinfo highpoint37x_idinfo = { +- .name = "highpoint_raid_member", ++ .name = "hpt37x_raid_member", + .usage = BLKID_USAGE_RAID, + .magics = { +- { .magic = "\xf0\x16\x78\x5a", .len = 4, .kboff = 4 }, +- { .magic = "\xfd\x16\x78\x5a", .len = 4, .kboff = 4 }, ++ /* ++ * Superblok offset: 4608 bytes (9 sectors) ++ * Magic string offset within superblock: 32 bytes ++ * ++ * kboff = (4608 + 32) / 1024 ++ * sboff = (4608 + 32) % kboff ++ */ ++ { .magic = "\xf0\x16\x78\x5a", .len = 4, .kboff = 4, .sboff = 544 }, ++ { .magic = "\xfd\x16\x78\x5a", .len = 4, .kboff = 4, .sboff = 544 }, + { NULL } + } + }; diff --git a/util-linux-ng.spec b/util-linux-ng.spec index 58d8f35..8b3a7a0 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -111,6 +111,8 @@ Patch8: util-linux-ng-2.15-ipcs-32bit.patch Patch9: util-linux-ng-2.16-blkid-crypto.patch # 536797 - ntfs volume labels are not correct in hal Patch10: util-linux-ng-2.16-blkid-ntfs.patch +# 547245 - blkid does not recognize Adaptec HostRAID members +Patch11: util-linux-ng-2.16-blkid-ataraid.patch %description The util-linux-ng package contains a large variety of low-level system @@ -207,6 +209,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 %build unset LINGUAS || : @@ -717,6 +720,9 @@ fi %changelog +* Tue Dec 15 2009 Karel Zak 2.16.2-5 +- fix #547245 - blkid does not recognize Adaptec HostRAID members + * Thu Dec 10 2009 Karel Zak 2.16.2-4 - add Requires: libblkid and libuuid (bz#531992 comment #38) From fa547b9550f824e45e3095b4303f79f7126eda23 Mon Sep 17 00:00:00 2001 From: kzak Date: Wed, 17 Feb 2010 09:45:17 +0000 Subject: [PATCH 12/16] - fix #557831 - blkid detects ext4 fs as minix fs - fix #494070 - Anaconda tries to mount zfs filesystem as EXT3 and install fails --- util-linux-ng-2.16-blkid-minix.patch | 91 ++++++++++++++++++++++++++++ util-linux-ng-2.16-blkid-zfs.patch | 62 +++++++++++++++++++ util-linux-ng.spec | 13 +++- 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 util-linux-ng-2.16-blkid-minix.patch create mode 100644 util-linux-ng-2.16-blkid-zfs.patch diff --git a/util-linux-ng-2.16-blkid-minix.patch b/util-linux-ng-2.16-blkid-minix.patch new file mode 100644 index 0000000..00e5861 --- /dev/null +++ b/util-linux-ng-2.16-blkid-minix.patch @@ -0,0 +1,91 @@ +diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c +--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak 2009-11-30 12:37:08.000000000 +0100 ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c 2010-02-17 10:33:53.000000000 +0100 +@@ -11,20 +11,84 @@ + + #include "blkidP.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; ++}; ++ ++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; ++}; ++ ++#define MINIX_BLOCK_SIZE_BITS 10 ++#define MINIX_BLOCK_SIZE (1 << MINIX_BLOCK_SIZE_BITS) ++ + static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag) + { ++ int version; ++ + /* for more details see magic strings below */ + switch(mag->magic[1]) { + case '\023': +- blkid_probe_set_version(pr, "1"); ++ version = 1; + break; + case '\044': +- blkid_probe_set_version(pr, "2"); ++ version = 2; + break; + case '\115': +- blkid_probe_set_version(pr, "3"); ++ version = 3; ++ break; ++ default: ++ return -1; + break; + } ++ ++ if (version <= 2) { ++ struct minix_super_block *sb; ++ uint32_t zones; ++ ++ sb = blkid_probe_get_sb(pr, mag, struct minix_super_block); ++ if (!sb || sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0) ++ return -1; ++ ++ zones = version == 2 ? sb->s_zones : sb->s_nzones; ++ ++ /* sanity checks to be sure that the FS is really minix */ ++ if (sb->s_imap_blocks * MINIX_BLOCK_SIZE * 8 < sb->s_ninodes + 1) ++ return -1; ++ if (sb->s_zmap_blocks * MINIX_BLOCK_SIZE * 8 < zones - sb->s_firstdatazone + 1) ++ return -1; ++ ++ } else if (version == 3) { ++ struct minix3_super_block *sb; ++ ++ sb = blkid_probe_get_sb(pr, mag, struct minix3_super_block); ++ if (!sb || sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0) ++ return -1; ++ ++ } ++ ++ blkid_probe_sprintf_version(pr, "%d", version); + return 0; + } + diff --git a/util-linux-ng-2.16-blkid-zfs.patch b/util-linux-ng-2.16-blkid-zfs.patch new file mode 100644 index 0000000..1989a51 --- /dev/null +++ b/util-linux-ng-2.16-blkid-zfs.patch @@ -0,0 +1,62 @@ +diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c +--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c.kzak 2009-11-30 12:43:13.000000000 +0100 ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c 2010-02-17 10:31:33.000000000 +0100 +@@ -23,21 +23,22 @@ struct zfs_uberblock { + uint64_t ub_txg; /* txg of last sync */ + uint64_t ub_guid_sum; /* sum of all vdev guids */ + uint64_t ub_timestamp; /* UTC time of last sync */ +- /*blkptr_t ub_rootbp;*/ /* MOS objset_phys_t */ ++ char ub_rootbp; /* MOS objset_phys_t */ + } __attribute__((packed)); + + static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag) + { + struct zfs_uberblock *ub; +- int swab_endian; + uint64_t spa_version; + + ub = blkid_probe_get_sb(pr, mag, struct zfs_uberblock); + if (!ub) + return -1; + +- swab_endian = (ub->ub_magic == swab64(UBERBLOCK_MAGIC)); +- spa_version = swab_endian ? swab64(ub->ub_version) : ub->ub_version; ++ if (ub->ub_magic == be64_to_cpu(UBERBLOCK_MAGIC)) ++ spa_version = be64_to_cpu(ub->ub_version); ++ else ++ spa_version = le64_to_cpu(ub->ub_version); + + blkid_probe_sprintf_version(pr, "%" PRIu64, spa_version); + #if 0 +@@ -56,10 +57,19 @@ const struct blkid_idinfo zfs_idinfo = + .probefunc = probe_zfs, + .magics = + { +- { .magic = "\0\0\x02\xf5\xb0\x07\xb1\x0c", .len = 8, .kboff = 8 }, +- { .magic = "\x1c\xb1\x07\xb0\xf5\x02\0\0", .len = 8, .kboff = 8 }, +- { .magic = "\0\0\x02\xf5\xb0\x07\xb1\x0c", .len = 8, .kboff = 264 }, +- { .magic = "\x0c\xb1\x07\xb0\xf5\x02\0\0", .len = 8, .kboff = 264 }, ++ /* ZFS has 128 root blocks (#4 is the first used), check only 6 of them */ ++ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 128 }, ++ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 128 }, ++ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 132 }, ++ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 132 }, ++ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 136 }, ++ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 136 }, ++ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 384 }, ++ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 384 }, ++ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 388 }, ++ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 388 }, ++ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 392 }, ++ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 392 }, + { NULL } + } + }; +diff -up util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs.kzak util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs +--- util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs.kzak 2009-10-16 22:50:03.000000000 +0200 ++++ util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs 2010-02-17 10:31:33.000000000 +0100 +@@ -1,3 +1,3 @@ + ID_FS_TYPE=zfs + ID_FS_USAGE=filesystem +-ID_FS_VERSION=1 ++ID_FS_VERSION=8 diff --git a/util-linux-ng.spec b/util-linux-ng.spec index 8b3a7a0..49d22b1 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -113,6 +113,11 @@ Patch9: util-linux-ng-2.16-blkid-crypto.patch Patch10: util-linux-ng-2.16-blkid-ntfs.patch # 547245 - blkid does not recognize Adaptec HostRAID members Patch11: util-linux-ng-2.16-blkid-ataraid.patch +# 557831 - blkid detects ext4 fs as minix fs +Patch12: util-linux-ng-2.16-blkid-minix.patch +# 494070 - Anaconda tries to mount zfs filesystem as EXT3 and install fails +Patch13: util-linux-ng-2.16-blkid-zfs.patch + %description The util-linux-ng package contains a large variety of low-level system @@ -210,6 +215,8 @@ cp %{SOURCE8} %{SOURCE9} . %patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 +%patch13 -p1 %build unset LINGUAS || : @@ -720,6 +727,10 @@ fi %changelog +* Wed Feb 17 2010 Karel Zak 2.16.2-6 +- fix #557831 - blkid detects ext4 fs as minix fs +- fix #494070 - Anaconda tries to mount zfs filesystem as EXT3 and install fails + * Tue Dec 15 2009 Karel Zak 2.16.2-5 - fix #547245 - blkid does not recognize Adaptec HostRAID members From ea621fccb04b6838966167ac3fdbb26711f931fa Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 8 Mar 2010 12:19:54 +0000 Subject: [PATCH 13/16] - fix #570606 - blkid (and related) should be a bit more robust --- util-linux-ng-2.16-blkid-minix.patch | 24 ++++++++++++++++++------ util-linux-ng.spec | 6 +++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/util-linux-ng-2.16-blkid-minix.patch b/util-linux-ng-2.16-blkid-minix.patch index 00e5861..99c341d 100644 --- a/util-linux-ng-2.16-blkid-minix.patch +++ b/util-linux-ng-2.16-blkid-minix.patch @@ -1,8 +1,11 @@ diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c --- util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak 2009-11-30 12:37:08.000000000 +0100 -+++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c 2010-02-17 10:33:53.000000000 +0100 -@@ -11,20 +11,84 @@ ++++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c 2010-03-08 13:11:54.000000000 +0100 +@@ -9,22 +9,96 @@ + * GNU Lesser General Public License. + */ ++#include #include "blkidP.h" +struct minix_super_block { @@ -39,6 +42,7 @@ diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak util-linux-n + static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag) { ++ unsigned char *ext; + int version; + /* for more details see magic strings below */ @@ -54,11 +58,11 @@ diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak util-linux-n case '\115': - blkid_probe_set_version(pr, "3"); + version = 3; -+ break; + break; + default: + return -1; - break; - } ++ break; ++ } + + if (version <= 2) { + struct minix_super_block *sb; @@ -83,7 +87,15 @@ diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak util-linux-n + if (!sb || sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0) + return -1; + -+ } + } ++ ++ /* unfortunately, some parts of ext3 is sometimes possible to ++ * interpreted as minix superblock. So check for extN magic ++ * string. (For extN magic string and offsets see ext.c.) ++ */ ++ ext = blkid_probe_get_buffer(pr, 0x400 + 0x38, 2); ++ if (ext && memcmp(ext, "\123\357", 2) == 0) ++ return -1; + + blkid_probe_sprintf_version(pr, "%d", version); return 0; diff --git a/util-linux-ng.spec b/util-linux-ng.spec index 49d22b1..ffe2ecd 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -114,6 +114,7 @@ Patch10: util-linux-ng-2.16-blkid-ntfs.patch # 547245 - blkid does not recognize Adaptec HostRAID members Patch11: util-linux-ng-2.16-blkid-ataraid.patch # 557831 - blkid detects ext4 fs as minix fs +# 570606 - blkid (and related) should be a bit more robust Patch12: util-linux-ng-2.16-blkid-minix.patch # 494070 - Anaconda tries to mount zfs filesystem as EXT3 and install fails Patch13: util-linux-ng-2.16-blkid-zfs.patch @@ -727,6 +728,9 @@ fi %changelog +* Mon Mar 8 2010 Karel Zak 2.16.2-7 +- fix #570606 - blkid (and related) should be a bit more robust + * Wed Feb 17 2010 Karel Zak 2.16.2-6 - fix #557831 - blkid detects ext4 fs as minix fs - fix #494070 - Anaconda tries to mount zfs filesystem as EXT3 and install fails From cc2529dc647e4c59f952305040cd7210acb5c4fb Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 12 Apr 2010 13:53:52 +0000 Subject: [PATCH 14/16] - fix #581252 - remounting tmpfs fails because of hidden rootcontext= --- mount.tmpfs | 13 ++++++++++--- util-linux-ng.spec | 5 ++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mount.tmpfs b/mount.tmpfs index f862c03..1734f4e 100644 --- a/mount.tmpfs +++ b/mount.tmpfs @@ -10,11 +10,18 @@ # /sbin/mount.tmpfs spec dir [-sfnv] [-o options] # -if ! echo "$@" | grep -q -E '(fs|def|root)?context='; then - con=$(ls --scontext -d "$2" | cut -f 1 -d ' ') - if [ -n "$con" ] && [ "$con" != "?" ] && [ "$con" != "unlabeled" ]; then +# Remount with context mount options is unsupported +# http://bugzilla.redhat.com/show_bug.cgi?id=563267 +# +if ! echo "$@" | grep -q -E '\-o.*remount'; then + + if ! echo "$@" | grep -q -E '(fs|def|root)?context='; then + con=$(ls --scontext -d "$2" | cut -f 1 -d ' ') + if [ -n "$con" ] && [ "$con" != "?" ] && [ "$con" != "unlabeled" ]; then exec /bin/mount "$@" -o "rootcontext=\"$con\"" -i -t tmpfs + fi fi + fi exec /bin/mount "$@" -i -t tmpfs diff --git a/util-linux-ng.spec b/util-linux-ng.spec index ffe2ecd..c6dfe39 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -728,6 +728,9 @@ fi %changelog +* Mon Apr 12 2010 Karel Zak 2.16.2-8 +- fix #581252 - remounting tmpfs fails because of hidden rootcontext= + * Mon Mar 8 2010 Karel Zak 2.16.2-7 - fix #570606 - blkid (and related) should be a bit more robust From ec700b7502182dca6a96e3085bdb41bcb1d4ca50 Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 12 Apr 2010 18:56:01 +0000 Subject: [PATCH 15/16] - fix #577947 - need --no-canonicalize option for mount --- util-linux-ng-2.16-mount-nocanonicalize.patch | 148 ++++++++++++++++++ util-linux-ng.spec | 9 +- 2 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 util-linux-ng-2.16-mount-nocanonicalize.patch diff --git a/util-linux-ng-2.16-mount-nocanonicalize.patch b/util-linux-ng-2.16-mount-nocanonicalize.patch new file mode 100644 index 0000000..1030021 --- /dev/null +++ b/util-linux-ng-2.16-mount-nocanonicalize.patch @@ -0,0 +1,148 @@ +diff -up util-linux-ng-2.16.2/mount/mount.8.kzak util-linux-ng-2.16.2/mount/mount.8 +--- util-linux-ng-2.16.2/mount/mount.8.kzak 2009-11-30 15:54:35.000000000 +0100 ++++ util-linux-ng-2.16.2/mount/mount.8 2010-04-12 17:32:22.000000000 +0200 +@@ -439,6 +439,14 @@ This is necessary for example when + .I /etc + is on a read-only filesystem. + .TP ++.B \-\-no\-canonicalize ++Don't canonicalize paths. The mount command canonicalizes all paths ++(from command line or fstab) and stores canonicalized paths to the ++.IR /etc/mtab ++file. This option can be used together with the ++.B \-f ++flag for already canonicalized absolut paths. ++.TP + .BI \-p " num" + In case of a loop mount with encryption, read the passphrase from + file descriptor +diff -up util-linux-ng-2.16.2/mount/mount.c.kzak util-linux-ng-2.16.2/mount/mount.c +--- util-linux-ng-2.16.2/mount/mount.c.kzak 2010-04-12 17:40:39.000000000 +0200 ++++ util-linux-ng-2.16.2/mount/mount.c 2010-04-12 17:34:34.000000000 +0200 +@@ -1878,6 +1878,7 @@ static struct option longopts[] = { + { "make-rslave", 0, 0, 141 }, + { "make-rprivate", 0, 0, 142 }, + { "make-runbindable", 0, 0, 143 }, ++ { "no-canonicalize", 0, 0, 144 }, + { "internal-only", 0, 0, 'i' }, + { NULL, 0, 0, 0 } + }; +@@ -2170,7 +2171,9 @@ main(int argc, char *argv[]) { + case 143: + mounttype = (MS_UNBINDABLE | MS_REC); + break; +- ++ case 144: ++ nocanonicalize = 1; ++ break; + case '?': + default: + usage (stderr, EX_USAGE); +@@ -2209,7 +2212,8 @@ main(int argc, char *argv[]) { + + if (restricted && + (types || options || readwrite || nomtab || mount_all || +- fake || mounttype || (argc + specseen) != 1)) { ++ nocanonicalize || fake || mounttype || (argc + specseen) != 1)) { ++ + die (EX_USAGE, _("mount: only root can do that")); + } + +diff -up util-linux-ng-2.16.2/mount/sundries.c.kzak util-linux-ng-2.16.2/mount/sundries.c +--- util-linux-ng-2.16.2/mount/sundries.c.kzak 2009-11-30 15:42:33.000000000 +0100 ++++ util-linux-ng-2.16.2/mount/sundries.c 2010-04-12 17:29:49.000000000 +0200 +@@ -21,6 +21,7 @@ + + int mount_quiet; + int verbose; ++int nocanonicalize; + char *progname; + + char * +@@ -270,9 +271,9 @@ canonicalize_spec (const char *path) + { + char *res; + +- if (path == NULL) ++ if (!path) + return NULL; +- if (is_pseudo_fs(path)) ++ if (nocanonicalize || is_pseudo_fs(path)) + return xstrdup(path); + + res = canonicalize_path(path); +@@ -283,8 +284,14 @@ canonicalize_spec (const char *path) + + char *canonicalize (const char *path) + { +- char *res = canonicalize_path(path); ++ char *res; + ++ if (!path) ++ return NULL; ++ else if (nocanonicalize) ++ return xstrdup(path); ++ ++ res = canonicalize_path(path); + if (!res) + die(EX_SYSERR, _("not enough memory")); + return res; +diff -up util-linux-ng-2.16.2/mount/sundries.h.kzak util-linux-ng-2.16.2/mount/sundries.h +--- util-linux-ng-2.16.2/mount/sundries.h.kzak 2009-10-16 22:50:03.000000000 +0200 ++++ util-linux-ng-2.16.2/mount/sundries.h 2010-04-12 17:29:49.000000000 +0200 +@@ -16,6 +16,7 @@ + /* global mount, umount, and losetup variables */ + extern int mount_quiet; + extern int verbose; ++extern int nocanonicalize; + extern char *progname; + + #define streq(s, t) (strcmp ((s), (t)) == 0) +diff -up util-linux-ng-2.16.2/mount/umount.8.kzak util-linux-ng-2.16.2/mount/umount.8 +--- util-linux-ng-2.16.2/mount/umount.8.kzak 2009-10-16 22:50:03.000000000 +0200 ++++ util-linux-ng-2.16.2/mount/umount.8 2010-04-12 17:34:44.000000000 +0200 +@@ -119,6 +119,10 @@ Lazy unmount. Detach the filesystem from + and cleanup all references to the filesystem as soon as it is not busy + anymore. + (Requires kernel 2.4.11 or later.) ++.IP "\fB\-\-no\-canonicalize\fP" ++Don't canonicalize paths. For more details about this option see the ++.B mount(8) ++man page. + + .SH "THE LOOP DEVICE" + The +diff -up util-linux-ng-2.16.2/mount/umount.c.kzak util-linux-ng-2.16.2/mount/umount.c +--- util-linux-ng-2.16.2/mount/umount.c.kzak 2009-10-16 22:50:03.000000000 +0200 ++++ util-linux-ng-2.16.2/mount/umount.c 2010-04-12 17:34:44.000000000 +0200 +@@ -388,6 +388,8 @@ static struct option longopts[] = + { "version", 0, 0, 'V' }, + { "read-only", 0, 0, 'r' }, + { "types", 1, 0, 't' }, ++ ++ { "no-canonicalize", 0, 0, 144 }, + { NULL, 0, 0, 0 } + }; + +@@ -672,7 +674,10 @@ main (int argc, char *argv[]) { + types = optarg; + break; + case 'i': +- external_allowed = 0; ++ external_allowed = 0; ++ break; ++ case 144: ++ nocanonicalize = 1; + break; + case 0: + break; +@@ -691,7 +696,8 @@ main (int argc, char *argv[]) { + } + } + +- if (restricted && (all || types || nomtab || force || remount)) { ++ if (restricted && ++ (all || types || nomtab || force || remount || nocanonicalize)) { + die (2, _("umount: only root can do that")); + } + diff --git a/util-linux-ng.spec b/util-linux-ng.spec index c6dfe39..b86d572 100644 --- a/util-linux-ng.spec +++ b/util-linux-ng.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux-ng Version: 2.16.2 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng @@ -118,7 +118,8 @@ Patch11: util-linux-ng-2.16-blkid-ataraid.patch Patch12: util-linux-ng-2.16-blkid-minix.patch # 494070 - Anaconda tries to mount zfs filesystem as EXT3 and install fails Patch13: util-linux-ng-2.16-blkid-zfs.patch - +# 577947 - need --no-canonicalize option for mount +Patch14: util-linux-ng-2.16-mount-nocanonicalize.patch %description The util-linux-ng package contains a large variety of low-level system @@ -218,6 +219,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build unset LINGUAS || : @@ -728,6 +730,9 @@ fi %changelog +* Mon Apr 12 2010 Karel Zak 2.16.2-9 +- fix #577947 - need --no-canonicalize option for mount + * Mon Apr 12 2010 Karel Zak 2.16.2-8 - fix #581252 - remounting tmpfs fails because of hidden rootcontext= From dbeb3ad15c420a45f6ae76e484368d901e449732 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 14:50:06 +0000 Subject: [PATCH 16/16] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index c5d5fa9..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: util-linux-ng -# $Id: Makefile,v 1.1 2007/08/17 21:07:02 wtogami Exp $ -NAME := util-linux-ng -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 06de2d2..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-12