summaryrefslogtreecommitdiffstats
path: root/sys-apps
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /sys-apps
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/darklin/Manifest6
-rw-r--r--sys-apps/darklin/darklin-4.0.1.ebuild85
-rw-r--r--sys-apps/darklin/darklin-4.0.2.ebuild85
-rw-r--r--sys-apps/darklin/files/bashrc11
-rw-r--r--sys-apps/darklin/files/issue17
-rw-r--r--sys-apps/darklin/files/profile10
-rw-r--r--sys-apps/darklin/files/skel.tar.bz2bin0 -> 12366 bytes
-rw-r--r--sys-apps/fbres/Manifest3
-rw-r--r--sys-apps/fbres/fbres-1.0.ebuild19
-rw-r--r--sys-apps/fbres/files/fbres.sysconfig1
-rw-r--r--sys-apps/fbres/files/fbres.sysinit14
-rw-r--r--sys-apps/kbd/Manifest36
-rw-r--r--sys-apps/kbd/files/alias-console-tools.sh23
-rw-r--r--sys-apps/kbd/files/alias-console-tools2.sh23
-rw-r--r--sys-apps/kbd/files/console-tools-ds-bin.tar.bz2bin0 -> 748 bytes
-rwxr-xr-xsys-apps/kbd/files/consolechars22
-rw-r--r--sys-apps/kbd/files/controlkeys26
-rwxr-xr-xsys-apps/kbd/files/dynamicvc21
-rw-r--r--sys-apps/kbd/files/kbd-1.08-terminal.patch31
-rw-r--r--sys-apps/kbd/files/kbd-1.12-Meta_utf8.patch11
-rw-r--r--sys-apps/kbd/files/kbd-1.12-alias.patch47
-rw-r--r--sys-apps/kbd/files/kbd-1.12-configure-LANG.patch27
-rw-r--r--sys-apps/kbd/files/kbd-1.12-cz-qwerty-map.patch101
-rw-r--r--sys-apps/kbd/files/kbd-1.12-debian.patch86
-rw-r--r--sys-apps/kbd/files/kbd-1.12-find-map-fix.patch37
-rw-r--r--sys-apps/kbd/files/kbd-1.12-it-euro-map.patch18
-rw-r--r--sys-apps/kbd/files/kbd-1.12-jp-escape.patch16
-rw-r--r--sys-apps/kbd/files/kbd-1.12-kbd_repeat-v2.patch27
-rw-r--r--sys-apps/kbd/files/kbd-1.12-kbio.patch25
-rw-r--r--sys-apps/kbd/files/kbd-1.12-setfont-man.patch14
-rw-r--r--sys-apps/kbd/files/kbd-1.12-unimap.patch16
-rw-r--r--sys-apps/kbd/files/kbd-1.12-xcompile.patch21
-rw-r--r--sys-apps/kbd/files/kbd-1.13-dont-use-error.patch17
-rw-r--r--sys-apps/kbd/files/kbd-1.14-ds-nohost.patch12
-rw-r--r--sys-apps/kbd/files/kbd-1.14-ds-unicode.patch59
-rw-r--r--sys-apps/kbd/files/kbd-1.14.1-missing-configure.patch15
-rw-r--r--sys-apps/kbd/files/kbd-1.15.1-ds-nohost.patch12
-rw-r--r--sys-apps/kbd/files/kbd-ds-nohost.patch12
-rw-r--r--sys-apps/kbd/files/keymaps.tar.bz2bin0 -> 15065 bytes
-rw-r--r--sys-apps/kbd/kbd-1.12-r10.ebuild132
-rw-r--r--sys-apps/kbd/kbd-1.12-r11.ebuild136
-rw-r--r--sys-apps/kbd/kbd-1.12-r9.ebuild132
-rw-r--r--sys-apps/kbd/kbd-1.14.1-r2.ebuild75
-rw-r--r--sys-apps/kbd/kbd-1.15.1-r1.ebuild65
-rw-r--r--sys-apps/mkinitrd/Manifest16
-rw-r--r--sys-apps/mkinitrd/files/mdadm-ds-static.patch22
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-4.2.17-mdk.patch.bz2bin0 -> 21102 bytes
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-6.0.93-ds.diff164
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-ds-grubby_compile.patch27
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-ds-raid.patch15
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-ds-vitalsunion.diff65
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-ds.patch42
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-lvm_statics.diff15
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-mdk-patches-6.0.93.tar.bz2bin0 -> 21199 bytes
-rw-r--r--sys-apps/mkinitrd/files/mkinitrd-swsusp2.patch13
-rw-r--r--sys-apps/mkinitrd/files/nash-ds-remount.patch85
-rw-r--r--sys-apps/mkinitrd/mkinitrd-4.2.17-r3.ebuild65
-rw-r--r--sys-apps/mkinitrd/mkinitrd-6.0.93-r1.ebuild46
-rw-r--r--sys-apps/util-linux/Manifest60
-rw-r--r--sys-apps/util-linux/files/agetty-ds-x509-v2.patch23
-rw-r--r--sys-apps/util-linux/files/agetty-ds-x509.patch13
-rw-r--r--sys-apps/util-linux/files/crypto-loop.confd9
-rwxr-xr-xsys-apps/util-linux/files/crypto-loop.initd70
-rw-r--r--sys-apps/util-linux/files/no-symlink-resolve.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.11z-01-nfsv4.dif475
-rw-r--r--sys-apps/util-linux/files/util-linux-2.11z-agetty-domainname-option.patch69
-rw-r--r--sys-apps/util-linux/files/util-linux-2.11z-parallel-make.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.11z-pic.patch76
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-fat-LABEL-support.patch319
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-gcloop.patch116
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-kernel-2.6.patch87
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-mips-lseek.patch24
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-only-root-can-remount.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-selinux.diff.bz2bin0 -> 2558 bytes
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12-swapon-unistd.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12i-fat-LABEL-support.patch69
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12i-ignore-managed.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12i-nfsv4.patch456
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12i-pic.patch59
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12i-swapon-check-symlinks.patch33
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12p-swapon-check-symlinks.patch34
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-debian-10cfdisk.patch49
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-dont-umask.patch17
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-i18n-update.patch10
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-more-fake-checks-v2.patch40
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-no-m68k-fdisk.patch15
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-umount-dont-write-mtab-with-remount.patch18
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch33
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-update_mtab-fixes.patch68
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch16
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h-loop-aes.patch18
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h.patch16
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch37
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch19
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-fdisk-frame-pointers.patch12
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-no-_syscall.patch53
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-umount-no-special.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.12r-umount-nosysfs.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-ioprio-syscalls.patch16
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-locale.patch121
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-no-nls.patch11
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch56
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch52
-rw-r--r--sys-apps/util-linux/files/util-linux-2.13-uclibc.patch71
-rw-r--r--sys-apps/util-linux/files/util-linux-no-kill.patch23
-rw-r--r--sys-apps/util-linux/util-linux-2.12r-r9.ebuild212
-rw-r--r--sys-apps/util-linux/util-linux-2.13.1.1-r1.ebuild96
-rw-r--r--sys-apps/util-linux/util-linux-2.14.2-r1.ebuild96
-rw-r--r--sys-apps/util-linux/util-linux-2.16.2-r1.ebuild101
109 files changed, 5466 insertions, 0 deletions
diff --git a/sys-apps/darklin/Manifest b/sys-apps/darklin/Manifest
new file mode 100644
index 0000000..c19cb33
--- /dev/null
+++ b/sys-apps/darklin/Manifest
@@ -0,0 +1,6 @@
+AUX bashrc 195 SHA256 df9c61bc0b9b29d109b0f7ceca08450d6c03a3d6c69844c9b291032e359c0046 SHA512 27702e71b289e32e1ed6ef611e3dc03438fefcb55c08b7816355a75ba230694c7e0e7519898ad19f6299305fa5afb7de4836e088dc76178b216b9d6f685f1dc5 WHIRLPOOL 35fafa30148dad1e02d6894c10092f0561695bb72e17ebb3ec451681f8640dfdad2cedb7aef161ef8e99f32cc14118e12fa54f090b8f807f234395c8600d5481
+AUX issue 1276 SHA256 4bdc593a14ab7f00b1a6a8db08ac081bc545d9d9450af00a3bb43c977982ebd3 SHA512 10092d6915e573996c21898d6ac18a290ac7f4948f5e2d54c8f15f133c78907b44f146cf040160028621c51276f1f0a662c0958c699b1b84a8f041f878afbd77 WHIRLPOOL ce8a9671925620483672a03c1898cd8b3b995339362f8305a661c19d49717d7fe51a93d55e5cd05bc4a6ded802c21469a96eae334ace1cccfecc1d621810eb4e
+AUX profile 125 SHA256 08ba0093adc60ae283680371944212a6d20ad94283b42be3c23ecc2ff352602d SHA512 97d80c7f5562aebac4f528b9f6aea67c9fea280d34f50e2a2c05c787b0af48c5e94bb75bd06b9274bd5383b25ae84f0e000e2135beb95c72ae068566fc40c7d1 WHIRLPOOL 1f11ed6d81ac9c235b7ad35999606899fa14bfa1114f2c1d2e2229d5d7a0b8dbd30c6888c824df9cf3a556ffa3e35cacb936a9ccb21b302dc4077c69c4ed9812
+AUX skel.tar.bz2 12366 SHA256 fde070a47fe35ffdd3edc69fd81220bfdd4bba3f2ad4831563406b0f54cefd00 SHA512 f9f63af462e52035851e934c6afa354825e01a3f694aa029ac8a3eda3f5202e816e33fb5732f6e76ab6049ffc5f20c4679fefb222e32758a2a3c414b42ec6a37 WHIRLPOOL 5d97ffb66ba68ff5caa74d36be781c72c91ee2f6b5f9876be00368c896bd2ec5ab0f1d8af8975ae23481e338cf70174ad759ea2c6e11de98ec2d3fd307590a13
+EBUILD darklin-4.0.1.ebuild 1756 SHA256 59413dbe9d9e630e08be56dcfdc1750f2d501704ee2ec18a86b5394c608d0ed6 SHA512 2be359163fa15215f5118d8bdfbbfe994109d0ad7b08bf8391cf4a958becf79b99d74271520798609dd95d81a251cd9f0434977bb9fe462b21b8be9c3cfa7a3e WHIRLPOOL cc57be060f700f622be0ae8955a2bb7c7d447a5dc5bc00a6863ef6937d4b4ed5970910aede437dad1611f0f9bfeee784c0d9553e655096a31b56439c3f7e95ae
+EBUILD darklin-4.0.2.ebuild 1756 SHA256 59413dbe9d9e630e08be56dcfdc1750f2d501704ee2ec18a86b5394c608d0ed6 SHA512 2be359163fa15215f5118d8bdfbbfe994109d0ad7b08bf8391cf4a958becf79b99d74271520798609dd95d81a251cd9f0434977bb9fe462b21b8be9c3cfa7a3e WHIRLPOOL cc57be060f700f622be0ae8955a2bb7c7d447a5dc5bc00a6863ef6937d4b4ed5970910aede437dad1611f0f9bfeee784c0d9553e655096a31b56439c3f7e95ae
diff --git a/sys-apps/darklin/darklin-4.0.1.ebuild b/sys-apps/darklin/darklin-4.0.1.ebuild
new file mode 100644
index 0000000..cf55522
--- /dev/null
+++ b/sys-apps/darklin/darklin-4.0.1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+inherit eutils
+
+DESCRIPTION="DarkLin Release"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+DARKLIN_DISTRIB="Charon"
+DEPEND="dev-lang/perl"
+
+src_install() {
+ dodir /etc/
+
+ echo ${PV} > ${D}/etc/darklin-version
+ echo "DarkLin IV ($DARKLIN_DISTRIB)" > ${D}/etc/darklin-release
+
+ cat "${FILESDIR}"/issue | sed -e "s/@name@/$DARKLIN_DISTRIB/g" -e "s/@version@/$PV/g" > ${D}/etc/issue
+}
+
+pkg_postinst() {
+perl -s -e '$^I="";
+if (@argv == 2) { $PN=pop(@argv); }
+$NOT_STARTED=1;$COMMENTS=1;$BL="";
+while (<>)
+{
+ $value=$_;
+
+ if ($value=~m/^\s*loginsh=/) {
+ next;
+ }
+
+ if (($COMMENTS)&&($value!~m/^\s*#/)) {
+ print "loginsh=1\n";
+ $COMMENTS=0;
+ }
+
+ if ((defined $PN)&&($value=~m/CfgStart\s*$PN/)) {
+ $NOT_STARTED=0;
+ } elsif ((defined $PN)&&($value=~m/CfgEnd\s*$PN/)) {
+ $NOT_STARTED=1;
+ } elsif ($NOT_STARTED) {
+ if ($value =~ m/^\s*$/) {
+ $BLS.=$value;
+ } else {
+ print $BLS;
+ print $value;
+ $BLS=""
+ }
+ }
+}
+if ($value !~ m/$\s*^/) {
+ print "\n";
+}' -- -PN=darklin /etc/profile
+
+perl -s -e '$^I="";
+if (@argv == 2) { $PN=pop(@argv); }
+$NOT_STARTED=1;$COMMENTS=1;$BL="";
+while (<>)
+{
+ $value=$_;
+
+ if ((defined $PN)&&($value=~m/CfgStart\s*$PN/)) {
+ $NOT_STARTED=0;
+ } elsif ((defined $PN)&&($value=~m/CfgEnd\s*$PN/)) {
+ $NOT_STARTED=1;
+ } elsif ($NOT_STARTED) {
+ if ($value =~ m/^\s*$/) {
+ $BLS.=$value;
+ } else {
+ print $BLS;
+ print $value;
+ $BLS=""
+ }
+ }
+}
+if ($value !~ m/$\s*^/) {
+ print "\n";
+}' -- -PN=darklin /etc/bash/bashrc
+
+ cat "${FILESDIR}"/bashrc >> /etc/bash/bashrc
+ cat "${FILESDIR}"/profile >> /etc/profile
+}
diff --git a/sys-apps/darklin/darklin-4.0.2.ebuild b/sys-apps/darklin/darklin-4.0.2.ebuild
new file mode 100644
index 0000000..cf55522
--- /dev/null
+++ b/sys-apps/darklin/darklin-4.0.2.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+inherit eutils
+
+DESCRIPTION="DarkLin Release"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+DARKLIN_DISTRIB="Charon"
+DEPEND="dev-lang/perl"
+
+src_install() {
+ dodir /etc/
+
+ echo ${PV} > ${D}/etc/darklin-version
+ echo "DarkLin IV ($DARKLIN_DISTRIB)" > ${D}/etc/darklin-release
+
+ cat "${FILESDIR}"/issue | sed -e "s/@name@/$DARKLIN_DISTRIB/g" -e "s/@version@/$PV/g" > ${D}/etc/issue
+}
+
+pkg_postinst() {
+perl -s -e '$^I="";
+if (@argv == 2) { $PN=pop(@argv); }
+$NOT_STARTED=1;$COMMENTS=1;$BL="";
+while (<>)
+{
+ $value=$_;
+
+ if ($value=~m/^\s*loginsh=/) {
+ next;
+ }
+
+ if (($COMMENTS)&&($value!~m/^\s*#/)) {
+ print "loginsh=1\n";
+ $COMMENTS=0;
+ }
+
+ if ((defined $PN)&&($value=~m/CfgStart\s*$PN/)) {
+ $NOT_STARTED=0;
+ } elsif ((defined $PN)&&($value=~m/CfgEnd\s*$PN/)) {
+ $NOT_STARTED=1;
+ } elsif ($NOT_STARTED) {
+ if ($value =~ m/^\s*$/) {
+ $BLS.=$value;
+ } else {
+ print $BLS;
+ print $value;
+ $BLS=""
+ }
+ }
+}
+if ($value !~ m/$\s*^/) {
+ print "\n";
+}' -- -PN=darklin /etc/profile
+
+perl -s -e '$^I="";
+if (@argv == 2) { $PN=pop(@argv); }
+$NOT_STARTED=1;$COMMENTS=1;$BL="";
+while (<>)
+{
+ $value=$_;
+
+ if ((defined $PN)&&($value=~m/CfgStart\s*$PN/)) {
+ $NOT_STARTED=0;
+ } elsif ((defined $PN)&&($value=~m/CfgEnd\s*$PN/)) {
+ $NOT_STARTED=1;
+ } elsif ($NOT_STARTED) {
+ if ($value =~ m/^\s*$/) {
+ $BLS.=$value;
+ } else {
+ print $BLS;
+ print $value;
+ $BLS=""
+ }
+ }
+}
+if ($value !~ m/$\s*^/) {
+ print "\n";
+}' -- -PN=darklin /etc/bash/bashrc
+
+ cat "${FILESDIR}"/bashrc >> /etc/bash/bashrc
+ cat "${FILESDIR}"/profile >> /etc/profile
+}
diff --git a/sys-apps/darklin/files/bashrc b/sys-apps/darklin/files/bashrc
new file mode 100644
index 0000000..82dcbad
--- /dev/null
+++ b/sys-apps/darklin/files/bashrc
@@ -0,0 +1,11 @@
+
+
+# CfgStart darklin
+ if [ -z "$loginsh" ]; then # We're not a login shell
+ for i in /etc/profile.d/*.sh; do
+ if [ -x $i ]; then
+ . $i
+ fi
+ done
+ fi
+# CfgEnd darklin
diff --git a/sys-apps/darklin/files/issue b/sys-apps/darklin/files/issue
new file mode 100644
index 0000000..48a64a1
--- /dev/null
+++ b/sys-apps/darklin/files/issue
@@ -0,0 +1,17 @@
+DDDDDDDDDD _
+D:::::::::DDD ( ) DarkLin IV @name@
+D::::::::::::DD _ _ _ __ | |/') Version: @version@
+DDD::::DDDD::::D /'_` ) ( '__) | , < System: \s
+ D::::D D::::D ( (_| | | | | |\\`\\ Architecture: \m
+ D::::D D::::D `\\__,_) (_) (_) (_) Kernel: \r
+ D::::D D::::D ____
+ D::::D D::::D |####| _ \n.\O
+ D::::D D::::D T##T (_)  Time: \t
+ D::::D D::::D  |##| _ ___ _ _
+DDD::::DDDD::::D  |##| | | /' _ `\\ ( ) ( ) (`\\/')
+D::::::::::::DD  |##| | | | ( ) | | (_) | > <
+D:::::::::DDD  |##| (_) (_) (_) `\\___/' (_/\\_)
+DDDDDDDDDD  |##|______,--,
+  [############]
+
+
diff --git a/sys-apps/darklin/files/profile b/sys-apps/darklin/files/profile
new file mode 100644
index 0000000..0b1851a
--- /dev/null
+++ b/sys-apps/darklin/files/profile
@@ -0,0 +1,10 @@
+
+
+# CfgStart darklin
+for sh in /etc/profile.d/*.sh ; do
+ if [ -r "$sh" ] ; then
+ . "$sh"
+ fi
+done
+unset sh
+# CfgEnd darklin
diff --git a/sys-apps/darklin/files/skel.tar.bz2 b/sys-apps/darklin/files/skel.tar.bz2
new file mode 100644
index 0000000..45065d7
--- /dev/null
+++ b/sys-apps/darklin/files/skel.tar.bz2
Binary files differ
diff --git a/sys-apps/fbres/Manifest b/sys-apps/fbres/Manifest
new file mode 100644
index 0000000..67df697
--- /dev/null
+++ b/sys-apps/fbres/Manifest
@@ -0,0 +1,3 @@
+AUX fbres.sysconfig 33 RMD160 5e58208462621ce4476fd8697ba1c4a62be363f8 SHA1 556334c6c18d5cbf96d3fe3b9159c8b26e1a2770 SHA256 0911b9b916a7b6bb3cfbdf0413ef1df6d7a00b63f78674626005611d4ff40e62
+AUX fbres.sysinit 348 RMD160 304f8815aeea2f21e637c4208b523de8c9f53bfe SHA1 725cb6621bec041365beb859c1b7192bafd42290 SHA256 66de1f43e85a5d0b69a00b2d0abe645a29e045759875bd69ec288c76f5933491
+EBUILD fbres-1.0.ebuild 471 RMD160 d8601d0c8de4a9611226c86cca1dd7f830d44b2e SHA1 fe3211778d8a305e41fd52d16be9b5d9efcc545d SHA256 f7855d3547bbaa146f35d4429f5ad70c817bcc6609d88b5a449c739c77ab3751
diff --git a/sys-apps/fbres/fbres-1.0.ebuild b/sys-apps/fbres/fbres-1.0.ebuild
new file mode 100644
index 0000000..170fd1c
--- /dev/null
+++ b/sys-apps/fbres/fbres-1.0.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+inherit eutils
+
+DESCRIPTION="Init script to set framebuffer resolution"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+RDEPEND="sys-libs/ncurses"
+
+src_install() {
+ dodir /etc/conf.d
+ dodir /etc/init.d
+
+ install -m 0755 ${FILESDIR}/fbres.sysinit ${D}/etc/init.d/fbres
+ install -m 0644 ${FILESDIR}/fbres.sysconfig ${D}/etc/conf.d/fbres
+}
diff --git a/sys-apps/fbres/files/fbres.sysconfig b/sys-apps/fbres/files/fbres.sysconfig
new file mode 100644
index 0000000..30aa226
--- /dev/null
+++ b/sys-apps/fbres/files/fbres.sysconfig
@@ -0,0 +1 @@
+FRAMEBUFFER_RESOLUTION=800x600-75 \ No newline at end of file
diff --git a/sys-apps/fbres/files/fbres.sysinit b/sys-apps/fbres/files/fbres.sysinit
new file mode 100644
index 0000000..6bd187b
--- /dev/null
+++ b/sys-apps/fbres/files/fbres.sysinit
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+start() {
+ ebegin "Setting frambe buffer resolution"
+ modprobe fbdev
+ if [ -n "$FRAMEBUFFER_RESOLUTION" ]; then
+ fbset -a $FRAMEBUFFER_RESOLUTION
+ fi
+ eend 0
+ /etc/init.d/consolefont restart
+}
diff --git a/sys-apps/kbd/Manifest b/sys-apps/kbd/Manifest
new file mode 100644
index 0000000..f940a59
--- /dev/null
+++ b/sys-apps/kbd/Manifest
@@ -0,0 +1,36 @@
+AUX alias-console-tools.sh 1229 RMD160 3d909523c5c94a0c689909c0580361b331d43612 SHA1 766c4c8a87ef774a7e776e55f1a0076e32db539d SHA256 0a4a8511cdc43e7cf141e740c8761645881745300faf39d68f18549baa5b95cf
+AUX alias-console-tools2.sh 1189 RMD160 4ee81489986e5fb8fd7c60b3a86af7410d6f8a72 SHA1 7418cf0644bafbc50a4792959588ad972287e5d7 SHA256 56d40ab6fe13bb2b26a2b31767ae20a205332a7ec26f39b0825a1e24b74a6885
+AUX console-tools-ds-bin.tar.bz2 748 RMD160 74fd500ebdf265cf7501386d4b4619e0b9940d71 SHA1 f187922fb87ec93caade069b510c6209bfdc0396 SHA256 6f7e70dce9b4e2f70d8b314337088d263fc42ad19a05abc65ff9c3256ce2b5d4
+AUX consolechars 278 RMD160 eb48ae272cc79b8d502a1b15852f7d3c19b8b52c SHA1 eba6100b488fdbcf81af75af177484ed03ae363b SHA256 670ae7db76d68efd01756ed0a5e08902cdbe22210a02f56d1e5d3faa4075dac5
+AUX controlkeys 905 RMD160 89c4f832aba5e7cf9a259a1df6f06a9e0ad33bfd SHA1 b56a670e4860ccd527b3c73586d548d8e41a3a41 SHA256 f700784a4facd8491b203c1bd8ac881c72a58d095292b207e7fbcd4fa92a9bae
+AUX dynamicvc 445 RMD160 18404ac90f44d8d4108c37415fc1985f46ab54ec SHA1 945b126a61bf8230ebf772cbaf8337ae28c21e51 SHA256 16bfab68a32bf7f3e4f593c8b9623ebc5b6ab95f85d609237125d7bd72e15a1f
+AUX kbd-1.08-terminal.patch 925 RMD160 0f622bcf874c01ee6533cfbdc6137e4f8949299b SHA1 e4a473ce98292a77403a9d79b8cdc083542113ec SHA256 466ac92951695017498c640547af9aeb6351b2da75b6b787c7d0f17f409e9134
+AUX kbd-1.12-Meta_utf8.patch 344 RMD160 a1a1326716716305767f297817519d1cd6f5670d SHA1 a3de75ef80288597d2a134dcc6f7a8b7ce81ca7e SHA256 9cb114acb7704fe14ae99d77ffc1f6fc586101fc541eadce5efbfd36f9d8b8c0
+AUX kbd-1.12-alias.patch 1129 RMD160 2dbff90ee13a3f7e738faed94301388ea8c4ce83 SHA1 2a266a3fc520371bba9050ea8fa13f4592892e83 SHA256 354779bdc2a3a69485877089d6eac95939fc48acea8d7a7e6efd2cac42de951a
+AUX kbd-1.12-configure-LANG.patch 609 RMD160 1ed668e620d438da9bc42542908232f72a138f5e SHA1 908c8f635af838f2de0febf0584ecee5609218f9 SHA256 2162d613d68391fd81b172d57c261569a6f342c87e4bb540e926184a3c00d331
+AUX kbd-1.12-cz-qwerty-map.patch 5821 RMD160 aa7d3448f3bfc053ef27b1a65d9da73664b5b5c5 SHA1 6a32a00be729d6804ec2551752c5ab24fcacf946 SHA256 5218c2119d50be11e36b7cec7985b69b43336bf8d51d869b3c367762d8bb9064
+AUX kbd-1.12-debian.patch 2628 RMD160 8ef9803e8472a74c6e501cb3dde38a87ab13937b SHA1 1936974779acbb3cec572acd4f515713e6fced33 SHA256 54663b3dde3337cd21e64d96f1ffa5e88143b3a4a1dce93311cd8cf432200f57
+AUX kbd-1.12-find-map-fix.patch 957 RMD160 4e3a6fd81f533d08c19d6f443ad447c1d0617924 SHA1 420fd29fc06e3518dac3fac8003c8ac71ae3b28e SHA256 76bed8974c260fff1a44bcc3844471c6dd24d04d473f052de6199eb39a38a456
+AUX kbd-1.12-it-euro-map.patch 501 RMD160 c1e7d02e0254f7800fbc432c8a4de9ea1f8aa1a5 SHA1 97bd7c4afc31862893256ce0adc337bcd9940cb5 SHA256 9114756bb0a07262790947303b941da0d873a35edcc8cd23f6dc4e29b5a84e6e
+AUX kbd-1.12-jp-escape.patch 404 RMD160 58773e9196a62ea46983d02c12f04de92ef31d1b SHA1 3b3b5b48b5d92493a504ba77d92a2143fb4a0cf5 SHA256 61f75f672a69018f25acd3a51de49ef971cac8eaa1e3c097e0b49dff470113ab
+AUX kbd-1.12-kbd_repeat-v2.patch 809 RMD160 48d058cd7cfcff6df450e21138f28ed8ead1cdca SHA1 f5e787fca0342976dc04ab1c00bb1a85ea8b412b SHA256 7b64a4d2a59f28e4f19405bbc81bedd7774f812f1831cb2c0afe217799d7c165
+AUX kbd-1.12-kbio.patch 648 RMD160 a1351e1d3691bc86cd8f5ad74c0b0a2d2e5da5d8 SHA1 64f1bcabd93d34dfaedc5b0f566f8cfd0decaf11 SHA256 822d7fb35a7d2f730e4272284368a44a055f850bf98005bf5d69e5e116bb417f
+AUX kbd-1.12-setfont-man.patch 629 RMD160 dba23dfb4a9d263da6bc094a56366371bfc1b9d2 SHA1 61f3e19290ec3d85838158b2efbbf60be21e88af SHA256 f81c6f07bddefe8bf1f8e1102f8a8c72e96f632aefa248e71a594ad19d767770
+AUX kbd-1.12-unimap.patch 642 RMD160 a8ae481be1e2ca64a2ddc73f03fda644436f76a2 SHA1 9cf44c9ed07da02f5ba9a0dce9df4278e8a4beaa SHA256 f1364a306636661ebcca73d91ca179be811b6b4ccd08b1b761a0847f579623a0
+AUX kbd-1.12-xcompile.patch 680 RMD160 a2db9ef656d9a09aec4ebd5d02726efa7e3d4818 SHA1 7c4c6b08f0f0c443a309a86055b01c11d8e80c21 SHA256 78d29c76075cf5ee347461e28ae0ac25a06ce446151d91ec661c3a2d33da4191
+AUX kbd-1.13-dont-use-error.patch 414 RMD160 76e822064fedc9f5b36daf10c06c83f13afc1f13 SHA1 543874d0f36ace327af79815004b1cd017ce9357 SHA256 9f9e7e860362b7e5402c1c0af55ff301e0542e34aacc71167f9252f50a4f74ca
+AUX kbd-1.14-ds-nohost.patch 413 RMD160 bc08f05b4b2b38e7b83bc74b12b047ac223de73b SHA1 506fd9515c967ab853c2a447e967abaa7c0cd1f6 SHA256 a12c39f52b96a4093c14fc6432a53dac882251c0e3796087c49485212645eb67
+AUX kbd-1.14-ds-unicode.patch 1443 RMD160 2bc0267b3f2cfa99003209bfe801cb0592178837 SHA1 4a67e14aeedf08fe73f4e5dde1ff3ffecdbad283 SHA256 c52ce04fecb9e2346b8450b617a2a80a4bc8f23ad4cc55a6fa2d767a5573ba3b
+AUX kbd-1.14.1-missing-configure.patch 444 RMD160 d1d4f185e8d761d865a3f64fb717446505e08c30 SHA1 ea03ca92b21c0d5a87db2e31f1fd27c1c2e4394b SHA256 0a2a530ac1d2baa03c7cc12e10a242bbc9d128304136f5dba4909d3df2b16eb1
+AUX kbd-1.15.1-ds-nohost.patch 423 RMD160 64181840f9e7a324b13adefbd3cf7b35a61824f3 SHA1 1686b2d61c1325caf6bd04698c25a7d008bc07ca SHA256 62e44bd7d1f19939e3281f190f7a09580cbabcadd556f6e56013cf1f6bc783fb
+AUX kbd-ds-nohost.patch 364 RMD160 ec84228fb79257d5578b6ac3793c0529c3ae5e55 SHA1 55cd0febb5447fee5d3b0abab33f569a35a414e2 SHA256 5d619184021001f77c5dd090dd8b83199f9eb42783ddcde3442787f9d6ef9ef7
+AUX keymaps.tar.bz2 15065 RMD160 a84e770fb28994fb3ab6b554a4467ee0c2092fab SHA1 709d182ff03d87b874412d1c649634d9f993f6d8 SHA256 7142ce3c1c9bfbae745a25d7046ace9e40371820fb2b461c0f1c874a2ec067f6
+DIST kbd-1.12.tar.gz 884827 RMD160 260ed9b79b5a679730fc16f1d3ce9360f4ad63fd SHA1 d4917da308e01e74d67d7b814bf527063b3919fc SHA256 f3bc6747dba7d1a35cd125ca0bd4649f88704be211cf7e47d36b43c7f44ce803
+DIST kbd-1.14.1.tar.gz 1010836 RMD160 5206423c9950c8beb2467e7b761d2a0f827ebbe2 SHA1 12d91613096d1a724fc780e2d7974a0a1b308dce SHA256 e97ed7ec4ec937a27ac2e72789e76db4b661f7ce2c2b7b68524f55ee69dce491
+DIST kbd-1.15.1.tar.gz 1107059 RMD160 4035b91529c1e47bcc5e0054d753569917111fd0 SHA1 a5750125be4ddff84cdcf37f5d5e320a7f3c4c35 SHA256 91b88c83a32eb584797b1cf271cdea902264eb65545453a5e933ca8db4ea99ce
+DIST svorakln.tar.gz 3030 RMD160 4ee5d1bdab312eb33cbde9195e6d4cdf28eb9a6e SHA1 a529a5fa4968b135996aefc7c2e4f38e8dc7d827 SHA256 7c4015dcd1f4310ba1b872c9a9e57c43d45da822330853ae465e628d3bca8ee3
+EBUILD kbd-1.12-r10.ebuild 3857 RMD160 2899489a3e33359d9654330d186908a9ccf158bd SHA1 08b0069d7bae910e9b269d0731d43f94ac8335c2 SHA256 a4e27414d0491ce806d26d1716b569ae571e4a3a89a687cc57305654b3ffdaf0
+EBUILD kbd-1.12-r11.ebuild 3919 RMD160 576824d6dc6e5324f7c7efb38d368138977458f2 SHA1 3d8b2f1363f654b58512a3fdcd31b1697ce52524 SHA256 4d0485f10266cdc819b05f32c96fdd328e99ae3395b0f65becbe8cc56a1e4cd9
+EBUILD kbd-1.12-r9.ebuild 3855 RMD160 42ba891e5b8ad22497df4b26f00de3461428baac SHA1 19fb98963d5efef346099e7fd929d56999510e72 SHA256 4acf9b995aef0ffdb59e94242b128b8702f1d4798d684fa31752680950f7ea5a
+EBUILD kbd-1.14.1-r2.ebuild 2183 RMD160 eff22464c81419635d6c7bde16610ed92d1844f2 SHA1 1f5964f6a55898c3a710c8b1fe08b2f22a4e6b2e SHA256 36ad231dfcf61e9812cb9fdc284bc0090d1ae772ca624d92876e2dbd464937c7
+EBUILD kbd-1.15.1-r1.ebuild 1819 RMD160 04f7e1ef454749e8acc87033f773a747042deb3d SHA1 154bbf17ab901e5d17ea408d64957a30e1a6422c SHA256 6060374618586c6a2d7ee9db110ea91d96400d8c59b47148b68d7bb885384bea
diff --git a/sys-apps/kbd/files/alias-console-tools.sh b/sys-apps/kbd/files/alias-console-tools.sh
new file mode 100644
index 0000000..b9ecfa2
--- /dev/null
+++ b/sys-apps/kbd/files/alias-console-tools.sh
@@ -0,0 +1,23 @@
+alias koif="consolechars -f Cyr_a8x16 -m koi8-r &>/dev/null"
+alias altf="consolechars -f Cyr_a8x16 -m cp866 &>/dev/null"
+alias winf="consolechars -f Cyr_a8x16 -m cp1251 &>/dev/null"
+alias isof="consolechars -f Cyr_a8x16 -m iso8859-5 &>/setdev/null"
+alias macf="consolechars -f Cyr_a8x16 -m MacCyrillic &>/dev/null"
+#unicode_start & unicode_stop for unicode
+
+alias seteng="loadkeys us.map &>/dev/null"
+alias setalt="loadkeys alt.map &>/dev/null"
+alias setkoi="loadkeys koi8.map &>/dev/null"
+alias setiso="loadkeys iso.map &>/dev/null"
+alias setwin="loadkeys win.map &>/dev/null"
+alias setuni="loadkeys ru4.uni.kmap &>/dev/null"
+
+alias locale-koi="export LC_CTYPE=ru_RU.KOI8-R; export LC_COLLATE=ru_RU.KOI8-R";
+alias locale-win="export LC_CTYPE=ru_RU.CP1251; export LC_COLLATE=ru_RU.CP1251";
+alias locale-alt="export LC_CTYPE=ru_RU.CP866; export LC_COLLATE=ru_RU.CP866";
+alias locale-utf="export LC_CTYPE=ru_RU.UTF-8; export LC_COLLATE=ru_RU.UTF-8";
+
+alias xterm-koi="LC_CTYPE=ru_RU.KOI8-R LC_COLLATE=ru_RU.KOI8-R xterm";
+alias xterm-win="LC_CTYPE=ru_RU.CP1251 LC_COLLATE=ru_RU.CP1251 xterm";
+alias xterm-alt="LC_CTYPE=ru_RU.CP866 LC_COLLATE=ru_RU.CP866 xterm";
+alias xterm-utf="LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8 xterm";
diff --git a/sys-apps/kbd/files/alias-console-tools2.sh b/sys-apps/kbd/files/alias-console-tools2.sh
new file mode 100644
index 0000000..e015595
--- /dev/null
+++ b/sys-apps/kbd/files/alias-console-tools2.sh
@@ -0,0 +1,23 @@
+alias koif="setfont -m koi8-r Cyr_a8x16 &>/dev/null"
+alias altf="setfont -m cp866 Cyr_a8x16 &>/dev/null"
+alias winf="setfont -m cp1251 Cyr_a8x16 &>/dev/null"
+alias isof="setfont -m iso8859-5 Cyr_a8x16 &>/setdev/null"
+alias macf="setfont -m MacCyrillic Cyr_a8x16 &>/dev/null"
+#unicode_start & unicode_stop for unicode
+
+alias seteng="loadkeys us.map &>/dev/null"
+alias setalt="loadkeys alt.map &>/dev/null"
+alias setkoi="loadkeys koi8.map &>/dev/null"
+alias setiso="loadkeys iso.map &>/dev/null"
+alias setwin="loadkeys win.map &>/dev/null"
+alias setuni="loadkeys ru4.uni.kmap &>/dev/null"
+
+alias locale-koi="export LC_CTYPE=ru_RU.KOI8-R; export LC_COLLATE=ru_RU.KOI8-R";
+alias locale-win="export LC_CTYPE=ru_RU.CP1251; export LC_COLLATE=ru_RU.CP1251";
+alias locale-alt="export LC_CTYPE=ru_RU.CP866; export LC_COLLATE=ru_RU.CP866";
+alias locale-utf="export LC_CTYPE=ru_RU.UTF-8; export LC_COLLATE=ru_RU.UTF-8";
+
+alias xterm-koi="LC_CTYPE=ru_RU.KOI8-R LC_COLLATE=ru_RU.KOI8-R xterm";
+alias xterm-win="LC_CTYPE=ru_RU.CP1251 LC_COLLATE=ru_RU.CP1251 xterm";
+alias xterm-alt="LC_CTYPE=ru_RU.CP866 LC_COLLATE=ru_RU.CP866 xterm";
+alias xterm-utf="LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8 xterm";
diff --git a/sys-apps/kbd/files/console-tools-ds-bin.tar.bz2 b/sys-apps/kbd/files/console-tools-ds-bin.tar.bz2
new file mode 100644
index 0000000..57d00bb
--- /dev/null
+++ b/sys-apps/kbd/files/console-tools-ds-bin.tar.bz2
Binary files differ
diff --git a/sys-apps/kbd/files/consolechars b/sys-apps/kbd/files/consolechars
new file mode 100755
index 0000000..810829f
--- /dev/null
+++ b/sys-apps/kbd/files/consolechars
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+setfont=0
+setmap=0
+
+for name in $@; do
+ if [ $setfont -eq 1 ]; then
+ setfont $name
+ setfont=0
+ fi
+
+ if [ $setmap -eq 1 ]; then
+ mapscrn $name
+ setmap=0
+ fi
+
+ if [ $name = "-f" ]; then
+ setfont=1
+ elif [ $name = "-m" ]; then
+ setmap=1
+ fi
+done
diff --git a/sys-apps/kbd/files/controlkeys b/sys-apps/kbd/files/controlkeys
new file mode 100644
index 0000000..3d2aa1c
--- /dev/null
+++ b/sys-apps/kbd/files/controlkeys
@@ -0,0 +1,26 @@
+ alt keycode 103 = Spawn_Console
+ alt keycode 108 = Last_Console
+ altgr keycode 59 = Console_13
+ altgr keycode 60 = Console_14
+ altgr keycode 61 = Console_15
+ altgr keycode 62 = Console_16
+ altgr keycode 63 = Console_17
+ altgr keycode 64 = Console_18
+ altgr keycode 65 = Console_19
+ altgr keycode 66 = Console_20
+ altgr keycode 67 = Console_21
+ altgr keycode 68 = Console_22
+ altgr keycode 87 = Console_23
+ altgr keycode 88 = Console_24
+ control altgr keycode 59 = Console_13
+ control altgr keycode 60 = Console_14
+ control altgr keycode 61 = Console_15
+ control altgr keycode 62 = Console_16
+ control altgr keycode 63 = Console_17
+ control altgr keycode 64 = Console_18
+ control altgr keycode 65 = Console_19
+ control altgr keycode 66 = Console_20
+ control altgr keycode 67 = Console_21
+ control altgr keycode 68 = Console_22
+ control altgr keycode 87 = Console_23
+ control altgr keycode 88 = Console_24
diff --git a/sys-apps/kbd/files/dynamicvc b/sys-apps/kbd/files/dynamicvc
new file mode 100755
index 0000000..e50792f
--- /dev/null
+++ b/sys-apps/kbd/files/dynamicvc
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+depend() {
+ need consolefont
+}
+
+start() {
+ ebegin "Starting dynamic-vc"
+ loadkeys < /etc/conf.d/controlkeys
+ start-stop-daemon --start --quiet --background --exec /usr/bin/spawn_login
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dynamic-vc"
+ start-stop-daemon --stop --quiet --exec /usr/bin/spawn_login
+ eend $?
+}
diff --git a/sys-apps/kbd/files/kbd-1.08-terminal.patch b/sys-apps/kbd/files/kbd-1.08-terminal.patch
new file mode 100644
index 0000000..13aeeec
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.08-terminal.patch
@@ -0,0 +1,31 @@
+Output terminal control sequences only when output is a terminal.
+
+--- kbd-1.08/src/unicode_start 2002-11-22 19:23:00.000000000 -0500
++++ kbd-1.08/src/unicode_start 2002-11-22 19:24:34.000000000 -0500
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # Enables Unicode processing in the current console.
+ #
+ # 1. The input side: the keyboard driver.
+@@ -25,7 +25,9 @@
+ # Tell the console output driver that the bytes arriving are UTF-8
+ # encoded multibyte sequences.
+
+-echo -n -e '\033%G'
++if test -t 1 -a -t 2 ; then
++ echo -n -e '\033%G'
++fi
+
+ # Tell the graphics card how to display Unicode characters not
+ # contained in the IBM 437 character set (on PCs). The font should
+--- kbd-1.08/src/unicode_stop 2002-11-22 19:23:30.000000000 -0500
++++ kbd-1.08/src/unicode_stop 2002-11-22 19:24:15.000000000 -0500
+@@ -1,4 +1,6 @@
+ #!/bin/sh
+ # stop unicode
+ kbd_mode -a
+-echo -n -e '\033%@'
++if test -t ; then
++ echo -n -e '\033%@'
++fi
diff --git a/sys-apps/kbd/files/kbd-1.12-Meta_utf8.patch b/sys-apps/kbd/files/kbd-1.12-Meta_utf8.patch
new file mode 100644
index 0000000..9bc68b6
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-Meta_utf8.patch
@@ -0,0 +1,11 @@
+--- kbd-1.12/src/ksyms.c.org 2005-01-11 16:38:32.000000000 +0100
++++ kbd-1.12/src/ksyms.c 2005-01-11 16:46:19.000000000 +0100
+@@ -1710,6 +1710,8 @@
+ keycode = ksymtocode(s+5);
+ if (KTYP(keycode) == KT_LATIN)
+ return K(KT_META, KVAL(keycode));
++ else if(prefer_unicode)
++ return (0);
+ /* fall through to error printf */
+ }
+
diff --git a/sys-apps/kbd/files/kbd-1.12-alias.patch b/sys-apps/kbd/files/kbd-1.12-alias.patch
new file mode 100644
index 0000000..30be4fa
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-alias.patch
@@ -0,0 +1,47 @@
+diff -u kbd-1.12/src/psffontop.c kbd-1.12/src/psffontop.c
+--- kbd-1.12/src/psffontop.c 2005-03-12 00:48:30.075310872 +0100
++++ kbd-1.12/src/psffontop.c 2005-05-14 10:49:59.000000000 +0900
+@@ -59,7 +59,6 @@
+
+ static unsigned int
+ assemble_ucs2(char **inptr, int cnt) {
+- unsigned char **in = (unsigned char **) inptr;
+ unsigned int u1, u2;
+
+ if (cnt < 2) {
+@@ -68,8 +67,8 @@
+ exit(EX_DATAERR);
+ }
+
+- u1 = *(*in)++;
+- u2 = *(*in)++;
++ u1 = (unsigned char)*(*inptr)++;
++ u2 = (unsigned char)*(*inptr)++;
+ return (u1 | (u2 << 8));
+ }
+
+@@ -110,7 +109,6 @@
+ */
+ static void
+ get_uni_entry(char **inptr, char **endptr, struct unicode_list *up, int utf8) {
+- unsigned char **in = (unsigned char **) inptr;
+ unsigned char uc;
+ unicode unichar;
+ int inseq = 0;
+@@ -126,14 +124,14 @@
+ exit(EX_DATAERR);
+ }
+ if (utf8) {
+- uc = *(*in)++;
++ uc = *(*inptr)++;
+ if (uc == PSF2_SEPARATOR)
+ break;
+ if (uc == PSF2_STARTSEQ) {
+ inseq = 1;
+ continue;
+ }
+- --(*in);
++ --(*inptr);
+ unichar = assemble_utf8(inptr, *endptr - *inptr);
+ } else {
+ unichar = assemble_ucs2(inptr, *endptr - *inptr);
diff --git a/sys-apps/kbd/files/kbd-1.12-configure-LANG.patch b/sys-apps/kbd/files/kbd-1.12-configure-LANG.patch
new file mode 100644
index 0000000..554c4f3
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-configure-LANG.patch
@@ -0,0 +1,27 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
+option parsing, it may break.
+
+http://bugs.gentoo.org/128253
+
+--- configure
++++ configure
+@@ -8,6 +8,19 @@
+ # New default: /usr/share/kbd
+ #
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ prefix=
+ datadir=
+ mandir=
diff --git a/sys-apps/kbd/files/kbd-1.12-cz-qwerty-map.patch b/sys-apps/kbd/files/kbd-1.12-cz-qwerty-map.patch
new file mode 100644
index 0000000..a27c88a
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-cz-qwerty-map.patch
@@ -0,0 +1,101 @@
+kavol@email.cz writes:
+
+I wanted to use the keymap file /usr/share/keymaps/i386/qwerty/cz.map.gz,
+but I have found this to be qwertz so I think it should be placed in
+/usr/share/keymaps/i386/qwertz/ (or, much better, converted to qwerty -
+I don't understand the masochists who use us-qwerty and cz-qwertz together :-)
+
+http://bugs.gentoo.org/show_bug.cgi?id=19010
+
+Gentoo notes:
+We copy the qwerty/cz.map to qwertz/cz.map and then apply this patch ...
+that way we end up with both a qwerty and qwertz version of the cz.map
+
+--- data/keymaps/i386/qwerty/cz.map.old 2004-06-21 00:03:22.000000000 +0200
++++ data/keymaps/i386/qwerty/cz.map 2004-10-24 16:04:44.471056808 +0200
+@@ -1,6 +1,9 @@
++# *** toto neni originalni verze souboru:
++# *** upraveno z puvodni QWERTZ na QWERTY + opraveno par preklepu
++#
+ # Tato keymapa NENI urcena pro jadro "opatchovane" programem "patch-capslock"
+ #
+-# klavesova mapa kompatibilni s windows QWERTZ
++# klavesova mapa kompatibilni s windows QWERTY
+ #
+ # Vytvoril: Richard S~puta, Richard.Sputa@os3.os.ds.mfcr.cz
+ #
+@@ -11,7 +14,7 @@
+ # Links: ftp://ftp.penguin.cz/pub/cestina/klavesnice/console/
+ # - primary ftp archiv
+ # http://www.debian.cz/proj/czkbd/index.php3
+-# - czech keyboard standarts
++# - czech keyboard standards
+ #
+ #
+ # POZOR: Tato klavesova mapa obsahuje ve skutecnosti 2 (dve) klavesnice
+@@ -27,7 +30,7 @@
+ # Navic klavesa "PrintScreen" funguje jako carka a hacek
+ #
+ #
+-# Rozsireni oproti standartni_CESKE_unikodove_klavesnici
++# Rozsireni oproti standardni_CESKE_unikodove_klavesnici
+ # (zde jsou popsany pouze kombinace, jejichz umisteni je diskutabilni)
+ # (popis ostatnich rozsireni je v souboru "readme.txt")
+ # 1) AltGr-SPACE => znak "nobreakspace" (neoddelitelna mezera kod 0xa0)
+@@ -148,7 +151,7 @@
+ # Linefeed (primarni) => Control_j
+ #
+ # vzdalenost mezi zacatky symbolu:
+-# 12 znaku (standartne) vyhovuje 80% symbolickych nazvu
++# 12 znaku (standardne) vyhovuje 80% symbolickych nazvu
+ # 25 znaku ma symbolicky nazev Meta_Control_bracketright
+ # 123456789012 123456789012 123456789012 123456789012 123456789012
+ keycode 1 = Escape Escape VoidSymbol VoidSymbol VoidSymbol \
+@@ -383,15 +386,15 @@
+ VoidSymbol VoidSymbol +T t VoidSymbol \
+ VoidSymbol VoidSymbol VoidSymbol Meta_T Meta_t \
+ VoidSymbol
+-keycode 21 = +z Z VoidSymbol VoidSymbol Control_z \
+- Control_z VoidSymbol VoidSymbol Meta_z Meta_Z \
+- VoidSymbol VoidSymbol +Z z VoidSymbol \
+- VoidSymbol VoidSymbol VoidSymbol Meta_Z Meta_z \
++keycode 21 = +y Y VoidSymbol VoidSymbol Control_y \
++ Control_y VoidSymbol VoidSymbol Meta_y Meta_Y \
++ VoidSymbol VoidSymbol +Y y VoidSymbol \
++ VoidSymbol VoidSymbol VoidSymbol Meta_Z Meta_y \
+ VoidSymbol \
+- +z Z VoidSymbol VoidSymbol Control_z \
+- Control_z VoidSymbol VoidSymbol Meta_z Meta_Z \
+- VoidSymbol VoidSymbol +Z z VoidSymbol \
+- VoidSymbol VoidSymbol VoidSymbol Meta_Z Meta_z \
++ +y Y VoidSymbol VoidSymbol Control_y \
++ Control_y VoidSymbol VoidSymbol Meta_y Meta_Y \
++ VoidSymbol VoidSymbol +Y y VoidSymbol \
++ VoidSymbol VoidSymbol VoidSymbol Meta_Y Meta_y \
+ VoidSymbol
+ keycode 22 = +u U VoidSymbol VoidSymbol Control_u \
+ Control_u VoidSymbol VoidSymbol Meta_u Meta_U \
+@@ -601,15 +604,15 @@
+ Meta_Control_backslash bar bar VoidSymbol \
+ VoidSymbol VoidSymbol VoidSymbol Meta_bar Meta_bar \
+ VoidSymbol
+-keycode 44 = +y Y degree degree Control_y \
+- Control_y VoidSymbol VoidSymbol Meta_y Meta_Y \
+- VoidSymbol VoidSymbol +Y y VoidSymbol \
+- VoidSymbol VoidSymbol VoidSymbol Meta_Y Meta_y \
++keycode 44 = +z Z degree degree Control_z \
++ Control_z VoidSymbol VoidSymbol Meta_z Meta_Z \
++ VoidSymbol VoidSymbol +Z z VoidSymbol \
++ VoidSymbol VoidSymbol VoidSymbol Meta_Z Meta_z \
+ VoidSymbol \
+- +y Y degree degree Control_y \
+- Control_y VoidSymbol VoidSymbol Meta_y Meta_Y \
+- VoidSymbol VoidSymbol +Y y VoidSymbol \
+- VoidSymbol VoidSymbol VoidSymbol Meta_Y Meta_y \
++ +z Z degree degree Control_z \
++ Control_z VoidSymbol VoidSymbol Meta_z Meta_Z \
++ VoidSymbol VoidSymbol +Z z VoidSymbol \
++ VoidSymbol VoidSymbol VoidSymbol Meta_Z Meta_z \
+ VoidSymbol
+ keycode 45 = +x X numbersign numbersign Control_x \
+ Control_x VoidSymbol VoidSymbol Meta_x Meta_X \
diff --git a/sys-apps/kbd/files/kbd-1.12-debian.patch b/sys-apps/kbd/files/kbd-1.12-debian.patch
new file mode 100644
index 0000000..de1e402
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-debian.patch
@@ -0,0 +1,86 @@
+diff -urNad /home/wart/Projects/debian/kbd/new/kbd-1.12/src/loadkeys.y kbd-1.12/src/loadkeys.y
+--- /home/wart/Projects/debian/kbd/new/kbd-1.12/src/loadkeys.y 2004-01-27 14:25:50.000000000 +0300
++++ kbd-1.12/src/loadkeys.y 2004-01-27 14:37:01.000000000 +0300
+@@ -566,7 +566,7 @@
+ }
+
+ char *dirpath[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 };
+-char *suffixes[] = { "", ".map", 0 };
++char *suffixes[] = { "", ".kmap", ".map", 0 };
+ extern FILE *findfile(char *fnam, char **dirpath, char **suffixes);
+
+ #undef yywrap
+diff -urNad /opt/tmp/kbd-1.12/src/loadunimap.c kbd-1.12/src/loadunimap.c
+--- /opt/tmp/kbd-1.12/src/loadunimap.c 2004-08-02 22:57:25.000000000 +0200
++++ kbd-1.12/src/loadunimap.c 2004-08-02 22:57:44.000000000 +0200
+@@ -28,8 +28,8 @@
+ extern char *progname;
+ extern int force;
+
+-static char *unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 };
+-static char *unisuffixes[] = { "", ".uni", 0 };
++static char *unidirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 };
++static char *unisuffixes[] = { "", ".sfm", ".uni", 0 };
+
+ #ifdef MAIN
+ #include "version.h"
+diff -urNad /opt/tmp/kbd-1.12/src/getunimap.c kbd-1.12/src/getunimap.c
+--- /opt/tmp/kbd-1.12/src/getunimap.c 2004-08-01 20:33:38.000000000 +0200
++++ kbd-1.12/src/getunimap.c 2004-08-02 22:45:30.000000000 +0200
+@@ -62,7 +62,7 @@
+ }
+ }
+
+- if (argc != 1)
++ if (optind < argc)
+ usage();
+
+ fd = getfd(console);
+diff -urNad /opt/tmp/kbd-1.12/src/loadunimap.c kbd-1.12/src/loadunimap.c
+--- /opt/tmp/kbd-1.12/src/loadunimap.c 2004-08-02 22:45:06.000000000 +0200
++++ kbd-1.12/src/loadunimap.c 2004-08-02 22:46:39.000000000 +0200
+@@ -73,18 +73,18 @@
+ }
+ }
+
+- if (argc > 2 || (argc == 1 && !outfnam))
++ if (argc > optind+1 || (argc == optind && !outfnam))
+ usage();
+
+ fd = getfd(console);
+
+ if (outfnam) {
+ saveunicodemap(fd, outfnam);
+- if (argc == 1)
++ if (argc == optind)
+ exit(0);
+ }
+
+- if (argc == 2)
++ if (argc == optind+1)
+ infnam = argv[optind];
+ loadunicodemap(fd, infnam);
+ exit(0);
+diff -urNad /opt/tmp/kbd-1.12/src/showconsolefont.c kbd-1.12/src/showconsolefont.c
+--- /opt/tmp/kbd-1.12/src/showconsolefont.c 2004-08-02 22:44:30.000000000 +0200
++++ kbd-1.12/src/showconsolefont.c 2004-08-02 22:47:07.000000000 +0200
+@@ -135,7 +135,7 @@
+ }
+ }
+
+- if (argc != 1)
++ if (optind < argc)
+ usage();
+
+ fd = getfd(console);
+--- kbd-1.12.orig/src/kbdrate.c
++++ kbd-1.12/src/kbdrate.c
+@@ -112,7 +112,7 @@
+ kbdrep_s.period = -1;
+ kbdrep_s.delay = -1;
+ if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
+- if (errno == EINVAL)
++ if (errno == EINVAL || errno == ENOTTY)
+ return 0;
+ perror( "ioctl(KDKBDREP)" );
+ exit( 1 );
diff --git a/sys-apps/kbd/files/kbd-1.12-find-map-fix.patch b/sys-apps/kbd/files/kbd-1.12-find-map-fix.patch
new file mode 100644
index 0000000..ca24703
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-find-map-fix.patch
@@ -0,0 +1,37 @@
+Oh, but I fixed it already. Patch below.
+
+Andries
+
+--- kbd-1.12.orig/src/findfile.c Fri Jan 16 20:45:31 2004
++++ kbd-1.12/src/findfile.c Wed Jan 28 23:29:35 2004
+@@ -70,6 +70,7 @@
+ FILE *fp = NULL;
+ DIR *d;
+ struct dirent *de;
++ struct stat statbuf;
+ char *ff, *fdir, *p, *q, **sp;
+ struct decompressor *dc;
+ int secondpass = 0;
+@@ -104,7 +105,6 @@
+ okdir = (ff && strcmp(de->d_name, fdir) == 0);
+
+ if ((secondpass && recdepth) || okdir) {
+- struct stat statbuf;
+ char *a;
+
+ a = xmalloc(strlen(dir) + strlen(de->d_name) + 2);
+@@ -137,6 +137,11 @@
+
+ sprintf(pathname, "%s/%s", dir, de->d_name);
+
++ /* Is this a regular file? */
++ if (stat(pathname, &statbuf) != 0 ||
++ !S_ISREG(statbuf.st_mode))
++ continue;
++
+ /* Does tail consist of a known suffix and possibly
+ a compression suffix? */
+ for(sp = suf; *sp; sp++) {
+
+
+[pasted and cut from another window, so with whitespace damage]
diff --git a/sys-apps/kbd/files/kbd-1.12-it-euro-map.patch b/sys-apps/kbd/files/kbd-1.12-it-euro-map.patch
new file mode 100644
index 0000000..bf42651
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-it-euro-map.patch
@@ -0,0 +1,18 @@
+Tupone Alfredo writes:
+
+To make euro key work at console (not X) I had to modify the
+it.map.gz to include euro.
+
+http://bugs.gentoo.org/show_bug.cgi?id=75970
+
+--- data/keymaps/i386/qwerty/it.map.orig 2004-12-29 15:31:59.269844456 -0500
++++ data/keymaps/i386/qwerty/it.map 2004-12-29 15:32:49.049276832 -0500
+@@ -86,7 +86,7 @@
+ alt keycode 15 = Meta_Tab
+ keycode 16 = q
+ keycode 17 = w
+-keycode 18 = e
++keycode 18 = e E euro
+ keycode 19 = r
+ keycode 20 = t
+ keycode 21 = y
diff --git a/sys-apps/kbd/files/kbd-1.12-jp-escape.patch b/sys-apps/kbd/files/kbd-1.12-jp-escape.patch
new file mode 100644
index 0000000..f413f00
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-jp-escape.patch
@@ -0,0 +1,16 @@
+Recognize Ctrl-[ as Escape.
+
+Patch by OKUMURA N. Shin-ya.
+
+http://bugs.gentoo.org/71870
+
+--- data/keymaps/i386/qwerty/jp106.map
++++ data/keymaps/i386/qwerty/jp106.map
+@@ -35,6 +35,7 @@
+ keycode 26 = at grave
+ control keycode 26 = nul
+ keycode 27 = bracketleft braceleft
++ control keycode 27 = Escape
+ keycode 28 = Return
+ alt keycode 28 = Meta_Control_m
+ keycode 29 = Control
diff --git a/sys-apps/kbd/files/kbd-1.12-kbd_repeat-v2.patch b/sys-apps/kbd/files/kbd-1.12-kbd_repeat-v2.patch
new file mode 100644
index 0000000..3e7f11d
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-kbd_repeat-v2.patch
@@ -0,0 +1,27 @@
+Linux is nice and changes around core structures :)
+
+--- kbd-1.12/src/kbdrate.c Fri Jan 16 20:45:31 2004
++++ kbd-1.12.kbdrate/src/kbdrate.c Sun Feb 8 14:52:04 2004
+@@ -164,10 +169,10 @@
+ exit( 1 );
+ }
+
+- kbdrate_s.period = (int) (rate + 0.5); /* round up */
++ kbdrate_s.rate = (int) (rate + 0.5); /* round up */
+ kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */
+- if (kbdrate_s.period > 50)
+- kbdrate_s.period = 50;
++ if (kbdrate_s.rate > 50)
++ kbdrate_s.rate = 50;
+
+ if (ioctl( fd, KIOCSRATE, &kbdrate_s )) {
+ perror( "ioctl(KIOCSRATE)" );
+@@ -177,7 +182,7 @@
+
+ if (!silent)
+ printf( "Typematic Rate set to %d cps (delay = %d ms)\n",
+- kbdrate_s.period, kbdrate_s.delay * 1000 / HZ );
++ kbdrate_s.rate, kbdrate_s.delay * 1000 / HZ );
+
+ return 1;
+ #else /* no KIOCSRATE */
diff --git a/sys-apps/kbd/files/kbd-1.12-kbio.patch b/sys-apps/kbd/files/kbd-1.12-kbio.patch
new file mode 100644
index 0000000..b2a80d9
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-kbio.patch
@@ -0,0 +1,25 @@
+diff -Nura kbd-1.12/src/kbdrate.c kbd-1.12.nokbio/src/kbdrate.c
+--- kbd-1.12/src/kbdrate.c 2004-01-16 16:45:31.000000000 -0300
++++ kbd-1.12.nokbio/src/kbdrate.c 2006-10-23 11:30:11.000000000 -0300
+@@ -77,7 +77,6 @@
+
+ #ifdef __sparc__
+ #include <asm/param.h>
+-#include <asm/kbio.h>
+ #endif
+
+ #ifndef KDKBDREP
+diff -Nura kbd-1.12/src/setleds.c kbd-1.12.nokbio/src/setleds.c
+--- kbd-1.12/src/setleds.c 2004-01-16 16:45:31.000000000 -0300
++++ kbd-1.12.nokbio/src/setleds.c 2006-10-23 11:30:20.000000000 -0300
+@@ -14,10 +14,6 @@
+ #include "nls.h"
+ #include "version.h"
+
+-#ifdef __sparc__
+-#include <asm/kbio.h>
+-#endif
+-
+ static void
+ usage(void)
+ {
diff --git a/sys-apps/kbd/files/kbd-1.12-setfont-man.patch b/sys-apps/kbd/files/kbd-1.12-setfont-man.patch
new file mode 100644
index 0000000..73cce39
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-setfont-man.patch
@@ -0,0 +1,14 @@
+diff -Nrbu kbd-1.12/man/man8/setfont.8.in kbd-1.12-OK/man/man8/setfont.8.in
+--- kbd-1.12/man/man8/setfont.8.in 2004-01-03 07:15:59.000000000 +0300
++++ kbd-1.12-OK/man/man8/setfont.8.in 2004-11-26 19:20:15.000000000 +0300
+@@ -50,6 +50,10 @@
+ Load a given font (here a 512-glyph font combining several
+ character sets) and indicate that one's local character set
+ is ISO 8859-2.
++.LP
++Note: if a font has more than 256 glyphs, only 8 out of 16 colors
++can be used simultaneously. It can make console perception worse
++(loss of intensity and even some colors).
+
+ .SH "FONT FORMATS"
+ The standard Linux font format is the PSF font.
diff --git a/sys-apps/kbd/files/kbd-1.12-unimap.patch b/sys-apps/kbd/files/kbd-1.12-unimap.patch
new file mode 100644
index 0000000..c7ea73c
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-unimap.patch
@@ -0,0 +1,16 @@
+That silly Debian patch changes the default dir to TRANSDIR.
+This patch corrects that oversight so both work if we ever
+use console-data, also by Debian.
+
+--- kbd-1.12/src/loadunimap.c.orig 2006-08-24 13:48:11.000000000 +0100
++++ kbd-1.12/src/loadunimap.c 2006-08-24 13:49:07.000000000 +0100
+@@ -28,7 +28,7 @@
+ extern char *progname;
+ extern int force;
+
+-static char *unidirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 };
+-static char *unisuffixes[] = { "", ".sfm", ".uni", 0 };
++static char *unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", DATADIR "/" TRANSDIR "/", 0 };
++static char *unisuffixes[] = { "", ".uni", ".sfm", 0 };
+
+ #ifdef MAIN
diff --git a/sys-apps/kbd/files/kbd-1.12-xcompile.patch b/sys-apps/kbd/files/kbd-1.12-xcompile.patch
new file mode 100644
index 0000000..985dbad
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.12-xcompile.patch
@@ -0,0 +1,21 @@
+this shit is wrong, but so was original ... this needs to be
+rewritten so that $HOST_ARCH/$TARGET_ARCH aren't even needed ...
+
+--- configure
++++ configure
+@@ -129,8 +129,13 @@
+ #
+ # 0. Figure out architecture (one of i386, alpha, sparc, arm, m68k, mips)
+ #
+-ARCH=`uname -m | sed s/i.86/i386/`
+-echo "ARCH=$ARCH" >> make_include
++HOST_ARCH=`uname -m`
++TARGET_ARCH=`$CC -dumpmachine | awk -F- '{print $1}'`
++# Don't allow ARCH="sparc" for sparc64 targets with 32-bit userland
++if (test "$HOST_ARCH" = "sparc64" && test "$TARGET_ARCH" = "sparc") ; then
++ TARGET_ARCH="sparc64"
++fi
++echo "ARCH=${TARGET_ARCH}" | sed -e 's:i.86:i386:' >> make_include
+
+ #
+ # 1. Do we have <locale.h>?
diff --git a/sys-apps/kbd/files/kbd-1.13-dont-use-error.patch b/sys-apps/kbd/files/kbd-1.13-dont-use-error.patch
new file mode 100644
index 0000000..d8e0bb1
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.13-dont-use-error.patch
@@ -0,0 +1,17 @@
+dont use GNU-specific function error()
+
+--- openvt/openvt.c
++++ openvt/openvt.c
+@@ -107,8 +107,10 @@
+
+ for (i=0; i<3; i++) {
+ struct stat st;
+- if (fstat(i, &st) == -1 && open("/dev/null", O_RDWR) == -1)
+- error(EXIT_FAILURE, errno, "open");
++ if (fstat(i, &st) == -1 && open("/dev/null", O_RDWR) == -1) {
++ perror("open(/dev/null/) failed");
++ return EXIT_FAILURE;
++ }
+ }
+
+ consfd = getfd(NULL);
diff --git a/sys-apps/kbd/files/kbd-1.14-ds-nohost.patch b/sys-apps/kbd/files/kbd-1.14-ds-nohost.patch
new file mode 100644
index 0000000..2ee1df0
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.14-ds-nohost.patch
@@ -0,0 +1,12 @@
+diff -dPNur kbd-1.14.1/src/spawn_login.c kbd-1.14.1-new/src/spawn_login.c
+--- kbd-1.14.1/src/spawn_login.c 2008-03-13 17:46:23.000000000 +0100
++++ kbd-1.14.1-new/src/spawn_login.c 2008-07-04 22:59:25.000000000 +0200
+@@ -15,7 +15,7 @@
+
+ static void
+ sighup(int n) {
+- if (system("openvt -s -l -- login -h spawn") == -1) {
++ if (system("openvt -s -l -- login") == -1) {
+ perror("system");
+ exit(1);
+ }
diff --git a/sys-apps/kbd/files/kbd-1.14-ds-unicode.patch b/sys-apps/kbd/files/kbd-1.14-ds-unicode.patch
new file mode 100644
index 0000000..9a21352
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.14-ds-unicode.patch
@@ -0,0 +1,59 @@
+diff -dPNur kbd-1.14.1/src/unicode_start kbd-1.14.1-unicode/src/unicode_start
+--- kbd-1.14.1/src/unicode_start 2008-03-24 17:03:56.000000000 +0100
++++ kbd-1.14.1-unicode/src/unicode_start 2008-07-04 23:20:41.000000000 +0200
+@@ -3,7 +3,7 @@
+ # 0. Check whether we're on a console
+ TTY="`/usr/bin/tty`"
+ case "$TTY" in
+- /dev/console|/dev/vc*|/dev/tty[0-9]*)
++ /dev/console|/dev/vc*|/dev/tty*|/dev/pts/*)
+ ;;
+ *)
+ echo "unicode_start skipped on $TTY" >&2
+diff -dPNur kbd-1.14.1/src/unicode_stop kbd-1.14.1-unicode/src/unicode_stop
+--- kbd-1.14.1/src/unicode_stop 2008-03-24 17:03:56.000000000 +0100
++++ kbd-1.14.1-unicode/src/unicode_stop 2008-07-04 23:22:18.000000000 +0200
+@@ -1,8 +1,13 @@
+ #!/bin/sh
+
+-TTY="`/usr/bin/tty`"
++if [ -z "$1" ]; then
++ TTY="`/usr/bin/tty`"
++else
++ TTY=$1
++fi
++
+ case "$TTY" in
+- /dev/console|/dev/vc*|/dev/tty[0-9]*)
++ /dev/console|/dev/vc*|/dev/tty*|/dev/pts/*)
+ ;;
+ *)
+ echo "unicode_stop skipped on $TTY"
+@@ -11,14 +16,23 @@
+ esac
+
+ # stop unicode
+-kbd_mode -a
+-if test -t ; then
++if [ -z "$1" ]; then
++ kbd_mode -a
++ if test -t ; then
+ printf '\033%%@'
++ fi
++ stty -iutf8
++else
++ kbd_mode -a -C $TTY
++ if test -t ; then
++ printf '\033%%@' > $TTY
++ fi
++ stty -F $TTY -iutf8
+ fi
+-stty -iutf8
+
+ uid="`id -u 2>/dev/null`" ||:
+ if [ "$uid" = '0' ]; then
+ [ ! -r "$HOME/.kbd/.keymap_sv" ] ||
+ loadkeys "$HOME/.kbd/.keymap_sv"
+ fi
++setfont
+\ No newline at end of file
diff --git a/sys-apps/kbd/files/kbd-1.14.1-missing-configure.patch b/sys-apps/kbd/files/kbd-1.14.1-missing-configure.patch
new file mode 100644
index 0000000..b9fe961
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.14.1-missing-configure.patch
@@ -0,0 +1,15 @@
+fix from Charles Clément for missing binaries
+
+http://bugs.gentoo.org/215610
+
+--- kbd-1.14.1/src/Makefile.in
++++ kbd-1.14.1/src/Makefile.in
+@@ -2,6 +2,8 @@ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = $(DESTDIR)@bindir@
+ datarootdir = @datarootdir@
++KEYCODES_PROGS = @KEYCODES_PROGS@
++RESIZECONS_PROGS = @RESIZECONS_PROGS@
+ OPTIONAL_PROGS = @OPTIONAL_PROGS@
+
+ # Something like /usr/lib/kbd or /usr/share/kbd
diff --git a/sys-apps/kbd/files/kbd-1.15.1-ds-nohost.patch b/sys-apps/kbd/files/kbd-1.15.1-ds-nohost.patch
new file mode 100644
index 0000000..2cb399e
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.15.1-ds-nohost.patch
@@ -0,0 +1,12 @@
+diff -dPNur kbd-1.15.1/src/spawn_login.c kbd-1.15.1-ds/src/spawn_login.c
+--- kbd-1.15.1/src/spawn_login.c 2009-10-09 15:36:06.000000000 +0200
++++ kbd-1.15.1-ds/src/spawn_login.c 2010-01-31 03:20:24.000000000 +0100
+@@ -17,7 +17,7 @@
+
+ static void
+ sighup(attr_unused int n) {
+- if (system("openvt -s -l -- login -h spawn") == -1) {
++ if (system("openvt -s -l -- login") == -1) {
+ perror("system");
+ exit(1);
+ }
diff --git a/sys-apps/kbd/files/kbd-ds-nohost.patch b/sys-apps/kbd/files/kbd-ds-nohost.patch
new file mode 100644
index 0000000..8f009f1
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-ds-nohost.patch
@@ -0,0 +1,12 @@
+diff -dPNur kbd-1.12/src/spawn_login.c kbd-1.12-new/src/spawn_login.c
+--- kbd-1.12/src/spawn_login.c 2004-01-16 20:45:31.000000000 +0100
++++ kbd-1.12-new/src/spawn_login.c 2008-07-04 22:19:22.000000000 +0200
+@@ -10,7 +10,7 @@
+
+ void
+ sighup(){
+- system("openvt -s -l -- login -h spawn");
++ system("openvt -s -l -- login");
+ signal(SIGHUP, sighup);
+ }
+
diff --git a/sys-apps/kbd/files/keymaps.tar.bz2 b/sys-apps/kbd/files/keymaps.tar.bz2
new file mode 100644
index 0000000..426191b
--- /dev/null
+++ b/sys-apps/kbd/files/keymaps.tar.bz2
Binary files differ
diff --git a/sys-apps/kbd/kbd-1.12-r10.ebuild b/sys-apps/kbd/kbd-1.12-r10.ebuild
new file mode 100644
index 0000000..69a55d2
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.12-r10.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.12-r8.ebuild,v 1.11 2006/12/30 07:02:37 vapier Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://freshmeat.net/projects/kbd/"
+SRC_URI="ftp://ftp.cwi.nl/pub/aeb/kbd/${P}.tar.gz
+ ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/${P}.tar.gz
+ nls? ( http://www.users.one.se/liket/svorak/svorakln.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ local a
+ # Workaround problem on JFS filesystems, see bug 42859
+ for a in ${A} ; do
+ echo ">>> Unpacking ${a} to ${WORKDIR}"
+ gzip -dc "${DISTDIR}"/${a} | tar xf -
+ assert
+ done
+
+ cd "${S}"
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:g" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ -e "s:install -s:install:" \
+ src/Makefile.in \
+ openvt/Makefile
+
+ if tc-is-cross-compiler; then
+ tc-export CC
+ # Cross-compiling: don't run test programs
+ sed -i -e "s:&& ./conftest::" configure || \
+ die "Could not do sed configure for cross-compile"
+ fi
+
+ # Other patches from RH
+ epatch "${FILESDIR}"/${PN}-1.08-terminal.patch
+
+ epatch "${FILESDIR}"/${P}-configure-LANG.patch #128253
+
+ # Fixes a problem where loadkeys matches dvorak the dir, and not the
+ # .map inside
+ epatch "${FILESDIR}"/${P}-find-map-fix.patch
+
+ # Sparc have not yet fixed struct kbd_rate to use 'period' and not 'rate'
+ epatch "${FILESDIR}"/${P}-kbd_repeat-v2.patch
+
+ # misc fixes from debian
+ epatch "${FILESDIR}"/${P}-debian.patch
+
+ # fix unimap path issue caused by Debian patch
+ epatch "${FILESDIR}/${P}"-unimap.patch
+
+ # Provide a QWERTZ and QWERTY cz map #19010
+ cp data/keymaps/i386/{qwerty,qwertz}/cz.map || die "cz qwerty"
+ epatch "${FILESDIR}"/${P}-cz-qwerty-map.patch
+
+ # Fix jp map to recognize Ctrl-[ as Escape #71870
+ epatch "${FILESDIR}"/${P}-jp-escape.patch
+
+ # Patches from Fedora
+ epatch "${FILESDIR}"/${P}-Meta_utf8.patch
+ ## Fix runtime with gcc4 (setfont: Input file: trailing garbage)
+ epatch "${FILESDIR}"/${P}-alias.patch
+ epatch "${FILESDIR}"/${P}-setfont-man.patch
+
+ # cross-compile fails for powerpc targets bug #133856
+ epatch "${FILESDIR}"/${P}-xcompile.patch
+
+ # sparc newer headers lack asm/kbio.h
+ epatch "${FILESDIR}"/${P}-kbio.patch
+}
+
+src_compile() {
+ local myconf=
+ # Non-standard configure script; --disable-nls to
+ # disable NLS, nothing to enable it.
+ use nls || myconf="--disable-nls"
+ ./configure \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --datadir=/usr/share \
+ ${myconf} || die
+
+ emake CC="$(tc-getCC)" || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ mv "${D}"/usr/bin/setfont "${D}"/bin/
+ dosym /bin/setfont /usr/bin/setfont
+
+#SDS
+ dobin src/spawn_console
+ dobin src/spawn_login
+
+ tar xjf ${FILESDIR}/keymaps.tar.bz2 -C ${D}/usr/share/keymaps/i386/qwerty || die
+ rm -f ${D}/usr/share/consolefonts/default8x16.psf*.gz
+ ln -s ruscii_8x16.psfu.gz ${D}/usr/share/consolefonts/default8x16.psfu.gz || die
+ tar xjf ${FILESDIR}/console-tools-ds-bin.tar.bz2 -C ${D}/usr/bin || die
+ mkdir -p ${D}/etc/profile.d/
+ install -c -m 755 ${FILESDIR}/alias-console-tools.sh ${D}/etc/profile.d/ || die
+ install -c -m 755 ${FILESDIR}/consolechars ${D}/usr/bin || die
+
+ mkdir -p ${D}/etc/init.d/
+ install -c -m 755 ${FILESDIR}/dynamicvc ${D}/etc/init.d || die
+
+ mkdir -p ${D}/etc/conf.d/
+ install -c -m 644 ${FILESDIR}/controlkeys ${D}/etc/conf.d || die
+#EDS
+
+ dodoc CHANGES CREDITS README
+ dodir /usr/share/doc/${PF}/html
+ cp -dR doc/* "${D}"/usr/share/doc/${PF}/html/
+
+ if use nls ; then
+ cd ${WORKDIR}/mnt/e/SvorakLN
+ insinto /usr/share/keymaps/i386/dvorak/
+ doins .svorakmap svorak.map.gz
+ dodoc Svorak.txt
+ fi
+}
diff --git a/sys-apps/kbd/kbd-1.12-r11.ebuild b/sys-apps/kbd/kbd-1.12-r11.ebuild
new file mode 100644
index 0000000..d4a2593
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.12-r11.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.12-r8.ebuild,v 1.11 2006/12/30 07:02:37 vapier Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://freshmeat.net/projects/kbd/"
+SRC_URI="ftp://ftp.cwi.nl/pub/aeb/kbd/${P}.tar.gz
+ ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/${P}.tar.gz
+ nls? ( http://www.users.one.se/liket/svorak/svorakln.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ local a
+ # Workaround problem on JFS filesystems, see bug 42859
+ for a in ${A} ; do
+ echo ">>> Unpacking ${a} to ${WORKDIR}"
+ gzip -dc "${DISTDIR}"/${a} | tar xf -
+ assert
+ done
+
+ cd "${S}"
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:g" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ -e "s:install -s:install:" \
+ src/Makefile.in \
+ openvt/Makefile
+
+ if tc-is-cross-compiler; then
+ tc-export CC
+ # Cross-compiling: don't run test programs
+ sed -i -e "s:&& ./conftest::" configure || \
+ die "Could not do sed configure for cross-compile"
+ fi
+
+ # Other patches from RH
+ epatch "${FILESDIR}"/${PN}-1.08-terminal.patch
+
+ epatch "${FILESDIR}"/${P}-configure-LANG.patch #128253
+
+ # Fixes a problem where loadkeys matches dvorak the dir, and not the
+ # .map inside
+ epatch "${FILESDIR}"/${P}-find-map-fix.patch
+
+ # Sparc have not yet fixed struct kbd_rate to use 'period' and not 'rate'
+ epatch "${FILESDIR}"/${P}-kbd_repeat-v2.patch
+
+ # misc fixes from debian
+ epatch "${FILESDIR}"/${P}-debian.patch
+
+ # fix unimap path issue caused by Debian patch
+ epatch "${FILESDIR}/${P}"-unimap.patch
+
+ # Provide a QWERTZ and QWERTY cz map #19010
+ cp data/keymaps/i386/{qwerty,qwertz}/cz.map || die "cz qwerty"
+ epatch "${FILESDIR}"/${P}-cz-qwerty-map.patch
+
+ # Fix jp map to recognize Ctrl-[ as Escape #71870
+ epatch "${FILESDIR}"/${P}-jp-escape.patch
+
+ # Patches from Fedora
+ epatch "${FILESDIR}"/${P}-Meta_utf8.patch
+ ## Fix runtime with gcc4 (setfont: Input file: trailing garbage)
+ epatch "${FILESDIR}"/${P}-alias.patch
+ epatch "${FILESDIR}"/${P}-setfont-man.patch
+
+ # cross-compile fails for powerpc targets bug #133856
+ epatch "${FILESDIR}"/${P}-xcompile.patch
+
+ # sparc newer headers lack asm/kbio.h
+ epatch "${FILESDIR}"/${P}-kbio.patch
+
+#SDS
+ epatch "${FILESDIR}"/${PN}-ds-nohost.patch || die
+#EDS
+}
+
+src_compile() {
+ local myconf=
+ # Non-standard configure script; --disable-nls to
+ # disable NLS, nothing to enable it.
+ use nls || myconf="--disable-nls"
+ ./configure \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --datadir=/usr/share \
+ ${myconf} || die
+
+ emake CC="$(tc-getCC)" || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ mv "${D}"/usr/bin/setfont "${D}"/bin/
+ dosym /bin/setfont /usr/bin/setfont
+
+#SDS
+ dobin src/spawn_console
+ dobin src/spawn_login
+
+ tar xjf ${FILESDIR}/keymaps.tar.bz2 -C ${D}/usr/share/keymaps/i386/qwerty || die
+ rm -f ${D}/usr/share/consolefonts/default8x16.psf*.gz
+ ln -s ruscii_8x16.psfu.gz ${D}/usr/share/consolefonts/default8x16.psfu.gz || die
+ tar xjf ${FILESDIR}/console-tools-ds-bin.tar.bz2 -C ${D}/usr/bin || die
+ mkdir -p ${D}/etc/profile.d/
+ install -c -m 755 ${FILESDIR}/alias-console-tools.sh ${D}/etc/profile.d/ || die
+ install -c -m 755 ${FILESDIR}/consolechars ${D}/usr/bin || die
+
+ mkdir -p ${D}/etc/init.d/
+ install -c -m 755 ${FILESDIR}/dynamicvc ${D}/etc/init.d || die
+
+ mkdir -p ${D}/etc/conf.d/
+ install -c -m 644 ${FILESDIR}/controlkeys ${D}/etc/conf.d || die
+#EDS
+
+ dodoc CHANGES CREDITS README
+ dodir /usr/share/doc/${PF}/html
+ cp -dR doc/* "${D}"/usr/share/doc/${PF}/html/
+
+ if use nls ; then
+ cd ${WORKDIR}/mnt/e/SvorakLN
+ insinto /usr/share/keymaps/i386/dvorak/
+ doins .svorakmap svorak.map.gz
+ dodoc Svorak.txt
+ fi
+}
diff --git a/sys-apps/kbd/kbd-1.12-r9.ebuild b/sys-apps/kbd/kbd-1.12-r9.ebuild
new file mode 100644
index 0000000..15a8164
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.12-r9.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.12-r8.ebuild,v 1.11 2006/12/30 07:02:37 vapier Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://freshmeat.net/projects/kbd/"
+SRC_URI="ftp://ftp.cwi.nl/pub/aeb/kbd/${P}.tar.gz
+ ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/${P}.tar.gz
+ nls? ( http://www.users.one.se/liket/svorak/svorakln.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ local a
+ # Workaround problem on JFS filesystems, see bug 42859
+ for a in ${A} ; do
+ echo ">>> Unpacking ${a} to ${WORKDIR}"
+ gzip -dc "${DISTDIR}"/${a} | tar xf -
+ assert
+ done
+
+ cd "${S}"
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:g" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ -e "s:install -s:install:" \
+ src/Makefile.in \
+ openvt/Makefile
+
+ if tc-is-cross-compiler; then
+ tc-export CC
+ # Cross-compiling: don't run test programs
+ sed -i -e "s:&& ./conftest::" configure || \
+ die "Could not do sed configure for cross-compile"
+ fi
+
+ # Other patches from RH
+ epatch "${FILESDIR}"/${PN}-1.08-terminal.patch
+
+ epatch "${FILESDIR}"/${P}-configure-LANG.patch #128253
+
+ # Fixes a problem where loadkeys matches dvorak the dir, and not the
+ # .map inside
+ epatch "${FILESDIR}"/${P}-find-map-fix.patch
+
+ # Sparc have not yet fixed struct kbd_rate to use 'period' and not 'rate'
+ epatch "${FILESDIR}"/${P}-kbd_repeat-v2.patch
+
+ # misc fixes from debian
+ epatch "${FILESDIR}"/${P}-debian.patch
+
+ # fix unimap path issue caused by Debian patch
+ epatch "${FILESDIR}/${P}"-unimap.patch
+
+ # Provide a QWERTZ and QWERTY cz map #19010
+ cp data/keymaps/i386/{qwerty,qwertz}/cz.map || die "cz qwerty"
+ epatch "${FILESDIR}"/${P}-cz-qwerty-map.patch
+
+ # Fix jp map to recognize Ctrl-[ as Escape #71870
+ epatch "${FILESDIR}"/${P}-jp-escape.patch
+
+ # Patches from Fedora
+ epatch "${FILESDIR}"/${P}-Meta_utf8.patch
+ ## Fix runtime with gcc4 (setfont: Input file: trailing garbage)
+ epatch "${FILESDIR}"/${P}-alias.patch
+ epatch "${FILESDIR}"/${P}-setfont-man.patch
+
+ # cross-compile fails for powerpc targets bug #133856
+ epatch "${FILESDIR}"/${P}-xcompile.patch
+
+ # sparc newer headers lack asm/kbio.h
+ epatch "${FILESDIR}"/${P}-kbio.patch
+}
+
+src_compile() {
+ local myconf=
+ # Non-standard configure script; --disable-nls to
+ # disable NLS, nothing to enable it.
+ use nls || myconf="--disable-nls"
+ ./configure \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --datadir=/usr/share \
+ ${myconf} || die
+
+ emake CC="$(tc-getCC)" || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ mv "${D}"/usr/bin/setfont "${D}"/bin/
+ dosym /bin/setfont /usr/bin/setfont
+
+#SDS
+ dobin src/spawn_console
+ dobin src/spawn_login
+
+ tar xjf ${FILESDIR}/keymaps.tar.bz2 -C ${D}/usr/share/keymaps/i386/qwerty || die
+ rm -f ${D}/usr/share/consolefonts/default8x16.psf*.gz
+ ln -s Cyr_a8x16.psfu.gz ${D}/usr/share/consolefonts/default8x16.psfu.gz || die
+ tar xjf ${FILESDIR}/console-tools-ds-bin.tar.bz2 -C ${D}/usr/bin || die
+ mkdir -p ${D}/etc/profile.d/
+ install -c -m 755 ${FILESDIR}/alias-console-tools.sh ${D}/etc/profile.d/ || die
+ install -c -m 755 ${FILESDIR}/consolechars ${D}/usr/bin || die
+
+ mkdir -p ${D}/etc/init.d/
+ install -c -m 755 ${FILESDIR}/dynamicvc ${D}/etc/init.d || die
+
+ mkdir -p ${D}/etc/conf.d/
+ install -c -m 644 ${FILESDIR}/controlkeys ${D}/etc/conf.d || die
+#EDS
+
+ dodoc CHANGES CREDITS README
+ dodir /usr/share/doc/${PF}/html
+ cp -dR doc/* "${D}"/usr/share/doc/${PF}/html/
+
+ if use nls ; then
+ cd ${WORKDIR}/mnt/e/SvorakLN
+ insinto /usr/share/keymaps/i386/dvorak/
+ doins .svorakmap svorak.map.gz
+ dodoc Svorak.txt
+ fi
+}
diff --git a/sys-apps/kbd/kbd-1.14.1-r2.ebuild b/sys-apps/kbd/kbd-1.14.1-r2.ebuild
new file mode 100644
index 0000000..621caea
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.14.1-r2.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.14.1-r1.ebuild,v 1.4 2008/05/25 06:32:24 corsair Exp $
+
+inherit eutils
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://freshmeat.net/projects/kbd/"
+SRC_URI="ftp://ftp.altlinux.org/pub/people/legion/kbd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i 's:install -s:install:' src/Makefile.in
+
+ # fix unimap path issue caused by Debian patch
+ epatch "${FILESDIR}"/${PN}-1.12-unimap.patch
+
+ # Provide a QWERTZ and QWERTY cz map #19010
+ cp data/keymaps/i386/{qwertz,qwerty}/cz.map || die "cz qwerty"
+ epatch "${FILESDIR}"/${PN}-1.12-cz-qwerty-map.patch
+
+ # Fix jp map to recognize Ctrl-[ as Escape #71870
+ epatch "${FILESDIR}"/${PN}-1.12-jp-escape.patch
+
+ epatch "${FILESDIR}"/${P}-missing-configure.patch #215610
+ epatch "${FILESDIR}"/${PN}-1.12-kbio.patch
+
+#SDS
+ epatch "${FILESDIR}"/${PN}-1.14-ds-nohost.patch || die
+ epatch "${FILESDIR}"/${PN}-1.14-ds-unicode.patch || die
+#EDS
+}
+
+src_compile() {
+#SDS
+ econf $(use_enable nls) --enable-optional-progs || die
+#EDS
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+#SDS
+ dobin src/spawn_console || die
+ dobin src/spawn_login || die
+
+ tar xjf ${FILESDIR}/keymaps.tar.bz2 -C ${D}/usr/share/keymaps/i386/qwerty || die
+ rm -f ${D}/usr/share/consolefonts/default8x16.psf*.gz
+ ln -s ruscii_8x16.psfu.gz ${D}/usr/share/consolefonts/default8x16.psfu.gz || die
+ tar xjf ${FILESDIR}/console-tools-ds-bin.tar.bz2 -C ${D}/usr/bin || die
+ mkdir -p ${D}/etc/profile.d/
+ install -c -m 755 ${FILESDIR}/alias-console-tools.sh ${D}/etc/profile.d/ || die
+ install -c -m 755 ${FILESDIR}/consolechars ${D}/usr/bin || die
+
+ mkdir -p ${D}/etc/init.d/
+ install -c -m 755 ${FILESDIR}/dynamicvc ${D}/etc/init.d || die
+
+ mkdir -p ${D}/etc/conf.d/
+ install -c -m 644 ${FILESDIR}/controlkeys ${D}/etc/conf.d || die
+#EDS
+
+ dodoc CHANGES CREDITS README
+ dohtml doc/*.html
+}
diff --git a/sys-apps/kbd/kbd-1.15.1-r1.ebuild b/sys-apps/kbd/kbd-1.15.1-r1.ebuild
new file mode 100644
index 0000000..9d61056
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.15.1-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.15.1.ebuild,v 1.2 2009/10/18 18:03:09 vapier Exp $
+
+inherit autotools
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://freshmeat.net/projects/kbd/"
+SRC_URI="ftp://ftp.altlinux.org/pub/people/legion/kbd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+#SDS
+ epatch "${FILESDIR}"/${PN}-1.15.1-ds-nohost.patch || die
+ epatch "${FILESDIR}"/${PN}-1.14-ds-unicode.patch || die
+#EDS
+
+ eautoreconf # stupid tarball lacks generated autotools
+ sed -i 's:-Werror::' src/Makefile.in
+}
+
+src_compile() {
+#SDS
+ econf $(use_enable nls) --enable-optional-progs || die
+# econf $(use_enable nls) || die
+#EDS
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+#SDS
+ dobin src/spawn_console || die
+ dobin src/spawn_login || die
+
+ tar xjf ${FILESDIR}/keymaps.tar.bz2 -C ${D}/usr/share/keymaps/i386/qwerty || die
+ rm -f ${D}/usr/share/consolefonts/default8x16.psf*.gz
+ ln -s ruscii_8x16.psfu.gz ${D}/usr/share/consolefonts/default8x16.psfu.gz || die
+ tar xjf ${FILESDIR}/console-tools-ds-bin.tar.bz2 -C ${D}/usr/bin || die
+ mkdir -p ${D}/etc/profile.d/
+ install -c -m 755 ${FILESDIR}/alias-console-tools2.sh ${D}/etc/profile.d/ || die
+# install -c -m 755 ${FILESDIR}/consolechars ${D}/usr/bin || die
+
+ mkdir -p ${D}/etc/init.d/
+ install -c -m 755 ${FILESDIR}/dynamicvc ${D}/etc/init.d || die
+
+ mkdir -p ${D}/etc/conf.d/
+ install -c -m 644 ${FILESDIR}/controlkeys ${D}/etc/conf.d || die
+#EDS
+
+ dodoc AUTHORS ChangeLog INSTALL NEWS README
+ dohtml doc/*.html
+}
diff --git a/sys-apps/mkinitrd/Manifest b/sys-apps/mkinitrd/Manifest
new file mode 100644
index 0000000..a9398c5
--- /dev/null
+++ b/sys-apps/mkinitrd/Manifest
@@ -0,0 +1,16 @@
+AUX mdadm-ds-static.patch 666 SHA256 6db05f1624496648747b9af99b9d408a123518e9b3f8b8fd67533e661fe1a516 SHA512 ac2c5cac8bb65a634c6b55d5338d1353e5979b18bd27d2147d13df565d3cf021b4cf4755bf9d548ead0a8e779fd5e06792bfa7247e62fdd06b270eb2db542c49 WHIRLPOOL 24592e6af5f7ef304a124122ed9b7eaf68eb9df60bd88f94adbc93e9f9f49178f5d433f5e4f6640a9a529491fc167b931095738590ddba6846af1b4ad4ac2d02
+AUX mkinitrd-4.2.17-mdk.patch.bz2 21102 SHA256 984c6753e555225c6a7cc96f03d5d2d7671cea59d2a9e7cb35c60d3d70b979fa SHA512 659bbe3d2e15f3f59e3bb21d73b420c35c29c3e63e56c97faa15deeb6c3615005c3cc0e7577f7b8b44924499f8e8cb45492dd212422516ba6e52457feea13b73 WHIRLPOOL fa6e81996e450535d15d22e54433f3322d2ccddd17a7e6be5b2ee794bf6ed98f8b590ecfa872bfce1d9cf4e14341f3295a1827b6834c52a2c9b16ded05501db5
+AUX mkinitrd-6.0.93-ds.diff 4274 SHA256 1acd2d1b01074190915cff3e25a6a93cd787e0dc7e606949f13dcaf5958f77ca SHA512 dd9880bf594bfd131f0df94ebb904605cfdc4632ee19e552b051956bd4eefe3f7f2189234e03e49db3fcfe041ed6e8859173e71801cf411732a334b4394e8491 WHIRLPOOL f6de3273e95f5e45ce29c9e70f853634d41c213c718be35f323112d60ac21f6b94139187ce81794843910779101d00bbb13edb9dfd5e3a23d0302671c3f30e49
+AUX mkinitrd-ds-grubby_compile.patch 915 SHA256 5397da77b350a3976013cac5df4c8b82eafb684830266f3840532c73f9b08b22 SHA512 1349b7774b92ef954ea3a3421f67261ccc4f660cfb1a9d7d51e6026feb9f551f8e4f315af59c55ea88c2effda0baa4cd21976e89c51fb9ef8e42f29324d62576 WHIRLPOOL 73baafe4e863e0bae6d250a990e43a4ba7ad53d1760809544775a0a2f9895b3b4e4301242dfded244486e14e3912923a0a35cf17a90ea1ed69af802a4b2fc604
+AUX mkinitrd-ds-raid.patch 627 SHA256 d6bff22ef23a6f489d89cce2a8bb120698256890953077f5fbd87039c03c3bd9 SHA512 742fac5f4e6ec84a1b65a429235c73997cf4eb9438ab7cce31027616b8a488a702e50004ad752de9404a6ff57528c72eaa4ad21e07bfce1deae812558db96d74 WHIRLPOOL 16784b8b4cf92e3cbe536288e289dde49503827c7ba3d35b52cb0bd6ad9619fd50c025c6f78b3308d37a57a0a1c87fd52cbd395001a54a0d2201680d747efb87
+AUX mkinitrd-ds-vitalsunion.diff 1724 SHA256 2767e5d0b800a789e061d1742a0a46bf8841339db6656647089845e72c79d1fe SHA512 f212f5dfe69eaefaa0c1d2d9294203d64572a6bb8dce7f88ad2380f10b4141985a2acdee62301a1867cf24ac6eedf479adaf79790f0eb41e5335ff6af9f16e5c WHIRLPOOL 887bd54939b5e428dbb4a6759e7580908c6782cb84b8fb06e9fa9406b97a510179f943a9b6bac214a07be7b5986068f6e0119a297b0e2b8e0300f7c2510f4d6b
+AUX mkinitrd-ds.patch 1440 SHA256 d322997e986cfd4d7510611dfada8a14f934da277aeac9a0af5334d9490557ac SHA512 9945e9e129234becbc93431e6777e3af14cef7afd1cd88d1bbe00040070f91bace43770baf9656c1bc92d0fd8c7143d92d76d4c33567baf8f9844205313ab504 WHIRLPOOL 14ede0b767dfec82653e05a0f9f7a0a2c551345cbab8a9ef2c68045ba4f797d513be799b7d744f303cfe929e4cc7ae34f532e1d64d8a6e0af5ab85bb9e78ff1a
+AUX mkinitrd-lvm_statics.diff 591 SHA256 27112716e4d4be34681341c5c1ef72466f236de8b1042685fad6dd33ed365c24 SHA512 197e54d049a7ffa7202bb88838fd70b7cf68653fcfe0d9da0e723783dd7798f3637ed9b3ab40aaf09fcd9ea6d6d6a82b6b9c4e46776f1c28564f5300da9fcb17 WHIRLPOOL c4f261d40fd544bd6a0341aa4130e80c155a83b907ee2c05964e8112f29c24e7cba69e53f089505aa0562bb0259d7d5fcb2d9c2e644c21ecbbfc4da1dfeade47
+AUX mkinitrd-mdk-patches-6.0.93.tar.bz2 21199 SHA256 77ba2883898df0bd941f570f3159d7c1bc7196deeadd83ebaef4fcb50654bfaf SHA512 9c2035ebccd2502414b71809e1c63951cbcf25aaf8341e84e87798dbf50231b60c742d9c1b569c3e854e6ba09946bb56824b367a09be7fc4b19281e2a084c406 WHIRLPOOL 9c4c5f414dc101a2c6411ed99e472913e6a491b0b1b9bf6431bc47588d5b3723b717bbfb57ae1dd02c3280dc32a0317d06bdb42fb5d4b5774cf3d83520143200
+AUX mkinitrd-swsusp2.patch 572 SHA256 ff4ba1a38616f5a30895b1eb8c7f80a0fcee021a17a07fdf1048bd1f5dc503ea SHA512 6a28d0d6558e6f5dc0faad850b8a090084fbfad00e68b7224fa4ad11aeaf9f374a35e8b702eeded1c78595f07c8ac730258fb1f765c36d1bdd256afb513018bc WHIRLPOOL e924736bfe8d510508b0ae3b68a9a728797a3064a660e833eef8697b56511a8ef0bf8408a6d28a08e5e5baa16b7bb46f193d1a71a1d8ac5ff74b174a9f188d67
+AUX nash-ds-remount.patch 1970 SHA256 9352e187e1cc4e2244e7e81389794f2d9c7c6b35f34d9c9b5001b8ca69b96c91 SHA512 bc06519abe9563895c5a54ad51ab9dfc117ef1c5b429649bdc94ee936c7cd021cfd1708dd2193e8edec972868e22bd917fe37d267ab821285f316efdc372ff06 WHIRLPOOL aac4dec3a51dd3f8135f8c38332d0c7cd6a1d078739962b9718077066780a46e4defb582765b85be1524ac656c6256a19da82b56ad7bff69e1fbc1fb51eff2d2
+DIST mdadm-2.1.tar.bz2 103201 SHA256 4a963abf294ca18eee47940c14a01101694f1653112f19c90dc332e9fe24ee2e SHA512 adb1d460ebfe22caaa3aefa7686df4b468c65bd08323edd0bf1728736859df2d369b0f4fd1e13ff2905c9d6d7181a38e99b61fec442e930efcc2d0b7e776eb4a WHIRLPOOL 7400d7b5d304a849ceba762b91bd5f6a628cb5ac111dd7ed7e018ab71363dc8c8b5e330a98ef3f7d450896c8991b39e3c0c67aa30b9e782ead69355204973d76
+DIST mkinitrd-4.2.17.tar.bz2 65568 SHA256 998dd8f89d6ff6d8ea31b922045574d2d5b344590ef39e7ed4fe277cd96811f5 SHA512 8bf3b65543cf167d8c5e74b058003322b3d0e23620a98714a7b819ebbab56e03d9213611fc1bf56a5063d10e3ef341f79e89e0af987db2ea80e71e5355febf49 WHIRLPOOL 460b290ef10ccaedfed5af283c1eab1f804e533e4914ba06c914c768fb94daf3dac734edb769b6204546360499140872c2812c97d2d793469a676afa3b7fd59e
+DIST mkinitrd-6.0.93.tar.bz2 124410 SHA256 7aeaf2e9ab1f78070173e2666dd2b6501cf7d39d9617611b3dc6b38fe083b68d SHA512 080019cffd561e00ca055528265fd30dd475e6fc82e0676ca153ab388aa2f731cd8929822d06fc6fec2f770eb1577e592e99b247e64985c4df6f3b8d4167b9e7 WHIRLPOOL 9fe945433124155b4d0b98ab275030dbbfa831c7a50f26e824821fb2fa5d62cd44ac566a3708ea0ae3e66b7a7ac6d9d243d178f18594eb27b891f12c2a172efd
+EBUILD mkinitrd-4.2.17-r3.ebuild 1871 SHA256 19dd0003e48065cfab52fb61662e6b6d765a4fb9a5b95ed30b489b87a4d88391 SHA512 d53c4d200e56b902e158126be0bfb55f8365181aad5abb73f9bf9b149e2a18c4b045b65ed60bb513b7f8e7d510fe998c43a620035308832ea24ae0ee581986ca WHIRLPOOL fc6973c95f7c78903f43d07c2f954c81d18c9cb6160fc58319f2ce93a649becd6a1bb7f0b3f3805202498c62402c12a51c0cde04e6506c1301f0ccb11da9cd35
+EBUILD mkinitrd-6.0.93-r1.ebuild 1152 SHA256 099d59d9505e63ed9effe1fc2102352fc3b50e22d41138e5d242af236e2cdf67 SHA512 2f1c62e3e87c53d5029d64d98fcf8b944a294ca5d8e7b153e27cc9322fffdf1180abebea26b3635f57bbad8162e5fb7e4fa200c1bc2fda263e773c04dbd996d0 WHIRLPOOL 0da5bda7c1a1afd68201f81c45be363af0c4825d8f8bc2a1bce2f87f0619dc743b05c831305965f8829c1c62000ed7c2998a3150e11b0642c89c42dbe43f19ce
diff --git a/sys-apps/mkinitrd/files/mdadm-ds-static.patch b/sys-apps/mkinitrd/files/mdadm-ds-static.patch
new file mode 100644
index 0000000..bd6afb4
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mdadm-ds-static.patch
@@ -0,0 +1,22 @@
+diff -dPNur mdadm-2.1/Makefile mdadm-2.1-new/Makefile
+--- mdadm-2.1/Makefile 2005-09-05 00:54:55.000000000 +0000
++++ mdadm-2.1-new/Makefile 2006-01-05 16:45:15.000000000 +0000
+@@ -39,15 +39,15 @@
+
+ CC = $(CROSS_COMPILE)gcc
+ CXFLAGS = -ggdb
+-CWFLAGS = -Wall -Werror -Wstrict-prototypes
++CWFLAGS = -Wall -Wstrict-prototypes
+ SYSCONFDIR = /etc
+ CONFFILE = $(SYSCONFDIR)/mdadm.conf
+ MAILCMD =/usr/sbin/sendmail -t
+ CFLAGS = $(CWFLAGS) -DCONFFILE=\"$(CONFFILE)\" $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\"
+
+ # If you want a static binary, you might uncomment these
+-# LDFLAGS = -static
+-# STRIP = -s
++LDFLAGS = -static
++STRIP = -s
+
+ INSTALL = /usr/bin/install
+ DESTDIR =
diff --git a/sys-apps/mkinitrd/files/mkinitrd-4.2.17-mdk.patch.bz2 b/sys-apps/mkinitrd/files/mkinitrd-4.2.17-mdk.patch.bz2
new file mode 100644
index 0000000..2adced7
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-4.2.17-mdk.patch.bz2
Binary files differ
diff --git a/sys-apps/mkinitrd/files/mkinitrd-6.0.93-ds.diff b/sys-apps/mkinitrd/files/mkinitrd-6.0.93-ds.diff
new file mode 100644
index 0000000..a9fcd0a
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-6.0.93-ds.diff
@@ -0,0 +1,164 @@
+diff -dPNur mkinitrd-6.0.93-patched/functions mkinitrd-6.0.93-patched-ds/functions
+--- mkinitrd-6.0.93-patched/functions 2012-11-19 23:57:17.000000000 +0100
++++ mkinitrd-6.0.93-patched-ds/functions 2012-11-19 23:59:42.000000000 +0100
+@@ -347,6 +347,15 @@
+ resolved="$items"
+ }
+
++get_numeric_dev() {
++(
++ fmt="%d:%d"
++ if [ "$1" = "hex" ]; then
++ fmt="%x:%x"
++ fi
++ ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
++) 2>/dev/null
++}
+
+
+ # vim:ts=8:sw=4:sts=4:et
+diff -dPNur mkinitrd-6.0.93-patched/mkinitrd mkinitrd-6.0.93-patched-ds/mkinitrd
+--- mkinitrd-6.0.93-patched/mkinitrd 2012-11-19 23:57:17.000000000 +0100
++++ mkinitrd-6.0.93-patched-ds/mkinitrd 2012-11-20 00:05:55.000000000 +0100
+@@ -48,8 +48,6 @@
+ PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
+ export PATH
+
+-. /etc/rc.d/init.d/functions
+-
+ # Set the umask. For iscsi, the initrd can contain plaintext
+ # password (chap secret), so only allow read by owner.
+ umask 077
+@@ -111,6 +109,7 @@
+ fi
+
+ $cmd "usage: `basename $0` [--version] [--help] [-v] [-f] [--preload <module>]"
++ $cmd " [--omit-ata-modules] [--busybox]"
+ $cmd " [--force-scsi-probe | --omit-scsi-modules]"
+ $cmd " [--omit-ide-modules]"
+ $cmd " [--image-version] [--force-raid-probe | --omit-raid-modules]"
+@@ -315,6 +314,7 @@
+ if echo $PWD | grep -q /virtio-pci/ ; then
+ findmodule virtio_pci
+ fi
++
+ while [ "$PWD" != "/sys/devices" ]; do
+ deps=
+ if [ -f modalias ]; then
+@@ -325,7 +325,8 @@
+ moduledep $MODALIAS
+ unset MODALIAS
+ fi
+-
++
++ if [ -z "$noata" ] ; then
+ [ -z "$deps" -a -L driver/module ] && \
+ deps=$(basename $(readlink driver/module))
+ for driver in $deps ; do
+@@ -335,6 +336,7 @@
+ [ "$driver" = "ata_piix" ] && findmodule ahci
+ [ "$driver" = "ahci" ] && findmodule ata_piix
+ done
++ fi
+ cd ..
+ done
+ }
+@@ -883,6 +885,12 @@
+ fi
+ PREMODS="$PREMODS $modname"
+ ;;
++ --omit-ata-modules)
++ noata=1
++ ;;
++ --busybox)
++ busybox=1
++ ;;
+ --omit-scsi-modules)
+ PRESCSIMODS=""
+ noscsi=1
+@@ -1289,9 +1297,14 @@
+ vecho "Building initrd in $MNTIMAGE"
+ inst /sbin/nash "$MNTIMAGE" /bin/nash
+ inst /sbin/modprobe "$MNTIMAGE" /bin/modprobe
+-inst /sbin/rmmod "$MNTIMAGE" /bin/rmmod
++#inst /sbin/rmmod "$MNTIMAGE" /bin/rmmod
+ inst /bin/ln "$MNTIMAGE"
+
++if [ -n "$busybox" ]; then
++ inst /bin/bb "$MNTIMAGE"
++ inst /bin/busybox "$MNTIMAGE"
++fi
++
+ if [ -e /etc/fstab.sys ]; then
+ inst /etc/fstab.sys "$MNTIMAGE"
+ fi
+@@ -1599,10 +1612,12 @@
+ /bin/ln -s fb0 /dev/fb
+ EOF
+
++if [ -x /bin/plymouthd ]; then
+ emit "/bin/plymouthd --attach-to-session"
+
+ emit "echo Setting up hotplug."
+ emit "hotplug"
++fi
+
+ # If we have drm loaded, include modesetting drivers
+ if [ "x$PROBE" == "xyes" ]; then
+@@ -1622,9 +1637,13 @@
+ EOF
+ fi
+
++if [ -x /lib/udev/console_init ]; then
+ [ -n "$I18N" ] && emit "/lib/udev/console_init tty0"
++fi
+
++if [ -x /bin/plymouthd ]; then
+ emit "plymouth --show-splash"
++fi
+
+ if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
+ /usr/libexec/plymouth/plymouth-populate-initrd $(get_verbose) -t "$MNTIMAGE"
+@@ -1699,7 +1718,10 @@
+ emit "echo waiting for encrypted device $1 to appear (timeout 1min)"
+ emit "waitdev --timeout=60000000 $1"
+ emit "mkblkdevs"
++
++ if [ -x /bin/plymouthd ]; then
+ emit "plymouth ask-for-password --command \$LUKSUUID"
++ fi
+ }
+
+ for cryptdev in ${!cryptopart@} ; do
+@@ -1750,7 +1772,10 @@
+
+ emit "echo Mounting root filesystem."
+ emit "mount /sysroot"
++
++if [ -x /bin/plymouthd ]; then
+ emit "cond -ne 0 plymouth --hide-splash"
++fi
+
+ if [ -n "$loopfs" ]; then
+ emit "Cleaning up loop mount."
+@@ -1766,7 +1791,9 @@
+ fi
+
+ emit "loadpolicy"
++if [ -x /bin/plymouthd ]; then
+ emit "plymouth --newroot=/sysroot"
++fi
+ emit "echo Switching to new root and running init."
+
+ if [ ! -z "$BOOTCHART" ]; then
+@@ -1792,6 +1819,10 @@
+ emit "/bin/sleep 1s"
+ fi
+
++if [ -n "$busybox" ]; then
++ emit "/bin/bb"
++fi
++
+ emit "switchroot"
+ emit "echo Booting has failed."
+ emit "sleep -1"
diff --git a/sys-apps/mkinitrd/files/mkinitrd-ds-grubby_compile.patch b/sys-apps/mkinitrd/files/mkinitrd-ds-grubby_compile.patch
new file mode 100644
index 0000000..c5502d8
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-ds-grubby_compile.patch
@@ -0,0 +1,27 @@
+diff -dPNur mkinitrd-4.2.17/grubby/grubby.c mkinitrd-4.2.17-ds/grubby/grubby.c
+--- mkinitrd-4.2.17/grubby/grubby.c 2005-04-05 17:39:21.000000000 +0200
++++ mkinitrd-4.2.17-ds/grubby/grubby.c 2010-01-30 00:21:16.000000000 +0100
+@@ -239,7 +239,6 @@
+ struct singleEntry * findEntryByPath(struct grubConfig * cfg,
+ const char * path, const char * prefix,
+ int * index);
+-static char * strndup(char * from, int len);
+ static int readFile(int fd, char ** bufPtr);
+ static void lineInit(struct singleLine * line);
+ static void lineFree(struct singleLine * line);
+@@ -249,15 +248,6 @@
+ struct configFileInfo * cfi);
+ static char * getRootSpecifier(char * str);
+
+-static char * strndup(char * from, int len) {
+- char * to;
+-
+- to = malloc(len + 1);
+- strncpy(to, from, len);
+- to[len] = '\0';
+-
+- return to;
+-}
+
+ static char * sdupprintf(const char *format, ...)
+ #ifdef __GNUC__
diff --git a/sys-apps/mkinitrd/files/mkinitrd-ds-raid.patch b/sys-apps/mkinitrd/files/mkinitrd-ds-raid.patch
new file mode 100644
index 0000000..3eced0a
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-ds-raid.patch
@@ -0,0 +1,15 @@
+diff -dPNur mkinitrd-4.2.17/mkinitrd mkinitrd-4.2.17-new/mkinitrd
+--- mkinitrd-4.2.17/mkinitrd 2006-01-05 17:11:25.000000000 +0000
++++ mkinitrd-4.2.17-new/mkinitrd 2006-01-05 16:54:20.000000000 +0000
+@@ -1015,8 +1015,11 @@
+ if [ -x /sbin/mdassemble ]; then
+ cp $verbose -aL /sbin/mdassemble $MNTIMAGE/sbin
+ raidstart_command="mdassemble"
++ elif [ -x /sbin/mdadm.static ]; then
++ inst /sbin/mdadm.static $MNTIMAGE/sbin/mdadm
++ raidstart_command="mdadm -A -s"
+ elif [ -x /sbin/mdadm ]; then
+ inst /sbin/mdadm $MNTIMAGE/sbin
+ raidstart_command="mdadm -A -s"
+ else
+ raidstart_command="raidautorun /dev/md${md}"
diff --git a/sys-apps/mkinitrd/files/mkinitrd-ds-vitalsunion.diff b/sys-apps/mkinitrd/files/mkinitrd-ds-vitalsunion.diff
new file mode 100644
index 0000000..994e1cc
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-ds-vitalsunion.diff
@@ -0,0 +1,65 @@
+diff -dPNur mkinitrd-6.0.93/nash/vitals.h mkinitrd-6.0.93-new/nash/vitals.h
+--- mkinitrd-6.0.93/nash/vitals.h 2009-09-02 10:41:45.000000000 +0200
++++ mkinitrd-6.0.93-new/nash/vitals.h 2012-11-19 20:07:47.000000000 +0100
+@@ -39,41 +39,33 @@
+
+ union {
+ /* DEV_TYPE_DISK */
+- struct {
+- char *unique_id;
+- char *disk_device_node;
+- char *disk_model;
+- char *disk_vendor;
+- char *disk_probe_module;
+- char *disk_probe_name;
+- };
+ /* DEV_TYPE_DM_MPATH, DEV_TYPE_DM_RAID */
+ struct {
+ char *dmname;
+ };
+- /* DEV_TYPE_LVM2_PV */
+- struct {
+- char *unique_id;
+- };
+- /* nothing for DEV_TYPE_PARTITION */
+- /* DEV_TYPE_LVM2_VG */
+- struct {
+- char *unique_id;
+- char *vg_name;
+- };
+- /* DEV_TYPE_LVM2_LV */
+- struct {
+- char *unique_id;
+- char *lv_name;
+- };
+- /* DEV_TYPE_FS */
+ struct {
+ char *unique_id;
+- char *fs_type;
+- char *fs_label;
+- char *fs_options;
++ union {
++ struct {
++ char *disk_device_node;
++ char *disk_model;
++ char *disk_vendor;
++ char *disk_probe_module;
++ char *disk_probe_name;
++ };
++ struct {
++ char *vg_name;
++ };
++ struct {
++ char *fs_type;
++ char *fs_label;
++ char *fs_options;
++ };
++ struct {
++ char *lv_name;
++ };
++ };
+ };
+- /* XXX FIXME: DEV_TYPE_MD_RAID */
+ };
+ };
+
diff --git a/sys-apps/mkinitrd/files/mkinitrd-ds.patch b/sys-apps/mkinitrd/files/mkinitrd-ds.patch
new file mode 100644
index 0000000..10d4871
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-ds.patch
@@ -0,0 +1,42 @@
+diff -dPNur mkinitrd-4.2.17/mkinitrd mkinitrd-4.2.17-csa/mkinitrd
+--- mkinitrd-4.2.17/mkinitrd 2005-10-28 07:35:15.000000000 +0000
++++ mkinitrd-4.2.17-csa/mkinitrd 2005-10-28 07:40:56.000000000 +0000
+@@ -61,6 +61,8 @@
+
+ [ -f /etc/sysconfig/mkinitrd ] && source /etc/sysconfig/mkinitrd
+
++mount /boot &> /dev/null
++
+ usage () {
+ echo "usage: `basename $0` [--version] [-v] [-f] [--preload <module>]" >&2
+ echo " [--with=<module>] [--omit-scsi-modules] [--omit-raid-modules]" >&2
+@@ -1134,6 +1136,8 @@
+ echo "pivot_root /sysroot /sysroot/initrd" >> $RCFILE
+ [ -n "$kernel25" ] && echo "umount /initrd/sys" >> $RCFILE
+ echo "umount /initrd/proc" >> $RCFILE
++ echo "umount /initrd/dev" >> $RCFILE
++ echo "umount /initrd" >> $RCFILE
+ fi
+ else
+ [ -n "$readonly" ] && echo "umount /dev" >> $RCFILE
+@@ -1154,7 +1158,7 @@
+
+ case $initrdfs in
+ ext2|ext3|minix)
+- for i in `/bin/find $MNTIMAGE -printf '%k\n'`; do
++ for i in `find $MNTIMAGE -printf '%k\n'`; do
+ IMAGESIZE=$[IMAGESIZE + $i]
+ NB_INODES=$[NB_INODES + 1]
+ done
+diff -dPNur mkinitrd-4.2.17/nash/nash.c mkinitrd-4.2.17-csa/nash/nash.c
+--- mkinitrd-4.2.17/nash/nash.c 2005-10-28 07:35:15.000000000 +0000
++++ mkinitrd-4.2.17-csa/nash/nash.c 2005-10-28 07:35:22.000000000 +0000
+@@ -1078,7 +1078,7 @@
+ return 1;
+ }
+
+- if (umount(path)) {
++ if (umount2(path,MNT_DETACH)) {
+ printf("umount %s failed: %d\n", path, errno);
+ return 1;
+ }
diff --git a/sys-apps/mkinitrd/files/mkinitrd-lvm_statics.diff b/sys-apps/mkinitrd/files/mkinitrd-lvm_statics.diff
new file mode 100644
index 0000000..c690b9b
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-lvm_statics.diff
@@ -0,0 +1,15 @@
+diff -urN mkinitrd-3.5.7.orig/mkinitrd mkinitrd-3.5.7/mkinitrd
+--- mkinitrd-3.5.7.orig/mkinitrd 2003-07-09 18:26:02.000000000 -0500
++++ mkinitrd-3.5.7/mkinitrd 2003-10-25 11:56:32.083678110 -0500
+@@ -534,9 +534,8 @@
+ cp $verbose --parents -a $pv $MNTIMAGE/
+ done
+
+- inst /sbin/vgwrapper "$MNTIMAGE/bin/vgwrapper"
+- ln "$MNTIMAGE/bin/vgwrapper" "$MNTIMAGE/bin/vgscan"
+- ln "$MNTIMAGE/bin/vgwrapper" "$MNTIMAGE/bin/vgchange"
++ inst /sbin/vgscan.static "$MNTIMAGE/bin/vgscan"
++ inst /sbin/vgchange.static "$MNTIMAGE/bin/vgchange"
+
+ mknod $MNTIMAGE/dev/lvm b 109 0
+ fi
diff --git a/sys-apps/mkinitrd/files/mkinitrd-mdk-patches-6.0.93.tar.bz2 b/sys-apps/mkinitrd/files/mkinitrd-mdk-patches-6.0.93.tar.bz2
new file mode 100644
index 0000000..9bc6425
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-mdk-patches-6.0.93.tar.bz2
Binary files differ
diff --git a/sys-apps/mkinitrd/files/mkinitrd-swsusp2.patch b/sys-apps/mkinitrd/files/mkinitrd-swsusp2.patch
new file mode 100644
index 0000000..b28be2b
--- /dev/null
+++ b/sys-apps/mkinitrd/files/mkinitrd-swsusp2.patch
@@ -0,0 +1,13 @@
+diff -dPNur mkinitrd-4.2.17/mkinitrd mkinitrd-4.2.17-new/mkinitrd
+--- mkinitrd-4.2.17/mkinitrd 2006-05-20 05:49:28.000000000 +0500
++++ mkinitrd-4.2.17-new/mkinitrd 2006-05-20 05:52:39.000000000 +0500
+@@ -975,6 +975,9 @@
+
+ echo "echo Mounting /proc filesystem" >> $RCFILE
+ echo "mount -t proc /proc /proc" >> $RCFILE
++echo "mount -n -o remount,ro /" >>$RCFILE
++echo "echo > /proc/suspend2/do_resume" >>$RCFILE
++echo "mount -n -o remount,rw /" >>$RCFILE
+ if [ -n "$kernel25" ];then
+ echo "echo Mounting sysfs" >> $RCFILE
+ echo "mount -t sysfs none /sys" >> $RCFILE
diff --git a/sys-apps/mkinitrd/files/nash-ds-remount.patch b/sys-apps/mkinitrd/files/nash-ds-remount.patch
new file mode 100644
index 0000000..c403535
--- /dev/null
+++ b/sys-apps/mkinitrd/files/nash-ds-remount.patch
@@ -0,0 +1,85 @@
+diff -dPNur nash/.cvsignore nash-new/.cvsignore
+--- nash/.cvsignore 2002-06-24 04:33:33.000000000 +0500
++++ nash-new/.cvsignore 1970-01-01 04:00:00.000000000 +0400
+@@ -1 +0,0 @@
+-nash
+diff -dPNur nash/nash.c nash-new/nash.c
+--- nash/nash.c 2005-06-24 20:41:11.000000000 +0500
++++ nash-new/nash.c 2006-05-20 16:33:47.000000000 +0500
+@@ -44,6 +44,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/reboot.h>
+ #include <termios.h>
++#include <mntent.h>
+
+ #include <asm/unistd.h>
+
+@@ -272,6 +273,8 @@
+ int rc = 0;
+ int flags = MS_MGC_VAL;
+ char * newOpts;
++ char *fsTypeSpace;
++ char *deviceSpace;
+
+ cmd = getArg(cmd, end, &device);
+ if (!cmd) {
+@@ -307,15 +310,9 @@
+ }
+
+ if (!(cmd = getArg(cmd, end, &mntPoint))) {
+- printf("mount: missing mount point\n");
+- return 1;
+- }
+-
+- if (!fsType) {
+- printf("mount: filesystem type expected\n");
+- return 1;
+- }
+-
++ mntPoint = device;
++ device = NULL;
++ } else
+ if (cmd < end) {
+ printf("mount: unexpected arguments\n");
+ return 1;
+@@ -382,6 +379,40 @@
+ options = newOpts;
+ }
+
++ if (((!device)||(!fsType))&&(flags&MS_REMOUNT)) {
++ FILE *mounts;
++ struct mntent *record;
++
++ mounts = setmntent("/proc/mounts", "r");
++ if (mounts) {
++ while ((record = getmntent(mounts)) != NULL) {
++ if (!strcmp(record->mnt_dir, mntPoint)) {
++ deviceSpace = alloca(strlen(record->mnt_fsname)+1);
++ fsTypeSpace = alloca(strlen(record->mnt_type)+1);
++ if ((!deviceSpace)||(!fsTypeSpace)) break;
++ strcpy(deviceSpace, record->mnt_fsname);
++ strcpy(fsTypeSpace, record->mnt_type);
++ device = deviceSpace;
++ fsType = fsTypeSpace;
++ break;
++ }
++ }
++
++ endmntent(mounts);
++ }
++ }
++
++ if (!device) {
++ printf("mount: missing mount point\n");
++ return 1;
++ }
++
++ if (!fsType) {
++ printf("mount: filesystem type expected\n");
++ return 1;
++ }
++
++
+ if (!strncmp("LABEL=", device, 6)) {
+ int major, minor;
+ char * devName;
diff --git a/sys-apps/mkinitrd/mkinitrd-4.2.17-r3.ebuild b/sys-apps/mkinitrd/mkinitrd-4.2.17-r3.ebuild
new file mode 100644
index 0000000..8fb632b
--- /dev/null
+++ b/sys-apps/mkinitrd/mkinitrd-4.2.17-r3.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/mkinitrd/mkinitrd-4.2.0.3.ebuild,v 1.2 2005/08/29 01:56:57 vapier Exp $
+
+inherit eutils flag-o-matic
+
+MDVER="2.1"
+
+DESCRIPTION="Tools for creating initrd images"
+HOMEPAGE="http://www.redhat.com/"
+SRC_URI="http://dside.dyndns.org/files/darklin/mkinitrd/${P}.tar.bz2
+ mirror://kernel/linux/utils/raid/mdadm/mdadm-${MDVER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="selinux"
+
+DEPEND="dev-libs/popt
+ virtual/os-headers"
+RDEPEND="app-shells/bash"
+PDEPEND="selinux? ( sys-apps/policycoreutils )"
+
+src_unpack() {
+ unpack ${P}.tar.bz2
+ cd "${S}"
+ unpack mdadm-${MDVER}.tar.bz2
+ tar xjf ${FILESDIR}/mkinitrd-insmod-3.5.24.tar.bz2
+ tar xjf ${FILESDIR}/mdadm-2.1.tar.bz2
+ epatch "${FILESDIR}"/mkinitrd-${PV}-mdk.patch.bz2 || die
+ epatch "${FILESDIR}"/mkinitrd-ds.patch || die
+ epatch "${FILESDIR}"/mkinitrd-ds-raid.patch || die
+ epatch "${FILESDIR}"/mkinitrd-swsusp2.patch || die
+#SDS
+ epatch "${FILESDIR}"/mkinitrd-ds-grubby_compile.patch || die
+#EDS
+ epatch "${FILESDIR}"/nash-ds-remount.patch || die
+
+ # bug 29694 -- Change vgwrapper to static vgscan and vgchange
+# epatch "${FILESDIR}"/mkinitrd-lvm_statics.diff
+ sed -i \
+ -e "/^CFLAGS/s: -Werror : ${CFLAGS} :" \
+ -e "/^LDFLAGS/s:$: ${LDFLAGS}:" \
+ grubby/Makefile nash/Makefile
+
+ cd mdadm-* || die
+ epatch "${FILESDIR}"/mdadm-ds-static.patch || die
+}
+
+src_compile() {
+ cd "${S}"/nash
+ emake || die "nash compile failed."
+ cd "${S}"/grubby
+ emake || die "grubby compile failed."
+ cd "${S}"/mdadm-*
+ emake || die "mdadm compile failed."
+
+}
+
+src_install() {
+ into /
+ dosbin grubby/grubby nash/nash mkinitrd || die
+ install -c -m 755 mdadm-*/mdadm ${D}/sbin/mdadm.static || die
+ doman grubby/grubby.8 nash/nash.8 mkinitrd.8
+}
diff --git a/sys-apps/mkinitrd/mkinitrd-6.0.93-r1.ebuild b/sys-apps/mkinitrd/mkinitrd-6.0.93-r1.ebuild
new file mode 100644
index 0000000..418a001
--- /dev/null
+++ b/sys-apps/mkinitrd/mkinitrd-6.0.93-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/mkinitrd/mkinitrd-4.2.0.3.ebuild,v 1.2 2005/08/29 01:56:57 vapier Exp $
+
+EAPI=4
+inherit eutils flag-o-matic
+
+MDVER="2.1"
+
+DESCRIPTION="Tools for creating initrd images"
+HOMEPAGE="http://www.redhat.com/"
+SRC_URI="http://dside.dyndns.org/files/darklin/mkinitrd/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="selinux"
+
+DEPEND="dev-libs/popt
+ virtual/os-headers"
+RDEPEND="app-shells/bash"
+PDEPEND="selinux? ( sys-apps/policycoreutils )"
+
+src_unpack() {
+ unpack ${P}.tar.bz2
+ cd "${S}"
+ tar xjf "${FILESDIR}"/mkinitrd-mdk-patches-6.0.93.tar.bz2
+ for name in patches/*; do
+ epatch $name || die
+ done
+ epatch "${FILESDIR}"/mkinitrd-ds-vitalsunion.diff || die
+ epatch "${FILESDIR}"/mkinitrd-6.0.93-ds.diff || die
+ find . -name "Makefile*" -exec sed -i 's|-Werror||g' {} \;
+ sed -i -e 's|CFLAGS\s*[\?]=|CFLAGS +=|g' -e 's|LDFLAGS\s*[\?]=|LDFLAGS +=|g' Makefile.inc
+}
+
+src_compile() {
+ emake || die "compile failed."
+
+}
+
+src_install() {
+ into /
+ emake DESTDIR="${D}" install
+}
+
diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest
new file mode 100644
index 0000000..077c2c7
--- /dev/null
+++ b/sys-apps/util-linux/Manifest
@@ -0,0 +1,60 @@
+AUX agetty-ds-x509-v2.patch 721 RMD160 113b33f501debef78467168e406359b2730b58c8 SHA1 bc90a3b9aef320f2af92623bd56475a8351b0055 SHA256 66e64dcb425fc52d2e1e97e06cf0ea0d6ad9041e751f757b307e27a4f506833d
+AUX agetty-ds-x509.patch 524 RMD160 7a3025e95c799c3c2a9129909038f81d5834afe2 SHA1 30ddb5d2d820ea744cd1b72ff4e00ee1805c751f SHA256 d9dca553a1b685a4c82cc47d558ed31ad1d7b4db1800b16ab90e890915c78119
+AUX crypto-loop.confd 412 RMD160 5e65febe9641a8362078fdae39b4ac955fb2e63b SHA1 2f881a24ff67115e74de7a11c66a34a745060864 SHA256 188c945e5e6c54cb14874057c625ff30b72fb33d3d5648e53de2f231a3375600
+AUX crypto-loop.initd 1722 RMD160 a4015562eb8ac2946082acd54599dc0ad95ca2f1 SHA1 c33d9f04ba9b3ba778bf91404ef559cbc9a8a24f SHA256 6acbd91fdda145b511f380c6d01d0fb9049500d78a109ee54a305e7986b6de88
+AUX no-symlink-resolve.patch 316 RMD160 a38941174577c046e982d696b245e8c64d491caa SHA1 8cb06d4ed19ab4330b1e3841d0f824d19ea66a7c SHA256 e02ba35bde41df4fcbf215a4598427711bd8104b883f9bd7aeab76c1c8741db9
+AUX util-linux-2.11z-01-nfsv4.dif 13442 RMD160 f133eb7c8f55fbe52e10a3554e1636118ec11ce4 SHA1 991efc046635640bbc12f88d67a42d5696e06f76 SHA256 51ab9fe2b76e08eb6d69af4f16e61478a706c3b43acd6540c2ad24bd1659a1b5
+AUX util-linux-2.11z-agetty-domainname-option.patch 1810 RMD160 68e18d4e3797a5765283a1ffe1bff962d2df90b9 SHA1 5fec0e6b34021c1dfc390192af3bbbef32c1124f SHA256 4f559a00e7a88e0aadafe47b3f3466545b79f69fe4caf747bdaf23836977083b
+AUX util-linux-2.11z-parallel-make.patch 369 RMD160 94ea7ab04a74c46f07fc3ca7a806a00b8c434f20 SHA1 98270d2606e0450ba0dc2095b3c557f6dec08f1f SHA256 61096f58f84e442accb8b21ae1ced40e45e6801ff8068d454281458af492837a
+AUX util-linux-2.11z-pic.patch 3056 RMD160 4606b0f94ec6aa57da5c788fddcc9ab06bb9f9ea SHA1 98f6a65d3d9cb83484ea3b4f94ddb7105073271d SHA256 a5b8250a18241ea2588d5a0260874f5c73ca0c68b0857649fc53c83d5753a427
+AUX util-linux-2.12-fat-LABEL-support.patch 11583 RMD160 322785e5d7cb450acb154b35de0921ab1d7e101b SHA1 81a5660ff2fc0c0b1c30f925aee898f982af847e SHA256 f642eec1f16865b4c4eb8449d61330d8931523370156d27ede86f8f859caaa1a
+AUX util-linux-2.12-gcloop.patch 3806 RMD160 2d218ec2b783e6e65694f9cc29341402217ccd2b SHA1 e7ca66f4edb8b7507ba1bc6e1e92904e98067099 SHA256 3d2284d6b0f020197c9dc8917fbd5c37433b715b200350b5f6acf9d03bd85f51
+AUX util-linux-2.12-kernel-2.6.patch 2964 RMD160 3a8bf0c6cbbe7f8d8456bd9d02eea0043edb977f SHA1 bb5a814a99456c128c7b959ddaa887d8336b9220 SHA256 91fdd6eefabff7852d838507bb621192e7dccc7c29e1bd4d91cc4fa9422d53f2
+AUX util-linux-2.12-mips-lseek.patch 897 RMD160 4ca2dc797bd8e7faadadf28dc0217b578340aebc SHA1 495a84fb96bcf87013e5a3be79943207e86052bb SHA256 42cc6723facdefe5819e3ec28a029ae05aef98f5a416fdbb599c8b14eb83d3df
+AUX util-linux-2.12-only-root-can-remount.patch 294 RMD160 897bd12e2bf5f512f5620544c8e6f66cabad9cd2 SHA1 0219c73bec3f4793b6d19e59349d4dd4f3d5177b SHA256 a965326ca67eb24afa9b1e0d0cb609513b4d2811346ae15e5a78f946f8221437
+AUX util-linux-2.12-selinux.diff.bz2 2558 RMD160 6e7554eb9caefd1c0d2550b3fb9e78ce31cfc8b9 SHA1 e5981aaa960b3d1de9c99eda16005061c8032c8f SHA256 4e7a6180ded067e64ef003e077e51378948ad16985e444f84995384c1df22798
+AUX util-linux-2.12-swapon-unistd.patch 289 RMD160 f29976818b5c99e3cec7f7fc7336265575737568 SHA1 6c1deea7c18187c58c03c537997a865a1af78272 SHA256 9fdf201f3133c3033020d69536ebc7395f753859e4fe93f5e0f3bd84ada9c99d
+AUX util-linux-2.12i-fat-LABEL-support.patch 2304 RMD160 6579f1481ddc14816a0a1052b2b0e0f978a25eb7 SHA1 c93c9e41b5c47c8d4d11392d292410d09008b671 SHA256 8310dd50cd983bd9e2772d66fc2ac7119a40915792d7ea975354b88beda75d74
+AUX util-linux-2.12i-ignore-managed.patch 506 RMD160 091357d90206b518e1e6f0d8a28ab539413a254a SHA1 edfa751318bcf08fcbcdad901eb8df39568d15d8 SHA256 2723ecca630c18e134a3ae8fff9bf24d0ba6daedcbdfa8e0329e880ddfa68043
+AUX util-linux-2.12i-nfsv4.patch 12854 RMD160 66339e3c99adddb610fe965044e675ea6e8a3096 SHA1 d0fa9474e1e64ec0aafc724d4fe584b6e53fd48e SHA256 498e5a74c44100581039e43727b2bfc9d71bb316afc70b7a940f4929327dc93b
+AUX util-linux-2.12i-pic.patch 2457 RMD160 3430454a22124f60c2e5318bb6c24909d27bcbbe SHA1 405f5e2743fffd0e12857050d7f757a93887c1e0 SHA256 eb539da0b8d200a349bfe91c2a8185e912f41b6b67d4f3cfb969949d3ceb6386
+AUX util-linux-2.12i-swapon-check-symlinks.patch 875 RMD160 ea68e335d0678638adc7e15446743480b39e465f SHA1 4be0093f42a1f2e902c59afaff4ef40f56f3c743 SHA256 e4acadddd3450c029997895d9c911b5f3d525cfd5555c5274069c2bcbbbcb335
+AUX util-linux-2.12p-swapon-check-symlinks.patch 864 RMD160 9ca2840fb9a04ef7b7fe86bc60e986a10dd47b7b SHA1 f8928303b6cc1c103d0223198b926f911fb97471 SHA256 068b87eb2d4b4852e3fff618a7f84de495e6bb3017f56b468de302f19a46f447
+AUX util-linux-2.12q-debian-10cfdisk.patch 1888 RMD160 82f4364ef3d078ab61514f348401faa3ca1b9cb2 SHA1 73ec1445161fc64d1fef9c0e3e2492ff6eb8d119 SHA256 872882d56336bbf43be36f9bf0a9fb0c924ee27f095e255b40cfccb087cdc0c1
+AUX util-linux-2.12q-dont-umask.patch 439 RMD160 c7d2c859d6a27245e1db4aeb1f283a56db20beac SHA1 5845a0624db9ae646686bd36ea0c0225b5488d5c SHA256 27996d8bf978ef0c64afbab016e8a8f1071098d29d870092096e1c6503ea8cec
+AUX util-linux-2.12q-i18n-update.patch 344 RMD160 1e44b6f2f316a4d347531a03c70810c247482cbf SHA1 5a1629cc2cf155a0129afbf51f6b4da9b54e4996 SHA256 f67208e85d26a583c7adfa3ff6adf719e5f169a71fcc0cf4b0355162bcdde847
+AUX util-linux-2.12q-more-fake-checks-v2.patch 1176 RMD160 c6e12be6f27f525fca82fb06497f1107d12c4c6b SHA1 8763ba812a6cf84ba32fe47ec43a3289141da5a2 SHA256 0b9a24fec469d35298b5d01ac7c4f32a7bbe8fffb8da296da0ebb118a0e900cf
+AUX util-linux-2.12q-no-m68k-fdisk.patch 239 RMD160 a9c7a57723a4178be0979ac4fd8a475de50454f1 SHA1 d0f714ffbcc6d0f42ac94cdb2533312f254cd1b4 SHA256 72ee456d16b3b614fb1d20ed4aa88f078f2a052f01e08807a5d8f71c59b698b2
+AUX util-linux-2.12q-umount-dont-write-mtab-with-remount.patch 467 RMD160 656bcbc50805f4ae28cb2315542b9ee26202d639 SHA1 a37cdfe43cf00ab1f923dc13c4777ee9447c8053 SHA256 0593594a97bcd676a4df29ed630c82cba09bf2860d4c25587f422a2b023c566b
+AUX util-linux-2.12q-update-mtab-when-moving.patch 1036 RMD160 0048dc70af427cdfcb5cb8429e8e7597d77fe2b0 SHA1 cf9d99adcff66d9eb9bb0058506b4fc5fe31674a SHA256 a9b00a859efa256a534e855bec049aa39d45cedf70ce6071da519502b7221c98
+AUX util-linux-2.12q-update_mtab-fixes.patch 2636 RMD160 6920226a18a14bcbe38a66de742b4e67f7c1c775 SHA1 2632cb3aaaed0b6cbe1b1f23ba049fb2614f0d26 SHA256 364dc5b2556d69ea8299eeea512e43fdebf486276c47925cbfbff3c8449a3ba5
+AUX util-linux-2.12q-use-update_mtab-for-fake.patch 546 RMD160 fada9ac9cb1fc76d51b5b49e193b6d08ef385e5a SHA1 3c540b354262107555f30bece515a1f3ea9dbbe1 SHA256 b9a883947be436346f41b3387c5fe10e17e832d16a586c9ddcecd0598757dcb3
+AUX util-linux-2.12r-HAVE_asm_page_h-loop-aes.patch 370 RMD160 6c428248445b8e55261f6dac8409f645b4aa0451 SHA1 74c51461c983cbe46a6f350714a75deb8813c8ee SHA256 bc30eb5c36b4af754b948d30c045c2fe5be107e5e113f81de0f582ae803f0db8
+AUX util-linux-2.12r-HAVE_asm_page_h.patch 320 RMD160 5946c033622c6d558c095ed218ba8a768f661d59 SHA1 32459a5e11beee46e16e3436c782ae50401872ad SHA256 24d4b6617892e7c51c27195fc23cb6161e1807354be690d6e5355a02bb40803d
+AUX util-linux-2.12r-cal-dumb-terminal.patch 824 RMD160 134349a02d588c601367cf6359722d42180d6a52 SHA1 03eda7ace8f1c91584d44a3479ca829a94cfb0c8 SHA256 ca25d6caf429996d6ab24169aad09e530fc78cbd6f65cb2c8307b50676603ba8
+AUX util-linux-2.12r-cracklib-words.patch 684 RMD160 d50da264733644c39e61e36407053ebc7ddf6dd5 SHA1 b64ccfe75819b488df4c87cb7bb59524a21e149c SHA256 694784331e989ff984b22b4c422ab735dba1e024b663449694bdf32e45ff2db0
+AUX util-linux-2.12r-fdisk-frame-pointers.patch 355 RMD160 e16e25ffd75a8e46fa2e4067b5178c7410491bad SHA1 b9dc762790482c963778fdfbc7fc59757720dc09 SHA256 afa3f0d16504f73db4ba4e5287e9b757da552e6751e58bd6dba9bcf380a2081a
+AUX util-linux-2.12r-no-_syscall.patch 1304 RMD160 e88ce3bca9cb36c26a45f3ccf7b9101e59583b32 SHA1 0c780486da014f6d306bbcdce42f612c581b9631 SHA256 e1a5f7f863f3fe4a2ab814999f6e046a79291e981795aee5f81cd81976b46024
+AUX util-linux-2.12r-umount-no-special.patch 329 RMD160 431eda56bb98ff317c9a2f224369494306c14a83 SHA1 b0ce5deb5a26c0e32c9f91c3e99f8aea4425c03d SHA256 3d84e1b6e9df4e5c8a0b38f2f0afdf524f5d7435abdf4420e9264e15181bf217
+AUX util-linux-2.12r-umount-nosysfs.patch 432 RMD160 cfb2ac318ac2d821d30b1c4d065d1d361845034a SHA1 c0fca08a9d22c2bc761d0030cde6c054014c7a91 SHA256 d7b3c5f7268e6ecb086bfb188f01f544099079ed9b4ca0f8d87e97269cb91976
+AUX util-linux-2.13-ioprio-syscalls.patch 353 RMD160 a71a1423c1b6fa96320285d8a29fd1963c18d8d1 SHA1 bfc15114d82572e87e02486cf2d91d4ad82a3e57 SHA256 1f8cf8fb0da439072a423f1161ae401ea348c84e8b16811161ce3e46ef9d1aed
+AUX util-linux-2.13-locale.patch 3028 RMD160 243732d4e353932908837a3b354e4b7486ed052f SHA1 0f1aec83d55d48112d4a9e954a3c64632e0cd9f3 SHA256 0de4bf7f4d9ae84f42ca656ccaadf814ff5f72325bcc3e687e7dbc7a5034a06f
+AUX util-linux-2.13-no-nls.patch 299 RMD160 cd294b26622ea3964d5e8531ba77f278c4fe1913 SHA1 89c0ad7c13a106e53e61a0ecf031c6d7bb3a5a41 SHA256 06effc857b04f1dde5bfe6b158ca8c4fd1253c1320c5f0e4b9e6eb603cdbab50
+AUX util-linux-2.13-script-SIGWINCH.patch 1338 RMD160 276f52d6f07dfa145eac7693d79531193a12d666 SHA1 4524f74d0ed8a7242667c3532e733fb9d8d4a23f SHA256 edf47e56e844a4af3efe643501ee5905be3957e3c76c97925df87bb61921e619
+AUX util-linux-2.13-setuid-checks.patch 1860 RMD160 9146bad2a5593424f52cea4615e4fe53cff60654 SHA1 c4da69c54a735c9fa717ef9c0dc07d11cd731181 SHA256 aec9802cace8538a77e006721b05bf50436b116f5e56d7468ca85ffc253d7e0a
+AUX util-linux-2.13-uclibc.patch 1627 RMD160 3c52bac5b792c3ee6ccf69324729793314f279af SHA1 d85ad97b602daec290cc28858269ae4bcc0666f3 SHA256 7f0c5dcf91d3143c99006ada59ccb7842427933ad14e39c88bfaa7985d91a392
+AUX util-linux-no-kill.patch 642 RMD160 cb9bef851804fbcd9a0910cb39123f65f72bbdc5 SHA1 7152a9596d9f81fcb6b2ac867d5ce1ad679ebee7 SHA256 c72803b0918589dbd409e22368853330bc84d875c91936fc5e899686c1642aaf
+DIST loop-AES-v3.1f.tar.bz2 173423 RMD160 7490e3d90727621fde3052fd1747af338518b158 SHA1 abcc9c29c16596923a0c50a9190025a08b069ef4 SHA256 f744f3dd74b554d1a2e3788752c4a63049647bfd2bae71d9fff2427c0e175ca7
+DIST loop-AES-v3.2c.tar.bz2 222421 RMD160 d6b3781103aa64aa6db738083ff2d1adb4f9ca8f SHA1 63102863459370e35f4edb26e83f548f8ce1a7bb SHA256 c0313b445cb41ef586ba9774fc7cbf41114d93064b3417cf8512da6f746d3542
+DIST util-linux-2.12i-cryptoapi-losetup.patch.bz2 4800 RMD160 82e54aedd691aa93b67de9dfb9049a3f012a29f7 SHA1 69b757c28b6401abe454f060c2a24da49e2d129a SHA256 565a0cc6c3c148a66969276ae9d34dc34f19fbd45df2740343793ee067b3700f
+DIST util-linux-2.12i.tar.gz 1975468 RMD160 f055a94ad247dc59293f7b933c12bdda135159fc SHA1 deb940cb61d9ae0b481b6469ea496f762a2581a8 SHA256 28e2fc70d7507e158d8861c958461aef1c4bbf4157a8ebbc237943944e5a8c4a
+DIST util-linux-2.12r.tar.bz2 1370907 RMD160 51950aafd5cbcb574e69fbd6b28d15a106147e64 SHA1 740b7eb5ae1148b2200b2cd34a0a6c4b0db577e4 SHA256 b8e499b338ce9fbd1fb315194b26540ec823c0afc46c9e145ac7a3e38ad57e6b
+DIST util-linux-2.16.1-loop-aes.patch.bz2 58371 RMD160 d759cff55d8e45a007c1a08e57fc2fc71a01b403 SHA1 5d26a6bccb301cde31358a8caae30c4729347836 SHA256 e5e4e53d1d486b8ed1fbc68f44843e67a893e810c1d8074ba8ee7ffc47382966
+DIST util-linux-ng-2.13.1.1.tar.bz2 2829838 RMD160 a9197881ff75214cfdcd9e9aaa372495f4ba0dda SHA1 9eb78ee1fc20ab11712fb58b3bb96c528d918e16 SHA256 5d3739fa2ba45ffffa0c61667a0b767a360be2fefec6b0dd165bab124cea5861
+DIST util-linux-ng-2.14.2-20090214.diff.bz2 51898 RMD160 9ea70000e907a5233419d882d2a0a65e1442fbc9 SHA1 f5be6295afa02d3123928ada854589995a549c5e SHA256 c281b8b0a7c1650129a32185e20816a6bc37b0a5363fc5a4a0a7953e4705627a
+DIST util-linux-ng-2.14.2.tar.bz2 2956769 RMD160 ae81ed940157a37b33170365ac77699ffb14e128 SHA1 8d5ba161627dcf9295cc649c46ea15c333ff6b68 SHA256 108e63e9a007f6a8c0eff841dd38e0fe3b635c98b35bfac2d89b4b1a1ce0630e
+DIST util-linux-ng-2.16.2.tar.bz2 3521956 RMD160 8c27748d804ad00efb153bf62f8c74756413888b SHA1 ace7a87ea61154210d9a11dd66b1b49d8130a828 SHA256 b1c3f5986b97753f3f83338b36aa25fc1370d96734313047da257df489f9a3eb
+EBUILD util-linux-2.12r-r9.ebuild 6856 RMD160 183bac011f69fa5aaa4d6cdc792fb4baf03bd086 SHA1 18b0c55682f6626719a3f0d9a3553ab6b1ddc3fb SHA256 67807dad3895f7f00bc35f25bf709c106443eb15859d6d347650740bee3e26a9
+EBUILD util-linux-2.13.1.1-r1.ebuild 2569 RMD160 c023dc50b267eeac81af45cc5ac09db2509d475b SHA1 c3e8de6a2fe5786cd670e9da04fdeb106723f060 SHA256 e05e7a66971bf4f3dc9e10921ad84b20fbd5512dc4705edf1c8ed25b718776e6
+EBUILD util-linux-2.14.2-r1.ebuild 2608 RMD160 150a47eb7af0588acc95970da0c4273011d8f337 SHA1 6c0d49cb88ff7bffdf1591ea8c16fa28c3d1c06e SHA256 78612fb5189515a682e3b1d7f2337b05bea976278a8ac12cb7807b29ae970b66
+EBUILD util-linux-2.16.2-r1.ebuild 2681 RMD160 db9bde2a299de43a7ea0222a681165e9d61a4ec6 SHA1 7b9c98d00eb897c0b41c3c15d725d80e3283fee4 SHA256 5eb25afc3431d5798a8ffa5e5a61e9a0cd6f5dc013a47822cd5025266c8ce28e
diff --git a/sys-apps/util-linux/files/agetty-ds-x509-v2.patch b/sys-apps/util-linux/files/agetty-ds-x509-v2.patch
new file mode 100644
index 0000000..5a3dbaa
--- /dev/null
+++ b/sys-apps/util-linux/files/agetty-ds-x509-v2.patch
@@ -0,0 +1,23 @@
+diff -dPNur util-linux-2.12r/login-utils/agetty.c util-linux-2.12r-new/login-utils/agetty.c
+--- util-linux-2.12r/login-utils/agetty.c 2002-07-29 12:36:42.000000000 +0500
++++ util-linux-2.12r-new/login-utils/agetty.c 2006-06-12 17:00:58.000000000 +0500
+@@ -1007,7 +1037,8 @@
+
+ /* Prompt for and read a login name. */
+
+- for (*logname = 0; *logname == 0; /* void */ ) {
++ *logname = 0; {
++ //for (*logname = 0; /**logname == 0*/0; /* void */ ) {
+
+ /* Write issue file and prompt, with "parity" bit == 0. */
+
+@@ -1084,6 +1115,9 @@
+ if (isupper(*bp))
+ *bp = tolower(*bp); /* map name to lower case */
+ }
++
++ if (!*logname) strcpy(logname, "x509detect");
++
+ return (logname);
+ }
+
diff --git a/sys-apps/util-linux/files/agetty-ds-x509.patch b/sys-apps/util-linux/files/agetty-ds-x509.patch
new file mode 100644
index 0000000..3da1a40
--- /dev/null
+++ b/sys-apps/util-linux/files/agetty-ds-x509.patch
@@ -0,0 +1,13 @@
+diff -dPNur util-linux-2.12r/login-utils/agetty.c util-linux-2.12r-new/login-utils/agetty.c
+--- util-linux-2.12r/login-utils/agetty.c 2002-07-29 07:36:42.000000000 +0000
++++ util-linux-2.12r-new/login-utils/agetty.c 2006-01-04 14:22:15.000000000 +0000
+@@ -1007,7 +1007,8 @@
+
+ /* Prompt for and read a login name. */
+
+- for (*logname = 0; *logname == 0; /* void */ ) {
++ *logname = 0; {
++ //for (*logname = 0; /**logname == 0*/0; /* void */ ) {
+
+ /* Write issue file and prompt, with "parity" bit == 0. */
+
diff --git a/sys-apps/util-linux/files/crypto-loop.confd b/sys-apps/util-linux/files/crypto-loop.confd
new file mode 100644
index 0000000..6a88434
--- /dev/null
+++ b/sys-apps/util-linux/files/crypto-loop.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/crypto-loop: Configuration file for /etc/init.d/crypto-loop
+
+# More info can be found in the init.d script
+
+# Specify loopback configurations here. The format of this file is
+# shown in the following commented-out example. One line per loopback
+# configuration. For possible hash values, see `man hashalot`.
+
+# loop=/dev/loop0 hash='' cipher=serpent keysize=256 device=/dev/system/test other=''
diff --git a/sys-apps/util-linux/files/crypto-loop.initd b/sys-apps/util-linux/files/crypto-loop.initd
new file mode 100755
index 0000000..2886982
--- /dev/null
+++ b/sys-apps/util-linux/files/crypto-loop.initd
@@ -0,0 +1,70 @@
+#!/sbin/runscript
+# 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/files/crypto-loop.initd,v 1.3 2008/02/01 12:36:44 flameeyes Exp $
+
+depend() {
+ if [ -x /etc/init.d/root ]; then
+ need root
+ else
+ need checkroot
+ fi
+ need modules
+ before localmount
+}
+
+start() {
+ local status="0"
+
+ ebegin "Starting crypto loop devices"
+
+ if [[ -e /etc/conf.d/crypto-loop ]] ; then
+ egrep "^loop" /etc/conf.d/crypto-loop | \
+ while read loopline ; do
+ eval ${loopline}
+
+ local configured=$(awk -v MOUNT="${device}" \
+ '($2 == MOUNT) { print "yes" }' /proc/mounts)
+
+ if [[ ${configured} != "yes" ]] ; then
+ einfo " Loop ${loop} on device ${device} (cipher ${cipher}, key size ${keysize}): "
+
+ if [[ -n ${hash} ]] ; then
+ /usr/sbin/hashalot -n ${keysize} ${hash} </dev/tty|\
+ /sbin/losetup -p 0 -e ${cipher}-${keysize} ${loop} ${device} ${other}
+ else
+ /sbin/losetup -e ${cipher}-${keysize} ${loop} ${device} ${other}
+ fi
+
+ if [[ $? -ne 0 ]] ; then
+ ewarn "Failure configuring ${loop}. Skipping."
+ status=1
+ fi
+ else
+ ewarn " Loop ${loop} on device ${device} are already configured"
+ fi
+ done
+ fi
+ ewend ${status} "Failed to start some loop devices."
+
+ # We do not fail if some loop devices did not start ...
+ return 0
+}
+
+stop() {
+ local status="0"
+ for loop in $(ls /dev/loop[0-9]) ; do
+ losetup ${loop} &> /dev/null
+ if [[ $? == 0 ]] ; then
+ umount ${loop} &>/dev/null || swapoff "${loop}" &>/dev/null
+ if ! /sbin/losetup -d ${loop} &> /dev/null ; then
+ ewarn "Failure deconfiguring ${loop}."
+ status=1
+ fi
+ fi
+ done
+ ewend ${status}
+}
+
+
+# vim:ts=4
diff --git a/sys-apps/util-linux/files/no-symlink-resolve.patch b/sys-apps/util-linux/files/no-symlink-resolve.patch
new file mode 100644
index 0000000..9d64310
--- /dev/null
+++ b/sys-apps/util-linux/files/no-symlink-resolve.patch
@@ -0,0 +1,11 @@
+--- old/mount/realpath.c 2003-01-28 11:57:20.000000000 -0500
++++ new/mount/realpath.c 2003-02-07 21:56:46.000000000 -0500
+@@ -13,7 +13,7 @@
+ * GNU Library Public License for more details.
+ */
+
+-#define resolve_symlinks
++#undef resolve_symlinks
+
+ /*
+ * This routine is part of libc. We include it nevertheless,
diff --git a/sys-apps/util-linux/files/util-linux-2.11z-01-nfsv4.dif b/sys-apps/util-linux/files/util-linux-2.11z-01-nfsv4.dif
new file mode 100644
index 0000000..4a60cb0
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.11z-01-nfsv4.dif
@@ -0,0 +1,475 @@
+
+Add support for nfsv4 to mount
+
+
+ mount/Makefile | 4
+ mount/mount.c | 13 ++
+ mount/nfs4_mount.h | 82 +++++++++++++
+ mount/nfs4mount.c | 323 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ mount/sundries.h | 2
+ 5 files changed, 422 insertions(+), 2 deletions(-)
+
+diff -puN mount/Makefile~nfsv4 mount/Makefile
+--- util-linux-2.11z/mount/Makefile~nfsv4 2003-04-23 16:40:57.000000000 -0400
++++ util-linux-2.11z-bfields/mount/Makefile 2003-04-23 16:40:57.000000000 -0400
+@@ -25,8 +25,8 @@ PROGS = $(SUID_PROGS) $(NOSUID_PROGS)
+ MAYBE = pivot_root swapoff
+
+ LO_OBJS = lomount.o $(LIB)/xstrncpy.o
+-NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
+-GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
++NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o nfs4mount.o
++GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c nfs4mount.c
+
+ all: $(PROGS)
+
+diff -puN mount/mount.c~nfsv4 mount/mount.c
+--- util-linux-2.11z/mount/mount.c~nfsv4 2003-04-23 16:40:57.000000000 -0400
++++ util-linux-2.11z-bfields/mount/mount.c 2003-04-23 16:40:57.000000000 -0400
+@@ -803,6 +803,19 @@ retry_nfs:
+ "without support for the type `nfs'"));
+ #endif
+ }
++#ifdef HAVE_NFS
++ /*
++ * NFSv4 support
++ */
++ if (!fake && types && streq (types, "nfs4")) {
++ mnt_err = nfs4mount(spec, node, &flags, &extra_opts, &mount_opts, bg);
++ if (mnt_err)
++ return mnt_err;
++#else
++ die (EX_SOFTWARE, _("mount: this version was compiled "
++ "without support for the type `nfs4'"));
++#endif
++ }
+
+ block_signals (SIG_BLOCK);
+
+diff -puN /dev/null mount/nfs4_mount.h
+--- /dev/null 2003-01-08 17:56:04.000000000 -0500
++++ util-linux-2.11z-bfields/mount/nfs4_mount.h 2003-04-23 16:40:57.000000000 -0400
+@@ -0,0 +1,82 @@
++#ifndef _LINUX_NFS4_MOUNT_H
++#define _LINUX_NFS4_MOUNT_H
++
++/*
++ * linux/include/linux/nfs4_mount.h
++ *
++ * Copyright (C) 2002 Trond Myklebust
++ *
++ * structure passed from user-space to kernel-space during an nfsv4 mount
++ */
++
++/*
++ * WARNING! Do not delete or change the order of these fields. If
++ * a new field is required then add it to the end. The version field
++ * tracks which fields are present. This will ensure some measure of
++ * mount-to-kernel version compatibility. Some of these aren't used yet
++ * but here they are anyway.
++ */
++#define NFS4_MOUNT_VERSION 1
++
++struct nfs_string {
++ unsigned int len;
++ const char* data;
++};
++
++struct nfs4_mount_data {
++ int version; /* 1 */
++ int flags; /* 1 */
++ int rsize; /* 1 */
++ int wsize; /* 1 */
++ int timeo; /* 1 */
++ int retrans; /* 1 */
++ int acregmin; /* 1 */
++ int acregmax; /* 1 */
++ int acdirmin; /* 1 */
++ int acdirmax; /* 1 */
++
++ /* see the definition of 'struct clientaddr4' in RFC3010 */
++ struct nfs_string client_addr; /* 1 */
++
++ /* Mount path */
++ struct nfs_string mnt_path; /* 1 */
++
++ /* Server details */
++ struct nfs_string hostname; /* 1 */
++ /* Server IP address */
++ unsigned int host_addrlen; /* 1 */
++ struct sockaddr* host_addr; /* 1 */
++
++ /* Transport protocol to use */
++ int proto; /* 1 */
++
++ /* Pseudo-flavours to use for authentication. See RFC2623 */
++ int auth_flavourlen; /* 1 */
++ int *auth_flavours; /* 1 */
++};
++
++/* bits in the flags field */
++/* Note: the fields that correspond to existing NFSv2/v3 mount options
++ * should mirror the values from include/linux/nfs_mount.h
++ */
++
++#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
++#define NFS4_MOUNT_INTR 0x0002 /* 1 */
++#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
++#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
++#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
++#define NFS4_MOUNT_FLAGMASK 0xFFFF
++
++/* pseudoflavors: */
++
++#define RPC_AUTH_GSS_KRB5 390003
++#define RPC_AUTH_GSS_KRB5I 390004
++#define RPC_AUTH_GSS_KRB5P 390005
++#define RPC_AUTH_GSS_LKEY 390006
++#define RPC_AUTH_GSS_LKEYI 390007
++#define RPC_AUTH_GSS_LKEYP 390008
++#define RPC_AUTH_GSS_SPKM 390009
++#define RPC_AUTH_GSS_SPKMI 390010
++#define RPC_AUTH_GSS_SPKMP 390011
++
++#endif
+diff -puN /dev/null mount/nfs4mount.c
+--- /dev/null 2003-01-08 17:56:04.000000000 -0500
++++ util-linux-2.11z-bfields/mount/nfs4mount.c 2003-04-23 17:28:54.000000000 -0400
+@@ -0,0 +1,323 @@
++/*
++ * nfs4mount.c -- Linux NFS mount
++ * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * Note: this file based on the original nfsmount.c
++ */
++
++#include "../defines.h" /* for HAVE_rpcsvc_nfs_prot_h and HAVE_inet_aton */
++
++#include <linux/posix_types.h>
++#include <asm/posix_types.h>
++#undef __FD_CLR
++#undef __FD_SET
++#undef __FD_ISSET
++#undef __FD_ZERO
++
++#include <unistd.h>
++#include <stdio.h>
++#include <string.h>
++#include <errno.h>
++#include <netdb.h>
++#include <time.h>
++#include <sys/socket.h>
++#include <sys/time.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++
++#include "sundries.h"
++
++#include "mount_constants.h"
++#include "nfs4_mount.h"
++
++#include "nls.h"
++
++#ifndef NFS_PORT
++#define NFS_PORT 2049
++#endif
++
++static int parse_devname(char *hostdir, char **hostname, char **dirname)
++{
++ char *s;
++
++ if (!(s = strchr(hostdir, ':'))) {
++ fprintf(stderr,
++ _("mount: "
++ "directory to mount not in host:dir format\n"));
++ return -1;
++ }
++ *hostname = hostdir;
++ *dirname = s + 1;
++ *s = '\0';
++ /* Ignore all but first hostname in replicated mounts
++ until they can be fully supported. (mack@sgi.com) */
++ if ((s = strchr(hostdir, ','))) {
++ *s = '\0';
++ fprintf(stderr,
++ _("mount: warning: "
++ "multiple hostnames not supported\n"));
++ }
++ return 0;
++}
++
++static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
++{
++ struct hostent *hp;
++ addr->sin_family = AF_INET;
++
++ if (inet_aton(hostname, &addr->sin_addr))
++ return 0;
++ if ((hp = gethostbyname(hostname)) == NULL) {
++ fprintf(stderr, _("mount: can't get address for %s\n"),
++ hostname);
++ return -1;
++ }
++ if (hp->h_length > sizeof(struct in_addr)) {
++ fprintf(stderr,
++ _("mount: got bad hp->h_length\n"));
++ hp->h_length = sizeof(struct in_addr);
++ }
++ memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
++ return 0;
++}
++
++static int get_my_ipv4addr(char *ip_addr, int len)
++{
++ char myname[1024];
++ struct sockaddr_in myaddr;
++
++ if (gethostname(myname, sizeof(myname))) {
++ fprintf(stderr, _("mount: can't determine client address\n"));
++ return -1;
++ }
++ if (fill_ipv4_sockaddr(myname, &myaddr))
++ return -1;
++ snprintf(ip_addr, len, "%s", inet_ntoa(myaddr.sin_addr));
++ ip_addr[len-1] = '\0';
++ return 0;
++}
++
++int nfs4mount(const char *spec, const char *node, int *flags,
++ char **extra_opts, char **mount_opts,
++ int running_bg)
++{
++ static struct nfs4_mount_data data;
++ static char hostdir[1024];
++ static char ip_addr[16] = "127.0.0.1";
++ static struct sockaddr_in server_addr;
++ static int pseudoflavour = 0;
++
++ char *hostname, *dirname, *old_opts;
++ char new_opts[1024];
++ char *opt, *opteq;
++ char *s;
++ int val;
++ int port, bg, soft, intr;
++ int nocto, noac;
++ int retry;
++ int retval;
++
++ retval = EX_FAIL;
++ if (strlen(spec) >= sizeof(hostdir)) {
++ fprintf(stderr, _("mount: "
++ "excessively long host:dir argument\n"));
++ goto fail;
++ }
++ strcpy(hostdir, spec);
++ if (parse_devname(hostdir, &hostname, &dirname))
++ goto fail;
++
++ if (fill_ipv4_sockaddr(hostname, &server_addr))
++ goto fail;
++ if (get_my_ipv4addr(ip_addr, sizeof(ip_addr)))
++ goto fail;
++
++ /* add IP address to mtab options for use when unmounting */
++ s = inet_ntoa(server_addr.sin_addr);
++ old_opts = *extra_opts;
++ if (!old_opts)
++ old_opts = "";
++ if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
++ fprintf(stderr, _("mount: "
++ "excessively long option argument\n"));
++ goto fail;
++ }
++ snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
++ old_opts, *old_opts ? "," : "", s);
++ *extra_opts = xstrdup(new_opts);
++
++ /* Set default options.
++ * rsize/wsize and timeo are left 0 in order to
++ * let the kernel decide.
++ */
++ memset(&data, 0, sizeof(data));
++ data.retrans = 3;
++ data.acregmin = 3;
++ data.acregmax = 60;
++ data.acdirmin = 30;
++ data.acdirmax = 60;
++ data.proto = IPPROTO_TCP;
++
++ bg = 0;
++ soft = 0;
++ intr = 0;
++ nocto = 0;
++ noac = 0;
++ retry = 10000; /* 10000 minutes ~ 1 week */
++
++ /*
++ * NFSv4 specifies that the default port should be 2049
++ */
++ port = NFS_PORT;
++
++ /* parse options */
++
++ for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
++ if ((opteq = strchr(opt, '='))) {
++ val = atoi(opteq + 1);
++ *opteq = '\0';
++ if (!strcmp(opt, "rsize"))
++ data.rsize = val;
++ else if (!strcmp(opt, "wsize"))
++ data.wsize = val;
++ else if (!strcmp(opt, "timeo"))
++ data.timeo = val;
++ else if (!strcmp(opt, "retrans"))
++ data.retrans = val;
++ else if (!strcmp(opt, "acregmin"))
++ data.acregmin = val;
++ else if (!strcmp(opt, "acregmax"))
++ data.acregmax = val;
++ else if (!strcmp(opt, "acdirmin"))
++ data.acdirmin = val;
++ else if (!strcmp(opt, "acdirmax"))
++ data.acdirmax = val;
++ else if (!strcmp(opt, "actimeo")) {
++ data.acregmin = val;
++ data.acregmax = val;
++ data.acdirmin = val;
++ data.acdirmax = val;
++ }
++ else if (!strcmp(opt, "retry"))
++ retry = val;
++ else if (!strcmp(opt, "port"))
++ port = val;
++ else if (!strcmp(opt, "proto")) {
++ if (!strncmp(opteq+1, "tcp", 3))
++ data.proto = IPPROTO_TCP;
++ else if (!strncmp(opteq+1, "udp", 3))
++ data.proto = IPPROTO_UDP;
++ else
++ printf(_("Warning: Unrecognized proto= option.\n"));
++ } else if (!strcmp(opt, "clientaddr")) {
++ if (strlen(opteq+1) >= sizeof(ip_addr))
++ printf(_("Invalid client address %s"),
++ opteq+1);
++ strncpy(ip_addr,opteq+1, sizeof(ip_addr));
++ ip_addr[sizeof(ip_addr)-1] = '\0';
++ } else if (!strcmp(opt, "sec")) {
++ if (!strncmp(opteq+1, "krb5i",5))
++ pseudoflavour = 390004;
++ else if (!strncmp(opteq+1, "krb5p",5))
++ pseudoflavour = 390005;
++ else if (!strncmp(opteq+1, "krb5",4))
++ pseudoflavour = 390003;
++ else {
++ printf(_("unknown security type %s\n"),
++ opteq+1);
++ goto fail;
++ }
++ } else if (!strcmp(opt, "addr")) {
++ /* ignore */;
++ } else {
++ printf(_("unknown nfs mount parameter: "
++ "%s=%d\n"), opt, val);
++ goto fail;
++ }
++ } else {
++ val = 1;
++ if (!strncmp(opt, "no", 2)) {
++ val = 0;
++ opt += 2;
++ }
++ if (!strcmp(opt, "bg"))
++ bg = val;
++ else if (!strcmp(opt, "fg"))
++ bg = !val;
++ else if (!strcmp(opt, "soft"))
++ soft = val;
++ else if (!strcmp(opt, "hard"))
++ soft = !val;
++ else if (!strcmp(opt, "intr"))
++ intr = val;
++ else if (!strcmp(opt, "cto"))
++ nocto = !val;
++ else if (!strcmp(opt, "ac"))
++ noac = !val;
++ else {
++ if (!sloppy) {
++ printf(_("unknown nfs mount option: "
++ "%s%s\n"), val ? "" : "no", opt);
++ goto fail;
++ }
++ }
++ }
++ }
++
++ data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
++ | (intr ? NFS4_MOUNT_INTR : 0)
++ | (nocto ? NFS4_MOUNT_NOCTO : 0)
++ | (noac ? NFS4_MOUNT_NOAC : 0);
++
++ if (pseudoflavour != 0) {
++ data.auth_flavourlen = 1;
++ data.auth_flavours = &pseudoflavour;
++ }
++
++ data.client_addr.data = ip_addr;
++ data.client_addr.len = strlen(ip_addr);
++
++ data.mnt_path.data = dirname;
++ data.mnt_path.len = strlen(dirname);
++
++ data.hostname.data = hostname;
++ data.hostname.len = strlen(hostname);
++ data.host_addr = (struct sockaddr *)&server_addr;
++ data.host_addrlen = sizeof(server_addr);
++
++#ifdef NFS_MOUNT_DEBUG
++ printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
++ data.rsize, data.wsize, data.timeo, data.retrans);
++ printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
++ data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
++ printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
++ port, bg, retry, data.flags);
++ printf("soft = %d, intr = %d, nocto = %d, noac = %d\n",
++ (data.flags & NFS4_MOUNT_SOFT) != 0,
++ (data.flags & NFS4_MOUNT_INTR) != 0,
++ (data.flags & NFS4_MOUNT_NOCTO) != 0,
++ (data.flags & NFS4_MOUNT_NOAC) != 0);
++ printf("proto = %s\n", (data.proto == IPPROTO_TCP) ? "tcp" : "udp");
++#endif
++
++ data.version = NFS4_MOUNT_VERSION;
++
++ *mount_opts = (char *) &data;
++ /* clean up */
++ return 0;
++
++fail:
++ return retval;
++}
+diff -puN mount/sundries.h~nfsv4 mount/sundries.h
+--- util-linux-2.11z/mount/sundries.h~nfsv4 2003-04-23 16:40:57.000000000 -0400
++++ util-linux-2.11z-bfields/mount/sundries.h 2003-04-23 16:40:57.000000000 -0400
+@@ -37,6 +37,8 @@ void die (int errcode, const char *fmt,
+ #ifdef HAVE_NFS
+ int nfsmount (const char *spec, const char *node, int *flags,
+ char **orig_opts, char **opt_args, int *version, int running_bg);
++int nfs4mount (const char *spec, const char *node, int *flags,
++ char **orig_opts, char **opt_args, int running_bg);
+ #endif
+
+ /* exit status - bits below are ORed */
+
+_
diff --git a/sys-apps/util-linux/files/util-linux-2.11z-agetty-domainname-option.patch b/sys-apps/util-linux/files/util-linux-2.11z-agetty-domainname-option.patch
new file mode 100644
index 0000000..d94d8b8
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.11z-agetty-domainname-option.patch
@@ -0,0 +1,69 @@
+--- util-linux-2.11z/login-utils/agetty.c 2002-07-29 09:36:42.000000000 +0200
++++ util-linux-2.11z.O/login-utils/agetty-with-dns.c 2003-07-13 04:24:01.000000000 +0200
+@@ -30,6 +30,7 @@
+ #include <getopt.h>
+ #include <time.h>
+ #include <sys/file.h>
++#include <netdb.h>
+ #include "xstrncpy.h"
+ #include "nls.h"
+
+@@ -122,6 +123,17 @@
+ #define BUFSIZ 1024
+ #endif
+
++/* set a maximum length for the hostname, */
++#ifdef HOST_NAME_MAX
++ /* defined by POSIX */
++ #define HOSTNAME_LENGTH HOST_NAME_MAX
++#elif defined(MAXHOSTNAMELEN)
++ /* implemented in current Unix-versions */
++ #define HOSTNAME_LENGTH MAXHOSTNAMELEN
++#else
++ #define HOSTNAME_LENGTH 500
++#endif
++
+ /*
+ * When multiple baud rates are specified on the command line, the first one
+ * we will try is the first one specified.
+@@ -878,7 +890,25 @@
+ printf ("%s", domainname);
+ }
+ break;
+-
++
++ case 'O':
++ {
++ char *domain = NULL;
++ char host[HOSTNAME_LENGTH + 1];
++ struct hostent *hp = NULL;
++
++ if (gethostname(host, HOSTNAME_LENGTH) || !(hp = gethostbyname(host))) {
++ domain = " unknown_domain";
++ } else {
++ /* get the substring after the first . */
++ domain = strchr(hp->h_name, '.');
++ if (domain == NULL)
++ domain = ".(none)";
++ }
++ printf("%s", ++domain);
++ }
++ break;
++
+ case 'd':
+ case 't':
+ {
+--- util-linux-2.11z/login-utils/agetty.8 1999-11-03 00:28:11.000000000 +0100
++++ util-linux-2.11z.O/login-utils/agetty-with-dns.8 2003-07-13 04:27:17.000000000 +0200
+@@ -217,7 +217,10 @@
+ Insert the nodename of the machine, also known as the hostname.
+ .TP
+ o
+-Insert the domainname of the machine.
++Insert the NIS domainname of the machine.
++.TP
++O
++Insert the DNS domainname of the machine.
+ .TP
+ r
+ Insert the release number of the OS, eg. 1.1.9.
diff --git a/sys-apps/util-linux/files/util-linux-2.11z-parallel-make.patch b/sys-apps/util-linux/files/util-linux-2.11z-parallel-make.patch
new file mode 100644
index 0000000..65c5166
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.11z-parallel-make.patch
@@ -0,0 +1,11 @@
+--- util-linux-2.11y/mount/Makefile.orig 2002-12-16 17:46:29.000000000 +0000
++++ util-linux-2.11y/mount/Makefile 2002-12-16 17:46:59.000000000 +0000
+@@ -78,7 +78,7 @@
+
+ sundries.o nfsmount.o nfsmount_xdr.o nfsmount_clnt.o: nfsmount.h
+
+-umount.o: mount_constants.h
++umount.o: mount_constants.h nfsmount.h
+
+ mount.o mount_by_label.o mount_guess_fstype.o: linux_fs.h
+
diff --git a/sys-apps/util-linux/files/util-linux-2.11z-pic.patch b/sys-apps/util-linux/files/util-linux-2.11z-pic.patch
new file mode 100644
index 0000000..53c5089
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.11z-pic.patch
@@ -0,0 +1,76 @@
+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
++ * 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) {
+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/files/util-linux-2.12-fat-LABEL-support.patch b/sys-apps/util-linux/files/util-linux-2.12-fat-LABEL-support.patch
new file mode 100644
index 0000000..0099bbf
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-fat-LABEL-support.patch
@@ -0,0 +1,319 @@
+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,7 +43,139 @@
+ #endif
+ }
+
+-/* for now, only ext2, ext3, xfs, ocfs 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;
++}
++
++
++/* for now, only ext2, ext3, xfs, ocfs, fat, fat32 are supported */
+ int
+ get_label_uuid(const char *device, char **label, char *uuid) {
+ int fd;
+@@ -54,8 +186,10 @@
+ struct jfs_super_block jfssb;
+ struct ocfs_volume_header ovh; /* Oracle */
+ struct ocfs_volume_label olbl;
++ 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.12-gcloop.patch b/sys-apps/util-linux/files/util-linux-2.12-gcloop.patch
new file mode 100644
index 0000000..97be88c
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-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, int 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, off, 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 *, int, const char *,
+- int, int *);
++ 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 ? strtoul(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.12-kernel-2.6.patch b/sys-apps/util-linux/files/util-linux-2.12-kernel-2.6.patch
new file mode 100644
index 0000000..3f03c55
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-kernel-2.6.patch
@@ -0,0 +1,87 @@
+diff -ruN util-linux-2.12.orig/disk-utils/blockdev.c util-linux-2.12/disk-utils/blockdev.c
+--- util-linux-2.12.orig/disk-utils/blockdev.c 2002-03-08 23:57:02.000000000 +0100
++++ util-linux-2.12/disk-utils/blockdev.c 2003-10-16 18:26:53.048373136 +0200
+@@ -9,6 +9,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
++#include <linux/version.h>
+
+ #include "nls.h"
+
+@@ -24,8 +25,13 @@
+ #define BLKRASET _IO(0x12,98)
+ #define BLKRAGET _IO(0x12,99)
+ #define BLKSSZGET _IO(0x12,104)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ #define BLKBSZGET _IOR(0x12,112,sizeof(int))
+ #define BLKBSZSET _IOW(0x12,113,sizeof(int))
++#else
++#define BLKBSZGET _IOR(0x12,112,int)
++#define BLKBSZSET _IOW(0x12,113,int)
++#endif
+ #endif
+
+ /* Maybe <linux/hdreg.h> could be included */
+diff -ruN util-linux-2.12.orig/disk-utils/elvtune.c util-linux-2.12/disk-utils/elvtune.c
+--- util-linux-2.12.orig/disk-utils/elvtune.c 2002-03-08 23:57:49.000000000 +0100
++++ util-linux-2.12/disk-utils/elvtune.c 2003-10-16 18:26:53.048373136 +0200
+@@ -26,6 +26,8 @@
+ #include <sys/ioctl.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <linux/version.h>
++
+ #include "nls.h"
+
+ /* this has to match with the kernel structure */
+@@ -37,8 +39,13 @@
+ int max_bomb_segments;
+ } blkelv_ioctl_arg_t;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ #define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
+ #define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
++#else
++#define BLKELVGET _IOR(0x12,106,blkelv_ioctl_arg_t)
++#define BLKELVSET _IOW(0x12,107,blkelv_ioctl_arg_t)
++#endif
+
+ static void
+ usage(void) {
+diff -ruN util-linux-2.12.orig/fdisk/common.h util-linux-2.12/fdisk/common.h
+--- util-linux-2.12.orig/fdisk/common.h 2003-07-13 15:59:53.000000000 +0200
++++ util-linux-2.12/fdisk/common.h 2003-10-16 18:29:11.365345760 +0200
+@@ -2,11 +2,18 @@
+
+ /* including <linux/fs.h> fails */
+ #include <sys/ioctl.h>
++#include <linux/version.h>
++
+ #define BLKRRPART _IO(0x12,95) /* re-read partition table */
+ #define BLKGETSIZE _IO(0x12,96) /* return device size */
+ #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
+ #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ #define BLKGETSIZE64 _IOR(0x12,114,8) /* 8 = sizeof(u64) */
++#else
++#define BLKGETSIZE64 _IOR(0x12,114,unsigned long long)
++#endif
+
+ /* including <linux/hdreg.h> also fails */
+ struct hd_geometry {
+diff -ruN util-linux-2.12.orig/mount/my_dev_t.h util-linux-2.12/mount/my_dev_t.h
+--- util-linux-2.12.orig/mount/my_dev_t.h 2003-07-16 22:05:50.000000000 +0200
++++ util-linux-2.12/mount/my_dev_t.h 2003-10-16 18:26:53.049372984 +0200
+@@ -4,4 +4,10 @@
+ /* for ancient systems use "unsigned short" */
+
+ #include <linux/posix_types.h>
++#include <linux/version.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+ #define my_dev_t __kernel_dev_t
++#else
++#define my_dev_t int
++#endif
diff --git a/sys-apps/util-linux/files/util-linux-2.12-mips-lseek.patch b/sys-apps/util-linux/files/util-linux-2.12-mips-lseek.patch
new file mode 100644
index 0000000..3fcd5b5
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-mips-lseek.patch
@@ -0,0 +1,24 @@
+Because there is no llseek defined for mips n32, we will use lseek instead.
+
+--- util-linux-2.12r/fdisk/sfdisk.c.orig
++++ util-linux-2.12r/fdisk/sfdisk.c
+@@ -172,7 +172,7 @@
+ * Note: we use 512-byte sectors here, irrespective of the hardware ss.
+ */
+ #undef use_lseek
+-#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__)
++#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__) || defined (__mips__)
+ #define use_lseek
+ #endif
+
+--- util-linux-2.12r/partx/partx.c.orig
++++ util-linux-2.12r/partx/partx.c
+@@ -333,7 +333,7 @@
+ /*
+ * sseek: seek to specified sector
+ */
+-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
++#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__) && !defined(__mips__)
+ #define NEED__llseek
+ #endif
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12-only-root-can-remount.patch b/sys-apps/util-linux/files/util-linux-2.12-only-root-can-remount.patch
new file mode 100644
index 0000000..2a1d44c
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-only-root-can-remount.patch
@@ -0,0 +1,11 @@
+--- util-linux-2.13-pre2/mount/umount.c
++++ util-linux-2.13-pre3/mount/umount.c
+@@ -707,7 +707,7 @@
+
+ if (getuid () != geteuid ()) {
+ suid = 1;
+- if (all || types || nomtab || force)
++ if (all || types || nomtab || force || remount)
+ die (2, _("umount: only root can do that"));
+ }
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12-selinux.diff.bz2 b/sys-apps/util-linux/files/util-linux-2.12-selinux.diff.bz2
new file mode 100644
index 0000000..6e5382b
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-selinux.diff.bz2
Binary files differ
diff --git a/sys-apps/util-linux/files/util-linux-2.12-swapon-unistd.patch b/sys-apps/util-linux/files/util-linux-2.12-swapon-unistd.patch
new file mode 100644
index 0000000..982ab1d
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12-swapon-unistd.patch
@@ -0,0 +1,11 @@
+--- mount/swapon.c.orig 2004-05-07 15:21:06.909712000 +0000
++++ mount/swapon.c 2004-05-07 15:21:28.319712000 +0000
+@@ -21,6 +21,7 @@
+ #include <mntent.h>
+ #include <errno.h>
+ #include <sys/stat.h>
++#include <unistd.h>
+ #include "swap_constants.h"
+ #include "swapargs.h"
+ #include "nls.h"
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12i-fat-LABEL-support.patch b/sys-apps/util-linux/files/util-linux-2.12i-fat-LABEL-support.patch
new file mode 100644
index 0000000..41b7139
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12i-fat-LABEL-support.patch
@@ -0,0 +1,69 @@
+--- mount-2.12-fat.patch.orig 2004-11-11 20:16:07.165232227 -0500
++++ mount-2.12-fat.patch 2004-11-11 20:18:47.717923660 -0500
+@@ -1,11 +1,10 @@
+ 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,7 +43,139 @@
+- #endif
++@@ -43,6 +43,137 @@
++ return rc;
+ }
+
+--/* for now, only ext2, ext3, xfs, ocfs are supported */
+ +/* Remove trailing spaces */
+ +static void remtrailspc(char *label) {
+ + char *c;
+@@ -137,29 +136,23 @@
+ + return -1;
+ +}
+ +
+-+
+-+/* for now, only ext2, ext3, xfs, ocfs, fat, fat32 are supported */
+- int
+- get_label_uuid(const char *device, char **label, char *uuid) {
+- int fd;
+-@@ -54,8 +186,10 @@
+- struct jfs_super_block jfssb;
+- struct ocfs_volume_header ovh; /* Oracle */
++ /*
++ * Get both label and uuid.
++ * For now, only ext2, ext3, xfs, ocfs, ocfs2, reiserfs are supported
++@@ -54,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;
+
+-- fd = open(device, O_RDONLY);
+-+ 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);
++@@ -111,6 +245,87 @@
+ }
+ rv = 0;
+-- }
+-+ } else if (lseek(fd, 0, SEEK_SET) == 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
+@@ -240,9 +233,9 @@
+ + rv = 0;
+ + }
+ + }
+-
+- close(fd);
+- return rv;
++ else if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET)
++ == REISERFS_DISK_OFFSET_IN_BYTES
++ && read(fd, (char *) &reiserfssb, sizeof(reiserfssb))
+ 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
diff --git a/sys-apps/util-linux/files/util-linux-2.12i-ignore-managed.patch b/sys-apps/util-linux/files/util-linux-2.12i-ignore-managed.patch
new file mode 100644
index 0000000..b6cb567
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12i-ignore-managed.patch
@@ -0,0 +1,11 @@
+--- util-linux-2.12a/mount/mount.c.sopwith 2004-03-04 20:28:22.000000000 -0500
++++ util-linux-2.12a/mount/mount.c 2004-07-16 16:50:18.792814782 -0400
+@@ -191,6 +191,8 @@
+ { "diratime", 0, 1, MS_NODIRATIME }, /* Update dir access times */
+ { "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
+ #endif
++ { "kudzu", 0, 0, 0 }, /* Silently remove this option (backwards compat use only) */
++ { "managed", 0, 0, 0 }, /* Silently remove this option */
+ { NULL, 0, 0, 0 }
+ };
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12i-nfsv4.patch b/sys-apps/util-linux/files/util-linux-2.12i-nfsv4.patch
new file mode 100644
index 0000000..864449b
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12i-nfsv4.patch
@@ -0,0 +1,456 @@
+diff -ur util-linux-2.12i.orig/mount/Makefile util-linux-2.12i/mount/Makefile
+--- util-linux-2.12i.orig/mount/Makefile 2004-11-11 20:03:33.032897551 -0500
++++ util-linux-2.12i/mount/Makefile 2004-11-11 20:04:38.279986828 -0500
+@@ -29,2 +29,4 @@
+
++NFS_OBJS += nfs4mount.o
++GEN_FILES += nfs4mount.c
+ all: $(PROGS)
+diff -ur util-linux-2.12i.orig/mount/mount.c util-linux-2.12i/mount/mount.c
+--- util-linux-2.12i.orig/mount/mount.c 2004-11-11 20:03:33.033897369 -0500
++++ util-linux-2.12i/mount/mount.c 2004-11-11 20:03:40.384555521 -0500
+@@ -810,6 +810,19 @@
+ "without support for the type `nfs'"));
+ #endif
+ }
++#ifdef HAVE_NFS
++ /*
++ * NFSv4 support
++ */
++ if (!fake && types && streq (types, "nfs4")) {
++ mnt_err = nfs4mount(spec, node, &flags, &extra_opts, &mount_opts, bg);
++ if (mnt_err)
++ return mnt_err;
++#else
++ die (EX_SOFTWARE, _("mount: this version was compiled "
++ "without support for the type `nfs4'"));
++#endif
++ }
+
+ block_signals (SIG_BLOCK);
+
+diff -ur util-linux-2.12i.orig/mount/sundries.h util-linux-2.12i/mount/sundries.h
+--- util-linux-2.12i.orig/mount/sundries.h 2004-11-11 20:03:33.034897186 -0500
++++ util-linux-2.12i/mount/sundries.h 2004-11-11 20:03:40.386555156 -0500
+@@ -37,6 +37,8 @@
+ #ifdef HAVE_NFS
+ int nfsmount (const char *spec, const char *node, int *flags,
+ char **orig_opts, char **opt_args, int *version, int running_bg);
++int nfs4mount (const char *spec, const char *node, int *flags,
++ char **orig_opts, char **opt_args, int running_bg);
+ #endif
+
+ /* exit status - bits below are ORed */
+diff -puN /dev/null mount/nfs4_mount.h
+--- /dev/null 2003-01-08 17:56:04.000000000 -0500
++++ util-linux-2.11z-bfields/mount/nfs4_mount.h 2003-04-23 16:40:57.000000000 -0400
+@@ -0,0 +1,82 @@
++#ifndef _LINUX_NFS4_MOUNT_H
++#define _LINUX_NFS4_MOUNT_H
++
++/*
++ * linux/include/linux/nfs4_mount.h
++ *
++ * Copyright (C) 2002 Trond Myklebust
++ *
++ * structure passed from user-space to kernel-space during an nfsv4 mount
++ */
++
++/*
++ * WARNING! Do not delete or change the order of these fields. If
++ * a new field is required then add it to the end. The version field
++ * tracks which fields are present. This will ensure some measure of
++ * mount-to-kernel version compatibility. Some of these aren't used yet
++ * but here they are anyway.
++ */
++#define NFS4_MOUNT_VERSION 1
++
++struct nfs_string {
++ unsigned int len;
++ const char* data;
++};
++
++struct nfs4_mount_data {
++ int version; /* 1 */
++ int flags; /* 1 */
++ int rsize; /* 1 */
++ int wsize; /* 1 */
++ int timeo; /* 1 */
++ int retrans; /* 1 */
++ int acregmin; /* 1 */
++ int acregmax; /* 1 */
++ int acdirmin; /* 1 */
++ int acdirmax; /* 1 */
++
++ /* see the definition of 'struct clientaddr4' in RFC3010 */
++ struct nfs_string client_addr; /* 1 */
++
++ /* Mount path */
++ struct nfs_string mnt_path; /* 1 */
++
++ /* Server details */
++ struct nfs_string hostname; /* 1 */
++ /* Server IP address */
++ unsigned int host_addrlen; /* 1 */
++ struct sockaddr* host_addr; /* 1 */
++
++ /* Transport protocol to use */
++ int proto; /* 1 */
++
++ /* Pseudo-flavours to use for authentication. See RFC2623 */
++ int auth_flavourlen; /* 1 */
++ int *auth_flavours; /* 1 */
++};
++
++/* bits in the flags field */
++/* Note: the fields that correspond to existing NFSv2/v3 mount options
++ * should mirror the values from include/linux/nfs_mount.h
++ */
++
++#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
++#define NFS4_MOUNT_INTR 0x0002 /* 1 */
++#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
++#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
++#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
++#define NFS4_MOUNT_FLAGMASK 0xFFFF
++
++/* pseudoflavors: */
++
++#define RPC_AUTH_GSS_KRB5 390003
++#define RPC_AUTH_GSS_KRB5I 390004
++#define RPC_AUTH_GSS_KRB5P 390005
++#define RPC_AUTH_GSS_LKEY 390006
++#define RPC_AUTH_GSS_LKEYI 390007
++#define RPC_AUTH_GSS_LKEYP 390008
++#define RPC_AUTH_GSS_SPKM 390009
++#define RPC_AUTH_GSS_SPKMI 390010
++#define RPC_AUTH_GSS_SPKMP 390011
++
++#endif
+diff -puN /dev/null mount/nfs4mount.c
+--- /dev/null 2003-01-08 17:56:04.000000000 -0500
++++ util-linux-2.11z-bfields/mount/nfs4mount.c 2003-04-23 17:28:54.000000000 -0400
+@@ -0,0 +1,323 @@
++/*
++ * nfs4mount.c -- Linux NFS mount
++ * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * Note: this file based on the original nfsmount.c
++ */
++
++#include "../defines.h" /* for HAVE_rpcsvc_nfs_prot_h and HAVE_inet_aton */
++
++#include <linux/posix_types.h>
++#include <asm/posix_types.h>
++#undef __FD_CLR
++#undef __FD_SET
++#undef __FD_ISSET
++#undef __FD_ZERO
++
++#include <unistd.h>
++#include <stdio.h>
++#include <string.h>
++#include <errno.h>
++#include <netdb.h>
++#include <time.h>
++#include <sys/socket.h>
++#include <sys/time.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++
++#include "sundries.h"
++
++#include "mount_constants.h"
++#include "nfs4_mount.h"
++
++#include "nls.h"
++
++#ifndef NFS_PORT
++#define NFS_PORT 2049
++#endif
++
++static int parse_devname(char *hostdir, char **hostname, char **dirname)
++{
++ char *s;
++
++ if (!(s = strchr(hostdir, ':'))) {
++ fprintf(stderr,
++ _("mount: "
++ "directory to mount not in host:dir format\n"));
++ return -1;
++ }
++ *hostname = hostdir;
++ *dirname = s + 1;
++ *s = '\0';
++ /* Ignore all but first hostname in replicated mounts
++ until they can be fully supported. (mack@sgi.com) */
++ if ((s = strchr(hostdir, ','))) {
++ *s = '\0';
++ fprintf(stderr,
++ _("mount: warning: "
++ "multiple hostnames not supported\n"));
++ }
++ return 0;
++}
++
++static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
++{
++ struct hostent *hp;
++ addr->sin_family = AF_INET;
++
++ if (inet_aton(hostname, &addr->sin_addr))
++ return 0;
++ if ((hp = gethostbyname(hostname)) == NULL) {
++ fprintf(stderr, _("mount: can't get address for %s\n"),
++ hostname);
++ return -1;
++ }
++ if (hp->h_length > sizeof(struct in_addr)) {
++ fprintf(stderr,
++ _("mount: got bad hp->h_length\n"));
++ hp->h_length = sizeof(struct in_addr);
++ }
++ memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
++ return 0;
++}
++
++static int get_my_ipv4addr(char *ip_addr, int len)
++{
++ char myname[1024];
++ struct sockaddr_in myaddr;
++
++ if (gethostname(myname, sizeof(myname))) {
++ fprintf(stderr, _("mount: can't determine client address\n"));
++ return -1;
++ }
++ if (fill_ipv4_sockaddr(myname, &myaddr))
++ return -1;
++ snprintf(ip_addr, len, "%s", inet_ntoa(myaddr.sin_addr));
++ ip_addr[len-1] = '\0';
++ return 0;
++}
++
++int nfs4mount(const char *spec, const char *node, int *flags,
++ char **extra_opts, char **mount_opts,
++ int running_bg)
++{
++ static struct nfs4_mount_data data;
++ static char hostdir[1024];
++ static char ip_addr[16] = "127.0.0.1";
++ static struct sockaddr_in server_addr;
++ static int pseudoflavour = 0;
++
++ char *hostname, *dirname, *old_opts;
++ char new_opts[1024];
++ char *opt, *opteq;
++ char *s;
++ int val;
++ int port, bg, soft, intr;
++ int nocto, noac;
++ int retry;
++ int retval;
++
++ retval = EX_FAIL;
++ if (strlen(spec) >= sizeof(hostdir)) {
++ fprintf(stderr, _("mount: "
++ "excessively long host:dir argument\n"));
++ goto fail;
++ }
++ strcpy(hostdir, spec);
++ if (parse_devname(hostdir, &hostname, &dirname))
++ goto fail;
++
++ if (fill_ipv4_sockaddr(hostname, &server_addr))
++ goto fail;
++ if (get_my_ipv4addr(ip_addr, sizeof(ip_addr)))
++ goto fail;
++
++ /* add IP address to mtab options for use when unmounting */
++ s = inet_ntoa(server_addr.sin_addr);
++ old_opts = *extra_opts;
++ if (!old_opts)
++ old_opts = "";
++ if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
++ fprintf(stderr, _("mount: "
++ "excessively long option argument\n"));
++ goto fail;
++ }
++ snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
++ old_opts, *old_opts ? "," : "", s);
++ *extra_opts = xstrdup(new_opts);
++
++ /* Set default options.
++ * rsize/wsize and timeo are left 0 in order to
++ * let the kernel decide.
++ */
++ memset(&data, 0, sizeof(data));
++ data.retrans = 3;
++ data.acregmin = 3;
++ data.acregmax = 60;
++ data.acdirmin = 30;
++ data.acdirmax = 60;
++ data.proto = IPPROTO_TCP;
++
++ bg = 0;
++ soft = 0;
++ intr = 0;
++ nocto = 0;
++ noac = 0;
++ retry = 10000; /* 10000 minutes ~ 1 week */
++
++ /*
++ * NFSv4 specifies that the default port should be 2049
++ */
++ port = NFS_PORT;
++
++ /* parse options */
++
++ for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
++ if ((opteq = strchr(opt, '='))) {
++ val = atoi(opteq + 1);
++ *opteq = '\0';
++ if (!strcmp(opt, "rsize"))
++ data.rsize = val;
++ else if (!strcmp(opt, "wsize"))
++ data.wsize = val;
++ else if (!strcmp(opt, "timeo"))
++ data.timeo = val;
++ else if (!strcmp(opt, "retrans"))
++ data.retrans = val;
++ else if (!strcmp(opt, "acregmin"))
++ data.acregmin = val;
++ else if (!strcmp(opt, "acregmax"))
++ data.acregmax = val;
++ else if (!strcmp(opt, "acdirmin"))
++ data.acdirmin = val;
++ else if (!strcmp(opt, "acdirmax"))
++ data.acdirmax = val;
++ else if (!strcmp(opt, "actimeo")) {
++ data.acregmin = val;
++ data.acregmax = val;
++ data.acdirmin = val;
++ data.acdirmax = val;
++ }
++ else if (!strcmp(opt, "retry"))
++ retry = val;
++ else if (!strcmp(opt, "port"))
++ port = val;
++ else if (!strcmp(opt, "proto")) {
++ if (!strncmp(opteq+1, "tcp", 3))
++ data.proto = IPPROTO_TCP;
++ else if (!strncmp(opteq+1, "udp", 3))
++ data.proto = IPPROTO_UDP;
++ else
++ printf(_("Warning: Unrecognized proto= option.\n"));
++ } else if (!strcmp(opt, "clientaddr")) {
++ if (strlen(opteq+1) >= sizeof(ip_addr))
++ printf(_("Invalid client address %s"),
++ opteq+1);
++ strncpy(ip_addr,opteq+1, sizeof(ip_addr));
++ ip_addr[sizeof(ip_addr)-1] = '\0';
++ } else if (!strcmp(opt, "sec")) {
++ if (!strncmp(opteq+1, "krb5i",5))
++ pseudoflavour = 390004;
++ else if (!strncmp(opteq+1, "krb5p",5))
++ pseudoflavour = 390005;
++ else if (!strncmp(opteq+1, "krb5",4))
++ pseudoflavour = 390003;
++ else {
++ printf(_("unknown security type %s\n"),
++ opteq+1);
++ goto fail;
++ }
++ } else if (!strcmp(opt, "addr")) {
++ /* ignore */;
++ } else {
++ printf(_("unknown nfs mount parameter: "
++ "%s=%d\n"), opt, val);
++ goto fail;
++ }
++ } else {
++ val = 1;
++ if (!strncmp(opt, "no", 2)) {
++ val = 0;
++ opt += 2;
++ }
++ if (!strcmp(opt, "bg"))
++ bg = val;
++ else if (!strcmp(opt, "fg"))
++ bg = !val;
++ else if (!strcmp(opt, "soft"))
++ soft = val;
++ else if (!strcmp(opt, "hard"))
++ soft = !val;
++ else if (!strcmp(opt, "intr"))
++ intr = val;
++ else if (!strcmp(opt, "cto"))
++ nocto = !val;
++ else if (!strcmp(opt, "ac"))
++ noac = !val;
++ else {
++ if (!sloppy) {
++ printf(_("unknown nfs mount option: "
++ "%s%s\n"), val ? "" : "no", opt);
++ goto fail;
++ }
++ }
++ }
++ }
++
++ data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
++ | (intr ? NFS4_MOUNT_INTR : 0)
++ | (nocto ? NFS4_MOUNT_NOCTO : 0)
++ | (noac ? NFS4_MOUNT_NOAC : 0);
++
++ if (pseudoflavour != 0) {
++ data.auth_flavourlen = 1;
++ data.auth_flavours = &pseudoflavour;
++ }
++
++ data.client_addr.data = ip_addr;
++ data.client_addr.len = strlen(ip_addr);
++
++ data.mnt_path.data = dirname;
++ data.mnt_path.len = strlen(dirname);
++
++ data.hostname.data = hostname;
++ data.hostname.len = strlen(hostname);
++ data.host_addr = (struct sockaddr *)&server_addr;
++ data.host_addrlen = sizeof(server_addr);
++
++#ifdef NFS_MOUNT_DEBUG
++ printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
++ data.rsize, data.wsize, data.timeo, data.retrans);
++ printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
++ data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
++ printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
++ port, bg, retry, data.flags);
++ printf("soft = %d, intr = %d, nocto = %d, noac = %d\n",
++ (data.flags & NFS4_MOUNT_SOFT) != 0,
++ (data.flags & NFS4_MOUNT_INTR) != 0,
++ (data.flags & NFS4_MOUNT_NOCTO) != 0,
++ (data.flags & NFS4_MOUNT_NOAC) != 0);
++ printf("proto = %s\n", (data.proto == IPPROTO_TCP) ? "tcp" : "udp");
++#endif
++
++ data.version = NFS4_MOUNT_VERSION;
++
++ *mount_opts = (char *) &data;
++ /* clean up */
++ return 0;
++
++fail:
++ return retval;
++}
diff --git a/sys-apps/util-linux/files/util-linux-2.12i-pic.patch b/sys-apps/util-linux/files/util-linux-2.12i-pic.patch
new file mode 100644
index 0000000..8fb91be
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12i-pic.patch
@@ -0,0 +1,59 @@
+diff -ur util-linux-2.12i.orig/fdisk/llseek.c util-linux-2.12i/fdisk/llseek.c
+--- util-linux-2.12i.orig/fdisk/llseek.c 2004-11-11 20:08:34.074942938 -0500
++++ util-linux-2.12i/fdisk/llseek.c 2004-11-11 20:09:43.040353443 -0500
+@@ -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>
+@@ -19,7 +22,9 @@
+
+ #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(__alpha__) || defined(__ia64__) || defined(__s390x__) \
++ || defined(__PIC__) || defined(__pic__)
+
+ #define my_llseek lseek
+
+diff -ur util-linux-2.12i.orig/fdisk/sfdisk.c util-linux-2.12i/fdisk/sfdisk.c
+--- util-linux-2.12i.orig/fdisk/sfdisk.c 2004-11-11 20:08:34.074942938 -0500
++++ util-linux-2.12i/fdisk/sfdisk.c 2004-11-11 20:11:07.242982424 -0500
+@@ -30,6 +30,7 @@
+ * 19990319 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> - i18n
+ * 20040428 - Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com> - added PACKED
+ * 20040824 - David A. Wheeler <dwheeler@dwheeler.com> - warnings to stderr
++ * 20030712 - Alexander Gabert <pappy@nikita.ath.cx> - adding PIC defines
+ */
+
+ #define PROGNAME "sfdisk"
+@@ -172,7 +173,9 @@
+ * Note: we use 512-byte sectors here, irrespective of the hardware ss.
+ */
+ #undef use_lseek
+-#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 (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__) \
++ || defined(__PIC__) && defined(__pic__)
+ #define use_lseek
+ #endif
+
+diff -ur util-linux-2.12i.orig/partx/partx.c util-linux-2.12i/partx/partx.c
+--- util-linux-2.12i.orig/partx/partx.c 2004-11-11 20:08:34.155928155 -0500
++++ util-linux-2.12i/partx/partx.c 2004-11-11 20:12:34.740010020 -0500
+@@ -333,7 +333,8 @@
+ /*
+ * sseek: seek to specified sector
+ */
+-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
++#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__) \
++ && !defined(__PIC__) && !defined(__pic__)
+ #define NEED__llseek
+ #endif
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12i-swapon-check-symlinks.patch b/sys-apps/util-linux/files/util-linux-2.12i-swapon-check-symlinks.patch
new file mode 100644
index 0000000..b9ed346
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12i-swapon-check-symlinks.patch
@@ -0,0 +1,33 @@
+--- util-linux-2.12b/mount/swapon.c.orig 2004-10-28 10:02:44.320023600 -0400
++++ util-linux-2.12b/mount/swapon.c 2004-10-28 10:02:14.384574000 -0400
+@@ -22,2 +22,3 @@
+ #include <stdlib.h>
++#include <sys/param.h>
+ #include <stdio.h>
+@@ -143,10 +144,26 @@
+ static int
+ is_in_proc_swaps(char *fname) {
+ int i;
++ struct stat fstatbuf;
+
+ for (i = 0; i < numSwaps; i++)
+ if (!strcmp(fname, swapFiles[i]))
+ return 1;
++
++ /* fallback:
++ * if the device in /etc/fstab is a symlink, the entry
++ * in /proc/swaps won't match because the kernel stores
++ * absolute pathnames. Here we compare dev_t's.
++ */
++ if (!lstat(fname, &fstatbuf))
++ if (S_ISLNK(fstatbuf.st_mode)) {
++ struct stat swapstatbuf;
++ for (i = 0; i < numSwaps; i++)
++ if (!stat(swapFiles[i], &swapstatbuf) && \
++ swapstatbuf.st_dev == fstatbuf.st_dev)
++ return 1;
++ }
++
+ return 0;
+ }
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12p-swapon-check-symlinks.patch b/sys-apps/util-linux/files/util-linux-2.12p-swapon-check-symlinks.patch
new file mode 100644
index 0000000..f421458
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12p-swapon-check-symlinks.patch
@@ -0,0 +1,34 @@
+--- util-linux-2.12b/mount/swapon.c
++++ util-linux-2.12b/mount/swapon.c
+@@ -7,2 +7,3 @@
+ #include <stdlib.h>
++#include <sys/param.h>
+ #include <stdio.h>
+@@ -137,10 +138,27 @@
+ static int
+ is_in_proc_swaps(const char *fname) {
+ int i;
++ struct stat fstatbuf;
+
+ for (i = 0; i < numSwaps; i++)
+ if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
+ return 1;
++
++ /* fallback:
++ * if the device in /etc/fstab is a symlink, the entry
++ * in /proc/swaps won't match because the kernel stores
++ * absolute pathnames. Here we compare dev_t's.
++ */
++ if (!lstat(fname, &fstatbuf))
++ if (S_ISLNK(fstatbuf.st_mode)) {
++ struct stat swapstatbuf;
++ stat(fname, &fstatbuf);
++ for (i = 0; i < numSwaps; i++)
++ if (swapFiles[i] && !stat(swapFiles[i], &swapstatbuf) && \
++ swapstatbuf.st_rdev == fstatbuf.st_rdev)
++ return 1;
++ }
++
+ return 0;
+ }
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-debian-10cfdisk.patch b/sys-apps/util-linux/files/util-linux-2.12q-debian-10cfdisk.patch
new file mode 100644
index 0000000..6105fb1
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-debian-10cfdisk.patch
@@ -0,0 +1,49 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10cfdisk.dpatch by LaMont Jones <lamont@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Buffer overruns with narrow terminal windows.
+
+@DPATCH@
+diff -urNad util-linux/fdisk/cfdisk.c /tmp/dpep.rEB26p/util-linux/fdisk/cfdisk.c
+--- util-linux/fdisk/cfdisk.c 2004-12-24 14:41:20.000000000 -0700
++++ /tmp/dpep.rEB26p/util-linux/fdisk/cfdisk.c 2004-12-24 15:00:00.503453740 -0700
+@@ -2100,7 +2100,7 @@
+ if (to_file) {
+ if ((fp = fopen(fname, "w")) == NULL) {
+ char errstr[LINE_LENGTH];
+- sprintf(errstr, _("Cannot open file '%s'"), fname);
++ snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
+ print_warning(errstr);
+ return;
+ }
+@@ -2184,7 +2184,7 @@
+ if (to_file) {
+ if ((fp = fopen(fname, "w")) == NULL) {
+ char errstr[LINE_LENGTH];
+- sprintf(errstr, _("Cannot open file '%s'"), fname);
++ snprintf(errstr, sizeof(errstr), _("Cannot open file '%s'"), fname);
+ print_warning(errstr);
+ return;
+ }
+@@ -2638,9 +2638,9 @@
+ mvaddstr(WARNING_START, 0, line);
+
+
+- sprintf(line, "cfdisk %s", VERSION);
++ snprintf(line, COLS+1, "cfdisk %s", VERSION);
+ mvaddstr(HEADER_START, (COLS-strlen(line))/2, line);
+- sprintf(line, _("Disk Drive: %s"), disk_device);
++ snprintf(line, COLS+1, _("Disk Drive: %s"), disk_device);
+ mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line);
+ {
+ long long bytes = actual_size*(long long) SECTOR_SIZE;
+@@ -2654,7 +2654,7 @@
+ bytes, megabytes/K, (10*megabytes/K)%10);
+ }
+ mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line);
+- sprintf(line, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
++ snprintf(line, COLS+1, _("Heads: %d Sectors per Track: %d Cylinders: %lld"),
+ heads, sectors, cylinders);
+ mvaddstr(HEADER_START+4, (COLS-strlen(line))/2, line);
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-dont-umask.patch b/sys-apps/util-linux/files/util-linux-2.12q-dont-umask.patch
new file mode 100644
index 0000000..704c258
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-dont-umask.patch
@@ -0,0 +1,17 @@
+Don't force umask to 022 or the -o umask option doesn't work.
+
+Patch by Daniel Drake.
+
+http://bugs.gentoo.org/93671
+
+--- mount/mount.c
++++ mount/mount.c
+@@ -1491,8 +1491,6 @@ main(int argc, char *argv[]) {
+ if ((p = strrchr(progname, '/')) != NULL)
+ progname = p+1;
+
+- umask(022);
+-
+ /* People report that a mount called from init without console
+ writes error messages to /etc/mtab
+ Let us try to avoid getting fd's 0,1,2 */
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-i18n-update.patch b/sys-apps/util-linux/files/util-linux-2.12q-i18n-update.patch
new file mode 100644
index 0000000..a47810c
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-i18n-update.patch
@@ -0,0 +1,10 @@
+DELACOUR Guillaume reports:
+i18n: Typo in french translation of mount error
+http://bugs.gentoo.org/show_bug.cgi?id=75693
+--- po/fr.po
++++ po/fr.po
+@@ -8358,3 +8358,3 @@
+ msgid "%s looks like swapspace - not mounted"
+-msgstr "%s ressemble à un esapce de swap - n'a pas été monté"
++msgstr "%s ressemble à un espace de swap - n'a pas été monté"
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-more-fake-checks-v2.patch b/sys-apps/util-linux/files/util-linux-2.12q-more-fake-checks-v2.patch
new file mode 100644
index 0000000..f598a8d
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-more-fake-checks-v2.patch
@@ -0,0 +1,40 @@
+> Running `mount -fv /mnt/pnt` incorrectly updates /etc/mtab
+
+This one is bogus.
+
+Manpage:
+
+=====
+-f Causes everything to be done except for the actual system call;
+ if it's not obvious, this ``fakes'' mounting the file system. This option
+ is useful in conjunction with the -v flag to determine what the mount
+ command is trying to do. It can also be used to add entries for devices that
+ were mounted earlier with the -n option.
+=====
+
+Also, we need it in /etc/init.d/checkroot to regen /etc/mtab ...
+
+
+=======================================================================
+Running `mount -afvt type` incorrectly warns that 'nothing was mounted'
+
+--- mount/mount.c
++++ mount/mount.c
+#@@ -659,7 +659,7 @@
+# if (verbose)
+# print_one (&mnt);
+#
+#- if (!nomtab && mtab_is_writable()) {
+#+ if (!fake && !nomtab && mtab_is_writable()) {
+# if (flags & MS_REMOUNT)
+# update_mtab (mnt.mnt_dir, &mnt);
+# else {
+@@ -1629,7 +1629,7 @@
+ case 0:
+ /* mount -a */
+ result = do_mount_all (types, options, test_opts);
+- if (result == 0 && verbose)
++ if (result == 0 && verbose && !fake)
+ error(_("nothing was mounted"));
+ break;
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-no-m68k-fdisk.patch b/sys-apps/util-linux/files/util-linux-2.12q-no-m68k-fdisk.patch
new file mode 100644
index 0000000..6d3334f
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-no-m68k-fdisk.patch
@@ -0,0 +1,15 @@
+Disable building fdisk on m68k
+
+--- fdisk/Makefile
++++ fdisk/Makefile
+@@ -18,8 +18,10 @@
+ endif
+ endif
+
++ifneq "$(ARCH)" "m68k"
+ SBIN:=$(SBIN) fdisk
+ MAN8:=$(MAN8) fdisk.8
++endif
+
+ ifneq "$(ARCH)" "sparc"
+ SBIN:=$(SBIN) $(CFDISK) sfdisk
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-umount-dont-write-mtab-with-remount.patch b/sys-apps/util-linux/files/util-linux-2.12q-umount-dont-write-mtab-with-remount.patch
new file mode 100644
index 0000000..2b8f4ad
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-umount-dont-write-mtab-with-remount.patch
@@ -0,0 +1,18 @@
+Make umount respect the -n option when using -r
+
+Patch by Derick Swanepoel
+
+http://bugs.gentoo.org/98675
+
+--- mount/umount.c
++++ mount/umount.c
+@@ -349,7 +349,8 @@
+ remnt.mnt_type = remnt.mnt_fsname = NULL;
+ remnt.mnt_dir = xstrdup(node);
+ remnt.mnt_opts = xstrdup("ro");
+- update_mtab(node, &remnt);
++ if (!nomtab && mtab_is_writable())
++ update_mtab(node, &remnt);
+ return 0;
+ } else if (errno != EBUSY) { /* hmm ... */
+ perror("remount");
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch b/sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch
new file mode 100644
index 0000000..aa921f5
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-update-mtab-when-moving.patch
@@ -0,0 +1,33 @@
+Running `mount --move /foo /bar` would leave the old /foo entry in /etc/mtab
+and create a new /bar entry with wrong info.
+
+http://bugs.gentoo.org/104697
+
+--- 1/mount/mount.c
++++ 2/mount/mount.c
+@@ -665,6 +665,25 @@
+ else {
+ mntFILE *mfp;
+
++ /* when moving a mount point, we have to make sure the mtab
++ * gets updated properly. We get info about the old mount
++ * point, copy it to the new mount point, and then delete
++ * the old mount point. */
++ if (flags & MS_MOVE) {
++ const char *olddir = mnt.mnt_fsname;
++ struct mntentchn *oldmc = oldmc = getmntfile(olddir);
++ if (oldmc != NULL) {
++ mnt.mnt_fsname = xstrdup(oldmc->m.mnt_fsname);
++ mnt.mnt_type = oldmc->m.mnt_type;
++ mnt.mnt_opts = oldmc->m.mnt_opts;
++ mnt.mnt_freq = oldmc->m.mnt_freq;
++ mnt.mnt_passno = oldmc->m.mnt_passno;
++ }
++ update_mtab(olddir, NULL);
++ if (oldmc != NULL)
++ my_free(olddir);
++ }
++
+ lock_mtab();
+ mfp = my_setmntent(MOUNTED, "a+");
+ if (mfp == NULL || mfp->mntent_fp == NULL) {
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-update_mtab-fixes.patch b/sys-apps/util-linux/files/util-linux-2.12q-update_mtab-fixes.patch
new file mode 100644
index 0000000..7e1c9db
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-update_mtab-fixes.patch
@@ -0,0 +1,68 @@
+This fixes a few issues with update_mtab():
+- If it is a remount, and only mnt_opts needs updating, mc->m.mnt_opts is set
+ to point to instead->mnt_opts, rather than allocating a new string, which
+ would cause a double free if the caller actually freed the passed mnt_opts,
+ as we free mc->m.mnt_opts before returning to the caller.
+- Mostly the same issue as above. If mtab does not contain the new entry, then
+ absent->m is set to point to instead, which would have cause a double free
+ if absent was inserted properly into the linked list, since we free all
+ elements of absent before returning to the caller.
+- If mtab does not contain the new entry, then only mc0->prev is updated to
+ point to absent, but not the old mc0->prev's nxt pointer. Because we then
+ use the nxt pointers to write the new mtab, absent is not added to the new
+ mtab.
+- If mtab is empty, absent->prev should be set to mc0, and not mc0->prev, as
+ it will be NULL.
+- Memory leak if we have to abort before mc0 and co are freed.
+
+Patch by Martin Schlemmer <azarah@gentoo.org>
+
+
+--- util-linux-2.12q/mount/fstab.c 2005-09-14 15:30:10.000000000 +0200
++++ util-linux-2.12q.az/mount/fstab.c 2005-09-14 15:31:48.000000000 +0200
+@@ -604,15 +604,32 @@ update_mtab (const char *dir, struct my_
+ free(mc);
+ }
+ } else {
+- /* A remount */
+- mc->m.mnt_opts = instead->mnt_opts;
++ /* A remount. */
++ my_free(mc->m.mnt_opts);
++ /* Need to alloc memory, else we might
++ * run into issues if both we and the caller frees
++ * mnt_opts ... */
++ mc->m.mnt_opts = xstrdup(instead->mnt_opts);
+ }
+ } else if (instead) {
+ /* not found, add a new entry */
+ absent = xmalloc(sizeof(*absent));
+- absent->m = *instead;
++ /* Cannot just set absent->m to instead, as we free absent
++ * below, and the caller might free instead */
++ absent->m.mnt_fsname = xstrdup(instead->mnt_fsname);
++ absent->m.mnt_dir = xstrdup(instead->mnt_dir);
++ absent->m.mnt_type = xstrdup(instead->mnt_type);
++ absent->m.mnt_opts = xstrdup(instead->mnt_opts);
++ absent->m.mnt_freq = instead->mnt_freq;
++ absent->m.mnt_passno = instead->mnt_passno;
++
+ absent->nxt = mc0;
+- absent->prev = mc0->prev;
++ if (mc0->prev != NULL) {
++ absent->prev = mc0->prev;
++ mc0->prev->nxt = absent;
++ } else {
++ absent->prev = mc0;
++ }
+ mc0->prev = absent;
+ if (mc0->nxt == NULL)
+ mc0->nxt = absent;
+@@ -624,6 +641,8 @@ update_mtab (const char *dir, struct my_
+ int errsv = errno;
+ error (_("cannot open %s (%s) - mtab not updated"),
+ MOUNTED_TEMP, strerror (errsv));
++ /* Do not leak memory */
++ discard_mntentchn(mc0);
+ goto leave;
+ }
+
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch b/sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch
new file mode 100644
index 0000000..5d0b436
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch
@@ -0,0 +1,16 @@
+Use update_mtab() to update /etc/mtab on fake mounts (mount -f), else we get
+dup entries in /etc/mtab.
+
+Patch by Mike Frysinger <vapier@gentoo.org>
+
+--- util-linux-2.12q/mount/mount.c 2005-09-14 15:37:43.000000000 +0200
++++ util-linux-2.12q.az/mount/mount.c 2005-09-14 15:27:14.000000000 +0200
+@@ -662,7 +662,7 @@ update_mtab_entry(const char *spec, cons
+ print_one (&mnt);
+
+ if (!nomtab && mtab_is_writable()) {
+- if (flags & MS_REMOUNT)
++ if (fake || (flags & MS_REMOUNT))
+ update_mtab (mnt.mnt_dir, &mnt);
+ else {
+ mntFILE *mfp;
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h-loop-aes.patch b/sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h-loop-aes.patch
new file mode 100644
index 0000000..8c5bbc7
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h-loop-aes.patch
@@ -0,0 +1,18 @@
+fix building when asm/page.h is not available
+
+http://bugs.gentoo.org/168278
+
+the loop-aes patch adds this ...
+
+--- mount/swapon.c
++++ mount/swapon.c
+@@ -31,7 +31,9 @@
+ #include <sys/ioctl.h>
+ #include <sys/utsname.h>
+ #include <sys/time.h>
++#ifdef HAVE_asm_page_h
+ #include <asm/page.h>
++#endif
+ #include "xmalloc.h"
+ #include "swap_constants.h"
+ #include "swapargs.h"
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h.patch b/sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h.patch
new file mode 100644
index 0000000..21c0470
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-HAVE_asm_page_h.patch
@@ -0,0 +1,16 @@
+fix building when asm/page.h is not available
+
+http://bugs.gentoo.org/168278
+
+--- disk-utils/fsck.cramfs.c
++++ disk-utils/fsck.cramfs.c
+@@ -76,7 +76,9 @@
+
+ #define PAD_SIZE 512
+
++#ifdef HAVE_asm_page_h
+ #include <asm/page.h>
++#endif
+ #ifdef PAGE_SIZE
+ #define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
+ #elif defined __ia64__
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch b/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch
new file mode 100644
index 0000000..073506e
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-cal-dumb-terminal.patch
@@ -0,0 +1,37 @@
+If you try to use cal on a terminal which doesnt support highlighting,
+Senter and Sexit will be set to NULL instead of "" which will cause the
+resulting output to be off:
+
+$ env TERM=dumb cal
+ December 2005
+Su Mo Tu We Th Fr Sa
+ 1 2 3
+ 4 5 6 7 8 9 10
+111 13 14 15 16 17
+18 19 20 21 22 23 24
+25 26 27 28 29 30 31
+
+http://bugs.gentoo.org/112406
+
+--- util-linux/misc-utils/cal.c
++++ util-linux/misc-utils/cal.c
+@@ -89,7 +89,8 @@
+
+ static char *
+ my_tgetstr(char *s, char *ss) {
+- return tigetstr(ss);
++ char *ret = tigetstr(ss);
++ return (ret == NULL ? "" : ret);
+ }
+
+ #elif defined(HAVE_termcap)
+@@ -112,7 +113,8 @@
+
+ static char *
+ my_tgetstr(char *s, char *ss) {
+- return tgetstr(s, &strbuf);
++ char *ret = tgetstr(s, &strbuf);
++ return (ret == NULL ? "" : ret);
+ }
+
+ #endif
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch b/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch
new file mode 100644
index 0000000..30bc7e0
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-cracklib-words.patch
@@ -0,0 +1,19 @@
+--- misc-utils/look.c
++++ misc-utils/look.c
+@@ -137,7 +137,15 @@
+ *++p = '\0';
+
+ if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
+- err("%s: %s", file, strerror(errno));
++ {
++ /* if opening the primary file failed, fall back to cracklib word files */
++ file = "/usr/share/dict/cracklib-words";
++ if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb)) {
++ file = "/usr/share/dict/cracklib-small";
++ if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
++ err("%s: %s\n\tplease emerge sys-apps/cracklib-words or sys-apps/miscfiles", file, strerror(errno));
++ }
++ }
+ front = mmap(NULL, (size_t) sb.st_size, PROT_READ,
+ #ifdef MAP_FILE
+ MAP_FILE |
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-fdisk-frame-pointers.patch b/sys-apps/util-linux/files/util-linux-2.12r-fdisk-frame-pointers.patch
new file mode 100644
index 0000000..1ad2916
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-fdisk-frame-pointers.patch
@@ -0,0 +1,12 @@
+--- fdisk/Makefile.orig 2005-10-15 14:30:56.000000000 +0000
++++ fdisk/Makefile 2005-10-15 14:33:02.000000000 +0000
+@@ -6,6 +6,9 @@
+ include ../make_include
+ include ../MCONFIG
+
++# fdisk when built with ssp and omiting -fomit-frame-pointer causes fdisk/cfdisk/sfdisk to not see the device
++CFLAGS += -fno-omit-frame-pointer
++
+ MAN8=
+ SBIN=
+ CFDISK=cfdisk
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-no-_syscall.patch b/sys-apps/util-linux/files/util-linux-2.12r-no-_syscall.patch
new file mode 100644
index 0000000..fb5ab38
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-no-_syscall.patch
@@ -0,0 +1,53 @@
+newer kernel headers stop exporting _syscall#() macro's, so let's insert
+some workarounds to handle this ...
+
+util-linux-2.13 doesnt use _syscall#() anymore
+
+http://bugs.gentoo.org/150852
+
+--- lib/my-syscall.h
++++ lib/my-syscall.h
+@@ -0,0 +1,12 @@
++#ifndef __MY_SYSCALL_H__
++#define __MY_SYSCALL_H__
++
++#ifndef _syscall5
++# define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++ return (type) syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5); \
++}
++#endif
++
++#endif
+--- fdisk/llseek.c
++++ fdisk/llseek.c
+@@ -10,6 +10,8 @@
+ #include <errno.h>
+ #include <unistd.h>
+
++#include "my-syscall.h"
++
+ extern long long ext2_llseek (unsigned int, long long, unsigned int);
+
+ #ifdef __linux__
+--- fdisk/sfdisk.c
++++ fdisk/sfdisk.c
+@@ -177,6 +177,7 @@
+ #endif
+
+ #ifndef use_lseek
++#include <my-syscall.h>
+ static __attribute__used
+ _syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
+ loff_t *, res, unsigned int, wh);
+--- partx/partx.c
++++ partx/partx.c
+@@ -339,6 +339,7 @@
+
+ #ifdef NEED__llseek
+ #include <linux/unistd.h> /* _syscall */
++#include "../lib/my-syscall.h"
+ static
+ _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
+ long long *, res, uint, wh);
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-umount-no-special.patch b/sys-apps/util-linux/files/util-linux-2.12r-umount-no-special.patch
new file mode 100644
index 0000000..2d2c1cf
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-umount-no-special.patch
@@ -0,0 +1,11 @@
+--- mount/umount.c
++++ mount/umount.c
+@@ -31,7 +31,7 @@
+ #include <arpa/inet.h>
+ #endif
+
+-#if defined(MNT_FORCE) && !defined(__sparc__) && !defined(__arm__)
++#if defined(MNT_FORCE)
+ /* Interesting ... it seems libc knows about MNT_FORCE and presumably
+ about umount2 as well -- need not do anything */
+ #else /* MNT_FORCE */
diff --git a/sys-apps/util-linux/files/util-linux-2.12r-umount-nosysfs.patch b/sys-apps/util-linux/files/util-linux-2.12r-umount-nosysfs.patch
new file mode 100644
index 0000000..eb0d405
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.12r-umount-nosysfs.patch
@@ -0,0 +1,11 @@
+--- util-linux-2.12r/mount/umount.c.orig 2006-03-03 11:29:57.000000000 -0500
++++ util-linux-2.12r/mount/umount.c 2006-03-03 11:30:07.000000000 -0500
+@@ -724,7 +724,7 @@
+ if (all) {
+ /* nodev stuff: sysfs, usbfs, oprofilefs, ... */
+ if (types == NULL)
+- types = "noproc,nodevfs,nodevpts";
++ types = "noproc,nodevfs,nodevpts,nosysfs";
+ result = umount_all (types, test_opts);
+ } else if (argc < 1) {
+ usage (stderr, 2);
diff --git a/sys-apps/util-linux/files/util-linux-2.13-ioprio-syscalls.patch b/sys-apps/util-linux/files/util-linux-2.13-ioprio-syscalls.patch
new file mode 100644
index 0000000..f558ff6
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-ioprio-syscalls.patch
@@ -0,0 +1,16 @@
+Just stub this cruft for crappy arches
+
+http://bugs.gentoo.org/190613
+
+--- schedutils/ionice.c
++++ schedutils/ionice.c
+@@ -39,7 +39,8 @@
+ # define __NR_ioprio_set 196
+ # define __NR_ioprio_get 218
+ # else
+-# error "Unsupported arch"
++# define __NR_ioprio_set -1
++# define __NR_ioprio_get -1
+ # endif
+
+ # define SYS_ioprio_get __NR_ioprio_get
diff --git a/sys-apps/util-linux/files/util-linux-2.13-locale.patch b/sys-apps/util-linux/files/util-linux-2.13-locale.patch
new file mode 100644
index 0000000..feb46f9
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-locale.patch
@@ -0,0 +1,121 @@
+http://bugs.gentoo.org/191111
+http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/614
+
+Move all locale/nls related includes to nls.h and make sure they are only
+pulled in when ENABLE_NLS. When !ENABLE_NLS, don't include any locale/nls
+related headers and stub out setlocale() as well.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/nls.h | 5 ++++-
+ misc-utils/cal.c | 1 -
+ misc-utils/look.c | 1 -
+ misc-utils/write.c | 1 -
+ text-utils/colrm.c | 2 +-
+ text-utils/more.c | 1 -
+ text-utils/pg.c | 2 --
+ 7 files changed, 5 insertions(+), 8 deletions(-)
+
+diff --git a/include/nls.h b/include/nls.h
+index f571ca5..e9f7927 100644
+--- a/include/nls.h
++++ b/include/nls.h
+@@ -9,6 +9,8 @@ int main(int argc, char *argv[]);
+
+ #ifdef ENABLE_NLS
+ # include <libintl.h>
++# include <locale.h>
++# include <nl_types.h>
+ # define _(Text) gettext (Text)
+ # ifdef gettext_noop
+ # define N_(String) gettext_noop (String)
+@@ -16,9 +18,10 @@ int main(int argc, char *argv[]);
+ # define N_(String) (String)
+ # endif
+ #else
+-# include <locale.h>
+ # undef bindtextdomain
+ # define bindtextdomain(Domain, Directory) /* empty */
++# undef setlocale
++# define setlocale(Category, Locale) /* empty */
+ # undef textdomain
+ # define textdomain(Domain) /* empty */
+ # define _(Text) (Text)
+diff --git a/misc-utils/cal.c b/misc-utils/cal.c
+index f5ede93..77333d8 100644
+--- a/misc-utils/cal.c
++++ b/misc-utils/cal.c
+@@ -63,7 +63,6 @@
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
+-#include <locale.h>
+ #include "errs.h"
+ #include "nls.h"
+
+diff --git a/misc-utils/look.c b/misc-utils/look.c
+index 5c7e30c..9e25596 100644
+--- a/misc-utils/look.c
++++ b/misc-utils/look.c
+@@ -59,7 +59,6 @@
+ #include <strings.h>
+ #include <ctype.h>
+ #include <getopt.h>
+-#include <locale.h>
+ #include "pathnames.h"
+ #include "nls.h"
+
+diff --git a/misc-utils/write.c b/misc-utils/write.c
+index b3c96d1..46b8f0a 100644
+--- a/misc-utils/write.c
++++ b/misc-utils/write.c
+@@ -54,7 +54,6 @@
+ #include <pwd.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <locale.h>
+ #include <signal.h>
+ #include <sys/param.h>
+ #include <sys/signal.h>
+diff --git a/text-utils/colrm.c b/text-utils/colrm.c
+index 5e18a6f..e8b1ea4 100644
+--- a/text-utils/colrm.c
++++ b/text-utils/colrm.c
+@@ -40,8 +40,8 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <locale.h>
+
++#include "nls.h"
+ #include "widechar.h"
+
+ /*
+diff --git a/text-utils/more.c b/text-utils/more.c
+index 19c4417..5dcae7b 100644
+--- a/text-utils/more.c
++++ b/text-utils/more.c
+@@ -55,7 +55,6 @@
+ #include <sys/file.h>
+ #include <sys/wait.h>
+ #include <a.out.h>
+-#include <locale.h>
+ #include "xstrncpy.h"
+ #include "nls.h"
+ #include "widechar.h"
+diff --git a/text-utils/pg.c b/text-utils/pg.c
+index 10bdd15..3e1b25e 100644
+--- a/text-utils/pg.c
++++ b/text-utils/pg.c
+@@ -49,8 +49,6 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <setjmp.h>
+-#include <locale.h>
+-#include <nl_types.h>
+ #include <libgen.h>
+
+ #ifdef HAVE_NCURSES_H
+--
+1.5.3.rc7
+
diff --git a/sys-apps/util-linux/files/util-linux-2.13-no-nls.patch b/sys-apps/util-linux/files/util-linux-2.13-no-nls.patch
new file mode 100644
index 0000000..f17debe
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-no-nls.patch
@@ -0,0 +1,11 @@
+--- include/nls.h
++++ include/nls.h
+@@ -17,6 +17,8 @@
+ # define bindtextdomain(Domain, Directory) /* empty */
+ # undef textdomain
+ # define textdomain(Domain) /* empty */
++# undef setlocale
++# define setlocale(category, locale) /* empty */
+ # define _(Text) (Text)
+ # define N_(Text) (Text)
+ #endif
diff --git a/sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch b/sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch
new file mode 100644
index 0000000..e8ed571
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-script-SIGWINCH.patch
@@ -0,0 +1,56 @@
+commit 2b8bbb5fb0f024ea3917fedbbbaf0fab1c1f6555
+Author: Karel Zak <kzak@redhat.com>
+Date: Fri Oct 5 12:22:13 2007 +0200
+
+ script: dies on SIGWINCH
+
+ The "doinput" process doesn't make a difference between SIGWINCH and
+ SIGCHILD. This process also sends unnecessary SIGWINCH to child (the
+ signal is ignored by child). Fixed.
+
+ Signed-off-by: Karel Zak <kzak@redhat.com>
+
+diff --git a/misc-utils/script.c b/misc-utils/script.c
+index d3272df..3b957d8 100644
+--- a/misc-utils/script.c
++++ b/misc-utils/script.c
+@@ -99,6 +99,7 @@ int tflg = 0;
+ static char *progname;
+
+ int die;
++int resized;
+
+ static void
+ die_if_link(char *fn) {
+@@ -235,8 +236,14 @@ doinput() {
+ if (die == 0 && child && kill(child, 0) == -1 && errno == ESRCH)
+ die = 1;
+
+- while (die == 0 && (cc = read(0, ibuf, BUFSIZ)) > 0)
+- (void) write(master, ibuf, cc);
++ while (die == 0) {
++ if ((cc = read(0, ibuf, BUFSIZ)) > 0)
++ (void) write(master, ibuf, cc);
++ else if (cc == -1 && errno == EINTR && resized)
++ resized = 0;
++ else
++ break;
++ }
+
+ done();
+ }
+@@ -255,11 +262,10 @@ finish(int dummy) {
+
+ void
+ resize(int dummy) {
++ resized = 1;
+ /* transmit window change information to the child */
+ (void) ioctl(0, TIOCGWINSZ, (char *)&win);
+ (void) ioctl(slave, TIOCSWINSZ, (char *)&win);
+-
+- kill(child, SIGWINCH);
+ }
+
+ /*
+
+
diff --git a/sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch b/sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch
new file mode 100644
index 0000000..a3758dd
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-setuid-checks.patch
@@ -0,0 +1,52 @@
+From: Ludwig Nussel <ludwig.nussel@suse.de>
+Date: Thu, 20 Sep 2007 12:57:20 +0000 (+0200)
+Subject: mount: doesn't drop privileges properly when calling helpers
+X-Git-Url: http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=ebbeb2c7ac1b00b6083905957837a271e80b187e
+
+mount: doesn't drop privileges properly when calling helpers
+
+{,u}mount calls setuid() and setgid() in the wrong order and doesn't checking
+the return value of set{u,g}id(() when running helpers like mount.nfs.
+
+Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+
+diff --git a/mount/mount.c b/mount/mount.c
+index 40699f3..5bc2b30 100644
+--- a/mount/mount.c
++++ b/mount/mount.c
+@@ -634,8 +634,12 @@ check_special_mountprog(const char *spec, const char *node, const char *type, in
+ char *oo, *mountargs[10];
+ int i = 0;
+
+- setuid(getuid());
+- setgid(getgid());
++ if(setgid(getgid()) < 0)
++ die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
++
++ if(setuid(getuid()) < 0)
++ die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
++
+ oo = fix_opts_string (flags, extra_opts, NULL);
+ mountargs[i++] = mountprog; /* 1 */
+ mountargs[i++] = (char *) spec; /* 2 */
+diff --git a/mount/umount.c b/mount/umount.c
+index b3100c9..3221619 100644
+--- a/mount/umount.c
++++ b/mount/umount.c
+@@ -102,8 +102,12 @@ check_special_umountprog(const char *spec, const char *node,
+ char *umountargs[8];
+ int i = 0;
+
+- setuid(getuid());
+- setgid(getgid());
++ if(setgid(getgid()) < 0)
++ die(EX_FAIL, _("umount: cannot set group id: %s"), strerror(errno));
++
++ if(setuid(getuid()) < 0)
++ die(EX_FAIL, _("umount: cannot set user id: %s"), strerror(errno));
++
+ umountargs[i++] = umountprog;
+ umountargs[i++] = xstrdup(node);
+ if (nomtab)
diff --git a/sys-apps/util-linux/files/util-linux-2.13-uclibc.patch b/sys-apps/util-linux/files/util-linux-2.13-uclibc.patch
new file mode 100644
index 0000000..237e126
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.13-uclibc.patch
@@ -0,0 +1,71 @@
+--- login-utils/agetty.c
++++ login-utils/agetty.c
+@@ -884,7 +884,7 @@
+
+ case 'o':
+ {
+- char domainname[HOST_NAME_MAX+1];
++ char domainname[HOSTNAME_LENGTH+1];
+ #ifdef HAVE_GETDOMAINNAME
+ if (getdomainname(domainname, sizeof(domainname)))
+ #endif
+@@ -897,7 +897,7 @@
+ case 'O':
+ {
+ char *dom = "unknown_domain";
+- char host[HOST_NAME_MAX + 1];
++ char host[HOSTNAME_LENGTH + 1];
+ struct addrinfo hints, *info = NULL;
+
+ memset(&hints, 0, sizeof(hints));
+@@ -992,7 +992,7 @@
+ }
+ #endif
+ {
+- char hn[HOST_NAME_MAX+1];
++ char hn[HOSTNAME_LENGTH+1];
+ if (gethostname(hn, sizeof(hn)) == 0)
+ write(1, hn, strlen(hn));
+ }
+--- configure
++++ configure
+@@ -7663,7 +7663,10 @@
+ main ()
+ {
+
+-int test = SYS_sched_getaffinity;
++#if defined(__UCLIBC__) && __UCLIBC_SUBLEVEL__ <= 28
++#error taskset unusable
++#endif
++int test = SYS_sched_getaffinity;
+
+ ;
+ return 0;
+--- sys-utils/setarch.c
++++ sys-utils/setarch.c
+@@ -39,6 +39,10 @@
+ #include <sys/utsname.h>
+ #include "nls.h"
+
++#if defined(__UCLIBC__) && __UCLIBC_SUBLEVEL__ <= 28
++static const char *program_invocation_short_name;
++#endif
++
+ #define set_pers(pers) ((long)syscall(SYS_personality, pers))
+
+ struct {
+@@ -184,6 +188,14 @@
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
++#if defined(__UCLIBC__) && __UCLIBC_SUBLEVEL__ <= 28
++ program_invocation_short_name = strrchr(argv[0],'/');
++ if (program_invocation_short_name)
++ program_invocation_short_name++;
++ else
++ program_invocation_short_name = argv[0];
++#endif
++
+ if (argc < 1)
+ show_usage(_("Not enough arguments"));
+
diff --git a/sys-apps/util-linux/files/util-linux-no-kill.patch b/sys-apps/util-linux/files/util-linux-no-kill.patch
new file mode 100644
index 0000000..bd4638b
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-no-kill.patch
@@ -0,0 +1,23 @@
+diff -urN util-linux-2.11z.old/misc-utils/Makefile util-linux-2.11z/misc-utils/Makefile
+--- util-linux-2.11z.old/misc-utils/Makefile 2002-11-02 05:51:02.000000000 -0800
++++ util-linux-2.11z/misc-utils/Makefile 2003-12-06 20:02:28.000000000 -0800
+@@ -34,11 +34,6 @@
+ MAN1:=$(MAN1) write.1
+ endif
+
+-ifeq "$(HAVE_KILL)" "no"
+-BIN:=$(BIN) kill
+-MAN1:=$(MAN1) kill.1
+-endif
+-
+ ifeq "$(HAVE_NCURSES)" "yes"
+ USRBIN:=$(USRBIN) setterm
+ MAN1:=$(MAN1) setterm.1
+@@ -81,7 +76,6 @@
+ cal: cal.o $(ERR_O)
+ chkdupexe: chkdupexe.pl
+ ddate: ddate.o
+-kill: kill.o procs.o
+ logger: logger.o
+ mcookie: mcookie.o $(LIB)/md5.o
+ mcookie.o: mcookie.c $(LIB)/md5.h
diff --git a/sys-apps/util-linux/util-linux-2.12r-r9.ebuild b/sys-apps/util-linux/util-linux-2.12r-r9.ebuild
new file mode 100644
index 0000000..bfc4b97
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.12r-r9.ebuild
@@ -0,0 +1,212 @@
+# Copyright 1999-2007 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.12r-r8.ebuild,v 1.8 2007/10/12 15:14:07 dertobi123 Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+OLD_CRYPT_VER=2.12i
+LOOP_AES_VER=3.1f
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+SRC_URI="mirror://kernel/linux/utils/${PN}/${P}.tar.bz2
+ old-crypt? (
+ mirror://kernel/linux/utils/${PN}/${PN}-${OLD_CRYPT_VER}.tar.gz
+ mirror://gentoo/util-linux-${OLD_CRYPT_VER}-cryptoapi-losetup.patch.bz2
+ )
+ crypt? ( http://loop-aes.sourceforge.net/loop-AES/loop-AES-v${LOOP_AES_VER}.tar.bz2 )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="crypt old-crypt nls static selinux perl"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+ >=sys-fs/e2fsprogs-1.34
+ selinux? ( sys-libs/libselinux )
+ crypt? ( app-crypt/hashalot )
+ perl? ( dev-lang/perl )
+ amd64? ( sys-apps/setarch )
+ mips? ( sys-apps/setarch )
+ ppc? ( sys-apps/setarch )
+ ppc64? ( sys-apps/setarch )
+ sparc? ( sys-apps/setarch )
+ !sys-apps/more"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+OLD_CRYPT_P=${WORKDIR}/${PN}-${OLD_CRYPT_VER}
+
+yesno() { useq $1 && echo yes || echo no; }
+
+src_unpack() {
+ unpack ${A}
+
+ # Old crypt support
+ if use old-crypt ; then
+ cd "${OLD_CRYPT_P}"
+ ewarn "You should update your system as USE=old-crypt"
+ ewarn "support will be dropped in future versions."
+ epatch "${WORKDIR}"/util-linux-${OLD_CRYPT_VER}-cryptoapi-losetup.patch
+ fi
+
+ cd "${S}"
+
+ sed -i '/LDFLAGS.*-s/d' configure #191112
+
+ # crypto support
+ use crypt && epatch "${WORKDIR}"/loop-AES-v${LOOP_AES_VER}/${P}.diff
+
+ # Fall back to cracklib if default words file doesnt exist #114416
+ epatch "${FILESDIR}"/${PN}-2.12r-cracklib-words.patch
+
+ # Fix rare failures with -j4 or higher
+ epatch "${FILESDIR}"/${PN}-2.11z-parallel-make.patch
+
+ # Fix -f usage with -a and in general
+ epatch "${FILESDIR}"/${PN}-2.12q-more-fake-checks-v2.patch
+
+ # Fix mtab updates with `mount --move /foo /bar` #104697
+ epatch "${FILESDIR}"/${PN}-2.12q-update-mtab-when-moving.patch
+
+ # Respect -n with -r and umount #98675
+ epatch "${FILESDIR}"/${PN}-2.12q-umount-dont-write-mtab-with-remount.patch
+
+ # A few fixes to beat update_mtab() into submission.
+ epatch "${FILESDIR}"/${PN}-2.12q-update_mtab-fixes.patch
+
+ # Use update_mtab() to avoid dups in mtab for 'mount -f'
+ epatch "${FILESDIR}"/${PN}-2.12q-use-update_mtab-for-fake.patch
+
+ # Fix unreadable df output when using devfs ... this check is kind of
+ # a hack, but whatever, the output isnt critical at all :P
+ [[ -e /dev/.devfsd ]] && epatch "${FILESDIR}"/no-symlink-resolve.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.
+ epatch "${FILESDIR}"/${PN}-2.11z-agetty-domainname-option.patch
+
+ # Fix french translation typo #75693
+ epatch "${FILESDIR}"/${PN}-2.12q-i18n-update.patch
+
+ # Add NFS4 support (kernel 2.5/2.6)
+ epatch "${FILESDIR}"/${PN}-2.12i-nfsv4.patch
+
+ # ignore managed/kudzu options #70873
+ epatch "${FILESDIR}"/${PN}-2.12i-ignore-managed.patch
+
+ # swapon gets confused by symlinks in /dev #69162
+ epatch "${FILESDIR}"/${PN}-2.12p-swapon-check-symlinks.patch
+
+ # fix simple buffer overflow (from Debian)
+ epatch "${FILESDIR}"/${PN}-2.12q-debian-10cfdisk.patch
+
+ # don't build fdisk on m68k
+ epatch "${FILESDIR}"/${PN}-2.12q-no-m68k-fdisk.patch
+
+ # don't force umask to 022 #93671
+ epatch "${FILESDIR}"/${PN}-2.12q-dont-umask.patch
+
+ # fix cal display when using featureless terminals #112406
+ epatch "${FILESDIR}"/${PN}-2.12r-cal-dumb-terminal.patch
+
+ # Bug #108988 unable to always seek when omiting frame pointers
+ epatch "${FILESDIR}"/${PN}-2.12r-fdisk-frame-pointers.patch
+
+ # don't treat sparc/arm specially
+ epatch "${FILESDIR}"/${PN}-2.12r-umount-no-special.patch
+
+ # Patches from Fedora
+ epatch "${FILESDIR}"/${PN}-2.12r-umount-nosysfs.patch
+
+ # fix mips n32 (no llseek syscall)
+ epatch "${FILESDIR}"/${PN}-2.12-mips-lseek.patch
+
+ epatch "${FILESDIR}"/${PN}-2.13-setuid-checks.patch
+ epatch "${FILESDIR}"/${PN}-2.12r-no-_syscall.patch #150852
+ epatch "${FILESDIR}"/${PN}-2.12r-HAVE_asm_page_h.patch #168278
+ use crypt && epatch "${FILESDIR}"/${PN}-2.12r-HAVE_asm_page_h-loop-aes.patch
+
+#SDS
+ epatch "${FILESDIR}"/agetty-ds-x509-v2.patch || die
+#EDS
+
+ # Enable random features
+ local mconfigs="MCONFIG"
+ use old-crypt && mconfigs="${mconfigs} ${OLD_CRYPT_P}/MCONFIG"
+ sed -i \
+ -e "/^HAVE_SELINUX=/s:no:$(yesno selinux):" \
+ -e "/^DISABLE_NLS=/s:no:$(yesno !nls):" \
+ -e "/^HAVE_KILL=/s:no:yes:" \
+ -e "/^HAVE_SLN=/s:no:yes:" \
+ -e "/^HAVE_TSORT/s:no:yes:" \
+ -e "s:-pipe -O2 \$(CPUOPT) -fomit-frame-pointer:${CFLAGS}:" \
+ -e "s:CPU=.*:CPU=${CHOST%%-*}:" \
+ -e "s:SUIDMODE=.*4755:SUIDMODE=4711:" \
+ ${mconfigs} || die "MCONFIG sed"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ export CC="$(tc-getCC)"
+
+ econf || die "configure failed"
+ emake || die "emake failed"
+
+ cd partx
+ has_version '>=sys-kernel/linux-headers-2.6' && \
+ has_version '<sys-kernel/linux-headers-2.6.18' \
+ && append-flags -include linux/compiler.h
+ emake CFLAGS="${CFLAGS}" || die "make partx failed"
+
+ if use old-crypt ; then
+ cd "${OLD_CRYPT_P}"
+ econf || die "old configure failed"
+ emake -C lib || die "old lib failed"
+ emake -C mount losetup mount || die "old make failed"
+ fi
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "install failed"
+ dosym ../man8/agetty.8 /usr/share/man/man1/getty.1
+ dosbin partx/{addpart,delpart,partx} || die "dosbin"
+ use perl || rm -f "${D}"/usr/bin/chkdupexe
+ # required by autotools
+ dosym /bin/arch /usr/bin/arch
+
+ if use crypt || use old-crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop
+ fi
+
+ # man-pages installs renice(1p) but util-linux does renice(8)
+ dosym ../man8/renice.8 /usr/share/man/man1/renice.1
+ # nfs-utils provides nfs(5) now
+ rm "${D}"/usr/share/man/man5/nfs.5 || die
+
+ dodoc HISTORY MAINTAINER README VERSION
+ docinto examples
+ dodoc example.files/*
+
+ if use old-crypt ; then
+ cd "${OLD_CRYPT_P}"/mount
+ into /
+ newbin mount mount-old-crypt || die
+ newbin losetup losetup-old-crypt || die
+ fperms 4711 /bin/{mount,losetup}-old-crypt
+ fi
+}
+
+pkg_postinst() {
+ if ! use old-crypt && use crypt ; then
+ ewarn "This version of util-linux includes crypto support"
+ ewarn "for loop-aes instead of the old cryptoapi."
+ ewarn "If you need the older support, please re-emerge"
+ ewarn "util-linux with USE=old-crypt. This will create"
+ ewarn "/sbin/mount-old-crypt and /sbin/losetup-old-crypt."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.13.1.1-r1.ebuild b/sys-apps/util-linux/util-linux-2.13.1.1-r1.ebuild
new file mode 100644
index 0000000..eb6a789
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.13.1.1-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2008 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.13.1.1.ebuild,v 1.7 2008/04/28 17:01:56 dertobi123 Exp $
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git"
+inherit eutils
+[[ ${PV} == "9999" ]] && inherit git
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-ng-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux-ng/"
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+else
+ SRC_URI="http://www.kernel.org/pub/linux/utils/util-linux-ng/v${PV:0:4}/${MY_P}.tar.bz2
+ loop-aes? ( http://loop-aes.sourceforge.net/loop-AES/loop-AES-v3.2c.tar.bz2 )"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="crypt loop-aes nls old-linux selinux slang unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ >=sys-libs/ncurses-5.2-r2
+ >=sys-fs/e2fsprogs-1.34
+ selinux? ( sys-libs/libselinux )
+ slang? ( sys-libs/slang )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git_src_unpack
+ cd "${S}"
+ ./autogen.sh || die
+ else
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-2.13-uclibc.patch #203711
+ use loop-aes && epatch "${WORKDIR}"/loop-AES-*/util-linux-ng-*.diff
+ use unicode && sed -i 's:-lncurses:-lncursesw:' */Makefile.in #208976
+ epatch "${FILESDIR}"/${PN}-2.13-ioprio-syscalls.patch #190613
+ fi
+
+#SDS
+ epatch "${FILESDIR}"/agetty-ds-x509-v2.patch || die
+#EDS
+}
+
+src_compile() {
+ econf \
+ --with-fsprobe=blkid \
+ $(use_enable nls) \
+ --enable-agetty \
+ --enable-cramfs \
+ $(use_enable old-linux elvtune) \
+ --disable-init \
+ --disable-kill \
+ --disable-last \
+ --disable-mesg \
+ --enable-partx \
+ --enable-raw \
+ --enable-rdev \
+ --enable-rename \
+ --disable-reset \
+ --disable-login-utils \
+ --enable-schedutils \
+ --disable-wall \
+ --enable-write \
+ --without-pam \
+ $(use_with selinux) \
+ $(use_with slang) \
+ || die "configure failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS NEWS README* TODO docs/*
+
+ if use crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die
+ fi
+}
+
+pkg_postinst() {
+ ewarn "USE=crypt has been changed to USE=loop-aes. If you need"
+ ewarn "support for it, make sure to update your USE accordingly."
+}
diff --git a/sys-apps/util-linux/util-linux-2.14.2-r1.ebuild b/sys-apps/util-linux/util-linux-2.14.2-r1.ebuild
new file mode 100644
index 0000000..edc3b9c
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.14.2-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2009 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.14.2.ebuild,v 1.3 2009/02/15 00:21:10 vapier Exp $
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git"
+inherit eutils
+[[ ${PV} == "9999" ]] && inherit git
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-ng-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux-ng/"
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+else
+ SRC_URI="mirror://kernel/linux/utils/util-linux-ng/v${PV:0:4}/${MY_P}.tar.bz2
+ loop-aes? ( http://loop-aes.sourceforge.net/updates/util-linux-ng-2.14.2-20090214.diff.bz2 )"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
+IUSE="crypt loop-aes nls old-linux selinux slang uclibc unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ >=sys-libs/ncurses-5.2-r2
+ >=sys-libs/e2fsprogs-libs-1.41
+ selinux? ( sys-libs/libselinux )
+ slang? ( sys-libs/slang )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git_src_unpack
+ cd "${S}"
+ ./autogen.sh || die
+ else
+ unpack ${A}
+ cd "${S}"
+ #epatch "${FILESDIR}"/${PN}-2.13-uclibc.patch #203711
+ use loop-aes && epatch "${WORKDIR}"/util-linux-ng-*.diff
+ fi
+ use uclibc && sed -i -e s/versionsort/alphasort/g -e s/strverscmp.h/dirent.h/g mount/lomount.c
+
+#SDS
+ epatch "${FILESDIR}"/agetty-ds-x509-v2.patch || die
+#EDS
+}
+
+src_compile() {
+ econf \
+ --with-fsprobe=blkid \
+ $(use_enable nls) \
+ --enable-agetty \
+ --enable-cramfs \
+ $(use_enable old-linux elvtune) \
+ --disable-init \
+ --disable-kill \
+ --disable-last \
+ --disable-mesg \
+ --enable-partx \
+ --enable-raw \
+ --enable-rdev \
+ --enable-rename \
+ --disable-reset \
+ --disable-login-utils \
+ --enable-schedutils \
+ --disable-wall \
+ --enable-write \
+ --without-pam \
+ $(use unicode || echo --with-ncurses) \
+ $(use_with selinux) \
+ $(use_with slang) \
+ || die "configure failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS NEWS README* TODO docs/*
+
+ if use crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die
+ fi
+}
+
+pkg_postinst() {
+ ewarn "The loop-aes code has been split out of USE=crypt and into USE=loop-aes."
+ ewarn "If you need support for it, make sure to update your USE accordingly."
+}
diff --git a/sys-apps/util-linux/util-linux-2.16.2-r1.ebuild b/sys-apps/util-linux/util-linux-2.16.2-r1.ebuild
new file mode 100644
index 0000000..ec9ad5c
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.16.2-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2010 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.16.2.ebuild,v 1.5 2010/01/27 04:00:24 jer Exp $
+
+EAPI="2"
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git"
+inherit eutils toolchain-funcs libtool
+[[ ${PV} == "9999" ]] && inherit git autotools
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-ng-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux-ng/"
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/linux/utils/util-linux-ng/v${PV:0:4}/${MY_P}.tar.bz2
+ loop-aes? ( http://dev.gentoo.org/~ssuominen/${PN}-2.16.1-loop-aes.patch.bz2 )"
+ KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="crypt loop-aes nls old-linux perl selinux slang uclibc unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ >=sys-libs/ncurses-5.2-r2
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ perl? ( dev-lang/perl )
+ selinux? ( sys-libs/libselinux )
+ slang? ( sys-libs/slang )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+src_prepare() {
+#SDS
+ epatch "${FILESDIR}"/agetty-ds-x509-v2.patch || die
+#EDS
+
+ if [[ ${PV} == "9999" ]] ; then
+ autopoint --force
+ eautoreconf
+ else
+ use loop-aes && epatch "${WORKDIR}"/${PN}-2.16.1-loop-aes.patch
+ fi
+ use uclibc && sed -i -e s/versionsort/alphasort/g -e s/strverscmp.h/dirent.h/g mount/lomount.c
+ elibtoolize
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ --enable-agetty \
+ --enable-cramfs \
+ $(use_enable old-linux elvtune) \
+ --disable-init \
+ --disable-kill \
+ --disable-last \
+ --disable-mesg \
+ --enable-partx \
+ --enable-raw \
+ --enable-rdev \
+ --enable-rename \
+ --disable-reset \
+ --disable-login-utils \
+ --enable-schedutils \
+ --disable-wall \
+ --enable-write \
+ --without-pam \
+ $(use unicode || echo --with-ncurses) \
+ $(use_with selinux) \
+ $(use_with slang) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS NEWS README* TODO docs/*
+
+ if ! use perl ; then #284093
+ rm "${D}"/usr/bin/chkdupexe || die
+ rm "${D}"/usr/share/man/man1/chkdupexe.1 || die
+ fi
+
+ # need the libs in /
+ gen_usr_ldscript -a blkid uuid
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ rm -f "${D}"/usr/$(get_libdir)/*.la
+
+ if use crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die
+ fi
+}