summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2004-09-03 18:05:46 +0000
committerMartin Schlemmer <azarah@gentoo.org>2004-09-03 18:05:46 +0000
commit8f4b4422cc88d6f595d1e32cb52d19035bf7165b (patch)
tree5d1bd50cf5a591e3cc8eb032571707899051d4ef /sys-apps/util-linux
parentVersion bumped. (Manifest recommit) (diff)
downloadgentoo-2-8f4b4422cc88d6f595d1e32cb52d19035bf7165b.tar.gz
gentoo-2-8f4b4422cc88d6f595d1e32cb52d19035bf7165b.tar.bz2
gentoo-2-8f4b4422cc88d6f595d1e32cb52d19035bf7165b.zip
Update version; also build partx. SELinux users should erify support, as it
seems it was merged upstream.
Diffstat (limited to 'sys-apps/util-linux')
-rw-r--r--sys-apps/util-linux/ChangeLog12
-rw-r--r--sys-apps/util-linux/Manifest48
-rw-r--r--sys-apps/util-linux/files/digest-util-linux-2.12b2
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12b-fat-LABEL-support.patch325
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12b-gcloop-with-crypt.patch116
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12b-gcloop.patch116
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12b-pic.patch79
-rw-r--r--sys-apps/util-linux/util-linux-2.12b.ebuild154
8 files changed, 824 insertions, 28 deletions
diff --git a/sys-apps/util-linux/ChangeLog b/sys-apps/util-linux/ChangeLog
index 89ff90626ff0..0d6b6604ffd2 100644
--- a/sys-apps/util-linux/ChangeLog
+++ b/sys-apps/util-linux/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sys-apps/util-linux
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.85 2004/07/01 21:44:07 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.86 2004/09/03 18:05:46 azarah Exp $
+
+*util-linux-2.12b (03 Sep 2004)
+
+ 03 Sep 2004; Martin Schlemmer <azarah@gentoo.org>
+ +files/util-linux-2.12b-fat-LABEL-support.patch,
+ +files/util-linux-2.12b-gcloop-with-crypt.patch,
+ +files/util-linux-2.12b-gcloop.patch, +files/util-linux-2.12b-pic.patch,
+ +util-linux-2.12b.ebuild:
+ Update version; also build partx. SELinux users should erify support, as it
+ seems it was merged upstream.
01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
util-linux-2.11z-r8.ebuild, util-linux-2.11z-r9.ebuild,
diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest
index 1abf382b6be9..5c23f044ad16 100644
--- a/sys-apps/util-linux/Manifest
+++ b/sys-apps/util-linux/Manifest
@@ -1,39 +1,33 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 d6859c757c22eec819411275fc368a4b ChangeLog 13597
-MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
MD5 e92a492381d2073f6f42d2f2e1e63a10 util-linux-2.11z-r8.ebuild 3161
-MD5 e012bcb53938d7147bd4eb55a2f21d41 util-linux-2.11z-r9.ebuild 3354
MD5 608d202bf0e75fcd128fab85401471cd util-linux-2.12-r2.ebuild 3198
MD5 f3789fe0aec47dff68ad09c16afc1371 util-linux-2.12-r3.ebuild 3699
-MD5 6d3d6296b9adb878eb1e8e76d7c8d37a util-linux-2.12-r4.ebuild 4108
+MD5 d6859c757c22eec819411275fc368a4b ChangeLog 13597
MD5 a7d560c1fbec607e50ddc90151460142 util-linux-2.12-r5.ebuild 4215
+MD5 6d3d6296b9adb878eb1e8e76d7c8d37a util-linux-2.12-r4.ebuild 4108
+MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
+MD5 e012bcb53938d7147bd4eb55a2f21d41 util-linux-2.11z-r9.ebuild 3354
+MD5 31290a252fdf17ae02aa92b0279758b6 util-linux-2.12b.ebuild 4294
+MD5 6d85a29dd1f3c5e5e1fb738a88eda052 .util-linux-2.12b.ebuild.swp 20480
+MD5 0be8df03dae23c81a0e929e58a4114e0 files/util-linux-2.11z-01-nfsv4.dif 13442
+MD5 0f2f1ddaeaf52622fa80f4f08bb25a6b files/util-linux-2.11z-01-nfsv4-crypt.dif 13460
+MD5 5a1bf3d383850b6c8ca05cc4fe76c813 files/digest-util-linux-2.12-r4 154
+MD5 5a1bf3d383850b6c8ca05cc4fe76c813 files/digest-util-linux-2.12-r5 154
+MD5 18371db840b08f5782e3f8f96c4efe8d files/util-linux-2.11z-pic.patch 3056
MD5 02afa4d774f45ab0b9ef42ecc1748005 files/digest-util-linux-2.11z-r8 153
-MD5 02afa4d774f45ab0b9ef42ecc1748005 files/digest-util-linux-2.11z-r9 153
+MD5 8d4f1146f0699deb1e6872e1c81293e3 files/util-linux-2.12-selinux.diff.bz2 2558
MD5 830453d37b748b7e2ec454603e33b920 files/digest-util-linux-2.12-r2 151
+MD5 6dc0134d8d5f325a86257698d2184718 files/util-linux-2.11z-mips-fdisk-fix.patch 1698
MD5 5a1bf3d383850b6c8ca05cc4fe76c813 files/digest-util-linux-2.12-r3 154
-MD5 6aa1c240dd789327ea92e36309052950 files/no-symlink-resolve.patch 316
-MD5 0f2f1ddaeaf52622fa80f4f08bb25a6b files/util-linux-2.11z-01-nfsv4-crypt.dif 13460
-MD5 0be8df03dae23c81a0e929e58a4114e0 files/util-linux-2.11z-01-nfsv4.dif 13442
+MD5 11fdaf3d68904b318fbffd7243e719b7 files/util-linux-2.12-amd64_rdev_installation.patch 737
MD5 7d35ae646b52391076f7a329af8265bc files/util-linux-2.11z-agetty-domainname-option.patch 1810
-MD5 6dc0134d8d5f325a86257698d2184718 files/util-linux-2.11z-mips-fdisk-fix.patch 1698
-MD5 e3697bc8fd6a344e8cba1c7d32e34790 files/util-linux-2.11z-parallel-make.patch 369
-MD5 18371db840b08f5782e3f8f96c4efe8d files/util-linux-2.11z-pic.patch 3056
MD5 90b5a47385e394b9112357282c35eb4a files/util-linux-2.11z-script.patch 1580
+MD5 e3697bc8fd6a344e8cba1c7d32e34790 files/util-linux-2.11z-parallel-make.patch 369
+MD5 02afa4d774f45ab0b9ef42ecc1748005 files/digest-util-linux-2.11z-r9 153
+MD5 a43d2b8c70c5f40a195721dc536abace files/util-linux-2.12-swapon-unistd.patch 289
MD5 d927611f34139a40f1fc9f4162c61f8a files/util-linux-2.12-kernel-2.6.patch 2964
-MD5 8d4f1146f0699deb1e6872e1c81293e3 files/util-linux-2.12-selinux.diff.bz2 2558
-MD5 65f42fbf981464410f7d5d84a429e920 files/util-linux-no-kill.patch 642
-MD5 5a1bf3d383850b6c8ca05cc4fe76c813 files/digest-util-linux-2.12-r4 154
MD5 7ce604460c5607e6eb5d894b6c8b2064 files/util-linux-2.12-fat-LABEL-support.patch 11583
-MD5 5a1bf3d383850b6c8ca05cc4fe76c813 files/digest-util-linux-2.12-r5 154
+MD5 65f42fbf981464410f7d5d84a429e920 files/util-linux-no-kill.patch 642
+MD5 6aa1c240dd789327ea92e36309052950 files/no-symlink-resolve.patch 316
MD5 4460875a6ebcf24a7ca5b41ed12f9fe5 files/util-linux-2.12-gcloop.patch 3806
-MD5 11fdaf3d68904b318fbffd7243e719b7 files/util-linux-2.12-amd64_rdev_installation.patch 737
-MD5 a43d2b8c70c5f40a195721dc536abace files/util-linux-2.12-swapon-unistd.patch 289
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.9.10 (GNU/Linux)
-
-iD8DBQFBKYVrHTu7gpaalycRAgaSAKC/VwANOT8VNWcEWBkq0Nm6xAGVTQCg71yX
-MhZvHGkhZ/WrfhEAUMOwANQ=
-=2yVU
------END PGP SIGNATURE-----
+MD5 87912a793169fad4258077f2f6957616 files/digest-util-linux-2.12b 156
+MD5 c24e268f41d733a8f91425b7e40b78c1 files/util-linux-2.12b-pic.patch 3193
diff --git a/sys-apps/util-linux/files/digest-util-linux-2.12b b/sys-apps/util-linux/files/digest-util-linux-2.12b
new file mode 100644
index 000000000000..2af541ccd3b5
--- /dev/null
+++ b/sys-apps/util-linux/files/digest-util-linux-2.12b
@@ -0,0 +1,2 @@
+MD5 2e96fd7efa1ff477502e91c31572d51b util-linux-2.12b.tar.gz 1967337
+MD5 a87c737b80c52fbd8f515c40f403737c util-linux-2.12b-cryptoapi-losetup.patch.bz2 4868
diff --git a/sys-apps/util-linux/files/util-linux-2.12b-fat-LABEL-support.patch b/sys-apps/util-linux/files/util-linux-2.12b-fat-LABEL-support.patch
new file mode 100644
index 000000000000..d748c355481a
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12b-fat-LABEL-support.patch
@@ -0,0 +1,325 @@
+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
+@@ -43,10 +43,142 @@
+ #endif
+ }
+
+-/*
+- * Get both label and uuid.
+- * For now, only ext2, ext3, xfs, ocfs, reiserfs are supported
+- */
++/* 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.
++ * For now, only ext2, ext3, xfs, ocfs, reiserfs are supported
++ */
+ int
+ get_label_uuid(const char *device, char **label, char *uuid) {
+ int fd;
+@@ -54,8 +186,10 @@
+ struct ocfs_volume_header ovh; /* Oracle */
+ struct ocfs_volume_label olbl;
+ struct reiserfs_super_block reiserfssb;
++ struct fat_super_block fatsb;
++ struct fat32_super_block fat32sb;
+
+- fd = open(device, O_RDONLY);
++ fd = open(device, O_RDONLY);
+ if (fd < 0)
+ return rv;
+
+@@ -111,7 +245,87 @@
+ memcpy(*label, jfssb.s_label, namesize);
+ }
+ rv = 0;
+- }
++ } else 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;
++ }
++ }
+
+ close(fd);
+ return rv;
+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
+@@ -122,13 +122,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/files/util-linux-2.12b-gcloop-with-crypt.patch b/sys-apps/util-linux/files/util-linux-2.12b-gcloop-with-crypt.patch
new file mode 100644
index 000000000000..fecefef4d4ce
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12b-gcloop-with-crypt.patch
@@ -0,0 +1,116 @@
+diff -ruN util-linux-2.12.orig/mount/lomount.c util-linux-2.12/mount/lomount.c
+--- util-linux-2.12.orig/mount/lomount.c 2004-02-17 02:08:05.341716624 +0100
++++ util-linux-2.12/mount/lomount.c 2004-02-17 02:12:10.653423576 +0100
+@@ -60,7 +60,8 @@
+ info->lo_flags = info64->lo_flags;
+ info->lo_init[0] = info64->lo_init[0];
+ info->lo_init[1] = info64->lo_init[1];
+- if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
++ if ((info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI) ||
++ (info->lo_encrypt_type == LO_CRYPT_COMPRESS))
+ memcpy(info->lo_name, info64->lo_crypt_name, LO_NAME_SIZE);
+ else
+ memcpy(info->lo_name, info64->lo_file_name, LO_NAME_SIZE);
+@@ -321,7 +322,8 @@
+
+ int
+ set_loop(const char *device, const char *file, unsigned long long offset,
+- const char *encryption, int pfd, int *loopro) {
++ const char *encnumber,const char *encryption,
++ int pfd, int *loopro) {
+ struct loop_info64 loopinfo64;
+ int fd, ffd, mode;
+ char *pass;
+@@ -344,8 +346,9 @@
+ memset(&loopinfo64, 0, sizeof(loopinfo64));
+
+ xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE);
+-
++
+ if (encryption && *encryption) {
++
+ if (digits_only(encryption)) {
+ loopinfo64.lo_encrypt_type = atoi(encryption);
+ } else {
+@@ -386,6 +389,12 @@
+ }
+ }
+
++ if (encnumber && *encnumber) {
++
++ if (digits_only(encnumber))
++ loopinfo64.lo_encrypt_type = atoi(encnumber);
++ }
++
+ loopinfo64.lo_offset = offset;
+
+ #ifdef MCL_FUTURE
+@@ -601,7 +610,7 @@
+
+ int
+ main(int argc, char **argv) {
+- char *offset, *encryption, *passfd;
++ char *offset, *encryption, *encnumber, *passfd;
+ int delete, c;
+ int res = 0;
+ int ro = 0;
+@@ -612,7 +621,7 @@
+ textdomain(PACKAGE);
+
+ delete = off = 0;
+- offset = encryption = passfd = NULL;
++ offset = encryption = encnumber = passfd = NULL;
+ progname = argv[0];
+ while ((c = getopt(argc,argv,"de:E:o:p:v")) != -1) {
+ switch (c) {
+@@ -620,6 +629,7 @@
+ delete = 1;
+ break;
+ case 'E':
++ encnumber = optarg;
+ case 'e':
+ encryption = optarg;
+ break;
+@@ -651,7 +661,7 @@
+ if (passfd && sscanf(passfd,"%d",&pfd) != 1)
+ usage();
+ res = set_loop(argv[optind], argv[optind+1], off,
+- encryption, pfd, &ro);
++ encnumber, encryption, pfd, &ro);
+ }
+ return res;
+ }
+diff -ruN util-linux-2.12.orig/mount/lomount.h util-linux-2.12/mount/lomount.h
+--- util-linux-2.12.orig/mount/lomount.h 2004-02-17 02:08:05.339716928 +0100
++++ util-linux-2.12/mount/lomount.h 2004-02-17 02:08:14.921260312 +0100
+@@ -1,6 +1,6 @@
+ extern int verbose;
+ extern int set_loop(const char *, const char *, unsigned long long,
+- const char *, int, int *);
++ const char *, const char *, int, int *);
+ extern int del_loop(const char *);
+ extern int is_loop_device(const char *);
+ extern char * find_unused_loop_device(void);
+diff -ruN util-linux-2.12.orig/mount/loop.h util-linux-2.12/mount/loop.h
+--- util-linux-2.12.orig/mount/loop.h 2004-02-17 02:08:05.341716624 +0100
++++ util-linux-2.12/mount/loop.h 2004-02-17 02:08:14.922260160 +0100
+@@ -2,6 +2,7 @@
+ #define LO_CRYPT_XOR 1
+ #define LO_CRYPT_DES 2
+ #define LO_CRYPT_CRYPTOAPI 18
++#define LO_CRYPT_COMPRESS 19
+
+ #define LOOP_SET_FD 0x4C00
+ #define LOOP_CLR_FD 0x4C01
+diff -ruN util-linux-2.12.orig/mount/mount.c util-linux-2.12/mount/mount.c
+--- util-linux-2.12.orig/mount/mount.c 2004-02-17 02:08:05.281725744 +0100
++++ util-linux-2.12/mount/mount.c 2004-02-17 02:08:14.924259856 +0100
+@@ -612,7 +612,7 @@
+ offset = opt_offset ? strtoull(opt_offset, NULL, 0) : 0;
+ if (opt_keygen)
+ pfd = use_keygen_prog(opt_keygen, keygen_args, _n_keygen_args);
+- if (set_loop(*loopdev, *loopfile, offset,
++ if (set_loop(*loopdev, *loopfile, offset, NULL,
+ opt_encryption, pfd, &loopro)) {
+ if (verbose)
+ printf(_("mount: failed setting up loop device\n"));
diff --git a/sys-apps/util-linux/files/util-linux-2.12b-gcloop.patch b/sys-apps/util-linux/files/util-linux-2.12b-gcloop.patch
new file mode 100644
index 000000000000..bf8eb7fbc653
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12b-gcloop.patch
@@ -0,0 +1,116 @@
+diff -ruN util-linux-2.12.orig/mount/lomount.c util-linux-2.12/mount/lomount.c
+--- util-linux-2.12.orig/mount/lomount.c 2004-02-17 02:08:05.341716624 +0100
++++ util-linux-2.12/mount/lomount.c 2004-02-17 02:12:10.653423576 +0100
+@@ -60,7 +60,8 @@
+ info->lo_flags = info64->lo_flags;
+ info->lo_init[0] = info64->lo_init[0];
+ info->lo_init[1] = info64->lo_init[1];
+- if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
++ if ((info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI) ||
++ (info->lo_encrypt_type == LO_CRYPT_COMPRESS))
+ memcpy(info->lo_name, info64->lo_crypt_name, LO_NAME_SIZE);
+ else
+ memcpy(info->lo_name, info64->lo_file_name, LO_NAME_SIZE);
+@@ -321,7 +322,8 @@
+
+ int
+ set_loop(const char *device, const char *file, unsigned long long offset,
+- const char *encryption, int pfd, int *loopro) {
++ const char *encnumber,const char *encryption,
++ int pfd, int *loopro) {
+ struct loop_info64 loopinfo64;
+ int fd, ffd, mode;
+ char *pass;
+@@ -344,8 +346,9 @@
+ memset(&loopinfo64, 0, sizeof(loopinfo64));
+
+ xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE);
+-
++
+ if (encryption && *encryption) {
++
+ if (digits_only(encryption)) {
+ loopinfo64.lo_encrypt_type = atoi(encryption);
+ } else {
+@@ -386,6 +389,12 @@
+ }
+ }
+
++ if (encnumber && *encnumber) {
++
++ if (digits_only(encnumber))
++ loopinfo64.lo_encrypt_type = atoi(encnumber);
++ }
++
+ loopinfo64.lo_offset = offset;
+
+ #ifdef MCL_FUTURE
+@@ -601,7 +610,7 @@
+
+ int
+ main(int argc, char **argv) {
+- char *offset, *encryption, *passfd;
++ char *offset, *encryption, *encnumber, *passfd;
+ int delete, c;
+ int res = 0;
+ int ro = 0;
+@@ -612,7 +621,7 @@
+ textdomain(PACKAGE);
+
+ delete = off = 0;
+- offset = encryption = passfd = NULL;
++ offset = encryption = encnumber = passfd = NULL;
+ progname = argv[0];
+ while ((c = getopt(argc,argv,"de:E:o:p:v")) != -1) {
+ switch (c) {
+@@ -620,6 +629,7 @@
+ delete = 1;
+ break;
+ case 'E':
++ encnumber = optarg;
+ case 'e':
+ encryption = optarg;
+ break;
+@@ -651,7 +661,7 @@
+ if (passfd && sscanf(passfd,"%d",&pfd) != 1)
+ usage();
+ res = set_loop(argv[optind], argv[optind+1], off,
+- encryption, pfd, &ro);
++ encnumber, encryption, pfd, &ro);
+ }
+ return res;
+ }
+diff -ruN util-linux-2.12.orig/mount/lomount.h util-linux-2.12/mount/lomount.h
+--- util-linux-2.12.orig/mount/lomount.h 2004-02-17 02:08:05.339716928 +0100
++++ util-linux-2.12/mount/lomount.h 2004-02-17 02:08:14.921260312 +0100
+@@ -1,6 +1,6 @@
+ extern int verbose;
+ extern int set_loop(const char *, const char *, unsigned long long,
+- const char *, int, int *);
++ const char *, const char *, int, int *);
+ extern int del_loop(const char *);
+ extern int is_loop_device(const char *);
+ extern char * find_unused_loop_device(void);
+diff -ruN util-linux-2.12.orig/mount/loop.h util-linux-2.12/mount/loop.h
+--- util-linux-2.12.orig/mount/loop.h 2004-02-17 02:08:05.341716624 +0100
++++ util-linux-2.12/mount/loop.h 2004-02-17 02:08:14.922260160 +0100
+@@ -2,6 +2,7 @@
+ #define LO_CRYPT_XOR 1
+ #define LO_CRYPT_DES 2
+ #define LO_CRYPT_CRYPTOAPI 18
++#define LO_CRYPT_COMPRESS 19
+
+ #define LOOP_SET_FD 0x4C00
+ #define LOOP_CLR_FD 0x4C01
+diff -ruN util-linux-2.12.orig/mount/mount.c util-linux-2.12/mount/mount.c
+--- util-linux-2.12.orig/mount/mount.c 2004-02-17 02:08:05.281725744 +0100
++++ util-linux-2.12/mount/mount.c 2004-02-17 02:08:14.924259856 +0100
+@@ -612,7 +612,7 @@
+ if (verbose)
+ printf(_("mount: going to use the loop device %s\n"), *loopdev);
+ offset = opt_offset ? strtoull(opt_offset, NULL, 0) : 0;
+- if (set_loop(*loopdev, *loopfile, offset,
++ if (set_loop(*loopdev, *loopfile, offset, NULL,
+ opt_encryption, pfd, &loopro)) {
+ if (verbose)
+ printf(_("mount: failed setting up loop device\n"));
diff --git a/sys-apps/util-linux/files/util-linux-2.12b-pic.patch b/sys-apps/util-linux/files/util-linux-2.12b-pic.patch
new file mode 100644
index 000000000000..9a180f8dafb5
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12b-pic.patch
@@ -0,0 +1,79 @@
+diff -u -r -N util-linux-2.11z.orig/fdisk/llseek.c util-linux-2.11z/fdisk/llseek.c
+--- util-linux-2.11z.orig/fdisk/llseek.c 2002-10-31 14:44:31.000000000 +0100
++++ util-linux-2.11z/fdisk/llseek.c 2003-07-12 19:08:59.000000000 +0200
+@@ -3,6 +3,9 @@
+ *
+ * Copyright (C) 1994 Remy Card. This file may be redistributed
+ * under the terms of the GNU Public License.
++ *
++ * Changes:
++ * 20030712 - Alexander Gabert <pappy@nikita.ath.cx> - adding PIC defines
+ */
+
+ #include <sys/types.h>
+@@ -25,7 +28,8 @@
+
+ #else /* HAVE_LLSEEK */
+
+-#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
++/* do not use assembler to put together syscalls at compile time (for llseek for example) when using PIC */
++#if defined(__PIC__) || defined(__pic__) || defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
+
+ #define my_llseek lseek
+
+diff -u -r -N util-linux-2.11z.orig/fdisk/sfdisk.c util-linux-2.11z/fdisk/sfdisk.c
+--- util-linux-2.11z.orig/fdisk/sfdisk.c 2003-01-28 19:18:03.000000000 +0100
++++ util-linux-2.11z/fdisk/sfdisk.c 2003-07-12 19:08:38.000000000 +0200
+@@ -28,6 +28,7 @@
+ * Changes:
+ * 19990319 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> - i18n
+ * 20040824 - David A. Wheeler <dwheeler@dwheeler.com> - warnings to stderr
++ * 20030712 - Alexander Gabert <pappy@nikita.ath.cx> - adding PIC defines
+ */
+
+ #define PROGNAME "sfdisk"
+@@ -130,7 +131,9 @@
+ *
+ * Note: we use 512-byte sectors here, irrespective of the hardware ss.
+ */
+-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) && !defined (__s390x__)
++
++/* do not use the assembler constructed syscalls for seeking if compiled as PIC */
++#if !defined(__PIC__) && !defined(__pic__) && !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) && !defined (__s390x__)
+ static
+ _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
+ loff_t *, res, uint, wh);
+@@ -142,7 +145,7 @@
+ in = ((loff_t) s << 9);
+ out = 1;
+
+-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) && !defined (__s390x__)
++#if !defined(__PIC__) && !defined(__pic__) && !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) && !defined (__s390x__)
+ if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) {
+ #else
+ if ((out = lseek(fd, in, SEEK_SET)) != in) {
+#
+# This seems to not be needed anymore
+#
+#diff -u -r -N util-linux-2.11z.orig/mount/pivot_root.c util-linux-2.11z/mount/pivot_root.c
+#--- util-linux-2.11z.orig/mount/pivot_root.c 2002-11-29 12:02:56.000000000 +0100
+#+++ util-linux-2.11z/mount/pivot_root.c 2003-07-12 19:07:39.000000000 +0200
+#@@ -1,12 +1,17 @@
+# /* pivot_root.c - Change the root file system */
+#
+# /* Written 2000 by Werner Almesberger */
+#+/*
+#+ * Jul 11 2003 <solar@gentoo.org>
+#+ * avoid using assembler constructed _syscall2() when PIC is needed
+#+ */
+#
+# #include <stdio.h>
+# #include <errno.h> /* needed for <linux/unistd.h> below */
+#
+#-#ifdef __ia64__
+#+#if (defined(__ia64__) || defined(__PIC__) || defined(__pic__))
+# # include <sys/syscall.h>
+#+# include <unistd.h>
+# # define pivot_root(new_root,put_old) syscall(SYS_pivot_root,new_root,put_old)
+# #else
+# # include <linux/unistd.h>
diff --git a/sys-apps/util-linux/util-linux-2.12b.ebuild b/sys-apps/util-linux/util-linux-2.12b.ebuild
new file mode 100644
index 000000000000..1515fdcbd22a
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.12b.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2004 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.12b.ebuild,v 1.1 2004/09/03 18:05:46 azarah Exp $
+
+inherit eutils flag-o-matic
+
+CRYPT_PATCH_P="${PN}-2.12b-cryptoapi-losetup"
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+SRC_URI="mirror://kernel/linux/utils/${PN}/${P}.tar.gz
+ ftp://ftp.cwi.nl/pub/aeb/${PN}/${P}.tar.gz
+ crypt? ( mirror://gentoo/${CRYPT_PATCH_P}.patch.bz2 )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~ppc64"
+IUSE="crypt nls static pam selinux uclibc"
+
+DEPEND="virtual/libc
+ >=sys-apps/sed-4.0.5
+ >=sys-libs/ncurses-5.2-r2
+ selinux? ( sys-libs/libselinux )
+ pam? ( sys-apps/pam-login )
+ crypt? ( app-crypt/hashalot )"
+RDEPEND="${DEPEND}
+ dev-lang/perl
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+
+ # CryptoAPI losetup patch for the cryptoapi sepecific
+ # to the 2.6 linux kernel. Needs hashalot.
+ # Original patch location:
+ # http://www.stwing.org/~sluskyb/util-linux/losetup-combined.patch
+ # Mailing list post with info:
+ # http://www.kerneli.org/pipermail/cryptoapi-devel/2003-September/000634.html
+ # Follow thread for usage.
+ use crypt && epatch ${DISTDIR}/${CRYPT_PATCH_P}.patch.bz2
+
+ # Fix rare failures with -j4 or higher
+ epatch ${FILESDIR}/${PN}-2.11z-parallel-make.patch
+
+ # Fix unreadable df output
+ epatch ${FILESDIR}/no-symlink-resolve.patch
+
+ # access() is a macro which uses R_OK however
+ # R_OK is not defined on sparc during a bootstrap
+ # unless we actually include unistd.h -solar (May 07 2004)
+ epatch ${FILESDIR}/${PN}-2.12-swapon-unistd.patch
+
+ # Add the O option to agetty to display DNS domainname in the issue
+ # file, thanks to Marius Mauch <genone@genone.de>, bug #22275.
+ #
+ # NOTE: Removing this will break future baselayout, so PLEASE
+ # consult with me before doing so.
+ #
+ # <azarah@gentoo.og> (17 Jul 2003)
+ epatch ${FILESDIR}/${PN}-2.11z-agetty-domainname-option.patch
+
+ # Add NFS4 support (kernel 2.5/2.6).
+# use crypt \
+# && epatch ${FILESDIR}/${PN}-2.11z-01-nfsv4-crypt.dif \
+# ||
+ epatch ${FILESDIR}/${PN}-2.11z-01-nfsv4.dif
+
+ # <solar@gentoo.org> This patch should allow us to remove -fPIC
+ # out of the filter-flags we need this be able to emit position
+ # independent code so we can link our elf executables as shared
+ # objects. "prelink" should now also be able to take advantage
+ epatch ${FILESDIR}/${P}-pic.patch
+
+ ## see below for details on pic.patch
+ case ${ARCH} in
+ "x86"|"hppa"|"sparc"|"ppc"|"amd64")
+ ;;
+ *)
+ filter-flags -fPIC
+ ;;
+ esac
+
+ # Add support to read fat/fat32 labels, bug #36722
+ epatch ${FILESDIR}/${P}-fat-LABEL-support.patch
+
+ # Add support for gcloop
+ use crypt || epatch ${FILESDIR}/${P}-gcloop.patch
+ use crypt && epatch ${FILESDIR}/${P}-gcloop-with-crypt.patch
+
+ # Enable pam only if we use it
+ use pam && sed -i "s:HAVE_PAM=no:HAVE_PAM=yes:" MCONFIG
+
+ use selinux && sed -i "s:HAVE_SELINUX=no:HAVE_SELINUX=yes:" MCONFIG
+
+ sed -i \
+ -e "s:-pipe -O2 \$(CPUOPT) -fomit-frame-pointer:${CFLAGS}:" \
+ -e "s:CPU=.*:CPU=${CHOST%%-*}:" \
+ -e "s:HAVE_KILL=no:HAVE_KILL=yes:" \
+ -e "s:HAVE_SLN=no:HAVE_SLN=yes:" \
+ -e "s:HAVE_TSORT=no:HAVE_TSORT=yes:" \
+ -e "s:usr/man:usr/share/man:" \
+ -e "s:usr/info:usr/share/info:" \
+ -e "s:SUIDMODE=.*4755:SUIDMODE=4711:" \
+ MCONFIG || die "MCONFIG sed"
+
+ if ! use nls ; then
+ sed -i -e 's/DISABLE_NLS=no/DISABLE_NLS=yes/' MCONFIG ||
+ die "MCONFIG nls sed"
+ fi
+
+ # 2.6 kernels have a broken blkpg.h (if included in userspace ...)
+ if [ -n "`grep __user /usr/include/linux/blkpg.h`" ] ; then
+ mkdir ${S}/partx/linux
+ sed -e 's:__user::g' /usr/include/linux/blkpg.h > \
+ ${S}/partx/linux/blkpg.h
+ fi
+
+ # Install rdev on amd64 platform
+ epatch ${FILESDIR}/${PN}-2.12-amd64_rdev_installation.patch
+
+ use uclibc && sed -e 's/sys_siglist\[sig\]/strsignal(sig)/' -i ${S}/mount/fstab.c
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ econf || die "configure failed"
+ emake || die "emake failed"
+ if [ ! -x "partx/partx" ] ; then
+ cd ${S}/partx
+ CFLAGS="-I." \
+ make || die "make partx failed"
+ else
+ ewarn "Build system now builds partx!"
+ fi
+ cd ${S}/sys-utils && makeinfo *.texi || die "makeinfo failed"
+}
+
+src_install() {
+ make DESTDIR=${D} install || die "install failed"
+
+ if [ ! -x "${D}/sbin/partx" ] ; then
+ into /
+ dosbin partx/{addpart,delpart,partx}
+ else
+ ewarn "Build system now installs partx!"
+ fi
+
+ dodoc HISTORY MAINTAINER README VERSION
+ docinto licenses
+ dodoc licenses/* HISTORY
+ docinto examples
+ dodoc example.files/*
+}