From b91d46d712e7135bd4114933ce51e6cd7359f215 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 12 Jan 2005 00:24:37 +0000 Subject: punt old fat label stuff #77487 --- sys-apps/util-linux/Manifest | 41 +-- .../files/util-linux-2.12p-fat-LABEL-support.patch | 312 --------------------- sys-apps/util-linux/util-linux-2.12p.ebuild | 5 +- 3 files changed, 26 insertions(+), 332 deletions(-) delete mode 100644 sys-apps/util-linux/files/util-linux-2.12p-fat-LABEL-support.patch (limited to 'sys-apps/util-linux') diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest index 03d954d14e67..399a83536f49 100644 --- a/sys-apps/util-linux/Manifest +++ b/sys-apps/util-linux/Manifest @@ -1,25 +1,34 @@ -MD5 6285cd723a19d84e43e70924fd12a7c8 util-linux-2.12p.ebuild 4421 -MD5 b47c69f9c6bd04f1e45909a9795a8b43 util-linux-2.12i-r1.ebuild 3677 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + MD5 54d81dd16e0c02c28e5421069078ff93 ChangeLog 16590 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 +MD5 b47c69f9c6bd04f1e45909a9795a8b43 util-linux-2.12i-r1.ebuild 3677 +MD5 a0be96a857d9199eaf630c2fa90acef9 util-linux-2.12p.ebuild 4312 +MD5 e3697bc8fd6a344e8cba1c7d32e34790 files/util-linux-2.11z-parallel-make.patch 369 +MD5 6aa1c240dd789327ea92e36309052950 files/no-symlink-resolve.patch 316 +MD5 a43d2b8c70c5f40a195721dc536abace files/util-linux-2.12-swapon-unistd.patch 289 +MD5 7d35ae646b52391076f7a329af8265bc files/util-linux-2.11z-agetty-domainname-option.patch 1810 MD5 0be8df03dae23c81a0e929e58a4114e0 files/util-linux-2.11z-01-nfsv4.dif 13442 -MD5 08a8f7d810ef0413ab5226883daf9d87 files/util-linux-2.12p-fat-LABEL-support.patch 11349 -MD5 a9bc06c292401d6f2d27e8e4ebf7e6ae files/util-linux-2.12i-fat-LABEL-support.patch 2304 -MD5 d448f3b1b3ea21db4c2c4f303b48c1c8 files/digest-util-linux-2.12p 294 MD5 18371db840b08f5782e3f8f96c4efe8d files/util-linux-2.11z-pic.patch 3056 -MD5 4460875a6ebcf24a7ca5b41ed12f9fe5 files/util-linux-2.12-gcloop.patch 3806 -MD5 7ce604460c5607e6eb5d894b6c8b2064 files/util-linux-2.12-fat-LABEL-support.patch 11583 -MD5 61beee95fb4696a6af11ffb84ddb055c files/util-linux-2.12i-ignore-managed.patch 506 -MD5 9ef7b493525da4e138c4d033e973e835 files/util-linux-2.12p-swapon-check-symlinks.patch 913 -MD5 33ddd96078cf91030b80f73eb70f5371 files/util-linux-2.12i-swapon-check-symlinks.patch 875 -MD5 8d4f1146f0699deb1e6872e1c81293e3 files/util-linux-2.12-selinux.diff.bz2 2558 MD5 d927611f34139a40f1fc9f4162c61f8a files/util-linux-2.12-kernel-2.6.patch 2964 -MD5 a43d2b8c70c5f40a195721dc536abace files/util-linux-2.12-swapon-unistd.patch 289 -MD5 cfa3960fd97ca16c85b0d1b87e6ba226 files/digest-util-linux-2.12i-r1 156 +MD5 7ce604460c5607e6eb5d894b6c8b2064 files/util-linux-2.12-fat-LABEL-support.patch 11583 +MD5 4460875a6ebcf24a7ca5b41ed12f9fe5 files/util-linux-2.12-gcloop.patch 3806 MD5 65f42fbf981464410f7d5d84a429e920 files/util-linux-no-kill.patch 642 MD5 11fdaf3d68904b318fbffd7243e719b7 files/util-linux-2.12-amd64_rdev_installation.patch 737 -MD5 6aa1c240dd789327ea92e36309052950 files/no-symlink-resolve.patch 316 -MD5 7d35ae646b52391076f7a329af8265bc files/util-linux-2.11z-agetty-domainname-option.patch 1810 MD5 73c0cb6f9aa5fa84e701fc68d0478aac files/util-linux-2.12i-nfsv4.patch 12854 +MD5 8d4f1146f0699deb1e6872e1c81293e3 files/util-linux-2.12-selinux.diff.bz2 2558 +MD5 61beee95fb4696a6af11ffb84ddb055c files/util-linux-2.12i-ignore-managed.patch 506 MD5 c9c2c92d7bba0652f22b638127c2107e files/util-linux-2.12i-pic.patch 2457 -MD5 e3697bc8fd6a344e8cba1c7d32e34790 files/util-linux-2.11z-parallel-make.patch 369 +MD5 d448f3b1b3ea21db4c2c4f303b48c1c8 files/digest-util-linux-2.12p 294 +MD5 a9bc06c292401d6f2d27e8e4ebf7e6ae files/util-linux-2.12i-fat-LABEL-support.patch 2304 +MD5 9ef7b493525da4e138c4d033e973e835 files/util-linux-2.12p-swapon-check-symlinks.patch 913 +MD5 33ddd96078cf91030b80f73eb70f5371 files/util-linux-2.12i-swapon-check-symlinks.patch 875 +MD5 cfa3960fd97ca16c85b0d1b87e6ba226 files/digest-util-linux-2.12i-r1 156 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.9.14 (GNU/Linux) + +iD8DBQFB5G5groRuSHgZdywRAsnLAJ9WNKT+L/slxelNRJynTT8L2xMQCgCfV2xO +fMuZAcRFrhcH1pXGIeyyNAg= +=Y07Z +-----END PGP SIGNATURE----- diff --git a/sys-apps/util-linux/files/util-linux-2.12p-fat-LABEL-support.patch b/sys-apps/util-linux/files/util-linux-2.12p-fat-LABEL-support.patch deleted file mode 100644 index bc7d429fb1fe..000000000000 --- a/sys-apps/util-linux/files/util-linux-2.12p-fat-LABEL-support.patch +++ /dev/null @@ -1,312 +0,0 @@ -diff -uNr util-linux-2.12/mount/get_label_uuid.c ../patch/util-linux-2.12/mount/get_label_uuid.c ---- util-linux-2.12/mount/get_label_uuid.c 2002-11-26 12:18:01.000000000 +0100 -+++ ../patch/util-linux-2.12/mount/get_label_uuid.c 2003-10-20 18:27:56.000000000 +0200 -@@ -94,6 +94,137 @@ - return 0; - } - -+/* Remove trailing spaces */ -+static void remtrailspc(char *label) { -+ char *c; -+ -+ c = strchr(label, 0)-1; -+ while (c >= label && *c == ' ') -+ *(c--) = 0; -+} -+ -+static int handle_fat_dirent(struct fat_dirent *dirent, char **label) { -+ size_t namesize; -+ -+ /* end-of-directory marker */ -+ if (!dirent->s_filename[0]) -+ return -1; -+ -+ /* valid volume label */ -+ if ((dirent->s_attr == 0x08 || dirent->s_attr == 0x28) && dirent->s_filename[0] != 0xe5) { -+ -+ /* sanity check */ -+ if (dirent->s_size[0] || dirent->s_size[1] || dirent->s_size[2] || dirent->s_size[3] || -+ dirent->s_cluster[0] || dirent->s_cluster[1]) -+ return -1; -+ -+ namesize = sizeof(dirent->s_filename); -+ if (!(*label = calloc(namesize + 1, 1))) -+ return -1; -+ memcpy(*label, dirent->s_filename, namesize); -+ (*label)[namesize] = 0; -+ remtrailspc(*label); -+ -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static int read_volume_label_fat(int fd, struct fat_super_block *fatsb, char **label) { -+ unsigned i, m; -+ off_t o; -+ -+ m = assemble2le(fatsb->s_dirents); /* root directory entries */ -+ -+ o = (off_t) assemble2le(fatsb->s_ssec) * /* bytes per sector */ -+ ((off_t) assemble2le(fatsb->s_rsecs) + /* reserved sectors */ -+ (off_t) assemble2le(fatsb->s_spfat) * /* sectors per fat */ -+ (off_t) fatsb->s_nfats); /* number of fats */ -+ -+ for (i = 0; i < m; i++) { -+ struct fat_dirent dirent; -+ int rv; -+ -+ if (lseek(fd, o, SEEK_SET) != o || -+ read(fd, &dirent, sizeof(dirent)) != sizeof(dirent)) -+ return -1; -+ -+ if ((rv = handle_fat_dirent(&dirent, label)) != 1) -+ return rv; -+ -+ o += sizeof(dirent); -+ } -+ -+ return -1; -+} -+ -+static int read_volume_label_fat32(int fd, struct fat32_super_block *fat32sb, char **label) { -+ unsigned c; -+ off_t fo, b, o; -+ int i, ifat; -+ size_t m, cs; -+ -+ ifat = fat32sb->s_mirror[0] & 128 ? (fat32sb->s_mirror[0] & 0xF) : 0; -+ -+ if (ifat >= fat32sb->s_nfats) -+ return -1; -+ -+ fo = (off_t) assemble2le(fat32sb->s_ssec) * /* bytes per sector */ -+ ((off_t) assemble2le(fat32sb->s_rsecs) + /* reserved sectors */ -+ (off_t) assemble4le(fat32sb->s_spfat) * /* sectors per fat */ -+ (off_t) ifat); /* number of FAT used */ -+ -+ b = (off_t) assemble2le(fat32sb->s_ssec) * /* bytes per sector */ -+ ((off_t) assemble2le(fat32sb->s_rsecs) + /* reserved sectors */ -+ (off_t) assemble4le(fat32sb->s_spfat) * /* sectors per fat */ -+ (off_t) fat32sb->s_nfats); /* number of FATs */ -+ -+ c = assemble4le(fat32sb->s_rcluster) & 0x0fffffffL; -+ if (c < 2 || c >= 0x0ffffff0) -+ return -1; -+ -+ m = cs = assemble2le(fat32sb->s_ssec) * (size_t) fat32sb->s_scluster; -+ o = b + (off_t) cs*(c-2); -+ -+ for (i = 0; i < 0xFFFF; i++) { /* safety against DoS attack */ -+ struct fat_dirent dirent; -+ int rv; -+ -+ if (lseek(fd, o, SEEK_SET) != o || -+ read(fd, &dirent, sizeof(dirent)) != sizeof(dirent)) -+ return -1; -+ -+ if ((rv = handle_fat_dirent(&dirent, label)) != 1) -+ return rv; -+ -+ if (m > sizeof(dirent)) { -+ m -= sizeof(dirent); -+ o += sizeof(dirent); -+ } else { -+ off_t d; -+ -+ /* next cluster */ -+ -+ d = fo+4*c; -+ if (lseek(fd, d, SEEK_SET) != d || -+ read(fd, &c, 4) != 4) -+ return -1; -+ -+ c = assemble4le((char*) &c) & 0x0fffffffL; -+ if (c < 2 || c >= 0x0ffffff0) { -+ return -1; -+ } -+ -+ m = cs; -+ o = b + cs*(c-2); -+ } -+ } -+ -+ -+ return -1; -+} -+ - - /* - * Get both label and uuid. -@@ -111,6 +186,8 @@ - struct ocfs_volume_label olbl; - struct ocfs2_super_block osb; - struct reiserfs_super_block reiserfssb; -+ struct fat_super_block fatsb; -+ struct fat32_super_block fat32sb; - int blksize; - int rv = 0; - -@@ -184,6 +245,87 @@ - } - goto done; - } -+ if (lseek(fd, 0, SEEK_SET) == 0 -+ && read(fd, (char*) &fat32sb, sizeof(fat32sb)) == sizeof(fat32sb) -+ && fat32sb.s_sig[0] == 0x55 -+ && fat32sb.s_sig[1] == 0xAA -+ && (fat32sb.s_media & 0xF0) == 0xF0 -+ && (fat32sb.s_spfat_old[0] == 0) -+ && (fat32sb.s_spfat_old[1] == 0) -+ && fat32sb.s_extsig == 0x29 -+ && (memcmp(fat32sb.s_fs, "FAT32 ", 8) == 0)) { -+ -+ *label = NULL; -+ -+ /* If no root directory entry volume name was found use the one from the boot sector */ -+ if (read_volume_label_fat32(fd, &fat32sb, label) != 0) { -+ if (memcmp(fat32sb.s_label, "NO NAME ", 11) != 0 && -+ memcmp(fat32sb.s_label, " ", 11) != 0 && -+ memcmp(fat32sb.s_label, "\0\0\0\0\0\0\0\0", 8) != 0) { -+ -+ namesize = sizeof(fat32sb.s_label); -+ if ((*label = calloc(namesize + 1, 1)) != NULL) { -+ memcpy(*label, fat32sb.s_label, namesize); -+ (*label)[namesize] = 0; -+ remtrailspc(*label); -+ } -+ } -+ } -+ -+ if (*label) { -+ -+ /* Set UUID from serial */ -+ uuid[0] = fat32sb.s_serial[3]; -+ uuid[1] = fat32sb.s_serial[2]; -+ uuid[2] = fat32sb.s_serial[1]; -+ uuid[3] = fat32sb.s_serial[0]; -+ memset(uuid+4, 0, 12); -+ -+ rv = 0; -+ } -+ } else if (lseek(fd, 0, SEEK_SET) == 0 -+ && read(fd, (char*) &fatsb, sizeof(fatsb)) == sizeof(fatsb) -+ && fatsb.s_sig[0] == 0x55 -+ && fatsb.s_sig[1] == 0xAA -+ && (fatsb.s_media & 0xF0) == 0xF0 -+ && fatsb.s_extsig == 0x29 -+ && (memcmp(fatsb.s_fs, "FAT12 ", 8) == 0 -+ || memcmp(fatsb.s_fs, "FAT16 ", 8) == 0 -+ || memcmp(fatsb.s_fs, "FAT ", 8) == 0 -+ || memcmp(fatsb.s_fs, "\0\0\0\0\0\0\0\0", 8) == 0) -+ && memcmp(fatsb.s_fs2, "FAT32 ", 8) != 0) { -+ -+ *label = NULL; -+ -+ if (read_volume_label_fat(fd, &fatsb, label) != 0) { -+ -+ /* If no root directory entry volume name was found use the one from the boot sector */ -+ if (memcmp(fatsb.s_label, "NO NAME ", 11) != 0 && -+ memcmp(fatsb.s_label, " ", 11) != 0 && -+ memcmp(fatsb.s_label, "\0\0\0\0\0\0\0\0", 8) != 0) { -+ -+ namesize = sizeof(fatsb.s_label); -+ if ((*label = calloc(namesize + 1, 1)) != NULL) { -+ memcpy(*label, fatsb.s_label, namesize); -+ (*label)[namesize] = 0; -+ remtrailspc(*label); -+ } -+ -+ } -+ } -+ -+ if (*label) { -+ -+ /* Set UUID from serial */ -+ uuid[0] = fatsb.s_serial[3]; -+ uuid[1] = fatsb.s_serial[2]; -+ uuid[2] = fatsb.s_serial[1]; -+ uuid[3] = fatsb.s_serial[0]; -+ memset(uuid+4, 0, 12); -+ -+ rv = 0; -+ } -+ } - - if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) - == REISERFS_DISK_OFFSET_IN_BYTES -diff -uNr util-linux-2.12/mount/linux_fs.h ../patch/util-linux-2.12/mount/linux_fs.h ---- util-linux-2.12/mount/linux_fs.h 2003-07-05 22:16:32.000000000 +0200 -+++ ../patch/util-linux-2.12/mount/linux_fs.h 2003-10-20 18:07:06.000000000 +0200 -@@ -137,13 +137,65 @@ - u_char s_dummy[3]; - u_char s_os[8]; /* "MSDOS5.0" or "MSWIN4.0" or "MSWIN4.1" */ - /* mtools-3.9.4 writes "MTOOL394" */ -- u_char s_dummy2[32]; -+ u_char s_ssec[2]; /* bytes per sector */ -+ u_char s_scluster; /* sectors per cluster */ -+ u_char s_rsecs[2]; /* reserved sectors */ -+ u_char s_nfats; /* number of FATs */ -+ u_char s_dirents[2]; /* maximum root directory entries */ -+ u_char s_nsecs[2]; /* total number of sectors */ -+ u_char s_media; /* media type, upper nibble is 0xF */ -+ u_char s_spfat[2]; /* sectors per fat */ -+ -+ u_char s_dummy2[14]; -+ u_char s_extsig; /* extended signature */ -+ u_char s_serial[4]; /* serial number */ - u_char s_label[11]; /* for DOS? */ -- u_char s_fs[8]; /* "FAT12 " or "FAT16 " or all zero */ -+ u_char s_fs[8]; /* "FAT12 " or "FAT16 " or all zero */ - /* OS/2 BM has "FAT " here. */ -- u_char s_dummy3[9]; -- u_char s_label2[11]; /* for Windows? */ -- u_char s_fs2[8]; /* garbage or "FAT32 " */ -+ -+ u_char s_dummy3[20]; -+ u_char s_fs2[8]; /* "FAT32 " */ -+ -+ u_char s_dummy4[420]; -+ u_char s_sig[2]; /* 55 AA */ -+}; -+ -+struct fat32_super_block { -+ u_char s_dummy[3]; -+ u_char s_os[8]; /* "MSDOS5.0" or "MSWIN4.0" or "MSWIN4.1" */ -+ /* mtools-3.9.4 writes "MTOOL394" */ -+ -+ u_char s_ssec[2]; /* bytes per sector */ -+ u_char s_scluster; /* sectors per cluster */ -+ u_char s_rsecs[2]; /* reserved sectors */ -+ u_char s_nfats; /* number of FATs */ -+ u_char s_dirents[2]; /* maximum root directory entries */ -+ u_char s_nsecs[2]; /* total number of sectors */ -+ u_char s_media; /* media type, upper nibble is 0xF */ -+ u_char s_spfat_old[2]; /* sectors per fat */ -+ -+ u_char s_dummy2[12]; -+ u_char s_spfat[4]; /* sectors per FAT */ -+ u_char s_mirror[2]; /* mirror flag */ -+ u_char s_version[2]; /* fs version */ -+ u_char s_rcluster[4]; /* root directory cluster */ -+ -+ u_char s_dummy3[18]; -+ u_char s_extsig; /* extended signature 0x29 */ -+ u_char s_serial[4]; /* serial number */ -+ u_char s_label[11]; /* label */ -+ u_char s_fs[8]; /* filesystem type "FAT32 " */ -+ -+ u_char s_dummy4[420]; -+ u_char s_sig[2]; /* 55 AA */ -+}; -+ -+struct fat_dirent { -+ u_char s_filename[11]; /* Filename with extension */ -+ u_char s_attr; /* File attribute flags */ -+ u_char s_dummy[14]; -+ u_char s_cluster[2]; /* Starting cluster */ -+ u_char s_size[4]; /* File size */ - }; - - #define XFS_SUPER_MAGIC "XFSB" diff --git a/sys-apps/util-linux/util-linux-2.12p.ebuild b/sys-apps/util-linux/util-linux-2.12p.ebuild index 466ea7d7060b..2296c2eff180 100644 --- a/sys-apps/util-linux/util-linux-2.12p.ebuild +++ b/sys-apps/util-linux/util-linux-2.12p.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.12p.ebuild,v 1.1 2005/01/10 04:34:23 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.12p.ebuild,v 1.2 2005/01/12 00:24:37 vapier Exp $ inherit eutils flag-o-matic toolchain-funcs @@ -72,9 +72,6 @@ src_unpack() { # Allow util-linux to be built with -fPIC epatch ${FILESDIR}/${PN}-2.12i-pic.patch - # Add support to read fat/fat32 labels, bug #36722 - epatch ${FILESDIR}/${PN}-2.12p-fat-LABEL-support.patch - # Install rdev on amd64 platform epatch ${FILESDIR}/${PN}-2.12-amd64_rdev_installation.patch -- cgit v1.2.3-65-gdbad