summaryrefslogtreecommitdiff
path: root/source/a
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2013-11-04 17:08:47 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 22:57:36 +0200
commit76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (patch)
tree9b98e6e193c7870cb27ac861394c1c4592850922 /source/a
parent9664bee729d487bcc0a0bc35859f8e13d5421c75 (diff)
downloadcurrent-76fc4757ac91ac7947a01fb7b53dddf9a78a01d1.tar.gz
Slackware 14.1slackware-14.1
Mon Nov 4 17:08:47 UTC 2013 Slackware 14.1 x86_64 stable is released! It's been another interesting release cycle here at Slackware bringing new features like support for UEFI machines, updated compilers and development tools, the switch from MySQL to MariaDB, and many more improvements throughout the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to 'source/a')
-rwxr-xr-xsource/a/aaa_base/aaa_base.SlackBuild6
-rw-r--r--source/a/aaa_base/os-release8
-rw-r--r--source/a/aaa_base/slackware-version2
-rwxr-xr-xsource/a/aaa_elflibs/aaa_elflibs.SlackBuild6
-rw-r--r--source/a/aaa_elflibs/symlinks-to-tracked-libs3
-rw-r--r--source/a/aaa_elflibs/tracked-files1
-rw-r--r--source/a/acpid/slack-desc2
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-03847
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-03958
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-04056
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-04147
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-04257
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-04365
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-04470
-rw-r--r--source/a/bash/bash-4.2-patches/bash42-04553
-rwxr-xr-xsource/a/btrfs-progs/btrfs-progs.SlackBuild12
-rw-r--r--source/a/btrfs-progs/fsck.btrfs57
-rw-r--r--source/a/cups/cups-1.5.4-usb-quirks.diff319
-rw-r--r--source/a/cups/cups-blacklist-usblp.conf10
-rwxr-xr-xsource/a/cups/cups.SlackBuild11
-rw-r--r--source/a/cups/usb-backend-reset-after-job-only-for-specific-devices.patch74
-rwxr-xr-xsource/a/cxxlibs/cxxlibs.SlackBuild4
-rw-r--r--source/a/dbus/dbus-1.6.x-allow_root_globally.diff (renamed from source/a/dbus/dbus-1.4.x-allow_root_globally.diff)6
-rwxr-xr-xsource/a/dbus/dbus.SlackBuild4
-rwxr-xr-xsource/a/dialog/dialog.SlackBuild5
-rw-r--r--source/a/dosfstools/dosfstools-3.0.11.tar.bz2.sign7
-rwxr-xr-xsource/a/dosfstools/dosfstools.SlackBuild13
-rw-r--r--source/a/e2fsprogs/e2fsprogs-1.42.6.tar.signbin543 -> 0 bytes
-rw-r--r--source/a/e2fsprogs/e2fsprogs-1.42.8.tar.signbin0 -> 543 bytes
-rwxr-xr-xsource/a/e2fsprogs/e2fsprogs.SlackBuild11
-rw-r--r--source/a/efibootmgr/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch28
-rw-r--r--source/a/efibootmgr/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch30
-rw-r--r--source/a/efibootmgr/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch29
-rw-r--r--source/a/efibootmgr/efibootmgr-0.5.4-support-4k-sectors.patch176
-rwxr-xr-xsource/a/efibootmgr/efibootmgr.SlackBuild117
-rw-r--r--source/a/efibootmgr/slack-desc19
-rw-r--r--source/a/eject/eject.CDROM_DRIVE_STATUS.diff76
-rwxr-xr-xsource/a/eject/eject.SlackBuild6
-rw-r--r--source/a/eject/eject_for_mac.patch12
-rwxr-xr-xsource/a/elilo/elilo.SlackBuild116
-rw-r--r--source/a/elilo/eliloconfig213
-rw-r--r--source/a/elilo/setup.ll.eliloconfig3
-rw-r--r--source/a/elilo/slack-desc19
-rwxr-xr-xsource/a/etc/etc.SlackBuild10
-rwxr-xr-xsource/a/file/file.SlackBuild47
-rw-r--r--source/a/floppy/fdutils-5.4-20020222.diff2991
-rw-r--r--source/a/floppy/fdutils-5.5-20081027.diff905
-rwxr-xr-xsource/a/floppy/floppy.SlackBuild41
-rw-r--r--source/a/floppy/slack-desc6
-rwxr-xr-xsource/a/gawk/gawk.SlackBuild11
-rwxr-xr-xsource/a/gettext/gettext-tools.SlackBuild10
-rwxr-xr-xsource/a/gettext/gettext.SlackBuild8
-rwxr-xr-xsource/a/getty-ps/getty-ps.SlackBuild2
-rw-r--r--source/a/getty-ps/getty.bugfixes.diff2
-rw-r--r--source/a/gpm/gpm-1.20.1-consolename.patch18
-rw-r--r--source/a/gpm/gpm-1.20.1-gpmopen.patch22
-rw-r--r--source/a/gpm/gpm-1.20.1-idie.patch12
-rw-r--r--source/a/gpm/gpm-1.20.1-input-defines.diff26
-rw-r--r--source/a/gpm/gpm-1.20.1-input.patch16
-rw-r--r--source/a/gpm/gpm-1.20.1-lib-silent.patch2
-rw-r--r--source/a/gpm/gpm-1.20.1-math.patch11
-rw-r--r--source/a/gpm/gpm-1.20.1-multilib.patch52
-rw-r--r--source/a/gpm/gpm-1.20.1-no-console-error.patch15
-rw-r--r--source/a/gpm/gpm-1.20.1-nodebug.patch12
-rw-r--r--source/a/gpm/gpm-1.20.1-select-1.patch30
-rw-r--r--source/a/gpm/gpm-1.20.1-subscript.patch11
-rw-r--r--source/a/gpm/gpm-1.20.1-weak-wgetch.patch16
-rw-r--r--source/a/gpm/gpm-1.20.1.send-noise-to-syslogs.diff86
-rw-r--r--source/a/gpm/gpm-1.20.5-close-fds.patch17
-rw-r--r--source/a/gpm/gpm-evdev-cumulative.patch7023
-rwxr-xr-xsource/a/gpm/gpm.SlackBuild112
-rw-r--r--source/a/gpm/gpm.evdevmakefile.patch11
-rw-r--r--source/a/gpm/slack-desc4
-rwxr-xr-xsource/a/gptfdisk/gptfdisk.SlackBuild2
-rw-r--r--source/a/grub/doinst.sh16
-rw-r--r--source/a/grub/etc.default.grub28
-rwxr-xr-xsource/a/grub/grub.SlackBuild192
-rw-r--r--source/a/grub/grub.dejavusansmono.gfxterm.font.diff43
-rw-r--r--source/a/grub/grub.e75fdee420a7ad95e9a465c9699adc2e2e970440.terminate.efi.several.times.diff75
-rw-r--r--source/a/grub/initrd_naming.patch13
-rw-r--r--source/a/grub/slack-desc19
-rw-r--r--source/a/grub/txtHRnXiHYUrM.txt49
-rwxr-xr-xsource/a/gzip/gzip.SlackBuild8
-rwxr-xr-xsource/a/infozip/infozip.SlackBuild8
-rw-r--r--source/a/infozip/unzip.process.c.diff28
-rw-r--r--source/a/infozip/unzip.use.system.libbz2.diff28
-rwxr-xr-xsource/a/kernel-firmware/kernel-firmware.SlackBuild9
-rw-r--r--source/a/kmod/kmod-15.tar.sign17
-rwxr-xr-xsource/a/kmod/kmod.SlackBuild7
-rwxr-xr-xsource/a/libcgroup/libcgroup.SlackBuild2
-rw-r--r--source/a/libcgroup/libcgroup.init.diff15
-rwxr-xr-xsource/a/lilo/lilo.SlackBuild14
-rw-r--r--source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff47
-rw-r--r--source/a/lilo/liloconfig55
-rwxr-xr-xsource/a/logrotate/logrotate.SlackBuild2
-rw-r--r--source/a/logrotate/logrotate.slackware.diff11
-rwxr-xr-xsource/a/lrzip/lrzip.SlackBuild9
-rwxr-xr-xsource/a/lvm2/lvm2.SlackBuild2
-rwxr-xr-xsource/a/minicom/minicom.SlackBuild4
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch12
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch75
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch34
-rw-r--r--source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch11
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch25
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch11
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch67
-rw-r--r--source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch123
-rwxr-xr-xsource/a/mkinitrd/init31
-rw-r--r--source/a/mkinitrd/mkinitrd13
-rwxr-xr-xsource/a/mkinitrd/mkinitrd.SlackBuild18
-rw-r--r--source/a/mkinitrd/mkinitrd_command_generator.sh21
-rwxr-xr-xsource/a/ntfs-3g/ntfs-3g.SlackBuild16
-rwxr-xr-xsource/a/os-prober/os-prober.SlackBuild141
-rw-r--r--source/a/os-prober/os-prober.reiserfs.diff11
-rw-r--r--source/a/os-prober/slack-desc19
-rw-r--r--source/a/pciutils/pciutils-3.2.0.tar.sign17
-rwxr-xr-xsource/a/pciutils/pciutils.SlackBuild7
-rwxr-xr-xsource/a/pkgtools/pkgtools.SlackBuild10
-rw-r--r--source/a/pkgtools/scripts/pkgtool4
-rw-r--r--source/a/pkgtools/scripts/setup.80.make-bootdisk68
-rw-r--r--source/a/procps/procps-3.2.8.makefile.diff11
-rwxr-xr-xsource/a/procps/procps.SlackBuild12
-rwxr-xr-xsource/a/reiserfsprogs/reiserfsprogs.SlackBuild21
-rw-r--r--source/a/reiserfsprogs/slack-desc4
-rwxr-xr-xsource/a/sed/sed.SlackBuild5
-rw-r--r--source/a/shadow/patches/r3054.diff27
-rw-r--r--source/a/shadow/patches/r3055.diff1515
-rw-r--r--source/a/shadow/patches/r3060.diff116
-rw-r--r--source/a/shadow/patches/r3062.diff139
-rw-r--r--source/a/shadow/patches/r3090.diff11
-rw-r--r--source/a/shadow/patches/r3096.diff27
-rw-r--r--source/a/shadow/patches/r3160.diff239
-rw-r--r--source/a/shadow/patches/r3194.diff15
-rwxr-xr-xsource/a/shadow/shadow.SlackBuild8
-rw-r--r--source/a/shadow/shadow.glibc217-crypt.diff258
-rw-r--r--source/a/shadow/shadow.man.nodups.diff11
-rwxr-xr-xsource/a/sharutils/sharutils.SlackBuild6
-rwxr-xr-xsource/a/slocate/slocate.SlackBuild2
-rwxr-xr-xsource/a/sysklogd/sysklogd.SlackBuild9
-rw-r--r--source/a/syslinux/syslinux-4.05.tar.sign17
-rw-r--r--source/a/syslinux/syslinux-4.06.tar.sign17
-rwxr-xr-xsource/a/syslinux/syslinux.SlackBuild6
-rw-r--r--source/a/syslinux/syslinux.altmbr.diff11
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.64
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.M16
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.S25
-rwxr-xr-xsource/a/sysvinit-scripts/sysvinit-scripts.SlackBuild4
-rwxr-xr-xsource/a/sysvinit/sysvinit.SlackBuild6
-rw-r--r--source/a/tcsh/tcsh-6.18.01-crypt.diff11
-rwxr-xr-xsource/a/tcsh/tcsh.SlackBuild6
-rw-r--r--source/a/udev/60-cdrom_id.rules.diff28
-rw-r--r--source/a/udev/config/rc.d/rc.udev.new9
-rw-r--r--source/a/udev/rule_generator.diff81
-rwxr-xr-xsource/a/udev/udev.SlackBuild11
-rwxr-xr-xsource/a/udisks/udisks.SlackBuild2
-rw-r--r--source/a/usb_modeswitch/device_reference.txt607
-rwxr-xr-xsource/a/usb_modeswitch/usb_modeswitch.SlackBuild8
-rw-r--r--source/a/usbutils/usbutils-007.tar.sign17
-rwxr-xr-xsource/a/usbutils/usbutils.SlackBuild2
-rw-r--r--source/a/util-linux/partx.data.type.diff11
-rwxr-xr-xsource/a/util-linux/util-linux.SlackBuild8
-rwxr-xr-xsource/a/xz/xz.SlackBuild4
162 files changed, 5034 insertions, 13137 deletions
diff --git a/source/a/aaa_base/aaa_base.SlackBuild b/source/a/aaa_base/aaa_base.SlackBuild
index b41e9545..eb67560f 100755
--- a/source/a/aaa_base/aaa_base.SlackBuild
+++ b/source/a/aaa_base/aaa_base.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,8 +20,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=14.0
-BUILD=${BUILD:-5}
+VERSION=14.1
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/a/aaa_base/os-release b/source/a/aaa_base/os-release
index 717dbbf8..2f64cbf7 100644
--- a/source/a/aaa_base/os-release
+++ b/source/a/aaa_base/os-release
@@ -1,10 +1,10 @@
NAME=Slackware
-VERSION="14.0"
+VERSION="14.1"
ID=slackware
-VERSION_ID=14.0
-PRETTY_NAME="Slackware 14.0"
+VERSION_ID=14.1
+PRETTY_NAME="Slackware 14.1"
ANSI_COLOR="0;34"
-CPE_NAME="cpe:/o:slackware:slackware_linux:14.0"
+CPE_NAME="cpe:/o:slackware:slackware_linux:14.1"
HOME_URL="http://slackware.com/"
SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
diff --git a/source/a/aaa_base/slackware-version b/source/a/aaa_base/slackware-version
index bd93610e..1147d297 100644
--- a/source/a/aaa_base/slackware-version
+++ b/source/a/aaa_base/slackware-version
@@ -1 +1 @@
-Slackware 14.0
+Slackware 14.1
diff --git a/source/a/aaa_elflibs/aaa_elflibs.SlackBuild b/source/a/aaa_elflibs/aaa_elflibs.SlackBuild
index 20a343d2..8fd9f3fe 100755
--- a/source/a/aaa_elflibs/aaa_elflibs.SlackBuild
+++ b/source/a/aaa_elflibs/aaa_elflibs.SlackBuild
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,8 +21,8 @@
PKGNAM=aaa_elflibs
-VERSION=${VERSION:-14.0}
-BUILD=${BUILD:-4}
+VERSION=${VERSION:-14.1}
+BUILD=${BUILD:-3}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/a/aaa_elflibs/symlinks-to-tracked-libs b/source/a/aaa_elflibs/symlinks-to-tracked-libs
index 38a44e9e..f19a6b9e 100644
--- a/source/a/aaa_elflibs/symlinks-to-tracked-libs
+++ b/source/a/aaa_elflibs/symlinks-to-tracked-libs
@@ -6,6 +6,7 @@
/lib/libdm.so.0
/lib/libfuse.so.2
/lib/libgpm.so.1
+/lib/libgpm.so.2
/lib/liblzma.so.5
/lib/libncurses.so.5
/lib/libncursesw.so.5
@@ -44,11 +45,11 @@
/usr/lib/libmenu.so.5
/usr/lib/libmenuw.so.5
/usr/lib/libmm.so.14
-/usr/lib/libmp.so.3
/usr/lib/libmpfr.so.1
/usr/lib/libpanel.so.5
/usr/lib/libpanelw.so.5
/usr/lib/libpcre.so.0
+/usr/lib/libpcre.so.1
/usr/lib/libpcreposix.so.0
/usr/lib/libpng.so.3
/usr/lib/libpng.so.14
diff --git a/source/a/aaa_elflibs/tracked-files b/source/a/aaa_elflibs/tracked-files
index 040ecbbc..16b731ba 100644
--- a/source/a/aaa_elflibs/tracked-files
+++ b/source/a/aaa_elflibs/tracked-files
@@ -6,4 +6,3 @@
/usr/lib/libcups.so.2
/usr/lib/libcupsimage.so.2
/usr/lib/libgcc_s.so.1
-/usr/lib/libtalloc.so.2
diff --git a/source/a/acpid/slack-desc b/source/a/acpid/slack-desc
index 1b065fce..a458e9f3 100644
--- a/source/a/acpid/slack-desc
+++ b/source/a/acpid/slack-desc
@@ -15,5 +15,5 @@ acpid: order to make the Linux ACPI support completely functional.
acpid:
acpid: ACPI must be compiled into the kernel to run acpid.
acpid:
-acpid: Homepage: http://www.tedfelix.com/linux/acpid-netlink.html
+acpid: Homepage: http://sourceforge.net/projects/acpid2/
acpid:
diff --git a/source/a/bash/bash-4.2-patches/bash42-038 b/source/a/bash/bash-4.2-patches/bash42-038
new file mode 100644
index 00000000..411e4dd5
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-038
@@ -0,0 +1,47 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-038
+
+Bug-Reported-by: armandsl@gmail.com
+Bug-Reference-ID: <20120822112810.8D14920040@windmill.latviatours.lv>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-08/msg00049.html
+
+Bug-Description:
+
+If a backslash-newline (which is removed) with no other input is given as
+input to `read', the shell tries to dereference a null pointer and seg faults.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/builtins/read.def 2012-03-11 17:52:44.000000000 -0400
+--- builtins/read.def 2012-08-22 11:53:09.000000000 -0400
+***************
+*** 792,796 ****
+ #endif
+
+! if (saw_escape)
+ {
+ t = dequote_string (input_string);
+--- 847,851 ----
+ #endif
+
+! if (saw_escape && input_string && *input_string)
+ {
+ t = dequote_string (input_string);
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 37
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 38
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-039 b/source/a/bash/bash-4.2-patches/bash42-039
new file mode 100644
index 00000000..21457af1
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-039
@@ -0,0 +1,58 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-039
+
+Bug-Reported-by: Dan Douglas <ormaaj@gmail.com>
+Bug-Reference-ID: <1498458.MpVlmOXDB7@smorgbox>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html
+
+Bug-Description:
+
+Under certain circumstances, bash attempts to expand variables in arithmetic
+expressions even when evaluation is being suppressed.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/expr.c 2011-11-21 18:03:35.000000000 -0500
+--- expr.c 2012-09-09 16:31:18.000000000 -0400
+***************
+*** 1010,1013 ****
+--- 1073,1082 ----
+ #endif
+
++ /*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
++ /* If we are suppressing evaluation, just short-circuit here instead of
++ going through the rest of the evaluator. */
++ if (noeval)
++ return (0);
++
+ /* [[[[[ */
+ #if defined (ARRAY_VARS)
+***************
+*** 1183,1186 ****
+--- 1256,1263 ----
+
+ *cp = '\0';
++ /* XXX - watch out for pointer aliasing issues here */
++ if (curlval.tokstr && curlval.tokstr == tokstr)
++ init_lvalue (&curlval);
++
+ FREE (tokstr);
+ tokstr = savestring (tp);
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 38
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 39
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-040 b/source/a/bash/bash-4.2-patches/bash42-040
new file mode 100644
index 00000000..1de0fe37
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-040
@@ -0,0 +1,56 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-040
+
+Bug-Reported-by: Andrey Zaitsev <jstcdr@gmail.com>
+Bug-Reference-ID: <CAEZVQT5PJ1Mb_Zh8LT5qz8sv+-9Q6hGfQ5DU9ZxdJ+gV7xBUaQ@mail.gmail.com>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00144.html
+
+Bug-Description:
+
+Output redirection applied to builtin commands missed I/O errors if
+they happened when the file descriptor was closed, rather than on write
+(e.g., like with an out-of-space error on a remote NFS file system).
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/redir.c 2011-01-02 16:00:31.000000000 -0500
+--- redir.c 2012-04-24 20:42:12.000000000 -0400
+***************
+*** 1092,1099 ****
+ #if defined (BUFFERED_INPUT)
+ check_bash_input (redirector);
+! close_buffered_fd (redirector);
+ #else /* !BUFFERED_INPUT */
+! close (redirector);
+ #endif /* !BUFFERED_INPUT */
+ }
+ break;
+--- 1092,1101 ----
+ #if defined (BUFFERED_INPUT)
+ check_bash_input (redirector);
+! r = close_buffered_fd (redirector);
+ #else /* !BUFFERED_INPUT */
+! r = close (redirector);
+ #endif /* !BUFFERED_INPUT */
++ if (r < 0 && (flags & RX_INTERNAL) && (errno == EIO || errno == ENOSPC))
++ REDIRECTION_ERROR (r, errno, -1);
+ }
+ break;
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 39
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 40
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-041 b/source/a/bash/bash-4.2-patches/bash42-041
new file mode 100644
index 00000000..37d4ac70
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-041
@@ -0,0 +1,47 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-041
+
+Bug-Reported-by: Andrey Borzenkov <arvidjaar@gmail.com>
+Bug-Reference-ID: <20121202205200.2134478e@opensuse.site>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-12/msg00008.html
+
+Bug-Description:
+
+Process substitution incorrectly inherited a flag that inhibited using the
+(local) temporary environment for variable lookups if it was providing
+the filename to a redirection. The intent the flag is to enforce the
+Posix command expansion ordering rules.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/subst.c 2012-07-14 15:53:20.000000000 -0400
+--- subst.c 2012-12-02 22:26:54.000000000 -0500
+***************
+*** 5125,5128 ****
+--- 5129,5136 ----
+ #endif /* HAVE_DEV_FD */
+
++ /* subshells shouldn't have this flag, which controls using the temporary
++ environment for variable lookups. */
++ expanding_redir = 0;
++
+ result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST));
+
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 40
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 41
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-042 b/source/a/bash/bash-4.2-patches/bash42-042
new file mode 100644
index 00000000..1ce0cae3
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-042
@@ -0,0 +1,57 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-042
+
+Bug-Reported-by: Adam Pippin <adam@gp-inc.ca>
+Bug-Reference-ID: <CAPYbNHr6ucZFOoWsRdUJj6KP3Ju0j1bkESa_cmb7iU+kZwdVpg@mail.gmail.com>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-11/msg00087.html
+
+Bug-Description:
+
+Compilation failed after specifying the `--enable-minimal-config' option to
+configure (more specifically, specifying `--disable-alias').
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/parse.y 2012-07-08 21:53:33.000000000 -0400
+--- parse.y 2012-10-14 20:20:34.000000000 -0400
+***************
+*** 2394,2397 ****
+--- 2392,2396 ----
+ to consume the quoted newline and move to the next character in
+ the expansion. */
++ #if defined (ALIAS)
+ if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0')
+ {
+***************
+*** 2404,2408 ****
+ goto next_alias_char; /* and get next character */
+ }
+! else
+ goto restart_read;
+ }
+--- 2403,2408 ----
+ goto next_alias_char; /* and get next character */
+ }
+! else
+! #endif
+ goto restart_read;
+ }
+
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 41
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 42
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-043 b/source/a/bash/bash-4.2-patches/bash42-043
new file mode 100644
index 00000000..b25a5ee3
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-043
@@ -0,0 +1,65 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-043
+
+Bug-Reported-by: konsolebox <konsolebox@gmail.com>
+Bug-Reference-ID: <CAJnmqwZuGKLgMsMwxRK4LL+2NN+HgvmKzrnode99QBGrcgX1Lw@mail.gmail.com>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-01/msg00138.html
+
+Bug-Description:
+
+When SIGCHLD is trapped, and a SIGCHLD trap handler runs when a pending
+`read -t' invocation times out and generates SIGALRM, bash can crash with
+a segmentation fault.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/builtins/read.def 2012-10-31 21:22:51.000517000 -0400
+--- builtins/read.def 2013-01-25 10:28:16.000038000 -0500
+***************
+*** 386,393 ****
+ /* Tricky. The top of the unwind-protect stack is the free of
+ input_string. We want to run all the rest and use input_string,
+! so we have to remove it from the stack. */
+! remove_unwind_protect ();
+! run_unwind_frame ("read_builtin");
+ input_string[i] = '\0'; /* make sure it's terminated */
+ retval = 128+SIGALRM;
+ goto assign_vars;
+--- 386,403 ----
+ /* Tricky. The top of the unwind-protect stack is the free of
+ input_string. We want to run all the rest and use input_string,
+! so we have to save input_string temporarily, run the unwind-
+! protects, then restore input_string so we can use it later. */
+!
+ input_string[i] = '\0'; /* make sure it's terminated */
++ if (i == 0)
++ {
++ t = (char *)xmalloc (1);
++ t[0] = 0;
++ }
++ else
++ t = savestring (input_string);
++
++ run_unwind_frame ("read_builtin");
++ input_string = t;
+ retval = 128+SIGALRM;
+ goto assign_vars;
+
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 42
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 43
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-044 b/source/a/bash/bash-4.2-patches/bash42-044
new file mode 100644
index 00000000..e5bf2832
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-044
@@ -0,0 +1,70 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-044
+
+Bug-Reported-by: "Dashing" <dashing@hushmail.com>
+Bug-Reference-ID: <20130211175049.D90786F446@smtp.hushmail.com>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-02/msg00030.html
+
+Bug-Description:
+
+When converting a multibyte string to a wide character string as part of
+pattern matching, bash does not handle the end of the string correctly,
+causing the search for the NUL to go beyond the end of the string and
+reference random memory. Depending on the contents of that memory, bash
+can produce errors or crash.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/lib/glob/xmbsrtowcs.c 2012-07-08 21:53:19.000000000 -0400
+--- lib/glob/xmbsrtowcs.c 2013-02-12 12:00:39.000000000 -0500
+***************
+*** 217,220 ****
+--- 217,226 ----
+ n = mbsnrtowcs(wsbuf+wcnum, &p, nms, wsbuf_size-wcnum, &state);
+
++ if (n == 0 && p == 0)
++ {
++ wsbuf[wcnum] = L'\0';
++ break;
++ }
++
+ /* Compensate for taking single byte on wcs conversion failure above. */
+ if (wcslength == 1 && (n == 0 || n == (size_t)-1))
+***************
+*** 222,226 ****
+ state = tmp_state;
+ p = tmp_p;
+! wsbuf[wcnum++] = *p++;
+ }
+ else
+--- 228,238 ----
+ state = tmp_state;
+ p = tmp_p;
+! wsbuf[wcnum] = *p;
+! if (*p == 0)
+! break;
+! else
+! {
+! wcnum++; p++;
+! }
+ }
+ else
+
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 43
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 44
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/bash/bash-4.2-patches/bash42-045 b/source/a/bash/bash-4.2-patches/bash42-045
new file mode 100644
index 00000000..e0f8559e
--- /dev/null
+++ b/source/a/bash/bash-4.2-patches/bash42-045
@@ -0,0 +1,53 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.2
+Patch-ID: bash42-045
+
+Bug-Reported-by: Stephane Chazelas <stephane.chazelas@gmail.com>
+Bug-Reference-ID: <20130218195539.GA9620@chaz.gmail.com>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-02/msg00080.html
+
+Bug-Description:
+
+The <&n- and >&n- redirections, which move one file descriptor to another,
+leave the file descriptor closed when applied to builtins or compound
+commands.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.2-patched/redir.c 2013-01-30 11:56:09.000000000 -0500
+--- redir.c 2013-02-19 09:38:36.000000000 -0500
+***************
+*** 1008,1011 ****
+--- 1008,1021 ----
+ REDIRECTION_ERROR (r, errno, -1);
+ }
++ if ((flags & RX_UNDOABLE) && (ri == r_move_input || ri == r_move_output))
++ {
++ /* r_move_input and r_move_output add an additional close()
++ that needs to be undone */
++ if (fcntl (redirector, F_GETFD, 0) != -1)
++ {
++ r = add_undo_redirect (redir_fd, r_close_this, -1);
++ REDIRECTION_ERROR (r, errno, -1);
++ }
++ }
+ #if defined (BUFFERED_INPUT)
+ check_bash_input (redirector);
+
+*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
+--- patchlevel.h Thu Feb 24 21:41:34 2011
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 44
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 45
+
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/source/a/btrfs-progs/btrfs-progs.SlackBuild b/source/a/btrfs-progs/btrfs-progs.SlackBuild
index 99dd753d..710c7eba 100755
--- a/source/a/btrfs-progs/btrfs-progs.SlackBuild
+++ b/source/a/btrfs-progs/btrfs-progs.SlackBuild
@@ -89,12 +89,14 @@ make install DESTDIR=$PKG || exit 1
# Move stuff out of /usr/local:
mv $PKG/usr/local/bin $PKG/sbin
mv $PKG/usr/local/man $PKG/usr/man
-rmdir $PKG/usr/local
-# Add an fsck.btrfs script. For now this serves to eat options such as -a
-# that would otherwise cause issues for btrfs at boot time.
-cat $CWD/fsck.btrfs > $PKG/sbin/fsck.btrfs
-chmod 755 $PKG/sbin/fsck.btrfs
+# Do not ship libraries/include files.
+# If there becomes a use for these outside of btrfs-progs, let me know.
+rm -rf $PKG/usr/local
+
+# According to https://btrfs.wiki.kernel.org/index.php/FAQ#When_will_Btrfs_have_a_fsck_like_tool.3F
+# it is not recommended to make fsck.btrfs a no-op by linking it to /bin/true:
+ln -sf /bin/true $PKG/sbin/fsck.btrfs
# Compress and link manpages, if any:
if [ -d $PKG/usr/man ]; then
diff --git a/source/a/btrfs-progs/fsck.btrfs b/source/a/btrfs-progs/fsck.btrfs
deleted file mode 100644
index 779e0b79..00000000
--- a/source/a/btrfs-progs/fsck.btrfs
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-
-# Copyright 2011 Patrick J. Volkerding, Sebeka, Minnesota, USA
-# All rights reserved.
-#
-# Redistribution and use of this script, with or without modification, is
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of this script must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Currently, btrfsck does not recognize any options, so eat any initial options
-# beginning with '-'. Then, check the remaining args with btrfsck only if they
-# exist and are readable.
-
-# Strip initial args:
-while [ ! -z "$1" ]; do
- if [ "$(echo $1 | cut -b1)" = "-" ]; then
- shift # strip option from command line
- else
- break
- fi
-done
-
-# Main filesystem check loop:
-RETVAL=0
-while [ ! -z "$1" ]; do
- if [ -r "$1" ]; then
- echo "fsck.btrfs: Checking filesystem on $1"
- # Checking the root filesystem (even read-only) will fail, check for that:
- if ! grep -w "$1" /etc/fstab | grep -wq / ; then
- btrfsck "$1"
- ERRCODE=$?
- if [ ! $ERRCODE = 0 ]; then
- RETVAL=$ERRCODE
- fi
- else
- echo " $1 mounted on /, skipped."
- fi
- fi
- shift
-done
-
-# If there was an error, return the most recent error code:
-exit $RETVAL
-
diff --git a/source/a/cups/cups-1.5.4-usb-quirks.diff b/source/a/cups/cups-1.5.4-usb-quirks.diff
new file mode 100644
index 00000000..dfe1dab8
--- /dev/null
+++ b/source/a/cups/cups-1.5.4-usb-quirks.diff
@@ -0,0 +1,319 @@
+From efe932a075744c1cfdf755ce8fea0870fc38a1c8 Mon Sep 17 00:00:00 2001
+From: mancha <mancha1@hush.com>
+Date: Wed, 9 Oct 2013
+Subject: Backport usb fixes to CUPS 1.5.4
+
+ usb-libusb.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 127 insertions(+), 25 deletions(-)
+
+--- a/backend/usb-libusb.c 2012-07-16
++++ b/backend/usb-libusb.c 2013-10-09
+@@ -13,7 +13,7 @@
+ *
+ * Contents:
+ *
+- * list_devices() - List the available printers.
++ * list_devices() - List the available printers.
+ * print_device() - Print a file to a USB device.
+ * close_device() - Close the connection to the USB printer.
+ * find_device() - Find or enumerate USB printers.
+@@ -70,7 +70,7 @@ typedef struct usb_printer_s /**** USB
+ read_endp, /* Read endpoint */
+ protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
+ usblp_attached, /* "usblp" kernel module attached? */
+- opened_for_job; /* Set to 1 by print_device() */
++ reset_after_job; /* Set to 1 by print_device() */
+ unsigned int quirks; /* Quirks flags */
+ struct libusb_device_handle *handle; /* Open handle to device */
+ } usb_printer_t;
+@@ -122,6 +122,9 @@ struct quirk_printer_struct {
+ #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
+ #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
+ Class or SubClass */
++#define USBLP_QUIRK_BLACKLIST 0x8 /* these printers do not conform to the USB print spec */
++#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
++ for clean-up */
+ #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
+ the usblp kernel module */
+
+@@ -139,17 +142,97 @@ static const struct quirk_printer_struct
+ { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
+ { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
+ { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
++ { 0x043d, 0x00f3, USBLP_QUIRK_NO_REATTACH }, /* Lexmark International,
++ Inc. (e250d), https://bugs.launchpad.net/bugs/1084164 */
++ { 0x043d, 0x00d7, USBLP_QUIRK_NO_REATTACH }, /* Lexmark E328 */
+ { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820,
+ by zut <kernel@zut.de> */
++ { 0x04a9, 0x1095, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP6000D
++ Printer, https://bugs.launchpad.net/bugs/1160638 */
++ { 0x04a9, 0x10a2, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4200
++ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300
++ Printer, https://bugs.launchpad.net/bugs/1032385 */
++ { 0x04a9, 0x1721, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP210
++ https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53 */
++ { 0x04a9, 0x170c, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP500
++ Printer, https://bugs.launchpad.net/bugs/1032456 */
++ { 0x04a9, 0x1717, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP510
++ Printer, https://bugs.launchpad.net/bugs/1050009 */
++ { 0x04a9, 0x173d, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP550
++ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x173e, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP560
++ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x26a3, USBLP_QUIRK_NO_REATTACH }, /* Canon, Inc. MF4150
++ Printer, https://bugs.launchpad.net/bugs/1160638 */
++ { 0x04f9, 0x001a, USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
++ HL-1430 Laser Printer,
++ https://bugs.launchpad.net/bugs/1038695 */
+ { 0x04f9, 0x000d, USBLP_QUIRK_BIDIR |
+ USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
+- HL-1440 Laser Printer */
++ HL-1440 Laser Printer,
++ https://bugs.launchpad.net/bugs/1000253 */
++ { 0x04f9, 0x000e, USBLP_QUIRK_BIDIR |
++ USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
++ HL-1450 Laser Printer,
++ https://bugs.launchpad.net/bugs/1000253 */
++ { 0x06bc, 0x000b, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp.
++ Okipage 14ex Printer,
++ https://bugs.launchpad.net/bugs/872483 */
++ { 0x06bc, 0x01c7, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. B410d,
++ https://bugs.launchpad.net/bugs/872483 */
++ { 0x04b8, 0x0001, USBLP_QUIRK_BIDIR |
++ USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 740 / Photo 750,
++ http://bugs.debian.org/697970 */
++ { 0x04b8, 0x0005, USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 670,
++ https://bugs.launchpad.net/bugs/872483 */
+ { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
+ Printer M129C */
+ { 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
+- USBLP_QUIRK_NO_REATTACH },
++ USBLP_QUIRK_NO_REATTACH |
++ USBLP_QUIRK_RESET },
+ /* Prolific Technology, Inc. PL2305 Parallel Port
+- (USB -> Parallel adapter) */
++ (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */
++ { 0x0924, 0x3ce9, USBLP_QUIRK_NO_REATTACH }, /* Xerox Phaser 3124
++ https://bugzilla.redhat.com/show_bug.cgi?id=867392 */
++ { 0x0924, 0x4293, USBLP_QUIRK_NO_REATTACH }, /* Xerox WorkCentre 3210
++ https://bugs.launchpad.net/bugs/1102470 */
++ { 0x1a86, 0x7584, USBLP_QUIRK_NO_REATTACH }, /* QinHeng Electronics
++ CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253 */
++ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices,
++ https://bugs.launchpad.net/bugs/1032456 */
++ { 0x0a5f, 0x0000, USBLP_QUIRK_BIDIR }, /* All Zebra devices,
++ https://bugs.launchpad.net/bugs/1001028 */
++ /* Canon */
++ { 0x04a9, 0x304a, USBLP_QUIRK_BLACKLIST }, /* Canon CP-10 */
++ { 0x04a9, 0x3063, USBLP_QUIRK_BLACKLIST }, /* Canon CP-100 */
++ { 0x04a9, 0x307c, USBLP_QUIRK_BLACKLIST }, /* Canon CP-200 */
++ { 0x04a9, 0x307d, USBLP_QUIRK_BLACKLIST }, /* Canon CP-300 */
++ { 0x04a9, 0x30bd, USBLP_QUIRK_BLACKLIST }, /* Canon CP-220 */
++ { 0x04a9, 0x30be, USBLP_QUIRK_BLACKLIST }, /* Canon CP-330 */
++ { 0x04a9, 0x30f6, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP400 */
++ { 0x04a9, 0x310b, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP600 */
++ { 0x04a9, 0x3127, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP710 */
++ { 0x04a9, 0x3128, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP510 */
++ { 0x04a9, 0x3141, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES1 */
++ { 0x04a9, 0x3142, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP730 */
++ { 0x04a9, 0x3143, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP720 */
++ { 0x04a9, 0x3170, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP750 */
++ { 0x04a9, 0x3171, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP740 */
++ { 0x04a9, 0x3185, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES2 */
++ { 0x04a9, 0x3186, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES20 */
++ { 0x04a9, 0x31aa, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP770 */
++ { 0x04a9, 0x31ab, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP760 */
++ { 0x04a9, 0x31b0, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES30 */
++ { 0x04a9, 0x31dd, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
++ { 0x04a9, 0x31ee, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES40 */
++ { 0x04a9, 0x3214, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP800 */
++ { 0x04a9, 0x3255, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP900 */
++ { 0x04a9, 0x3256, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP810 */
++ { 0x04a9, 0x30F5, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP500 */
++ { 0x04a9, 0x31AF, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES3 */
++ { 0x04a9, 0x31DD, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
++ /* MISSING PIDs: CP520, CP530, CP790 */
+ { 0, 0 }
+ };
+
+@@ -256,7 +339,12 @@ print_device(const char *uri, /* I - De
+ }
+
+ g.print_fd = print_fd;
+- g.printer->opened_for_job = 1;
++
++ /*
++ * Some devices need a reset after finishing a job, these devices are
++ * marked with the USBLP_QUIRK_RESET quirk.
++ */
++ g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0);
+
+ /*
+ * If we are printing data from a print driver on stdin, ignore SIGTERM
+@@ -639,10 +727,10 @@ print_device(const char *uri, /* I - De
+ * If it didn't exit abort the pending read and wait an additional
+ * second...
+ */
+-
++
+ if (!g.read_thread_done)
+ {
+- fputs("DEBUG: Read thread still active, aborting the pending read...\n",
++ fputs("DEBUG: Read thread still active, aborting the pending read...\n",
+ stderr);
+
+ g.wait_eof = 0;
+@@ -650,7 +738,7 @@ print_device(const char *uri, /* I - De
+ gettimeofday(&tv, NULL);
+ cond_timeout.tv_sec = tv.tv_sec + 1;
+ cond_timeout.tv_nsec = tv.tv_usec * 1000;
+-
++
+ while (!g.read_thread_done)
+ {
+ if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
+@@ -663,9 +751,6 @@ print_device(const char *uri, /* I - De
+ pthread_mutex_unlock(&g.read_thread_mutex);
+ }
+
+- if (print_fd)
+- close(print_fd);
+-
+ /*
+ * Close the connection and input file and general clean up...
+ */
+@@ -725,7 +810,7 @@ close_device(usb_printer_t *printer) /*
+ */
+ if (printer->origconf > 0 && printer->origconf != number2)
+ {
+- fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n",
++ fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n",
+ number2, printer->origconf);
+ if ((errcode = libusb_set_configuration(printer->handle,
+ printer->origconf)) < 0)
+@@ -772,7 +857,7 @@ close_device(usb_printer_t *printer) /*
+ * Reset the device to clean up after the job
+ */
+
+- if (printer->opened_for_job == 1)
++ if (printer->reset_after_job == 1)
+ {
+ if ((errcode = libusb_reset_device(printer->handle)) < 0)
+ fprintf(stderr,
+@@ -815,7 +900,8 @@ find_device(usb_cb_t cb, /* I - Callb
+ /* Pointer to current alternate setting */
+ const struct libusb_endpoint_descriptor *endpptr = NULL;
+ /* Pointer to current endpoint */
+- ssize_t numdevs, /* number of connected devices */
++ ssize_t err = 0, /* Error code */
++ numdevs, /* number of connected devices */
+ i = 0;
+ uint8_t conf, /* Current configuration */
+ iface, /* Current interface */
+@@ -834,7 +920,14 @@ find_device(usb_cb_t cb, /* I - Callb
+ * Initialize libusb...
+ */
+
+- libusb_init(NULL);
++ err = libusb_init(NULL);
++ if (err)
++ {
++ fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
++ "libusb error %i\n", err);
++ return (NULL);
++ }
++
+ numdevs = libusb_get_device_list(NULL, &list);
+ fprintf(stderr, "DEBUG: libusb_get_device_list=%d\n", (int)numdevs);
+
+@@ -859,7 +952,14 @@ find_device(usb_cb_t cb, /* I - Callb
+ !devdesc.idProduct)
+ continue;
+
+- printer.quirks = quirks(devdesc.idVendor, devdesc.idProduct);
++ printer.quirks = quirks(devdesc.idVendor, devdesc.idProduct);
++
++ /*
++ * Ignore blacklisted printers...
++ */
++
++ if (printer.quirks & USBLP_QUIRK_BLACKLIST)
++ continue;
+
+ for (conf = 0; conf < devdesc.bNumConfigurations; conf ++)
+ {
+@@ -886,7 +986,7 @@ find_device(usb_cb_t cb, /* I - Callb
+ */
+
+ if (((altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER ||
+- altptr->bInterfaceSubClass != 1) &&
++ altptr->bInterfaceSubClass != 1) &&
+ ((printer.quirks & USBLP_QUIRK_BAD_CLASS) == 0)) ||
+ (altptr->bInterfaceProtocol != 1 && /* Unidirectional */
+ altptr->bInterfaceProtocol != 2) || /* Bidirectional */
+@@ -964,7 +1064,7 @@ find_device(usb_cb_t cb, /* I - Callb
+ bEndpointAddress;
+ }
+ else
+- fprintf(stderr, "DEBUG: Uni-directional USB communication "
++ fprintf(stderr, "DEBUG: Uni-directional USB communication "
+ "only!\n");
+ printer.write_endp = confptr->interface[printer.iface].
+ altsetting[printer.altset].
+@@ -997,7 +1097,8 @@ find_device(usb_cb_t cb, /* I - Callb
+ * Clean up ....
+ */
+
+- libusb_free_device_list(list, 1);
++ if (numdevs >= 0)
++ libusb_free_device_list(list, 1);
+ libusb_exit(NULL);
+
+ return (NULL);
+@@ -1144,7 +1245,7 @@ make_device_uri(
+ if ((sern = cupsGetOption("SERIALNUMBER", num_values, values)) == NULL)
+ if ((sern = cupsGetOption("SERN", num_values, values)) == NULL)
+ if ((sern = cupsGetOption("SN", num_values, values)) == NULL &&
+- ((libusb_get_device_descriptor (printer->device, &devdesc) >= 0) &&
++ ((libusb_get_device_descriptor(printer->device, &devdesc) >= 0) &&
+ devdesc.iSerialNumber))
+ {
+ /*
+@@ -1288,7 +1389,7 @@ open_device(usb_printer_t *printer, /* I
+ }
+
+ printer->usblp_attached = 0;
+- printer->opened_for_job = 0;
++ printer->reset_after_job = 0;
+
+ if (verbose)
+ fputs("STATE: +connecting-to-device\n", stderr);
+@@ -1343,7 +1444,7 @@ open_device(usb_printer_t *printer, /* I
+
+ printer->origconf = current;
+
+- if ((errcode =
++ if ((errcode =
+ libusb_get_config_descriptor (printer->device, printer->conf, &confptr))
+ < 0)
+ {
+@@ -1355,7 +1456,7 @@ open_device(usb_printer_t *printer, /* I
+
+ if (number1 != current)
+ {
+- fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n",
++ fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n",
+ current, number1);
+ if ((errcode = libusb_set_configuration(printer->handle, number1)) < 0)
+ {
+@@ -1586,7 +1687,8 @@ static unsigned int quirks(int vendor, i
+ for (i = 0; quirk_printers[i].vendorId; i++)
+ {
+ if (vendor == quirk_printers[i].vendorId &&
+- product == quirk_printers[i].productId)
++ (quirk_printers[i].productId == 0x0000 ||
++ product == quirk_printers[i].productId))
+ return quirk_printers[i].quirks;
+ }
+ return 0;
diff --git a/source/a/cups/cups-blacklist-usblp.conf b/source/a/cups/cups-blacklist-usblp.conf
new file mode 100644
index 00000000..0ebaa9a6
--- /dev/null
+++ b/source/a/cups/cups-blacklist-usblp.conf
@@ -0,0 +1,10 @@
+##############################################################################
+# Do not edit this file; instead, copy it to /etc/modprobe.d/ and edit that
+##############################################################################
+
+# Blacklist the (obsolete) usblp module. While the CUPS package has been
+# patched to handle if this module is loaded, there are some reports that
+# it doesn't always work. Anyway, there should be no need to have this
+# module loaded, so we'll blacklist it just in case.
+
+blacklist usblp
diff --git a/source/a/cups/cups.SlackBuild b/source/a/cups/cups.SlackBuild
index afac9132..0bb759ee 100755
--- a/source/a/cups/cups.SlackBuild
+++ b/source/a/cups/cups.SlackBuild
@@ -23,7 +23,7 @@
# CUPS build script by volkerdi@slackware.com.
VERSION=1.5.4
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -57,7 +57,7 @@ cd cups-$VERSION || exit 1
# Fix for CUPS 1.5.4. Don't reload the obsolete usblp module, as this
# can cause partial printing with certain printers.
-zcat $CWD/usb-backend-reset-after-job-only-for-specific-devices.patch.gz | patch -p0 --verbose || exit 1
+zcat $CWD/cups-1.5.4-usb-quirks.diff.gz | patch -p1 --verbose || exit 1
sed -i.orig -e 's#$exec_prefix/lib/cups#$libdir/cups#g' configure
./configure \
@@ -76,6 +76,13 @@ mkdir -p $PKG/etc/cups
mkdir -p $PKG/var/spool
make BUILDROOT=$PKG install || exit 1
+# Blacklist the usblp module just to make sure that it doesn't cause
+# any problems:
+mkdir -p $PKG/lib/modprobe.d
+cp -a $CWD/cups-blacklist-usblp.conf $PKG/lib/modprobe.d
+chown root:root $PKG/lib/modprobe.d/cups-blacklist-usblp.conf
+chmod 644 $PKG/lib/modprobe.d/cups-blacklist-usblp.conf
+
# Hey, what's with the gigantic test files? Bloat is bad.
rm -f $PKG/usr/share/cups/ipptool/*.{pdf,ps,jpg}
diff --git a/source/a/cups/usb-backend-reset-after-job-only-for-specific-devices.patch b/source/a/cups/usb-backend-reset-after-job-only-for-specific-devices.patch
deleted file mode 100644
index dcf91c83..00000000
--- a/source/a/cups/usb-backend-reset-after-job-only-for-specific-devices.patch
+++ /dev/null
@@ -1,74 +0,0 @@
---- backend/usb-libusb.c.orig 2012-07-16 19:10:55.000000000 +0200
-+++ backend/usb-libusb.c 2012-08-06 11:01:58.034150159 +0200
-@@ -70,7 +70,7 @@
- read_endp, /* Read endpoint */
- protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
- usblp_attached, /* "usblp" kernel module attached? */
-- opened_for_job; /* Set to 1 by print_device() */
-+ reset_after_job; /* Set to 1 by print_device() */
- unsigned int quirks; /* Quirks flags */
- struct libusb_device_handle *handle; /* Open handle to device */
- } usb_printer_t;
-@@ -122,6 +122,8 @@
- #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
- #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
- Class or SubClass */
-+#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
-+ for clean-up */
- #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
- the usblp kernel module */
-
-@@ -147,9 +149,11 @@
- { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
- Printer M129C */
- { 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
-- USBLP_QUIRK_NO_REATTACH },
-+ USBLP_QUIRK_NO_REATTACH |
-+ USBLP_QUIRK_RESET },
- /* Prolific Technology, Inc. PL2305 Parallel Port
- (USB -> Parallel adapter) */
-+ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices */
- { 0, 0 }
- };
-
-@@ -256,7 +260,12 @@
- }
-
- g.print_fd = print_fd;
-- g.printer->opened_for_job = 1;
-+
-+ /*
-+ * Some devices need a reset after finishing a job, these devices are
-+ * marked with the USBLP_QUIRK_RESET quirk.
-+ */
-+ g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0);
-
- /*
- * If we are printing data from a print driver on stdin, ignore SIGTERM
-@@ -772,7 +781,7 @@
- * Reset the device to clean up after the job
- */
-
-- if (printer->opened_for_job == 1)
-+ if (printer->reset_after_job == 1)
- {
- if ((errcode = libusb_reset_device(printer->handle)) < 0)
- fprintf(stderr,
-@@ -1288,7 +1297,7 @@
- }
-
- printer->usblp_attached = 0;
-- printer->opened_for_job = 0;
-+ printer->reset_after_job = 0;
-
- if (verbose)
- fputs("STATE: +connecting-to-device\n", stderr);
-@@ -1586,7 +1595,7 @@
- for (i = 0; quirk_printers[i].vendorId; i++)
- {
- if (vendor == quirk_printers[i].vendorId &&
-- product == quirk_printers[i].productId)
-+ (product == 0x0000 || product == quirk_printers[i].productId))
- return quirk_printers[i].quirks;
- }
- return 0;
diff --git a/source/a/cxxlibs/cxxlibs.SlackBuild b/source/a/cxxlibs/cxxlibs.SlackBuild
index b795d273..4de69818 100755
--- a/source/a/cxxlibs/cxxlibs.SlackBuild
+++ b/source/a/cxxlibs/cxxlibs.SlackBuild
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2006, 2007, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +21,7 @@
PKGNAM=cxxlibs
-VERSION=${VERSION:-6.0.17}
+VERSION=${VERSION:-6.0.18}
BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
diff --git a/source/a/dbus/dbus-1.4.x-allow_root_globally.diff b/source/a/dbus/dbus-1.6.x-allow_root_globally.diff
index 6bd84833..ae2d30a6 100644
--- a/source/a/dbus/dbus-1.4.x-allow_root_globally.diff
+++ b/source/a/dbus/dbus-1.6.x-allow_root_globally.diff
@@ -1,6 +1,6 @@
-diff -Nur dbus-1.4.0.orig//bus/system.conf.in dbus-1.4.0//bus/system.conf.in
---- dbus-1.4.0.orig//bus/system.conf.in 2010-08-31 16:44:19.000000000 -0500
-+++ dbus-1.4.0//bus/system.conf.in 2010-09-14 09:17:56.080373096 -0500
+diff -Nur dbus-1.6.0.orig/bus/system.conf.in dbus-1.6.0/bus/system.conf.in
+--- dbus-1.6.0.orig/bus/system.conf.in 2012-01-04 11:49:23.000000000 -0600
++++ dbus-1.6.0/bus/system.conf.in 2012-06-12 23:07:14.541913190 -0500
@@ -70,6 +70,14 @@
send_member="UpdateActivationEnvironment"/>
</policy>
diff --git a/source/a/dbus/dbus.SlackBuild b/source/a/dbus/dbus.SlackBuild
index bd6acd99..ee115afa 100755
--- a/source/a/dbus/dbus.SlackBuild
+++ b/source/a/dbus/dbus.SlackBuild
@@ -23,7 +23,7 @@
PKGNAM=dbus
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -68,7 +68,7 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-zcat $CWD/dbus-1.4.x-allow_root_globally.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/dbus-1.6.x-allow_root_globally.diff.gz | patch -p1 --verbose || exit 1
zcat $CWD/dbus.set.home.diff.gz | patch -p1 --verbose || exit 1
CFLAGS="$SLKCFLAGS" \
diff --git a/source/a/dialog/dialog.SlackBuild b/source/a/dialog/dialog.SlackBuild
index c79a6c81..6d3721e4 100755
--- a/source/a/dialog/dialog.SlackBuild
+++ b/source/a/dialog/dialog.SlackBuild
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2006, 2007, 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
PKGNAM=dialog
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1,2 -d - | rev)}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -75,6 +75,7 @@ find . \
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
+ --mandir=/usr/man \
--disable-static \
--enable-nls \
--with-ncursesw \
diff --git a/source/a/dosfstools/dosfstools-3.0.11.tar.bz2.sign b/source/a/dosfstools/dosfstools-3.0.11.tar.bz2.sign
deleted file mode 100644
index ca1fec55..00000000
--- a/source/a/dosfstools/dosfstools-3.0.11.tar.bz2.sign
+++ /dev/null
@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.10 (GNU/Linux)
-
-iEYEABECAAYFAk0U0YcACgkQ+C5cwEsrK54SwACg2GdKFHonvr+sJx9d6wA+OTwT
-pbUAoK/eDyuvkyfQygxW07g6URh5Adg+
-=eKdA
------END PGP SIGNATURE-----
diff --git a/source/a/dosfstools/dosfstools.SlackBuild b/source/a/dosfstools/dosfstools.SlackBuild
index abb2d85b..bd3c5773 100755
--- a/source/a/dosfstools/dosfstools.SlackBuild
+++ b/source/a/dosfstools/dosfstools.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2011 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2011, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,8 +22,8 @@
PKGNAM=dosfstools
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | rev | cut -f 2- -d -)}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | rev | cut -f 2- -d -)}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -60,7 +60,7 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
cd $PKGNAM-$VERSION
chown -R root:root .
@@ -76,11 +76,6 @@ zcat $CWD/dosfstools.paths.diff.gz | patch -p1 --verbose || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
-## I do not believe we want these, or it may cause autofscking fat volumes at boot:
-## NOTE: only if it is set in fstab, which is not default. Some other things need
-## to see fsck.vfat, so allowing it again.
-#rm -f $PKG/sbin/fsck.* $PKG/usr/man/man?/fsck.*
-
# We can handle this:
rm -r $PKG/usr/doc
# Add a documentation directory:
diff --git a/source/a/e2fsprogs/e2fsprogs-1.42.6.tar.sign b/source/a/e2fsprogs/e2fsprogs-1.42.6.tar.sign
deleted file mode 100644
index 6558e77e..00000000
--- a/source/a/e2fsprogs/e2fsprogs-1.42.6.tar.sign
+++ /dev/null
Binary files differ
diff --git a/source/a/e2fsprogs/e2fsprogs-1.42.8.tar.sign b/source/a/e2fsprogs/e2fsprogs-1.42.8.tar.sign
new file mode 100644
index 00000000..660df333
--- /dev/null
+++ b/source/a/e2fsprogs/e2fsprogs-1.42.8.tar.sign
Binary files differ
diff --git a/source/a/e2fsprogs/e2fsprogs.SlackBuild b/source/a/e2fsprogs/e2fsprogs.SlackBuild
index 3ba78e55..51c268a1 100755
--- a/source/a/e2fsprogs/e2fsprogs.SlackBuild
+++ b/source/a/e2fsprogs/e2fsprogs.SlackBuild
@@ -24,7 +24,7 @@
VERSION=${VERSION:-$(echo e2fsprogs*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -121,6 +121,15 @@ mv $PKG/lib${LIBDIRSUFFIX}/pkgconfig $PKG/lib${LIBDIRSUFFIX}/*.so \
ln -sf /lib${LIBDIRSUFFIX}/$(readlink $i) $i ;
done
)
+
+# Since fsck is now part of util-linux, let's prefer that version:
+if [ -r $PKG/sbin/fsck ]; then
+ mv $PKG/sbin/fsck $PKG/sbin/fsck-e2fsprogs
+fi
+if [ -r $PKG/usr/man/man8/fsck.8 ]; then
+ mv $PKG/usr/man/man8/fsck.8 $PKG/usr/man/man8/fsck-e2fsprogs.8
+fi
+
# findfs is intentionally left out here - we use the one in util-linux-ng
( cd $PKG/sbin
rm -f \
diff --git a/source/a/efibootmgr/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch b/source/a/efibootmgr/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch
new file mode 100644
index 00000000..240aa696
--- /dev/null
+++ b/source/a/efibootmgr/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch
@@ -0,0 +1,28 @@
+From 2d8f962284f40b918c0fc8385e58fcba219ddc12 Mon Sep 17 00:00:00 2001
+From: Fedora Ninjas <pjones@fedoraproject.org>
+Date: Wed, 28 Nov 2012 17:13:24 -0500
+Subject: [PATCH 2/5] Remove device path padding on non-Itanium
+
+This code predates EFI support on any x86 hardware, and it's a strict
+violation of the specification. Windows doesn't do it either.
+---
+ src/include/efi.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/include/efi.h b/src/include/efi.h
+index be667ae..c2ac853 100644
+--- a/src/include/efi.h
++++ b/src/include/efi.h
+@@ -294,7 +294,9 @@ typedef struct {
+ uint8_t signature[16];
+ uint8_t mbr_type;
+ uint8_t signature_type;
++#ifdef __ia64
+ uint8_t padding[6]; /* Emperically needed */
++#endif
+ } __attribute__((packed)) HARDDRIVE_DEVICE_PATH;
+
+ typedef struct {
+--
+1.8.0
+
diff --git a/source/a/efibootmgr/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch b/source/a/efibootmgr/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch
new file mode 100644
index 00000000..a1d9831d
--- /dev/null
+++ b/source/a/efibootmgr/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch
@@ -0,0 +1,30 @@
+From 6edc3ed5479b575f87eb51e335957b05fdd04fe8 Mon Sep 17 00:00:00 2001
+From: Fedora Ninjas <pjones@fedoraproject.org>
+Date: Wed, 28 Nov 2012 16:49:18 -0500
+Subject: [PATCH 1/5] Work around broken Apple firmware
+
+Alex Murray found that Apple's firmware sets an invalid EFI attribute on
+BootCurrent, which newer versions of the kernel then reject. This patch
+from him simply masks off the extraneous bit.
+---
+ src/lib/efivars_sysfs.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/lib/efivars_sysfs.c b/src/lib/efivars_sysfs.c
+index 182c70f..ea87325 100644
+--- a/src/lib/efivars_sysfs.c
++++ b/src/lib/efivars_sysfs.c
+@@ -55,6 +55,10 @@ sysfs_read_variable(const char *name, efi_variable_t *var)
+ return EFI_INVALID_PARAMETER;
+ }
+ close(fd);
++ /* latest apple firmware sets high bit which appears invalid
++ to the linux kernel if we write it back so lets zero it out
++ if it is set since it would be invalid to set it anyway */
++ var->Attributes = var->Attributes & ~(1 << 31);
+ return var->Status;
+ }
+
+--
+1.8.0
+
diff --git a/source/a/efibootmgr/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch b/source/a/efibootmgr/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch
new file mode 100644
index 00000000..e9b53583
--- /dev/null
+++ b/source/a/efibootmgr/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch
@@ -0,0 +1,29 @@
+From f9f4ee75ad745637a47bf17ed968101b1ffbcc1d Mon Sep 17 00:00:00 2001
+From: Matt Domsch <Matt_Domsch@dell.com>
+Date: Thu, 23 Jul 2009 14:20:19 -0500
+Subject: [PATCH 4/5] fix disk minor number discovery
+
+Raymund Will noted disk_info_from_fd() incorrectly used logical &&
+instead of bitwise & when obtaining the minor number.
+
+Reported in https://bugzilla.novell.com/show_bug.cgi?id=524529#c1
+---
+ src/lib/disk.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/disk.c b/src/lib/disk.c
+index ebfe619..8ad590b 100644
+--- a/src/lib/disk.c
++++ b/src/lib/disk.c
+@@ -55,7 +55,7 @@ disk_info_from_fd(int fd,
+ return 1;
+ }
+ major = buf.st_dev >> 8;
+- minor = buf.st_dev && 0xFF;
++ minor = buf.st_dev & 0xFF;
+
+ /* IDE disks can have up to 64 partitions, or 6 bits worth,
+ * and have one bit for the disk number.
+--
+1.8.0
+
diff --git a/source/a/efibootmgr/efibootmgr-0.5.4-support-4k-sectors.patch b/source/a/efibootmgr/efibootmgr-0.5.4-support-4k-sectors.patch
new file mode 100644
index 00000000..c380c610
--- /dev/null
+++ b/source/a/efibootmgr/efibootmgr-0.5.4-support-4k-sectors.patch
@@ -0,0 +1,176 @@
+Return-Path: pjones@redhat.com
+Received: from zmta02.collab.prod.int.phx2.redhat.com (LHLO
+ zmta02.collab.prod.int.phx2.redhat.com) (10.5.5.32) by
+ mail04.corp.redhat.com with LMTP; Wed, 14 Jul 2010 14:25:52 -0400 (EDT)
+Received: from localhost (localhost.localdomain [127.0.0.1])
+ by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id B69C19F152
+ for <pjones@redhat.com>; Wed, 14 Jul 2010 14:25:52 -0400 (EDT)
+Received: from zmta02.collab.prod.int.phx2.redhat.com ([127.0.0.1])
+ by localhost (zmta02.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024)
+ with ESMTP id jCHcGZehMQ5J for <pjones@redhat.com>;
+ Wed, 14 Jul 2010 14:25:52 -0400 (EDT)
+Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21])
+ by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id A601C9F14C
+ for <pjones@mail.corp.redhat.com>; Wed, 14 Jul 2010 14:25:52 -0400 (EDT)
+Received: from pjones4.install.bos.redhat.com (pjones4.install.bos.redhat.com [10.16.52.154])
+ by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6EIPpGh017771;
+ Wed, 14 Jul 2010 14:25:52 -0400
+From: Peter Jones <pjones@redhat.com>
+To: Matt Domsch <Matt_Domsch@dell.com>
+Cc: Peter Jones <pjones@redhat.com>, Stuart Hayes <stuart_hayes@dell.com>
+Subject: [efibootmgr patch] Handle sector_size != 512.
+Date: Wed, 14 Jul 2010 14:26:49 -0400
+Message-Id: <1279132009-26635-1-git-send-email-pjones@redhat.com>
+In-Reply-To: <1279121617-17961-1-git-send-email-pjones@redhat.com>
+References: <1279121617-17961-1-git-send-email-pjones@redhat.com>
+X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21
+
+Disks can have 4kB sectors now, so don't just bail out when that's the
+case.
+---
+ src/include/disk.h | 3 +++
+ src/lib/disk.c | 43 +++++++++++++++++++++++++++++++++----------
+ src/lib/gpt.c | 30 ++++++++++++++----------------
+ 3 files changed, 50 insertions(+), 26 deletions(-)
+
+diff --git a/src/include/disk.h b/src/include/disk.h
+index eb93d10..8aa37d7 100644
+--- a/src/include/disk.h
++++ b/src/include/disk.h
+@@ -65,6 +65,9 @@ enum _interface_type {interface_type_unknown,
+ ata, atapi, scsi, usb,
+ i1394, fibre, i2o, md};
+
++
++unsigned int lcm(unsigned int x, unsigned int y);
++
+ int disk_get_pci(int fd,
+ unsigned char *bus,
+ unsigned char *device,
+diff --git a/src/lib/disk.c b/src/lib/disk.c
+index 883864f..9c3a878 100644
+--- a/src/lib/disk.c
++++ b/src/lib/disk.c
+@@ -420,6 +420,27 @@ get_sector_size(int filedes)
+ return sector_size;
+ }
+
++/************************************************************
++ * lcm
++ * Requires:
++ * - numbers of which to find the lowest common multiple
++ * Modifies: nothing
++ * Returns:
++ * lowest common multiple of x and y
++ ************************************************************/
++unsigned int
++lcm(unsigned int x, unsigned int y)
++{
++ unsigned int m = x, n = y, o;
++
++ while ((o = m % n)) {
++ m = n;
++ n = o;
++ }
++
++ return (x / n) * y;
++}
++
+ /**
+ * disk_get_partition_info()
+ * @fd - open file descriptor to disk
+@@ -442,26 +463,27 @@ disk_get_partition_info (int fd,
+ uint8_t *mbr_type, uint8_t *signature_type)
+ {
+ legacy_mbr *mbr;
+- void *mbr_unaligned;
++ void *mbr_sector;
++ size_t mbr_size;
+ off_t offset;
+ int this_bytes_read = 0;
+ int gpt_invalid=0, mbr_invalid=0;
+ int rc=0;
+ int sector_size = get_sector_size(fd);
+
+- if (sizeof(*mbr) != sector_size)
+- return 1;
+- mbr_unaligned = malloc(sizeof(*mbr)+sector_size-1);
+- mbr = (legacy_mbr *)
+- (((unsigned long)mbr_unaligned + sector_size - 1) &
+- ~(unsigned long)(sector_size-1));
+- memset(mbr, 0, sizeof(*mbr));
++
++ mbr_size = lcm(sizeof(*mbr), sector_size);
++ if ((rc = posix_memalign(&mbr_sector, sector_size, mbr_size)) != 0)
++ goto error;
++ memset(mbr_sector, '\0', mbr_size);
++
+ offset = lseek(fd, 0, SEEK_SET);
+- this_bytes_read = read(fd, mbr, sizeof(*mbr));
++ this_bytes_read = read(fd, mbr_sector, mbr_size);
+ if (this_bytes_read < sizeof(*mbr)) {
+ rc=1;
+ goto error_free_mbr;
+ }
++ mbr = (legacy_mbr *)mbr_sector;
+ gpt_invalid = gpt_disk_get_partition_info(fd, num,
+ start, size,
+ signature,
+@@ -479,7 +501,8 @@ disk_get_partition_info (int fd,
+ }
+ }
+ error_free_mbr:
+- free(mbr_unaligned);
++ free(mbr_sector);
++ error:
+ return rc;
+ }
+
+diff --git a/src/lib/gpt.c b/src/lib/gpt.c
+index d90ddaf..83e7a94 100644
+--- a/src/lib/gpt.c
++++ b/src/lib/gpt.c
+@@ -215,26 +215,24 @@ read_lastoddsector(int fd, uint64_t lba, void *buffer, size_t count)
+ static ssize_t
+ read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
+ {
+- int sector_size = get_sector_size(fd);
+- off_t offset = lba * sector_size;
++ int sector_size = get_sector_size(fd);
++ off_t offset = lba * sector_size;
+ ssize_t bytesread;
+- void *aligned;
+- void *unaligned;
+-
+- if (bytes % sector_size)
+- return EINVAL;
++ void *iobuf;
++ size_t iobuf_size;
++ int rc;
+
+- unaligned = malloc(bytes+sector_size-1);
+- aligned = (void *)
+- (((unsigned long)unaligned + sector_size - 1) &
+- ~(unsigned long)(sector_size-1));
+- memset(aligned, 0, bytes);
++ iobuf_size = lcm(bytes, sector_size);
++ rc = posix_memalign(&iobuf, sector_size, iobuf_size);
++ if (rc)
++ return rc;
++ memset(iobuf, 0, bytes);
+
+
+- lseek(fd, offset, SEEK_SET);
+- bytesread = read(fd, aligned, bytes);
+- memcpy(buffer, aligned, bytesread);
+- free(unaligned);
++ lseek(fd, offset, SEEK_SET);
++ bytesread = read(fd, iobuf, iobuf_size);
++ memcpy(buffer, iobuf, bytes);
++ free(iobuf);
+
+ /* Kludge. This is necessary to read/write the last
+ block of an odd-sized disk, until Linux 2.5.x kernel fixes.
+--
+1.7.1.1
+
diff --git a/source/a/efibootmgr/efibootmgr.SlackBuild b/source/a/efibootmgr/efibootmgr.SlackBuild
new file mode 100755
index 00000000..1e411677
--- /dev/null
+++ b/source/a/efibootmgr/efibootmgr.SlackBuild
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PKGNAM=efibootmgr
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7lh ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
+fi
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION
+
+zcat $CWD/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/efibootmgr-0.5.4-support-4k-sectors.patch.gz | patch -p1 --verbose || exit 1
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Build:
+CFLAGS="$SLKCFLAGS" make || exit 1
+
+# Install:
+mkdir -p $PKG/usr/sbin
+cp src/efibootmgr/efibootmgr $PKG/usr/sbin
+chown root:root $PKG/usr/sbin/efibootmgr
+chmod 755 $PKG/usr/sbin/efibootmgr
+mkdir -p $PKG/usr/man/man8
+cat src/man/man8/efibootmgr.8 | gzip -9c > $PKG/usr/man/man8/efibootmgr.8.gz
+
+# Strip binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AUTHORS COPYING* INSTALL README* doc/* \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/a/efibootmgr/slack-desc b/source/a/efibootmgr/slack-desc
new file mode 100644
index 00000000..953b4b2a
--- /dev/null
+++ b/source/a/efibootmgr/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+efibootmgr: efibootmgr (tool to modify UEFI boot entries)
+efibootmgr:
+efibootmgr: efibootmgr is a Linux userspace application to modify the Intel
+efibootmgr: Extensible Firmware Interface (EFI) Boot Manager. This application
+efibootmgr: can create and destroy boot entries, change the boot order, change
+efibootmgr: the next running boot option, and more.
+efibootmgr:
+efibootmgr: Homepage: http://linux.dell.com/efibootmgr
+efibootmgr:
+efibootmgr:
+efibootmgr:
diff --git a/source/a/eject/eject.CDROM_DRIVE_STATUS.diff b/source/a/eject/eject.CDROM_DRIVE_STATUS.diff
new file mode 100644
index 00000000..0a80739f
--- /dev/null
+++ b/source/a/eject/eject.CDROM_DRIVE_STATUS.diff
@@ -0,0 +1,76 @@
+# Make CDROM tray toggle more robust by using CDS_TRAY_OPEN
+# when avaiable.
+# Also includes Slackware's eject_for_mac.patch
+#
+diff -Nurp eject.old/eject.c eject.new/eject.c
+--- eject.old/eject.c 2013-02-19 10:18:36.041669514 +0000
++++ eject.new/eject.c 2013-02-19 10:33:04.289392780 +0000
+@@ -564,34 +564,45 @@ static void ToggleTray(int fd)
+ {
+ struct timeval time_start, time_stop;
+ int time_elapsed;
++ int status;
+
+ #ifdef CDROMCLOSETRAY
++
++ status = ioctl(fd, CDROM_DRIVE_STATUS, 0);
++ if (status == CDS_TRAY_OPEN) {
++ CloseTray(fd);
++ } else {
+
+- /* Try to open the CDROM tray and measure the time therefor
+- * needed. In my experience the function needs less than 0.05
+- * seconds if the tray was already open, and at least 1.5 seconds
+- * if it was closed. */
+- gettimeofday(&time_start, NULL);
++ /* Try to open the CDROM tray and measure the time therefor
++ * needed. In my experience the function needs less than 0.05
++ * seconds if the tray was already open, and at least 1.5 seconds
++ * if it was closed. */
++ gettimeofday(&time_start, NULL);
+
+- /* Send the CDROMEJECT command to the device. */
+- if (ioctl(fd, CDROMEJECT, 0) < 0) {
+- perror("ioctl");
+- exit(1);
++ /* Send the CDROMEJECT command to the device. */
++ if (ioctl(fd, CDROMEJECT, 0) < 0 && errno != EIO) {
++ perror("ioctl CDROMEJECT");
++ exit(1);
++ }
++
++ /* Get the second timestamp, to measure the time needed to open
++ * the tray. */
++ gettimeofday(&time_stop, NULL);
++
++ /* If the ioctl returns CDS_TRAY_OPEN now then we can ignore
++ * the guess based on elapsed-time */
++ status = ioctl(fd, CDROM_DRIVE_STATUS, 0);
++ if (status != CDS_TRAY_OPEN) {
++ time_elapsed = (time_stop.tv_sec * 1000000 + time_stop.tv_usec) -
++ (time_start.tv_sec * 1000000 + time_start.tv_usec);
++
++ /* If the tray "opened" too fast, we can be nearly sure, that it
++ * was already open. In this case, close it now. Else the tray was
++ * closed before. This would mean that we are done. */
++ if (time_elapsed < TRAY_WAS_ALREADY_OPEN_USECS)
++ CloseTray(fd);
++ }
+ }
+-
+- /* Get the second timestamp, to measure the time needed to open
+- * the tray. */
+- gettimeofday(&time_stop, NULL);
+-
+- time_elapsed = (time_stop.tv_sec * 1000000 + time_stop.tv_usec) -
+- (time_start.tv_sec * 1000000 + time_start.tv_usec);
+-
+- /* If the tray "opened" too fast, we can be nearly sure, that it
+- * was already open. In this case, close it now. Else the tray was
+- * closed before. This would mean that we are done. */
+- if (time_elapsed < TRAY_WAS_ALREADY_OPEN_USECS)
+- CloseTray(fd);
+-
+ #else
+ fprintf(stderr, _("%s: CD-ROM tray toggle command not supported by this kernel\n"), programName);
+ #endif
diff --git a/source/a/eject/eject.SlackBuild b/source/a/eject/eject.SlackBuild
index 94b0ccf7..7d2c0982 100755
--- a/source/a/eject/eject.SlackBuild
+++ b/source/a/eject/eject.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2006, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2008, 2009, 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
PKGNAM=eject
VERSION=${VERSION:-2.1.5}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -60,7 +60,7 @@ cd ${PKGNAM}
zcat $CWD/eject.spaces.diff.gz | patch -p0 --verbose || exit 1
# Fix "eject -T":
-zcat $CWD/eject_for_mac.patch.gz | patch -p4 --verbose || exit 1
+zcat $CWD/eject.CDROM_DRIVE_STATUS.diff.gz | patch -p1 --verbose || exit 1
# Make sure ownerships and permissions are sane:
chown -R root:root .
diff --git a/source/a/eject/eject_for_mac.patch b/source/a/eject/eject_for_mac.patch
deleted file mode 100644
index c86e3c17..00000000
--- a/source/a/eject/eject_for_mac.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nru /tmp/6rrvEn4EMT/eject-2.1.4/eject.c /tmp/Jon9ZzjSLN/eject-2.1.4/eject.c
---- /tmp/6rrvEn4EMT/eject-2.1.4/eject.c 2007-03-12 14:15:26.000000000 +0100
-+++ /tmp/Jon9ZzjSLN/eject-2.1.4/eject.c 2007-03-12 14:15:28.000000000 +0100
-@@ -552,7 +552,7 @@
- gettimeofday(&time_start, NULL);
-
- /* Send the CDROMEJECT command to the device. */
-- if (ioctl(fd, CDROMEJECT, 0) < 0) {
-+ if (ioctl(fd, CDROMEJECT, 0) < 0 && errno != EIO) {
- perror("ioctl");
- exit(1);
- }
diff --git a/source/a/elilo/elilo.SlackBuild b/source/a/elilo/elilo.SlackBuild
new file mode 100755
index 00000000..ad2ffc14
--- /dev/null
+++ b/source/a/elilo/elilo.SlackBuild
@@ -0,0 +1,116 @@
+#!/bin/sh
+
+# Copyright 2013 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PKGNAM=elilo
+VERSION=${VERSION:-$(echo $PKGNAM*.tar.?z* | rev | cut -f 2 -d - | rev)}
+BUILD=${BUILD:-6}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf elilo
+mkdir elilo
+cd elilo
+tar xvf $CWD/${PKGNAM}-$VERSION-all.tar.?z* || exit 1
+tar xvf elilo-${VERSION}-source.tar.gz || exit 1
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+cd elilo
+
+sed -i "s,/usr/lib,/usr/lib${LIBDIRSUFFIX},g" Make.defaults
+sed -i "s,EFICRT0.*= /usr/lib${LIBDIRSUFFIX},EFICRT0 = /usr/lib${LIBDIRSUFFIX}/gnuefi,g" Make.defaults
+
+# We will build this from source.
+# However, we will package the pre-built EFI binaries, since we would
+# like to include both 32-bit and 64-bit x86 EFI loaders in the
+# finished package.
+
+make || exit 1
+
+# Install the files in the package directory:
+mkdir -p $PKG/usr/sbin
+cp tools/eliloalt $PKG/usr/sbin
+
+# Install eliloconfig, a simple setup script:
+cp -a $CWD/eliloconfig $PKG/usr/sbin
+chown root:root $PKG/usr/sbin/eliloconfig
+chmod 755 $PKG/usr/sbin/eliloconfig
+mkdir -p $PKG/var/log/setup
+cp -a $CWD/setup.ll.eliloconfig $PKG/var/log/setup
+chown root:root $PKG/var/log/setup/setup.ll.eliloconfig
+chmod 755 $PKG/var/log/setup/setup.ll.eliloconfig
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+ ChangeLog LIMITATIONS README README.gnu-efi TODO docs/* \
+ examples \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+
+# Since it might not be safe to strip the EFI binaries, do this now:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+cd ..
+
+# Install EFI bootloaders in /boot:
+mkdir $PKG/boot
+# The ia32 version is pretty much useless, since 32-bit UEFI is nowhere to be
+# found. Maybe it would help old 32-bit Intel Macs though?
+cp -a elilo*ia32.efi $PKG/boot/elilo-ia32.efi
+# Itanium binary isn't needed here.
+#cp -a elilo*ia64.efi $PKG/boot/elilo-ia64.efi
+cp -a elilo*x86_64.efi $PKG/boot/elilo-x86_64.efi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/a/elilo/eliloconfig b/source/a/elilo/eliloconfig
new file mode 100644
index 00000000..91f66d69
--- /dev/null
+++ b/source/a/elilo/eliloconfig
@@ -0,0 +1,213 @@
+#!/bin/sh
+# Copyright 2013 Patrick Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# This script installs the elilo boot loader, the kernel, and optionally
+# an initrd into the EFI System Partition. A boot menu entry can also be
+# installed using efibootmgr. The kernel used will be whatever the symlink
+# /boot/vmlinuz points to, and if /boot/initrd.gz exists, that will be
+# installed as the initrd.
+#
+# The EFI System Partition is expected to be mounted on /boot/efi before
+# running this script.
+
+TMP=/var/log/setup/tmp
+
+# Set the OS root directory (called T_PX for some unknown reason).
+# If an argument is given to this script and it is a directory, it
+# is taken to be the root directory. First though, we check for a
+# directory named $T_PX, and that gets the first priority.
+if [ ! -d "$T_PX" ]; then
+ if [ ! "$1" = "" ]; then
+ if [ -d "$1" ]; then
+ T_PX="$1"
+ fi
+ else
+ # Are we on the installer image?
+ if [ -r /usr/lib/setup/SeTpartitions ]; then
+ T_PX=/mnt
+ # Or, are we on a running system?
+ elif [ -r /etc/slackware-version ]; then
+ T_PX=/
+ # One more installer-likely thing:
+ elif [ -r /usr/lib/setup/setup ]; then
+ T_PX=/mnt
+ else
+ # We will have to assume we're on an installed and running system.
+ T_PX=/
+ fi
+ fi
+fi
+
+# Determine the root partition (such as /dev/sda1)
+ROOT_DEVICE=$2
+if [ "$ROOT_DEVICE" = "" ]; then
+ if [ -r $TMP/SeTrootdev ]; then
+ ROOT_DEVICE="$(cat $TMP/SeTrootdev)"
+ else
+ ROOT_DEVICE="$(mount | cut -f 1 -d ' ' | head -n 1)"
+ fi
+fi
+
+# If the system is not running under EFI, skip running this script:
+if [ ! -d /sys/firmware/efi ]; then
+ if [ "$T_PX" = "/" ]; then
+ echo "ERROR: System is not running under UEFI."
+ fi
+ exit
+fi
+
+# If there's no vfat mounted on /boot/efi or /mnt/boot/efi, forget it:
+if ! mount | grep vfat | grep -wq /boot/efi ; then
+ if ! mount | grep vfat | grep -wq /mnt/boot/efi ; then
+ if [ "$T_PX" = "/" ]; then
+ echo "ERROR: No EFI System Partition mounted on /boot/efi."
+ fi
+ exit
+ fi
+fi
+
+# Figure out the device and partition number of the ESP:
+if mount | grep vfat | grep -wq /boot/efi ; then
+ EFI_DEVICE=$(mount | grep vfat | grep -w /boot/efi | cut -b 1-8)
+ EFI_PARTITION=$(mount | grep vfat | grep -w /boot/efi | cut -f 1 -d ' ' | cut -b 9-)
+else
+ EFI_DEVICE=$(mount | grep vfat | grep -w /mnt/boot/efi | cut -b 1-8)
+ EFI_PARTITION=$(mount | grep vfat | grep -w /mnt/boot/efi | cut -f 1 -d ' ' | cut -b 9-)
+fi
+
+# There better be a kernel:
+if [ ! -r $T_PX/boot/vmlinuz ]; then
+ if [ "$T_PX" = "/" ]; then
+ echo "ERROR: No kernel found at /boot/vmlinuz."
+ fi
+ exit
+fi
+
+dialog --title "INSTALL ELILO" \
+--backtitle "ELILO (EFI Linux Loader) installation" \
+--menu "ELILO is a Linux boot loader for \
+EFI based systems. Installing ELILO will allow you to boot your Linux \
+system from the hard drive after selecting it from the UEFI boot menu. \
+Since an EFI System Partition was detected on this machine, it is \
+recommended that you install ELILO now. Please select an option:" \
+13 70 2 \
+"install" "Install ELILO on the EFI System Partition" \
+"skip" "Do not install ELILO" 2> $TMP/reply
+if [ $? = 1 -o $? = 255 ]; then
+ exit
+fi
+REPLY="`cat $TMP/reply`"
+rm -f $TMP/reply
+if [ "$REPLY" = "skip" ]; then
+ exit
+fi
+
+mkdir -p $T_PX/boot/efi/EFI/Slackware 1> /dev/null 2> /dev/null
+cat << EOF > $T_PX/boot/efi/EFI/Slackware/elilo.conf
+chooser=simple
+delay=1
+timeout=1
+#
+EOF
+cp -a $T_PX/boot/elilo-x86_64.efi $T_PX/boot/efi/EFI/Slackware/elilo.efi 1> /dev/null 2> /dev/null
+cp $T_PX/boot/vmlinuz $T_PX/boot/efi/EFI/Slackware 1> /dev/null 2> /dev/null
+cat << EOF >> $T_PX/boot/efi/EFI/Slackware/elilo.conf
+image=vmlinuz
+ label=vmlinuz
+EOF
+touch -r $T_PX/boot/vmlinuz $T_PX/boot/efi/EFI/Slackware/vmlinuz
+if [ -r $T_PX/boot/initrd.gz ]; then
+ cp $T_PX/boot/initrd.gz $T_PX/boot/efi/EFI/Slackware 1> /dev/null 2> /dev/null
+ touch -r $T_PX/boot/initrd.gz $T_PX/boot/efi/EFI/Slackware/initrd.gz
+ cat << EOF >> $T_PX/boot/efi/EFI/Slackware/elilo.conf
+ initrd=initrd.gz
+EOF
+fi
+cat << EOF >> $T_PX/boot/efi/EFI/Slackware/elilo.conf
+ read-only
+ append="root=$ROOT_DEVICE vga=normal ro"
+EOF
+
+dialog --title "INSTALL BOOT MENU ENTRY?" \
+--backtitle "ELILO (EFI Linux Loader) installation" \
+--menu "Would you like to install \
+a boot menu entry so that you can easily select Slackware when you boot your \
+machine? WARNING: DO NOT install a boot menu entry on Apple hardware. \
+Apple computers use a different type of EFI firmware, and efibootmgr has \
+been known to damage them. On all other computers, it is recommended to add \
+a boot menu entry. Please select an option:" \
+14 70 2 \
+"install" "Install a boot menu entry" \
+"skip" "Do not install a boot menu entry" 2> $TMP/reply
+if [ $? = 1 -o $? = 255 ]; then
+ exit
+fi
+REPLY="`cat $TMP/reply`"
+rm -f $TMP/reply
+if [ "$REPLY" = "skip" ]; then
+ exit
+fi
+
+if [ ! -d /sys/firmware/efi/vars ]; then
+ modprobe efivars 1> /dev/null 2> /dev/null
+ sleep 1 # Probably not needed, but playing it safe
+fi
+# If it's still gone, we fail silently:
+if [ ! -d /sys/firmware/efi/vars ]; then
+ exit
+fi
+
+efibootmgr -v | rev | cut -f 2- | rev | grep Boot0 | grep Slackware | while read line ; do
+ # Reject entries that don't exactly match as not our business
+ if [ ! "$(echo $line | cut -f 2- -d ' ')" = "Slackware" ]; then
+ continue
+ fi
+ ENTRY="$(efibootmgr -v | grep "^$(echo $line | cut -b1-8)")"
+ dialog --title "REMOVE OLD \"Slackware\" EFI BOOT ENTRY?" \
+ --backtitle "ELILO (EFI Linux Loader) installation" \
+ --yesno "An old Slackware boot entry has been found in your EFI boot menu. \
+Would you like to remove this before installing the new Slackware boot \
+entry? This is recommended.\n\nOld EFI boot menu entry:\n$ENTRY" 13 70
+ if [ ! $? = 0 ]; then
+ continue
+ fi
+ # Remove the boot entry:
+ efibootmgr -q -B -b $(echo $line | cut -b5-8)
+done
+
+efibootmgr -q -c -d $EFI_DEVICE -p $EFI_PARTITION -l "\\EFI\\Slackware\\elilo.efi" -L "Slackware"
+
+efibootmgr -v | rev | cut -f 2- | rev | grep Boot0 | grep Slackware | while read line ; do
+ # Reject entries that don't exactly match as not our business
+ if [ ! "$(echo $line | cut -f 2- -d ' ')" = "Slackware" ]; then
+ continue
+ fi
+ ENTRY="$(efibootmgr -v | grep "^$(echo $line | cut -b1-8)")"
+ if echo $ENTRY | grep -q -F "\EFI\Slackware\elilo.efi" ; then
+ dialog --title "EFI BOOT ENTRY INSTALLED" \
+ --backtitle "ELILO (EFI Linux Loader) installation" \
+ --msgbox "A Slackware boot entry has been installed to your EFI boot
+menu.\n\nEFI boot menu entry:\n$ENTRY" 11 70
+ fi
+done
+
+# Done.
diff --git a/source/a/elilo/setup.ll.eliloconfig b/source/a/elilo/setup.ll.eliloconfig
new file mode 100644
index 00000000..75e56138
--- /dev/null
+++ b/source/a/elilo/setup.ll.eliloconfig
@@ -0,0 +1,3 @@
+#!/bin/sh
+#BLURB="Set up ELILO (EFI LILO) to boot Linux from your hard drive"
+sh usr/sbin/eliloconfig $*
diff --git a/source/a/elilo/slack-desc b/source/a/elilo/slack-desc
new file mode 100644
index 00000000..acacac07
--- /dev/null
+++ b/source/a/elilo/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler-----------------------------------------------------|
+elilo: elilo (Linux Loader for EFI-based platforms)
+elilo:
+elilo: This is elilo, a boot loader originally developed by HP for IA-64
+elilo: systems. This is used to load the kernel and initial ramdisk on
+elilo: machines that use UEFI. Since most UEFI implementations are 64-bit,
+elilo: the 64-bit EFI binary is generally the one to use (even for loading
+elilo: a 32-bit kernel).
+elilo:
+elilo: Homepage: http://elilo.sourceforge.net
+elilo:
+elilo:
diff --git a/source/a/etc/etc.SlackBuild b/source/a/etc/etc.SlackBuild
index 5db87ea7..0233a977 100755
--- a/source/a/etc/etc.SlackBuild
+++ b/source/a/etc/etc.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,8 +20,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=14.0
-BUILD=${BUILD:-1}
+VERSION=14.1
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -44,6 +44,10 @@ cd $PKG
explodepkg $CWD/_etc.tar.gz
# Fix for ARCH:
sed -i -e "s#/i486-slackware-linux#/${ARCH}-slackware-linux#" etc/ld.so.conf.new
+# Fix paths if lib64 is needed:
+if [ "$ARCH" = "x86_64" ]; then
+ sed -i -e "s#/lib#/lib64#" etc/ld.so.conf.new
+fi
cp -a $CWD/termcap-BSD.gz etc/termcap-BSD.gz
gzip -d --force etc/termcap-BSD.gz
chown root:root etc/termcap-BSD
diff --git a/source/a/file/file.SlackBuild b/source/a/file/file.SlackBuild
index 04c47856..2435c5f0 100755
--- a/source/a/file/file.SlackBuild
+++ b/source/a/file/file.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -71,9 +71,15 @@ zcat $CWD/file.etc.file.diff.gz | patch -p1 --verbose || exit 1
# This is needed after the patch above:
autoreconf || exit 1
-# Don't spew warnings about using the flat text files
-zcat $CWD/file.quiet.diff.gz | patch -p1 -E --verbose || exit 1
-# I don't know what this one does
+# Since we're going to include the compiled magic database now (otherwise
+# there seem to be libmagic related crashes), this patch probably doesn't
+# need to be applied.
+#
+## Don't spew warnings about using the flat text files
+#zcat $CWD/file.quiet.diff.gz | patch -p1 -E --verbose || exit 1
+
+# Keep the output format for ELF binaries the same as it was in earlier
+# versions of file to avoid breaking existing scripts:
zcat $CWD/file.short.diff.gz | patch -p1 -E --verbose || exit 1
# Add zisofs and crda regulatory bin detection
@@ -103,22 +109,27 @@ make install DESTDIR=$PKG || exit 1
# Seems --disable-static has been ignored lately:
rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libmagic.a
-# Is file really this much of a processing bottleneck? Doubtful.
+# Update: We're going to use magic.mgc now as the flat files cause
+# libmagic crashes with versions newer than file-5.11. Maybe that
+# wasn't being tested as well... in any case, using magic.mgc works.
#
-# NOTE: Benchmarked flat files vs. .mgc June 2009, found no measurable
-# difference on 3000+ files.
#
-# If you really need these (let's say you're doing virus scanning
-# and this *would* speed things up quite a bit) you can create
-# the pre-parsed file yourself using file's -C option.
-rm -f $PKG/etc/file/magic.mgc
-mkdir -p $PKG/etc/file/magic
-cp -a magic/Magdir/* $PKG/etc/file/magic
-# After building, this works fine. /etc/file/magic/ takes up 1.2M,
-# while the magic.mgc file is 1.7M. Considering a difference of 500k,
-# and the potential speedup, I'm not sure it's worth the effort...
-# but it does make it easier for an admin to add a small chunk of
-# new magic.
+## Is file really this much of a processing bottleneck? Doubtful.
+##
+## NOTE: Benchmarked flat files vs. .mgc June 2009, found no measurable
+## difference on 3000+ files.
+##
+## If you really need these (let's say you're doing virus scanning
+## and this *would* speed things up quite a bit) you can create
+## the pre-parsed file yourself using file's -C option.
+#rm -f $PKG/etc/file/magic.mgc
+#mkdir -p $PKG/etc/file/magic
+#cp -a magic/Magdir/* $PKG/etc/file/magic
+## After building, this works fine. /etc/file/magic/ takes up 1.2M,
+## while the magic.mgc file is 1.7M. Considering a difference of 500k,
+## and the potential speedup, I'm not sure it's worth the effort...
+## but it does make it easier for an admin to add a small chunk of
+## new magic.
# IMHO, moving this sort of thing does not make sense.
# We'll support both the traditional and new locations.
diff --git a/source/a/floppy/fdutils-5.4-20020222.diff b/source/a/floppy/fdutils-5.4-20020222.diff
deleted file mode 100644
index 28a7b040..00000000
--- a/source/a/floppy/fdutils-5.4-20020222.diff
+++ /dev/null
@@ -1,2991 +0,0 @@
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/Changelog fdutils/Changelog
---- fdutils-5.4/Changelog Sat Jun 3 16:29:33 2000
-+++ fdutils/Changelog Sun Feb 3 23:51:42 2002
-@@ -1,3 +1,9 @@
-+020203 Fix fdmount and superformat bugs
-+020203 Create /dev/fd0 before testing for existence of /dev/fd0
-+011002 Fix floppycontrol.c printf conditional on FD_DISK_CHANGED, so that
-+ it works with gcc3 which apparently considers printf as a macro...
-+000612 Explicitly include sysmacros.h, apparently this is needed in
-+ certain environments
- 000603 Released 5.4
- 000527 Fixed a couple of buffer overrun exploits and other cleanup. Made
- fdutils compilable with Linux 2.3/2.4 kernels. Documentation fixes
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/INSTALL fdutils/INSTALL
---- fdutils-5.4/INSTALL Thu Jul 1 19:48:19 1999
-+++ fdutils/INSTALL Mon May 21 00:24:21 2001
-@@ -8,14 +8,17 @@
- 3. Compile the utilities:
- make
-
-- 3. Run the MAKEFLOPPIES script to create the device files:
-+ 4. Install:
-+ make install
-+
-+ 5. Run the MAKEFLOPPIES script to create the device files:
- cd /dev
- MAKEFLOPPIES
-
-- 4. Enjoy!
-+ 6. Enjoy!
- I you have any questions, feel free to ask!
-
-- 5. You might also want to get a recent version of mtools (later than
-+ 7. You might also want to get a recent version of mtools (later than
- 3.0)
-
- A. Knaff
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/config.guess fdutils/config.guess
---- fdutils-5.4/config.guess Tue Jun 17 22:37:13 1997
-+++ fdutils/config.guess Mon May 21 00:24:45 2001
-@@ -1,7 +1,10 @@
- #! /bin/sh
- # Attempt to guess a canonical system name.
--# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
--#
-+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-+# Free Software Foundation, Inc.
-+
-+timestamp='2001-04-20'
-+
- # This file 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 of the License, or
-@@ -22,18 +25,92 @@
- # the same distribution terms that you use for the rest of that program.
-
- # Written by Per Bothner <bothner@cygnus.com>.
--# The master version of this file is at the FSF in /home/gd/gnu/lib.
-+# Please send patches to <config-patches@gnu.org>.
- #
- # This script attempts to guess a canonical system name similar to
- # config.sub. If it succeeds, it prints the system name on stdout, and
- # exits with 0. Otherwise, it exits with 1.
- #
- # The plan is that this can be called by configure scripts if you
--# don't specify an explicit system type (host/target name).
--#
--# Only a few systems have been added to this list; please add others
--# (but try to keep the structure clean).
--#
-+# don't specify an explicit build system type.
-+
-+me=`echo "$0" | sed -e 's,.*/,,'`
-+
-+usage="\
-+Usage: $0 [OPTION]
-+
-+Output the configuration name of the system \`$me' is run on.
-+
-+Operation modes:
-+ -h, --help print this help, then exit
-+ -t, --time-stamp print date of last modification, then exit
-+ -v, --version print version number, then exit
-+
-+Report bugs and patches to <config-patches@gnu.org>."
-+
-+version="\
-+GNU config.guess ($timestamp)
-+
-+Originally written by Per Bothner.
-+Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
-+Free Software Foundation, Inc.
-+
-+This is free software; see the source for copying conditions. There is NO
-+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-+
-+help="
-+Try \`$me --help' for more information."
-+
-+# Parse command line
-+while test $# -gt 0 ; do
-+ case $1 in
-+ --time-stamp | --time* | -t )
-+ echo "$timestamp" ; exit 0 ;;
-+ --version | -v )
-+ echo "$version" ; exit 0 ;;
-+ --help | --h* | -h )
-+ echo "$usage"; exit 0 ;;
-+ -- ) # Stop option processing
-+ shift; break ;;
-+ - ) # Use stdin as input.
-+ break ;;
-+ -* )
-+ echo "$me: invalid option $1$help" >&2
-+ exit 1 ;;
-+ * )
-+ break ;;
-+ esac
-+done
-+
-+if test $# != 0; then
-+ echo "$me: too many arguments$help" >&2
-+ exit 1
-+fi
-+
-+
-+dummy=dummy-$$
-+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
-+
-+# CC_FOR_BUILD -- compiler used by this script.
-+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-+# use `HOST_CC' if defined, but it is deprecated.
-+
-+case $CC_FOR_BUILD,$HOST_CC,$CC in
-+ ,,) echo "int dummy(){}" > $dummy.c
-+ for c in cc gcc c89 ; do
-+ ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
-+ if test $? = 0 ; then
-+ CC_FOR_BUILD="$c"; break
-+ fi
-+ done
-+ rm -f $dummy.c $dummy.o $dummy.rel
-+ if test x"$CC_FOR_BUILD" = x ; then
-+ CC_FOR_BUILD=no_compiler_found
-+ fi
-+ ;;
-+ ,,*) CC_FOR_BUILD=$CC ;;
-+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-+esac
-
- # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
- # (ghazi@noc.rutgers.edu 8/24/94.)
-@@ -43,37 +120,162 @@
-
- UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
- UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
--UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
- UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
--trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
--
- # Note: order is significant - the case branches are not exclusive.
-
- case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-+ *:NetBSD:*:*)
-+ # Netbsd (nbsd) targets should (where applicable) match one or
-+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
-+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
-+ # switched to ELF, *-*-netbsd* would select the old
-+ # object file format. This provides both forward
-+ # compatibility and a consistent mechanism for selecting the
-+ # object file format.
-+ # Determine the machine/vendor (is the vendor relevant).
-+ case "${UNAME_MACHINE}" in
-+ amiga) machine=m68k-unknown ;;
-+ arm32) machine=arm-unknown ;;
-+ atari*) machine=m68k-atari ;;
-+ sun3*) machine=m68k-sun ;;
-+ mac68k) machine=m68k-apple ;;
-+ macppc) machine=powerpc-apple ;;
-+ hp3[0-9][05]) machine=m68k-hp ;;
-+ ibmrt|romp-ibm) machine=romp-ibm ;;
-+ *) machine=${UNAME_MACHINE}-unknown ;;
-+ esac
-+ # The Operating System including object format, if it has switched
-+ # to ELF recently, or will in the future.
-+ case "${UNAME_MACHINE}" in
-+ i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
-+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-+ | grep __ELF__ >/dev/null
-+ then
-+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-+ # Return netbsd for either. FIX?
-+ os=netbsd
-+ else
-+ os=netbsdelf
-+ fi
-+ ;;
-+ *)
-+ os=netbsd
-+ ;;
-+ esac
-+ # The OS release
-+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-+ # contains redundant information, the shorter form:
-+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-+ echo "${machine}-${os}${release}"
-+ exit 0 ;;
- alpha:OSF1:*:*)
-+ if test $UNAME_RELEASE = "V4.0"; then
-+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-+ fi
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
-- echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
-+ cat <<EOF >$dummy.s
-+ .data
-+\$Lformat:
-+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-+
-+ .text
-+ .globl main
-+ .align 4
-+ .ent main
-+main:
-+ .frame \$30,16,\$26,0
-+ ldgp \$29,0(\$27)
-+ .prologue 1
-+ .long 0x47e03d80 # implver \$0
-+ lda \$2,-1
-+ .long 0x47e20c21 # amask \$2,\$1
-+ lda \$16,\$Lformat
-+ mov \$0,\$17
-+ not \$1,\$18
-+ jsr \$26,printf
-+ ldgp \$29,0(\$26)
-+ mov 0,\$16
-+ jsr \$26,exit
-+ .end main
-+EOF
-+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-+ if test "$?" = 0 ; then
-+ case `./$dummy` in
-+ 0-0)
-+ UNAME_MACHINE="alpha"
-+ ;;
-+ 1-0)
-+ UNAME_MACHINE="alphaev5"
-+ ;;
-+ 1-1)
-+ UNAME_MACHINE="alphaev56"
-+ ;;
-+ 1-101)
-+ UNAME_MACHINE="alphapca56"
-+ ;;
-+ 2-303)
-+ UNAME_MACHINE="alphaev6"
-+ ;;
-+ 2-307)
-+ UNAME_MACHINE="alphaev67"
-+ ;;
-+ esac
-+ fi
-+ rm -f $dummy.s $dummy
-+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-+ exit 0 ;;
-+ Alpha\ *:Windows_NT*:*)
-+ # How do we know it's Interix rather than the generic POSIX subsystem?
-+ # Should we change UNAME_MACHINE based on the output of uname instead
-+ # of the specific Alpha model?
-+ echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
-- echo m68k-cbm-sysv4
-+ echo m68k-unknown-sysv4
- exit 0;;
-- amiga:NetBSD:*:*)
-- echo m68k-cbm-netbsd${UNAME_RELEASE}
-- exit 0 ;;
- amiga:OpenBSD:*:*)
-- echo m68k-cbm-openbsd${UNAME_RELEASE}
-- exit 0 ;;
-+ echo m68k-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:[Aa]miga[Oo][Ss]:*:*)
-+ echo ${UNAME_MACHINE}-unknown-amigaos
-+ exit 0 ;;
-+ arc64:OpenBSD:*:*)
-+ echo mips64el-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ arc:OpenBSD:*:*)
-+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ hkmips:OpenBSD:*:*)
-+ echo mips-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ pmax:OpenBSD:*:*)
-+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ sgi:OpenBSD:*:*)
-+ echo mips-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ wgrisc:OpenBSD:*:*)
-+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:OS/390:*:*)
-+ echo i370-ibm-openedition
-+ exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
-- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
-+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-+ echo hppa1.1-hitachi-hiuxmpp
-+ exit 0;;
-+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
-@@ -81,9 +283,12 @@
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
-- NILE:*:*:dcosx)
-+ NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
-+ sun4H:SunOS:5.*:*)
-+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-+ exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
-@@ -108,26 +313,61 @@
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
-+ sun*:*:4.2BSD:*)
-+ UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-+ case "`/bin/arch`" in
-+ sun3)
-+ echo m68k-sun-sunos${UNAME_RELEASE}
-+ ;;
-+ sun4)
-+ echo sparc-sun-sunos${UNAME_RELEASE}
-+ ;;
-+ esac
-+ exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
-- atari*:NetBSD:*:*)
-- echo m68k-atari-netbsd${UNAME_RELEASE}
-- exit 0 ;;
- atari*:OpenBSD:*:*)
-- echo m68k-atari-openbsd${UNAME_RELEASE}
-+ echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
-- sun3*:NetBSD:*:*)
-- echo m68k-sun-netbsd${UNAME_RELEASE}
-+ # The situation for MiNT is a little confusing. The machine name
-+ # can be virtually everything (everything which is not
-+ # "atarist" or "atariste" at least should have a processor
-+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
-+ # to the lowercase version "mint" (or "freemint"). Finally
-+ # the system name "TOS" denotes a system which is actually not
-+ # MiNT. But MiNT is downward compatible to TOS, so this should
-+ # be no problem.
-+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-+ echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
-- sun3*:OpenBSD:*:*)
-- echo m68k-sun-openbsd${UNAME_RELEASE}
-+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-+ echo m68k-atari-mint${UNAME_RELEASE}
-+ exit 0 ;;
-+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-+ echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
-- mac68k:NetBSD:*:*)
-- echo m68k-apple-netbsd${UNAME_RELEASE}
-+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-+ echo m68k-milan-mint${UNAME_RELEASE}
-+ exit 0 ;;
-+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-+ echo m68k-hades-mint${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-+ echo m68k-unknown-mint${UNAME_RELEASE}
-+ exit 0 ;;
-+ sun3*:OpenBSD:*:*)
-+ echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
-- echo m68k-apple-openbsd${UNAME_RELEASE}
-+ echo m68k-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ mvme68k:OpenBSD:*:*)
-+ echo m68k-unknown-openbsd${UNAME_RELEASE}
-+ exit 0 ;;
-+ mvme88k:OpenBSD:*:*)
-+ echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
-@@ -141,9 +381,17 @@
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
-+ 2020:CLIX:*:* | 2430:CLIX:*:*)
-+ echo clipper-intergraph-clix${UNAME_RELEASE}
-+ exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
-- sed 's/^ //' << EOF >dummy.c
-- int main (argc, argv) int argc; char **argv; {
-+ sed 's/^ //' << EOF >$dummy.c
-+#ifdef __cplusplus
-+#include <stdio.h> /* for printf() prototype */
-+ int main (int argc, char *argv[]) {
-+#else
-+ int main (argc, argv) int argc; char *argv[]; {
-+#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-@@ -158,12 +406,15 @@
- exit (-1);
- }
- EOF
-- ${CC-cc} dummy.c -o dummy \
-- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-- && rm dummy.c dummy && exit 0
-- rm -f dummy.c dummy
-+ $CC_FOR_BUILD $dummy.c -o $dummy \
-+ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-+ && rm -f $dummy.c $dummy && exit 0
-+ rm -f $dummy.c $dummy
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
-+ Motorola:PowerMAX_OS:*:*)
-+ echo powerpc-motorola-powermax
-+ exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
-@@ -179,15 +430,18 @@
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
-- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
-- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
-+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-+ then
-+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-+ [ ${TARGET_BINARY_INTERFACE}x = x ]
-+ then
- echo m88k-dg-dgux${UNAME_RELEASE}
-- else
-+ else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
-+ fi
-+ else
-+ echo i586-dg-dgux${UNAME_RELEASE}
- fi
-- else echo i586-dg-dgux${UNAME_RELEASE}
-- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
-@@ -208,12 +462,20 @@
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
-- i?86:AIX:*:*)
-+ i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
-+ ia64:AIX:*:*)
-+ if [ -x /usr/bin/oslevel ] ; then
-+ IBM_REV=`/usr/bin/oslevel`
-+ else
-+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-+ fi
-+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-+ exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-- sed 's/^ //' << EOF >dummy.c
-+ sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
-@@ -224,8 +486,8 @@
- exit(0);
- }
- EOF
-- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-- rm -f dummy.c dummy
-+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-+ rm -f $dummy.c $dummy
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
-@@ -233,8 +495,9 @@
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
-- *:AIX:*:4)
-- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
-+ *:AIX:*:[45])
-+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
-+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
-@@ -242,7 +505,7 @@
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
-- IBM_REV=4.${UNAME_RELEASE}
-+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
-@@ -252,7 +515,7 @@
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
-- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
-+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
-@@ -267,18 +530,75 @@
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
-- 9000/[3478]??:HP-UX:*:*)
-+ 9000/[34678]??:HP-UX:*:*)
-+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
-- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
-- 9000/8?? ) HP_ARCH=hppa1.0 ;;
-+ 9000/[678][0-9][0-9])
-+ case "${HPUX_REV}" in
-+ 11.[0-9][0-9])
-+ if [ -x /usr/bin/getconf ]; then
-+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-+ case "${sc_cpu_version}" in
-+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-+ 532) # CPU_PA_RISC2_0
-+ case "${sc_kernel_bits}" in
-+ 32) HP_ARCH="hppa2.0n" ;;
-+ 64) HP_ARCH="hppa2.0w" ;;
-+ esac ;;
-+ esac
-+ fi ;;
-+ esac
-+ if [ "${HP_ARCH}" = "" ]; then
-+ sed 's/^ //' << EOF >$dummy.c
-+
-+ #define _HPUX_SOURCE
-+ #include <stdlib.h>
-+ #include <unistd.h>
-+
-+ int main ()
-+ {
-+ #if defined(_SC_KERNEL_BITS)
-+ long bits = sysconf(_SC_KERNEL_BITS);
-+ #endif
-+ long cpu = sysconf (_SC_CPU_VERSION);
-+
-+ switch (cpu)
-+ {
-+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-+ case CPU_PA_RISC2_0:
-+ #if defined(_SC_KERNEL_BITS)
-+ switch (bits)
-+ {
-+ case 64: puts ("hppa2.0w"); break;
-+ case 32: puts ("hppa2.0n"); break;
-+ default: puts ("hppa2.0"); break;
-+ } break;
-+ #else /* !defined(_SC_KERNEL_BITS) */
-+ puts ("hppa2.0"); break;
-+ #endif
-+ default: puts ("hppa1.0"); break;
-+ }
-+ exit (0);
-+ }
-+EOF
-+ (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
-+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
-+ rm -f $dummy.c $dummy
-+ fi ;;
- esac
-- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
-+ ia64:HP-UX:*:*)
-+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-+ echo ia64-hp-hpux${HPUX_REV}
-+ exit 0 ;;
- 3050*:HI-UX:*:*)
-- sed 's/^ //' << EOF >dummy.c
-+ sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
-@@ -303,8 +623,8 @@
- exit (0);
- }
- EOF
-- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-- rm -f dummy.c dummy
-+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-+ rm -f $dummy.c $dummy
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-@@ -313,13 +633,16 @@
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
-+ *9??*:MPE/iX:*:*)
-+ echo hppa1.0-hp-mpeix
-+ exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
-- i?86:OSF1:*:*)
-+ i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
-@@ -329,6 +652,9 @@
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
-+ hppa*:OpenBSD:*:*)
-+ echo hppa-unknown-openbsd
-+ exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
-@@ -359,104 +685,297 @@
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
- exit 0 ;;
- CRAY*TS:*:*:*)
-- echo t90-cray-unicos${UNAME_RELEASE}
-+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-+ exit 0 ;;
-+ CRAY*T3D:*:*:*)
-+ echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-+ exit 0 ;;
-+ CRAY*T3E:*:*:*)
-+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-+ exit 0 ;;
-+ CRAY*SV1:*:*:*)
-+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
-- F300:UNIX_System_V:*:*)
-- FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
-+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
-- F301:UNIX_System_V:*:*)
-- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
-- exit 0 ;;
-- hp3[0-9][05]:NetBSD:*:*)
-- echo m68k-hp-netbsd${UNAME_RELEASE}
-+ hp300:OpenBSD:*:*)
-+ echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
-- hp3[0-9][05]:OpenBSD:*:*)
-- echo m68k-hp-openbsd${UNAME_RELEASE}
-- exit 0 ;;
-- i?86:BSD/386:*:* | *:BSD/OS:*:*)
-+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
-+ sparc*:BSD/OS:*:*)
-+ echo sparc-unknown-bsdi${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:BSD/OS:*:*)
-+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-+ exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
-- *:NetBSD:*:*)
-- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- i*:CYGWIN*:*)
-- echo i386-pc-cygwin32
-+ echo ${UNAME_MACHINE}-pc-cygwin
-+ exit 0 ;;
-+ i*:MINGW*:*)
-+ echo ${UNAME_MACHINE}-pc-mingw32
-+ exit 0 ;;
-+ i*:PW*:*)
-+ echo ${UNAME_MACHINE}-pc-pw32
-+ exit 0 ;;
-+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-+ # How do we know it's Interix rather than the generic POSIX subsystem?
-+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-+ # UNAME_MACHINE based on the output of uname instead of i386?
-+ echo i386-pc-interix
-+ exit 0 ;;
-+ i*:UWIN*:*)
-+ echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
-- echo powerpcle-unknown-cygwin32
-+ echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
-- echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
-- *:Linux:*:*)
-- # The BFD linker knows what the default object file format is, so
-- # first see if it will tell us.
-- ld_help_string=`ld --help 2>&1`
-- if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
-- echo "${UNAME_MACHINE}-pc-linux" ; exit 0
-- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
-- echo "${UNAME_MACHINE}-pc-linux-aout" ; exit 0
-- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
-- echo "${UNAME_MACHINE}-pc-linux-coff" ; exit 0
-- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
-- echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
-- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
-- echo "${UNAME_MACHINE}-unknown-linux-aout" ; exit 0
-- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
-- echo "powerpc-unknown-linux" ; exit 0
-- elif test "${UNAME_MACHINE}" = "alpha" ; then
-- echo alpha-unknown-linux ; exit 0
-- elif test "${UNAME_MACHINE}" = "sparc" ; then
-- echo sparc-unknown-linux ; exit 0
-- else
-- # Either a pre-BFD a.out linker (linux-oldld) or one that does not give us
-- # useful --help. Gcc wants to distinguish between linux-oldld and linux-aout.
-- test ! -d /usr/lib/ldscripts/. \
-- && echo "${UNAME_MACHINE}-pc-linux-oldld" && exit 0
-- # Determine whether the default compiler is a.out or elf
-- cat >dummy.c <<EOF
-+ i*86:Minix:*:*)
-+ echo ${UNAME_MACHINE}-pc-minix
-+ exit 0 ;;
-+ arm*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-gnu
-+ exit 0 ;;
-+ ia64:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux
-+ exit 0 ;;
-+ m68*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-gnu
-+ exit 0 ;;
-+ mips:Linux:*:*)
-+ cat >$dummy.c <<EOF
-+#ifdef __cplusplus
-+#include <stdio.h> /* for printf() prototype */
-+int main (int argc, char *argv[]) {
-+#else
-+int main (argc, argv) int argc; char *argv[]; {
-+#endif
-+#ifdef __MIPSEB__
-+ printf ("%s-unknown-linux-gnu\n", argv[1]);
-+#endif
-+#ifdef __MIPSEL__
-+ printf ("%sel-unknown-linux-gnu\n", argv[1]);
-+#endif
-+ return 0;
-+}
-+EOF
-+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-+ rm -f $dummy.c $dummy
-+ ;;
-+ ppc:Linux:*:*)
-+ # Determine Lib Version
-+ cat >$dummy.c <<EOF
-+#include <features.h>
-+#if defined(__GLIBC__)
-+extern char __libc_version[];
-+extern char __libc_release[];
-+#endif
- main(argc, argv)
--int argc;
--char *argv[];
-+ int argc;
-+ char *argv[];
- {
-+#if defined(__GLIBC__)
-+ printf("%s %s\n", __libc_version, __libc_release);
-+#else
-+ printf("unknown\n");
-+#endif
-+ return 0;
-+}
-+EOF
-+ LIBC=""
-+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
-+ if test "$?" = 0 ; then
-+ ./$dummy | grep 1\.99 > /dev/null
-+ if test "$?" = 0 ; then LIBC="libc1" ; fi
-+ fi
-+ rm -f $dummy.c $dummy
-+ echo powerpc-unknown-linux-gnu${LIBC}
-+ exit 0 ;;
-+ alpha:Linux:*:*)
-+ cat <<EOF >$dummy.s
-+ .data
-+ \$Lformat:
-+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-+ .text
-+ .globl main
-+ .align 4
-+ .ent main
-+ main:
-+ .frame \$30,16,\$26,0
-+ ldgp \$29,0(\$27)
-+ .prologue 1
-+ .long 0x47e03d80 # implver \$0
-+ lda \$2,-1
-+ .long 0x47e20c21 # amask \$2,\$1
-+ lda \$16,\$Lformat
-+ mov \$0,\$17
-+ not \$1,\$18
-+ jsr \$26,printf
-+ ldgp \$29,0(\$26)
-+ mov 0,\$16
-+ jsr \$26,exit
-+ .end main
-+EOF
-+ LIBC=""
-+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-+ if test "$?" = 0 ; then
-+ case `./$dummy` in
-+ 0-0) UNAME_MACHINE="alpha" ;;
-+ 1-0) UNAME_MACHINE="alphaev5" ;;
-+ 1-1) UNAME_MACHINE="alphaev56" ;;
-+ 1-101) UNAME_MACHINE="alphapca56" ;;
-+ 2-303) UNAME_MACHINE="alphaev6" ;;
-+ 2-307) UNAME_MACHINE="alphaev67" ;;
-+ esac
-+ objdump --private-headers $dummy | \
-+ grep ld.so.1 > /dev/null
-+ if test "$?" = 0 ; then
-+ LIBC="libc1"
-+ fi
-+ fi
-+ rm -f $dummy.s $dummy
-+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-+ exit 0 ;;
-+ parisc:Linux:*:* | hppa:Linux:*:*)
-+ # Look for CPU level
-+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
-+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
-+ *) echo hppa-unknown-linux-gnu ;;
-+ esac
-+ exit 0 ;;
-+ parisc64:Linux:*:* | hppa64:Linux:*:*)
-+ echo hppa64-unknown-linux-gnu
-+ exit 0 ;;
-+ s390:Linux:*:* | s390x:Linux:*:*)
-+ echo ${UNAME_MACHINE}-ibm-linux
-+ exit 0 ;;
-+ sh*:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-gnu
-+ exit 0 ;;
-+ sparc:Linux:*:* | sparc64:Linux:*:*)
-+ echo ${UNAME_MACHINE}-unknown-linux-gnu
-+ exit 0 ;;
-+ x86_64:Linux:*:*)
-+ echo x86_64-unknown-linux-gnu
-+ exit 0 ;;
-+ i*86:Linux:*:*)
-+ # The BFD linker knows what the default object file format is, so
-+ # first see if it will tell us. cd to the root directory to prevent
-+ # problems with other programs or directories called `ld' in the path.
-+ ld_supported_emulations=`cd /; ld --help 2>&1 \
-+ | sed -ne '/supported emulations:/!d
-+ s/[ ][ ]*/ /g
-+ s/.*supported emulations: *//
-+ s/ .*//
-+ p'`
-+ case "$ld_supported_emulations" in
-+ i*86linux)
-+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-+ exit 0
-+ ;;
-+ elf_i*86)
-+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-+ ;;
-+ i*86coff)
-+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-+ exit 0
-+ ;;
-+ esac
-+ # Either a pre-BFD a.out linker (linux-gnuoldld)
-+ # or one that does not give us useful --help.
-+ # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
-+ # If ld does not provide *any* "supported emulations:"
-+ # that means it is gnuoldld.
-+ test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-+ case "${UNAME_MACHINE}" in
-+ i*86)
-+ VENDOR=pc;
-+ ;;
-+ *)
-+ VENDOR=unknown;
-+ ;;
-+ esac
-+ # Determine whether the default compiler is a.out or elf
-+ cat >$dummy.c <<EOF
-+#include <features.h>
-+#ifdef __cplusplus
-+#include <stdio.h> /* for printf() prototype */
-+ int main (int argc, char *argv[]) {
-+#else
-+ int main (argc, argv) int argc; char *argv[]; {
-+#endif
- #ifdef __ELF__
-- printf ("%s-pc-linux\n", argv[1]);
-+# ifdef __GLIBC__
-+# if __GLIBC__ >= 2
-+ printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-+# else
-+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-+# endif
-+# else
-+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-+# endif
- #else
-- printf ("%s-pc-linux-aout\n", argv[1]);
-+ printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
- #endif
- return 0;
- }
- EOF
-- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-- rm -f dummy.c dummy
-- fi ;;
-+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-+ rm -f $dummy.c $dummy
-+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
-+ ;;
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
- # are messed up and put the nodename in both sysname and nodename.
-- i?86:DYNIX/ptx:4*:*)
-+ i*86:DYNIX/ptx:4*:*)
- echo i386-sequent-sysv4
- exit 0 ;;
-- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
-+ i*86:UNIX_SV:4.2MP:2.*)
-+ # Unixware is an offshoot of SVR4, but it has its own version
-+ # number series starting with 2...
-+ # I am not positive that other SVR4 systems won't match this,
-+ # I just have to hope. -- rms.
-+ # Use sysv4.2uw... so that sysv4* matches it.
-+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-+ exit 0 ;;
-+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
-+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
-- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
-+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
-- i?86:*:3.2:*)
-+ i*86:*:5:7*)
-+ # Fixed at (any) Pentium or better
-+ UNAME_MACHINE=i586
-+ if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
-+ echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
-+ else
-+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
-+ fi
-+ exit 0 ;;
-+ i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-@@ -465,11 +984,24 @@
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
-+ (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
-+ && UNAME_MACHINE=i686
-+ (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
-+ && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
-+ i*86:*DOS:*:*)
-+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
-+ exit 0 ;;
-+ pc:*:*:*)
-+ # Left here for compatibility:
-+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
-+ # the processor, so we play safe by assuming i386.
-+ echo i386-pc-msdosdjgpp
-+ exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
-@@ -489,7 +1021,7 @@
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
-+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-@@ -500,24 +1032,30 @@
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
-- m68*:LynxOS:2.*:*)
-+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
-- i?86:LynxOS:2.*:*)
-+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
-- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
-+ rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
-+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
-+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
-+ exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
-+ RM*:ReliantUNIX-*:*:*)
-+ echo mips-sni-sysv4
-+ exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
-@@ -529,6 +1067,10 @@
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
-+ PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-+ # says <Richard.M.Bartel@ccMail.Census.GOV>
-+ echo i586-unisys-sysv4
-+ exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
-@@ -541,23 +1083,101 @@
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
-- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
-+ news*:NEWS-OS:6*:*)
-+ echo mips-sony-newsos6
-+ exit 0 ;;
-+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
-- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-- # says <Richard.M.Bartel@ccMail.Census.GOV>
-- echo i586-unisys-sysv4
-- exit 0 ;;
-+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
-+ echo powerpc-be-beos
-+ exit 0 ;;
-+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
-+ echo powerpc-apple-beos
-+ exit 0 ;;
-+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
-+ echo i586-pc-beos
-+ exit 0 ;;
-+ SX-4:SUPER-UX:*:*)
-+ echo sx4-nec-superux${UNAME_RELEASE}
-+ exit 0 ;;
-+ SX-5:SUPER-UX:*:*)
-+ echo sx5-nec-superux${UNAME_RELEASE}
-+ exit 0 ;;
-+ Power*:Rhapsody:*:*)
-+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:Rhapsody:*:*)
-+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:Darwin:*:*)
-+ echo `uname -p`-apple-darwin${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
-+ if test "${UNAME_MACHINE}" = "x86pc"; then
-+ UNAME_MACHINE=pc
-+ fi
-+ echo `uname -p`-${UNAME_MACHINE}-nto-qnx
-+ exit 0 ;;
-+ *:QNX:*:4*)
-+ echo i386-pc-qnx
-+ exit 0 ;;
-+ NSR-[KW]:NONSTOP_KERNEL:*:*)
-+ echo nsr-tandem-nsk${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:NonStop-UX:*:*)
-+ echo mips-compaq-nonstopux
-+ exit 0 ;;
-+ BS2000:POSIX*:*:*)
-+ echo bs2000-siemens-sysv
-+ exit 0 ;;
-+ DS/*:UNIX_System_V:*:*)
-+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-+ exit 0 ;;
-+ *:Plan9:*:*)
-+ # "uname -m" is not consistent, so use $cputype instead. 386
-+ # is converted to i386 for consistency with other x86
-+ # operating systems.
-+ if test "$cputype" = "386"; then
-+ UNAME_MACHINE=i386
-+ else
-+ UNAME_MACHINE="$cputype"
-+ fi
-+ echo ${UNAME_MACHINE}-unknown-plan9
-+ exit 0 ;;
-+ i*86:OS/2:*:*)
-+ # If we were able to find `uname', then EMX Unix compatibility
-+ # is probably installed.
-+ echo ${UNAME_MACHINE}-pc-os2-emx
-+ exit 0 ;;
-+ *:TOPS-10:*:*)
-+ echo pdp10-unknown-tops10
-+ exit 0 ;;
-+ *:TENEX:*:*)
-+ echo pdp10-unknown-tenex
-+ exit 0 ;;
-+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-+ echo pdp10-dec-tops20
-+ exit 0 ;;
-+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-+ echo pdp10-xkl-tops20
-+ exit 0 ;;
-+ *:TOPS-20:*:*)
-+ echo pdp10-unknown-tops20
-+ exit 0 ;;
-+ *:ITS:*:*)
-+ echo pdp10-unknown-its
-+ exit 0 ;;
- esac
-
- #echo '(No uname command or uname output not recognized.)' 1>&2
- #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
--cat >dummy.c <<EOF
-+cat >$dummy.c <<EOF
- #ifdef _SEQUENT_
- # include <sys/types.h>
- # include <sys/utsname.h>
-@@ -595,7 +1215,10 @@
- #endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-+ if (version < 4)
-+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-+ else
-+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
- #endif
-
-@@ -640,11 +1263,24 @@
- #endif
-
- #if defined (vax)
--#if !defined (ultrix)
-- printf ("vax-dec-bsd\n"); exit (0);
--#else
-- printf ("vax-dec-ultrix\n"); exit (0);
--#endif
-+# if !defined (ultrix)
-+# include <sys/param.h>
-+# if defined (BSD)
-+# if BSD == 43
-+ printf ("vax-dec-bsd4.3\n"); exit (0);
-+# else
-+# if BSD == 199006
-+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
-+# else
-+ printf ("vax-dec-bsd\n"); exit (0);
-+# endif
-+# endif
-+# else
-+ printf ("vax-dec-bsd\n"); exit (0);
-+# endif
-+# else
-+ printf ("vax-dec-ultrix\n"); exit (0);
-+# endif
- #endif
-
- #if defined (alliant) && defined (i860)
-@@ -655,8 +1291,8 @@
- }
- EOF
-
--${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
--rm -f dummy.c dummy
-+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-+rm -f $dummy.c $dummy
-
- # Apollos put the system type in the environment.
-
-@@ -688,6 +1324,48 @@
- esac
- fi
-
--#echo '(Unable to guess system type)' 1>&2
-+cat >&2 <<EOF
-+$0: unable to guess system type
-+
-+This script, last modified $timestamp, has failed to recognize
-+the operating system you are using. It is advised that you
-+download the most up to date version of the config scripts from
-+
-+ ftp://ftp.gnu.org/pub/gnu/config/
-+
-+If the version you run ($0) is already up to date, please
-+send the following data and any information you think might be
-+pertinent to <config-patches@gnu.org> in order to provide the needed
-+information to handle your system.
-+
-+config.guess timestamp = $timestamp
-+
-+uname -m = `(uname -m) 2>/dev/null || echo unknown`
-+uname -r = `(uname -r) 2>/dev/null || echo unknown`
-+uname -s = `(uname -s) 2>/dev/null || echo unknown`
-+uname -v = `(uname -v) 2>/dev/null || echo unknown`
-+
-+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-+
-+hostinfo = `(hostinfo) 2>/dev/null`
-+/bin/universe = `(/bin/universe) 2>/dev/null`
-+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-+/bin/arch = `(/bin/arch) 2>/dev/null`
-+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-+
-+UNAME_MACHINE = ${UNAME_MACHINE}
-+UNAME_RELEASE = ${UNAME_RELEASE}
-+UNAME_SYSTEM = ${UNAME_SYSTEM}
-+UNAME_VERSION = ${UNAME_VERSION}
-+EOF
-
- exit 1
-+
-+# Local variables:
-+# eval: (add-hook 'write-file-hooks 'time-stamp)
-+# time-stamp-start: "timestamp='"
-+# time-stamp-format: "%:y-%02m-%02d"
-+# time-stamp-end: "'"
-+# End:
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/config.h.in fdutils/config.h.in
---- fdutils-5.4/config.h.in Fri Jul 2 23:37:12 1999
-+++ fdutils/config.h.in Mon May 21 00:24:53 2001
-@@ -14,3 +14,6 @@
-
- /* Define if you have the <linux/xia_fs.h> header file. */
- #undef HAVE_LINUX_XIA_FS_H
-+
-+/* Define if you have the <sys/sysmacros.h> header file. */
-+#undef HAVE_SYS_SYSMACROS_H
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/config.sub fdutils/config.sub
---- fdutils-5.4/config.sub Sun Mar 2 18:43:27 1997
-+++ fdutils/config.sub Mon May 21 00:24:43 2001
-@@ -1,6 +1,10 @@
- #! /bin/sh
--# Configuration validation subroutine script, version 1.1.
--# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
-+# Configuration validation subroutine script.
-+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-+# Free Software Foundation, Inc.
-+
-+timestamp='2001-05-11'
-+
- # This file is (in principle) common to ALL GNU software.
- # The presence of a machine in this file suggests that SOME GNU software
- # can handle that machine. It does not imply ALL GNU software can.
-@@ -25,6 +29,8 @@
- # configuration script generated by Autoconf, you may include it under
- # the same distribution terms that you use for the rest of that program.
-
-+# Please send patches to <config-patches@gnu.org>.
-+#
- # Configuration subroutine to validate and canonicalize a configuration type.
- # Supply the specified configuration type as an argument.
- # If it is invalid, we print an error message on stderr and exit with code 1.
-@@ -45,30 +51,73 @@
- # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
- # It is wrong to echo any other type of specification.
-
--if [ x$1 = x ]
--then
-- echo Configuration name missing. 1>&2
-- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
-- echo "or $0 ALIAS" 1>&2
-- echo where ALIAS is a recognized configuration type. 1>&2
-- exit 1
--fi
-+me=`echo "$0" | sed -e 's,.*/,,'`
-
--# First pass through any local machine types.
--case $1 in
-- *local*)
-- echo $1
-- exit 0
-- ;;
-- *)
-- ;;
-+usage="\
-+Usage: $0 [OPTION] CPU-MFR-OPSYS
-+ $0 [OPTION] ALIAS
-+
-+Canonicalize a configuration name.
-+
-+Operation modes:
-+ -h, --help print this help, then exit
-+ -t, --time-stamp print date of last modification, then exit
-+ -v, --version print version number, then exit
-+
-+Report bugs and patches to <config-patches@gnu.org>."
-+
-+version="\
-+GNU config.sub ($timestamp)
-+
-+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-+Free Software Foundation, Inc.
-+
-+This is free software; see the source for copying conditions. There is NO
-+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-+
-+help="
-+Try \`$me --help' for more information."
-+
-+# Parse command line
-+while test $# -gt 0 ; do
-+ case $1 in
-+ --time-stamp | --time* | -t )
-+ echo "$timestamp" ; exit 0 ;;
-+ --version | -v )
-+ echo "$version" ; exit 0 ;;
-+ --help | --h* | -h )
-+ echo "$usage"; exit 0 ;;
-+ -- ) # Stop option processing
-+ shift; break ;;
-+ - ) # Use stdin as input.
-+ break ;;
-+ -* )
-+ echo "$me: invalid option $1$help"
-+ exit 1 ;;
-+
-+ *local*)
-+ # First pass through any local machine types.
-+ echo $1
-+ exit 0;;
-+
-+ * )
-+ break ;;
-+ esac
-+done
-+
-+case $# in
-+ 0) echo "$me: missing argument$help" >&2
-+ exit 1;;
-+ 1) ;;
-+ *) echo "$me: too many arguments$help" >&2
-+ exit 1;;
- esac
-
- # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
-- linux-gnu*)
-+ nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
-@@ -94,15 +143,25 @@
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-- -apple)
-+ -apple | -axis)
- os=
- basic_machine=$1
- ;;
-+ -sim | -cisco | -oki | -wec | -winbond)
-+ os=
-+ basic_machine=$1
-+ ;;
-+ -scout)
-+ ;;
-+ -wrs)
-+ os=-vxworks
-+ basic_machine=$1
-+ ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
-- os=sco3.2v5
-+ os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
-@@ -121,6 +180,9 @@
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
-+ -udk*)
-+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-+ ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-@@ -143,25 +205,50 @@
- -psos*)
- os=-psos
- ;;
-+ -mint | -mint[0-9]*)
-+ basic_machine=m68k-atari
-+ os=-mint
-+ ;;
- esac
-
- # Decode aliases for certain CPU-COMPANY combinations.
- case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
-- tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
-- | arme[lb] | pyramid \
-- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
-- | alpha | we32k | ns16k | clipper | i370 | sh \
-- | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
-- | pdp11 | mips64el | mips64orion | mips64orionel \
-- | sparc | sparclet | sparclite | sparc64)
-+ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
-+ | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
-+ | pyramid | mn10200 | mn10300 | tron | a29k \
-+ | 580 | i960 | h8300 \
-+ | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
-+ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-+ | hppa64 \
-+ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
-+ | alphaev6[78] \
-+ | we32k | ns16k | clipper | i370 | sh | sh[34] \
-+ | powerpc | powerpcle \
-+ | 1750a | dsp16xx | pdp10 | pdp11 \
-+ | mips16 | mips64 | mipsel | mips64el \
-+ | mips64orion | mips64orionel | mipstx39 | mipstx39el \
-+ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-+ | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
-+ | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
-+ | v850 | c4x \
-+ | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
-+ | pj | pjl | h8500 | z8k)
- basic_machine=$basic_machine-unknown
- ;;
-+ m6811 | m68hc11 | m6812 | m68hc12)
-+ # Motorola 68HC11/12.
-+ basic_machine=$basic_machine-unknown
-+ os=-none
-+ ;;
-+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65 | z8k)
-+ ;;
-+
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
-- i[3456]86)
-+ i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
-@@ -170,23 +257,52 @@
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
-- vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
-- | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
-- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
-- | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
-- | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
-- | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
-- | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
-- | mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
-+ # FIXME: clean up the formatting here.
-+ vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
-+ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
-+ | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
-+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-+ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
-+ | xmp-* | ymp-* \
-+ | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
-+ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
-+ | hppa2.0n-* | hppa64-* \
-+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
-+ | alphaev6[78]-* \
-+ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
-+ | clipper-* | orion-* \
-+ | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
-+ | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
-+ | mips16-* | mips64-* | mipsel-* \
-+ | mips64el-* | mips64orion-* | mips64orionel-* \
-+ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
-+ | mipstx39-* | mipstx39el-* | mcore-* \
-+ | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
-+ | [cjt]90-* \
-+ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
-+ | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
-+ | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
-+ 386bsd)
-+ basic_machine=i386-unknown
-+ os=-bsd
-+ ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
-+ a29khif)
-+ basic_machine=a29k-amd
-+ os=-udi
-+ ;;
-+ adobe68k)
-+ basic_machine=m68010-adobe
-+ os=-scout
-+ ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
-@@ -202,20 +318,24 @@
- os=-sysv
- ;;
- amiga | amiga-*)
-- basic_machine=m68k-cbm
-+ basic_machine=m68k-unknown
- ;;
-- amigados)
-- basic_machine=m68k-cbm
-- os=-amigados
-+ amigaos | amigados)
-+ basic_machine=m68k-unknown
-+ os=-amigaos
- ;;
- amigaunix | amix)
-- basic_machine=m68k-cbm
-+ basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
-+ apollo68bsd)
-+ basic_machine=m68k-apollo
-+ os=-bsd
-+ ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
-@@ -252,13 +372,16 @@
- basic_machine=cray2-cray
- os=-unicos
- ;;
-- [ctj]90-cray)
-- basic_machine=c90-cray
-+ [cjt]90)
-+ basic_machine=${basic_machine}-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
-+ cris | cris-* | etrax*)
-+ basic_machine=cris-axis
-+ ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
-@@ -292,6 +415,10 @@
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
-+ es1800 | OSE68k | ose68k | ose | OSE)
-+ basic_machine=m68k-ericsson
-+ os=-ose
-+ ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
-@@ -302,6 +429,10 @@
- basic_machine=tron-gmicro
- os=-sysv
- ;;
-+ go32)
-+ basic_machine=i386-pc
-+ os=-go32
-+ ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
-@@ -310,6 +441,14 @@
- basic_machine=h8300-hitachi
- os=-hms
- ;;
-+ h8300xray)
-+ basic_machine=h8300-hitachi
-+ os=-xray
-+ ;;
-+ h8500hms)
-+ basic_machine=h8500-hitachi
-+ os=-hms
-+ ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
-@@ -325,13 +464,30 @@
- basic_machine=m68k-hp
- os=-hpux
- ;;
-+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
-+ basic_machine=hppa1.0-hp
-+ ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
-- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
-+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
-+ basic_machine=hppa1.0-hp
-+ ;;
-+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
-+ basic_machine=hppa1.1-hp
-+ ;;
-+ hp9k78[0-9] | hp78[0-9])
-+ # FIXME: really hppa2.0-hp
-+ basic_machine=hppa1.1-hp
-+ ;;
-+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-+ # FIXME: really hppa2.0-hp
-+ basic_machine=hppa1.1-hp
-+ ;;
-+ hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
-@@ -340,27 +496,42 @@
- hppa-next)
- os=-nextstep3
- ;;
-+ hppaosf)
-+ basic_machine=hppa1.1-hp
-+ os=-osf
-+ ;;
-+ hppro)
-+ basic_machine=hppa1.1-hp
-+ os=-proelf
-+ ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
-- os=-mvs
- ;;
- # I'm not sure what "Sysv32" means. Should this be sysv3.2?
-- i[3456]86v32)
-+ i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
-- i[3456]86v4*)
-+ i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
-- i[3456]86v)
-+ i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
-- i[3456]86sol2)
-+ i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
-+ i386mach)
-+ basic_machine=i386-mach
-+ os=-mach
-+ ;;
-+ i386-vsta | vsta)
-+ basic_machine=i386-unknown
-+ os=-vsta
-+ ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
-@@ -386,19 +557,59 @@
- basic_machine=ns32k-utek
- os=-sysv
- ;;
-+ mingw32)
-+ basic_machine=i386-pc
-+ os=-mingw32
-+ ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
-+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-+ basic_machine=m68k-atari
-+ os=-mint
-+ ;;
-+ mipsel*-linux*)
-+ basic_machine=mipsel-unknown
-+ os=-linux-gnu
-+ ;;
-+ mips*-linux*)
-+ basic_machine=mips-unknown
-+ os=-linux-gnu
-+ ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
-+ mmix*)
-+ basic_machine=mmix-knuth
-+ os=-mmixware
-+ ;;
-+ monitor)
-+ basic_machine=m68k-rom68k
-+ os=-coff
-+ ;;
-+ msdos)
-+ basic_machine=i386-pc
-+ os=-msdos
-+ ;;
-+ mvs)
-+ basic_machine=i370-ibm
-+ os=-mvs
-+ ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
-+ netbsd386)
-+ basic_machine=i386-unknown
-+ os=-netbsd
-+ ;;
-+ netwinder)
-+ basic_machine=armv4l-rebel
-+ os=-linux
-+ ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
-@@ -411,6 +622,10 @@
- basic_machine=mips-sony
- os=-newsos
- ;;
-+ necv70)
-+ basic_machine=v70-nec
-+ os=-sysv
-+ ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
-@@ -436,9 +651,32 @@
- basic_machine=i960-intel
- os=-nindy
- ;;
-+ mon960)
-+ basic_machine=i960-intel
-+ os=-mon960
-+ ;;
-+ nonstopux)
-+ basic_machine=mips-compaq
-+ os=-nonstopux
-+ ;;
- np1)
- basic_machine=np1-gould
- ;;
-+ nsr-tandem)
-+ basic_machine=nsr-tandem
-+ ;;
-+ op50n-* | op60c-*)
-+ basic_machine=hppa1.1-oki
-+ os=-proelf
-+ ;;
-+ OSE68000 | ose68000)
-+ basic_machine=m68000-ericsson
-+ os=-ose
-+ ;;
-+ os68k)
-+ basic_machine=m68k-none
-+ os=-os68k
-+ ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
-@@ -456,30 +694,28 @@
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
-- pentium | p5)
-- basic_machine=i586-intel
-+ pentium | p5 | k5 | k6 | nexgen)
-+ basic_machine=i586-pc
-+ ;;
-+ pentiumpro | p6 | 6x86 | athlon)
-+ basic_machine=i686-pc
- ;;
-- pentiumpro | p6)
-- basic_machine=i686-intel
-+ pentiumii | pentium2)
-+ basic_machine=i686-pc
- ;;
-- pentium-* | p5-*)
-+ pentium-* | p5-* | k5-* | k6-* | nexgen-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
-- pentiumpro-* | p6-*)
-+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
-- k5)
-- # We don't have specific support for AMD's K5 yet, so just call it a Pentium
-- basic_machine=i586-amd
-- ;;
-- nexen)
-- # We don't have specific support for Nexgen yet, so just call it a Pentium
-- basic_machine=i586-nexgen
-+ pentiumii-* | pentium2-*)
-+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
-- power) basic_machine=rs6000-ibm
-+ power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
-@@ -494,12 +730,24 @@
- ps2)
- basic_machine=i386-ibm
- ;;
-+ pw32)
-+ basic_machine=i586-unknown
-+ os=-pw32
-+ ;;
-+ rom68k)
-+ basic_machine=m68k-rom68k
-+ os=-coff
-+ ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
-+ sa29200)
-+ basic_machine=a29k-amd
-+ os=-udi
-+ ;;
- sequent)
- basic_machine=i386-sequent
- ;;
-@@ -507,6 +755,10 @@
- basic_machine=sh-hitachi
- os=-hms
- ;;
-+ sparclite-wrs)
-+ basic_machine=sparclite-wrs
-+ os=-vxworks
-+ ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
-@@ -514,6 +766,13 @@
- spur)
- basic_machine=spur-unknown
- ;;
-+ st2000)
-+ basic_machine=m68k-tandem
-+ ;;
-+ stratus)
-+ basic_machine=i860-stratus
-+ os=-sysv4
-+ ;;
- sun2)
- basic_machine=m68000-sun
- ;;
-@@ -554,10 +813,28 @@
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
-+ sv1)
-+ basic_machine=sv1-cray
-+ os=-unicos
-+ ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
-+ t3e)
-+ basic_machine=t3e-cray
-+ os=-unicos
-+ ;;
-+ tic54x | c54x*)
-+ basic_machine=tic54x-unknown
-+ os=-coff
-+ ;;
-+ tx39)
-+ basic_machine=mipstx39-unknown
-+ ;;
-+ tx39el)
-+ basic_machine=mipstx39el-unknown
-+ ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
-@@ -569,6 +846,10 @@
- basic_machine=a29k-nyu
- os=-sym1
- ;;
-+ v810 | necv810)
-+ basic_machine=v810-nec
-+ os=-none
-+ ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
-@@ -577,7 +858,7 @@
- basic_machine=vax-dec
- os=-vms
- ;;
-- vpp*|vx|vx-*)
-+ vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
-@@ -592,6 +873,14 @@
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
-+ w65*)
-+ basic_machine=w65-wdc
-+ os=-none
-+ ;;
-+ w89k-*)
-+ basic_machine=hppa1.1-winbond
-+ os=-proelf
-+ ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
-@@ -599,6 +888,10 @@
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
-+ z8k-*-coff)
-+ basic_machine=z8k-unknown
-+ os=-sim
-+ ;;
- none)
- basic_machine=none-none
- os=-none
-@@ -606,8 +899,21 @@
-
- # Here we handle the default manufacturer of certain CPU types. It is in
- # some cases the only manufacturer, in others, it is the most popular.
-+ w89k)
-+ basic_machine=hppa1.1-winbond
-+ ;;
-+ op50n)
-+ basic_machine=hppa1.1-oki
-+ ;;
-+ op60c)
-+ basic_machine=hppa1.1-oki
-+ ;;
- mips)
-- basic_machine=mips-mips
-+ if [ x$os = x-linux-gnu ]; then
-+ basic_machine=mips-unknown
-+ else
-+ basic_machine=mips-mips
-+ fi
- ;;
- romp)
- basic_machine=romp-ibm
-@@ -618,13 +924,20 @@
- vax)
- basic_machine=vax-dec
- ;;
-+ pdp10)
-+ # there are many clones, so DEC is not a safe bet
-+ basic_machine=pdp10-unknown
-+ ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
-- sparc)
-+ sh3 | sh4)
-+ basic_machine=sh-unknown
-+ ;;
-+ sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
-@@ -636,6 +949,19 @@
- orion105)
- basic_machine=clipper-highlevel
- ;;
-+ mac | mpw | mac-mpw)
-+ basic_machine=m68k-apple
-+ ;;
-+ pmac | pmac-mpw)
-+ basic_machine=powerpc-apple
-+ ;;
-+ c4x*)
-+ basic_machine=c4x-none
-+ os=-coff
-+ ;;
-+ *-unknown)
-+ # Make sure to match an already-canonicalized machine name.
-+ ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
-@@ -668,9 +994,12 @@
- -solaris)
- os=-solaris2
- ;;
-- -unixware* | svr4*)
-+ -svr4*)
- os=-sysv4
- ;;
-+ -unixware*)
-+ os=-sysv4.2uw
-+ ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
-@@ -681,19 +1010,42 @@
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-- | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
-+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-+ | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
-+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-- | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-- | -linux-gnu* | -uxpv*)
-+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
-+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
-+ -qnx*)
-+ case $basic_machine in
-+ x86-* | i*86-*)
-+ ;;
-+ *)
-+ os=-nto$os
-+ ;;
-+ esac
-+ ;;
-+ -nto*)
-+ os=-nto-qnx
-+ ;;
-+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
-+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-+ ;;
-+ -mac*)
-+ os=`echo $os | sed -e 's|mac|macos|'`
-+ ;;
- -linux*)
-- os=`echo $os | sed -e 's|linux|linux|'`
-+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
-@@ -701,6 +1053,12 @@
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
-+ -opened*)
-+ os=-openedition
-+ ;;
-+ -wince*)
-+ os=-wince
-+ ;;
- -osfrose*)
- os=-osfrose
- ;;
-@@ -716,12 +1074,18 @@
- -acis*)
- os=-aos
- ;;
-+ -386bsd)
-+ os=-bsd
-+ ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -ns2 )
- os=-nextstep2
- ;;
-+ -nsk*)
-+ os=-nsk
-+ ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
-@@ -747,9 +1111,18 @@
- # This must come after -sysvr4.
- -sysv*)
- ;;
-+ -ose*)
-+ os=-ose
-+ ;;
-+ -es1800*)
-+ os=-ose
-+ ;;
- -xenix)
- os=-xenix
- ;;
-+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-+ os=-mint
-+ ;;
- -none)
- ;;
- *)
-@@ -775,9 +1148,15 @@
- *-acorn)
- os=-riscix1.2
- ;;
-+ arm*-rebel)
-+ os=-linux
-+ ;;
- arm*-semi)
- os=-aout
- ;;
-+ pdp10-*)
-+ os=-tops20
-+ ;;
- pdp11-*)
- os=-none
- ;;
-@@ -796,15 +1175,36 @@
- # default.
- # os=-sunos4
- ;;
-+ m68*-cisco)
-+ os=-aout
-+ ;;
-+ mips*-cisco)
-+ os=-elf
-+ ;;
-+ mips*-*)
-+ os=-elf
-+ ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
-+ *-be)
-+ os=-beos
-+ ;;
- *-ibm)
- os=-aix
- ;;
-+ *-wec)
-+ os=-proelf
-+ ;;
-+ *-winbond)
-+ os=-proelf
-+ ;;
-+ *-oki)
-+ os=-proelf
-+ ;;
- *-hp)
- os=-hpux
- ;;
-@@ -815,7 +1215,7 @@
- os=-sysv
- ;;
- *-cbm)
-- os=-amigados
-+ os=-amigaos
- ;;
- *-dg)
- os=-dgux
-@@ -865,9 +1265,21 @@
- *-masscomp)
- os=-rtu
- ;;
-- f301-fujitsu)
-+ f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
-+ *-rom68k)
-+ os=-coff
-+ ;;
-+ *-*bug)
-+ os=-coff
-+ ;;
-+ *-apple)
-+ os=-macos
-+ ;;
-+ *-atari*)
-+ os=-mint
-+ ;;
- *)
- os=-none
- ;;
-@@ -889,9 +1301,15 @@
- -aix*)
- vendor=ibm
- ;;
-+ -beos*)
-+ vendor=be
-+ ;;
- -hpux*)
- vendor=hp
- ;;
-+ -mpeix*)
-+ vendor=hp
-+ ;;
- -hiux*)
- vendor=hitachi
- ;;
-@@ -907,7 +1325,7 @@
- -genix*)
- vendor=ns
- ;;
-- -mvs*)
-+ -mvs* | -opened*)
- vendor=ibm
- ;;
- -ptx*)
-@@ -919,9 +1337,26 @@
- -aux*)
- vendor=apple
- ;;
-+ -hms*)
-+ vendor=hitachi
-+ ;;
-+ -mpw* | -macos*)
-+ vendor=apple
-+ ;;
-+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-+ vendor=atari
-+ ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
- esac
-
- echo $basic_machine$os
-+exit 0
-+
-+# Local variables:
-+# eval: (add-hook 'write-file-hooks 'time-stamp)
-+# time-stamp-start: "timestamp='"
-+# time-stamp-format: "%:y-%02m-%02d"
-+# time-stamp-end: "'"
-+# End:
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/configure fdutils/configure
---- fdutils-5.4/configure Fri Jul 2 23:37:09 1999
-+++ fdutils/configure Mon May 21 00:24:49 2001
-@@ -1250,7 +1250,7 @@
- esac
-
-
--for ac_hdr in linux/ext_fs.h linux/xia_fs.h
-+for ac_hdr in linux/ext_fs.h linux/xia_fs.h sys/sysmacros.h
- do
- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
- echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/configure.in fdutils/configure.in
---- fdutils-5.4/configure.in Thu Jul 1 19:22:51 1999
-+++ fdutils/configure.in Mon May 21 00:24:21 2001
-@@ -18,7 +18,7 @@
- AC_C_CONST
- AC_C_INLINE
-
--AC_CHECK_HEADERS(linux/ext_fs.h linux/xia_fs.h)
-+AC_CHECK_HEADERS(linux/ext_fs.h linux/xia_fs.h sys/sysmacros.h)
-
- dnl Make fdmount accessible by the floppy group only
- undefine([fdmount-floppy-only])dnl
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/README fdutils/doc/README
---- fdutils-5.4/doc/README Thu Jul 1 19:43:45 1999
-+++ fdutils/doc/README Mon Jun 11 22:26:36 2001
-@@ -171,7 +171,7 @@
- disks and also Commodore 1581 disks. Please get Michael Haardt's
- documentation on floppy drives for a detailed description of those
- formats. This can be ftp'ed from
--ftp://cantor.informatik.rwth-aachen.de/pub/linux/floppy.ps
-+http://www.moria.de/~michael/floppy/floppy.ps
-
- Commodore 1581 disks are not yet described in this documentation.
- Use 'setfdprm /dev/fd0 1600 10 2 80 2 0x2A 0x02 0xDF 0x2E' to use
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/acronyms.texi fdutils/doc/acronyms.texi
---- fdutils-5.4/doc/acronyms.texi Sat May 27 18:37:00 2000
-+++ fdutils/doc/acronyms.texi Mon Jun 11 22:23:31 2001
-@@ -100,7 +100,7 @@
- disks, i.e. virtually all disks that are available today. The PC
- hardware can only read MFM and FM disks. The doc at:
- @example
--ftp://cantor.informatik.rwth-aachen.de/pub/linux/floppy.ps
-+http://www.moria.de/~michael/floppy/floppy.ps
- @end example
- contains more detailed information about FM and MFM encoding.
-
-@@ -108,7 +108,7 @@
- FM is a low level encoding of disk data. It was used for SD disks, and
- is now considered to be obsolete. The doc at:
- @example
--ftp://cantor.informatik.rwth-aachen.de/pub/linux/floppy.ps
-+http://www.moria.de/~michael/floppy/floppy.ps
- @end example
- contains more detailed information about FM and MFM encoding.
-
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/diskd.1 fdutils/doc/diskd.1
---- fdutils-5.4/doc/diskd.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/diskd.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH diskd 1 "02jun00" fdutils-5.4
-+.TH diskd 1 "11Jun01" fdutils-5.4
- .SH Name
- diskd - disk daemon; wait for disk to be inserted
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/diskseekd.1 fdutils/doc/diskseekd.1
---- fdutils-5.4/doc/diskseekd.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/diskseekd.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH diskseekd 1 "02jun00" fdutils-5.4
-+.TH diskseekd 1 "11Jun01" fdutils-5.4
- .SH Name
- diskseek, diskseekd - disk seek daemon; simulates Messy Dos' drive cleaning effect
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/fd.4 fdutils/doc/fd.4
---- fdutils-5.4/doc/fd.4 Fri Jul 2 23:44:15 1999
-+++ fdutils/doc/fd.4 Mon Jun 11 22:23:59 2001
-@@ -1,7 +1,7 @@
- '\" t
- .\"{{{}}}
- .\"{{{ Notes
--.\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de)
-+.\" Copyright (c) 1993 Michael Haardt (michael@moria.de)
- .\" and 1994,1995, 1997 Alain Knaff (alain@linux.lu)
- .\"
- .\" This is free documentation; you can redistribute it and/or
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/fdmount.1 fdutils/doc/fdmount.1
---- fdutils-5.4/doc/fdmount.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/fdmount.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH fdmount 1 "02jun00" fdutils-5.4
-+.TH fdmount 1 "11Jun01" fdutils-5.4
- .SH Name
- fdmount - Floppy disk mount utility
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/fdrawcmd.1 fdutils/doc/fdrawcmd.1
---- fdutils-5.4/doc/fdrawcmd.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/fdrawcmd.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH fdrawcmd 1 "02jun00" fdutils-5.4
-+.TH fdrawcmd 1 "11Jun01" fdutils-5.4
- .SH Name
- fdrawcmd - send raw commands to the floppy disk controller
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/floppycontrol.1 fdutils/doc/floppycontrol.1
---- fdutils-5.4/doc/floppycontrol.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/floppycontrol.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH floppycontrol 1 "02jun00" fdutils-5.4
-+.TH floppycontrol 1 "11Jun01" fdutils-5.4
- .SH Name
- floppycontrol - floppy driver configuration utility
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/floppymeter.1 fdutils/doc/floppymeter.1
---- fdutils-5.4/doc/floppymeter.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/floppymeter.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH floppymeter 1 "02jun00" fdutils-5.4
-+.TH floppymeter 1 "11Jun01" fdutils-5.4
- .SH Name
- floppymeter - measure raw capacity and exact rotation speed of floppy drive
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/format2.texi fdutils/doc/format2.texi
---- fdutils-5.4/doc/format2.texi Fri Sep 19 21:01:19 1997
-+++ fdutils/doc/format2.texi Mon Jun 11 21:59:18 2001
-@@ -157,7 +157,7 @@
- on floppy drives for a detailed description of those formats. This can
- be ftp'ed from the following location:
- @example
--ftp://cantor.informatik.rwth-aachen.de/pub/linux/floppy.ps
-+http://www.moria.de/~michael/floppy/
- @end example
-
- Commodore 1581 disks are not yet described in this documentation. Use
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/getfdprm.1 fdutils/doc/getfdprm.1
---- fdutils-5.4/doc/getfdprm.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/getfdprm.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH getfdprm 1 "02jun00" fdutils-5.4
-+.TH getfdprm 1 "11Jun01" fdutils-5.4
- .SH Name
- getfdprm - print the current format information
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/makefloppies.1 fdutils/doc/makefloppies.1
---- fdutils-5.4/doc/makefloppies.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/makefloppies.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH makefloppies 1 "02jun00" fdutils-5.4
-+.TH makefloppies 1 "11Jun01" fdutils-5.4
- .SH Name
- MAKEFLOPPIES - Creates the default floppy device nodes.
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/setfdprm.1 fdutils/doc/setfdprm.1
---- fdutils-5.4/doc/setfdprm.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/setfdprm.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH setfdprm 1 "02jun00" fdutils-5.4
-+.TH setfdprm 1 "11Jun01" fdutils-5.4
- .SH Name
- setfdprm - sets user-provided floppy disk parameters
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/superformat.1 fdutils/doc/superformat.1
---- fdutils-5.4/doc/superformat.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/superformat.1 Mon Jun 11 22:22:46 2001
-@@ -1,4 +1,4 @@
--.TH superformat 1 "02jun00" fdutils-5.4
-+.TH superformat 1 "11Jun01" fdutils-5.4
- .SH Name
- superformat - format floppies
- '\" t
-@@ -258,14 +258,19 @@
- spins, and on how much time is needed to change the head or the track.
- .TP
- \&\fR\&\f(CW--absolute_skew\ \fIabsolute-skew\fR\&\f(CW\fR\
--Set the absolute skew. (The skew value used for the first formatted
--track)
-+.IP
-+Set the absolute skew. This skew value is used for the first formatted
-+track. It is expressed in raw bytes.
- .TP
- \&\fR\&\f(CW--head_skew\ \fIhead-skew\fR\&\f(CW\fR\
--Set the head skew. (The skew added for passing from head 0 to head 1)
-+.IP
-+Set the head skew. This is the skew added for passing from head 0 to
-+head 1. It is expressed in raw bytes.
- .TP
- \&\fR\&\f(CW--track_skew\ \fItrack-skew\fR\&\f(CW\fR\
--Set the track skew. (The skew added for seeking to the next track)
-+.IP
-+Set the track skew. This is the skew added for seeking to the next
-+track. It is expressed in raw bytes.
- .PP
- Example: (absolute skew=3, head skew=1, track skew=2)
- .PP
-@@ -287,6 +292,10 @@
- .lp
-
- \&\fR
-+.PP
-+N.B. For simplicitie's sake, this example expresses skews in units of
-+sectors. In reality, superformat expects the skews to be expressed in
-+raw bytes.
- .PP
- .SH Examples
- In all the examples of this section, we assume that drive 0 is a 3 1/2
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/superformat.texi fdutils/doc/superformat.texi
---- fdutils-5.4/doc/superformat.texi Sat May 27 18:36:51 2000
-+++ fdutils/doc/superformat.texi Mon May 21 00:24:21 2001
-@@ -187,14 +187,20 @@
-
- @table @code
- @item --absolute_skew @var{absolute-skew}
--Set the absolute skew. (The skew value used for the first formatted
--track)
-+
-+Set the absolute skew. This skew value is used for the first formatted
-+track. It is expressed in raw bytes.
-
- @item --head_skew @var{head-skew}
--Set the head skew. (The skew added for passing from head 0 to head 1)
-+
-+Set the head skew. This is the skew added for passing from head 0 to
-+head 1. It is expressed in raw bytes.
-
- @item --track_skew @var{track-skew}
--Set the track skew. (The skew added for seeking to the next track)
-+
-+Set the track skew. This is the skew added for seeking to the next
-+track. It is expressed in raw bytes.
-+
- @end table
-
- Example: (absolute skew=3, head skew=1, track skew=2)
-@@ -209,6 +215,10 @@
- track 2 head 0: 4,5,6,1,2,3 (skew=3)
- track 2 head 1: 3,4,5,6,1,2 (skew=4)
- @end example
-+
-+N.B. For simplicitie's sake, this example expresses skews in units of
-+sectors. In reality, superformat expects the skews to be expressed in
-+raw bytes.
-
- @node Examples, Troubleshooting, Sector skewing options, superformat
- @subsection Examples
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/doc/xdfcopy.1 fdutils/doc/xdfcopy.1
---- fdutils-5.4/doc/xdfcopy.1 Fri Jun 2 22:28:27 2000
-+++ fdutils/doc/xdfcopy.1 Mon Jun 11 22:22:47 2001
-@@ -1,4 +1,4 @@
--.TH xdfcopy 1 "02jun00" fdutils-5.4
-+.TH xdfcopy 1 "11Jun01" fdutils-5.4
- .SH Name
- xdfcopy - Program to copy and format Xdf disks in Linux
- '\" t
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/MAKEFLOPPIES fdutils/src/MAKEFLOPPIES
---- fdutils-5.4/src/MAKEFLOPPIES Wed Aug 21 16:51:25 1996
-+++ fdutils/src/MAKEFLOPPIES Sun Feb 3 20:13:39 2002
-@@ -12,6 +12,9 @@
- set -u
- MAJOR=2
- TMPDEVICE=/dev/tmpfloppy$$
-+if [ ! -b /dev/fd0 ] ; then
-+ mknod /dev/fd0 b $MAJOR 0
-+fi
- if floppycontrol 2>/dev/null; then
- FLOPPYCONTROL=yes
- else
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/diskseekd.c fdutils/src/diskseekd.c
---- fdutils-5.4/src/diskseekd.c Sat May 27 18:50:05 2000
-+++ fdutils/src/diskseekd.c Mon May 21 00:24:21 2001
-@@ -1,4 +1,7 @@
- #include <sys/types.h>
-+#ifdef HAVE_SYS_SYSMACROS_H
-+# include <sys/sysmacros.h>
-+#endif
- #include <sys/time.h>
- #include <unistd.h>
- #include <stdio.h>
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/driveprm.c fdutils/src/driveprm.c
---- fdutils-5.4/src/driveprm.c Sat May 27 18:49:58 2000
-+++ fdutils/src/driveprm.c Mon May 21 00:24:21 2001
-@@ -1,3 +1,7 @@
-+#include <sys/types.h>
-+#ifdef HAVE_SYS_SYSMACROS_H
-+# include <sys/sysmacros.h>
-+#endif
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/fdmount.c fdutils/src/fdmount.c
---- fdutils-5.4/src/fdmount.c Sat May 27 18:50:14 2000
-+++ fdutils/src/fdmount.c Sun Feb 3 23:50:06 2002
-@@ -826,14 +826,9 @@
-
- mnt=get_mounted(devname);
- if (!mnt) {
-- if (!force) {
-- errmsg("not mounted");
-- save_unlock_mtab();
-- return -1;
-- }
-- else {
-- msg("not in /etc/mtab, trying to unmount anyway!");
-- }
-+ errmsg("not mounted");
-+ save_unlock_mtab();
-+ return -1;
- }
- else {
- mountpoint=mnt->ms.mnt_dir;
-@@ -860,7 +855,7 @@
- }
- #endif
-
-- e=umount(devname);
-+ e=umount(mountpoint);
- if (e) {
- errmsg("failed to unmount: %s\n",strerror(errno));
- goto err;
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/floppycontrol.c fdutils/src/floppycontrol.c
---- fdutils-5.4/src/floppycontrol.c Sun Apr 2 10:18:15 2000
-+++ fdutils/src/floppycontrol.c Sat Oct 27 13:47:28 2001
-@@ -16,6 +16,11 @@
- #include <getopt.h>
- #include "enh_options.h"
-
-+#ifndef FD_DISK_CHANGED
-+#define FD_DISK_CHANGED 0
-+#endif
-+
-+
- int eioctl(int fd, int command,void * param, char *emsg)
- {
- int r;
-@@ -381,14 +386,17 @@
- eioctl( fd, FDPOLLDRVSTAT, &drivstat,"get drive state");
- else
- eioctl( fd, FDGETDRVSTAT , &drivstat,"get drive state");
-- printf("%s %s %s %s %s\n",
-+
-+#ifndef FD_DCL_SEEN
-+# define FD_DCL_SEEN 0x40
-+#endif
-+ printf("%s %s %s %s %s %s\n",
- drivstat.flags & FD_VERIFY ? "verify" : "",
- drivstat.flags & FD_DISK_NEWCHANGE ? "newchange" : "",
- drivstat.flags & FD_NEED_TWADDLE ? "need_twaddle" : "",
--#ifdef FD_DISK_CHANGED
- drivstat.flags & FD_DISK_CHANGED ? "disk_changed" : "",
--#endif
-- drivstat.flags & FD_DISK_WRITABLE ?"disk_writable" : "");
-+ drivstat.flags & FD_DISK_WRITABLE ?"disk_writable" : "",
-+ drivstat.flags & FD_DCL_SEEN ?"dcl_seen" : "");
- printf("spinup= %ld\n", drivstat.spinup_date);
- printf("select= %ld\n", drivstat.select_date);
- printf("first_read= %ld\n", drivstat.first_read_date);
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/floppymeter.c fdutils/src/floppymeter.c
---- fdutils-5.4/src/floppymeter.c Sat May 27 18:49:58 2000
-+++ fdutils/src/floppymeter.c Mon May 21 00:24:21 2001
-@@ -1,3 +1,7 @@
-+#include <sys/types.h>
-+#ifdef HAVE_SYS_SYSMACROS_H
-+# include <sys/sysmacros.h>
-+#endif
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/measure.c fdutils/src/measure.c
---- fdutils-5.4/src/measure.c Sat May 27 18:49:57 2000
-+++ fdutils/src/measure.c Sun Feb 3 22:15:54 2002
-@@ -138,6 +138,23 @@
- perror("format");
- exit(1);
- }
-+
-+ if((raw_cmd.reply[1] & ~0x20) |
-+ (raw_cmd.reply[2] & ~0x20)) {
-+ int i;
-+
-+ if ( raw_cmd.reply[1] & ST1_WP ){
-+ fprintf(stderr,"The disk is write protected\n");
-+ exit(1);
-+ }
-+
-+ fprintf(stderr,
-+ "\nFatal error while measuring raw capacity\n");
-+ for(i=0; i < raw_cmd.reply_count; i++) {
-+ fprintf(stderr, "%d: %02x\n", i, raw_cmd.reply[i]);
-+ }
-+ exit(1);
-+ }
- }
-
-
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/mediaprm.c fdutils/src/mediaprm.c
---- fdutils-5.4/src/mediaprm.c Wed Mar 22 22:16:53 2000
-+++ fdutils/src/mediaprm.c Mon May 21 00:24:21 2001
-@@ -20,6 +20,7 @@
- FE_TPI,
- FE_STRETCH,
- FE_SWAPSIDES,
-+ FE_ZEROBASED,
-
- FE_GAP,
-
-@@ -35,7 +36,8 @@
- FE_DENSITY,
- } field_t;
-
--static int SIZE, SECT, VSECT, HEAD, CYL, TPI, STRETCH, SWAPSIDES, GAP, FM;
-+static int SIZE, SECT, VSECT, HEAD, CYL, TPI, STRETCH, SWAPSIDES, ZEROBASED;
-+static int GAP, FM;
- static int PERP, SSIZE, _2M, DTR, SPEC1, FMT_GAP, DENSITY;
- static int ssize;
-
-@@ -48,6 +50,7 @@
- #define F_TPI FE_TPI,&TPI
- #define F_STRETCH FE_STRETCH,&STRETCH
- #define F_SWAPSIDES FE_SWAPSIDES,&SWAPSIDES
-+#define F_ZEROBASED FE_ZEROBASED,&ZEROBASED
-
- #define F_GAP FE_GAP,&GAP
-
-@@ -77,6 +80,7 @@
- { "stretch", F_STRETCH, 0 },
-
- { "swapsides", F_SWAPSIDES, 1},
-+ { "zerobased", F_ZEROBASED, 1},
-
- { "gap", F_GAP, 0},
-
-@@ -234,7 +238,7 @@
- medprm->sect = VSECT / 512;
- medprm->head = HEAD;
- medprm->track = CYL;
-- medprm->stretch = STRETCH | (SWAPSIDES << 1);
-+ medprm->stretch = STRETCH | (SWAPSIDES << 1) | (ZEROBASED << 2);
- medprm->gap = GAP;
- medprm->rate = (FM<<7) | (PERP<<6) | (ssize<<3) | (_2M<<2) | DTR;
- medprm->spec1 = SPEC1;
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/printfdprm.c fdutils/src/printfdprm.c
---- fdutils-5.4/src/printfdprm.c Mon Jun 9 22:58:15 1997
-+++ fdutils/src/printfdprm.c Mon May 21 00:24:21 2001
-@@ -141,6 +141,12 @@
- print("swapsides",0);
- #endif
-
-+#ifdef FD_ZEROBASED
-+ if(ft->stretch & FD_ZEROBASED)
-+ print("zerobased",0);
-+#endif
-+
-+
- if(ft->rate & FD_2M)
- print("2M",0);
-
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/superformat.c fdutils/src/superformat.c
---- fdutils-5.4/src/superformat.c Sat May 27 18:49:57 2000
-+++ fdutils/src/superformat.c Fri Feb 22 11:55:23 2002
-@@ -26,7 +26,10 @@
- cylinders as happen to work (as in 2m). Currently, if too many cylinders
- are attempted it won't fail until the very end
- */
--
-+#include <sys/types.h>
-+#ifdef HAVE_SYS_SYSMACROS_H
-+# include <sys/sysmacros.h>
-+#endif
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
-@@ -68,6 +71,7 @@
- char floppy_buffer[24 * 512];
- int verbosity = 3;
- static char noverify = 0;
-+static char noformat = 0;
- static char dosverify = 0;
- static char verify_later = 0;
- short stretch;
-@@ -323,7 +327,8 @@
- raw_cmd.length = nssect * sizeof(format_map_t);
- raw_cmd.cmd_count = 6;
- raw_cmd.cmd[0] = FD_FORMAT & ~fm_mode;
-- raw_cmd.cmd[1] = head << 2 | ( fd->drive & 3);
-+ raw_cmd.cmd[1] = (head << 2 | ( fd->drive & 3)) ^
-+ (fd->swapSides ? 4 : 0);
- raw_cmd.cmd[2] = fd->sizecode;
- raw_cmd.cmd[3] = nssect;
- raw_cmd.cmd[4] = fd->fmt_gap;
-@@ -355,7 +360,8 @@
- raw_cmd.data = floppy_buffer;
- raw_cmd.cmd_count = 9;
- raw_cmd.cmd[0] = FD_WRITE & ~fm_mode & ~0x80;
-- raw_cmd.cmd[1] = head << 2 | ( fd->drive & 3);
-+ raw_cmd.cmd[1] = (head << 2 | ( fd->drive & 3)) ^
-+ (fd->swapSides ? 4 : 0);
- raw_cmd.cmd[2] = cylinder;
- raw_cmd.cmd[3] = head;
- raw_cmd.cmd[4] = cur_sector;
-@@ -490,6 +496,7 @@
-
- short retries;
- short zeroBased=0;
-+ short swapSides=0;
- int n,rsize;
- char *verify_buffer = NULL;
- char dosdrive;
-@@ -510,6 +517,11 @@
- (void *) &noverify,
- "skip verification" },
-
-+ { '\0', "print-drive-deviation", 0, EO_TYPE_BYTE, 1, 0,
-+ (void *) &noformat,
-+ "print deviation, do not format " },
-+
-+
- { 'B', "dosverify", 0, EO_TYPE_BYTE, 1, 0,
- (void *) &dosverify,
- "verify disk using mbadblocks" },
-@@ -662,11 +674,6 @@
- exit(1);
- }
-
-- fd[0].zeroBased = zeroBased;
-- if(zeroBased)
-- noverify = 1;
--
--
- /* sanity checking */
- if (sizecode < 0 || sizecode >= MAX_SIZECODE) {
- fprintf(stderr,"Bad sizecode %d\n", sizecode);
-@@ -779,7 +786,16 @@
- break;
- }
- stretch = geometry.stretch & 1;
--
-+#ifdef FD_ZEROBASED
-+ if(geometry.stretch & FD_ZEROBASED) {
-+ zeroBased = 1;
-+ }
-+#endif
-+#ifdef FD_SWAPSIDES
-+ if(geometry.stretch & FD_SWAPSIDES) {
-+ swapSides = 1;
-+ }
-+#endif
- mask |= SET_SECTORS | SET_CYLINDERS |
- SET_SIZECODE | SET_2M | SET_RATE;
- } else {
-@@ -831,6 +847,15 @@
- stretch = 0;
- }
- }
-+
-+ fd[0].zeroBased = zeroBased;
-+#ifndef FD_ZEROBASED
-+ if(zeroBased) {
-+ noverify = 1;
-+ }
-+#endif
-+
-+ fd[0].swapSides = swapSides;
-
- if (cylinders > fd[0].drvprm.tracks) {
- fprintf(stderr,"too many cylinder for this drive\n");
-@@ -900,8 +925,9 @@
- fprintf(stderr,
- "In order to avoid this time consuming "
- "measurement in the future,\n"
-- "add the following line to " DRIVEPRMFILE
-- ":\ndrive%d: deviation=%d\n",
-+ "add the following line to " DRIVEPRMFILE ":\n");
-+ fprintf(stdout,
-+ "drive%d: deviation=%d\n",
- fd[0].drive,
- (fd[0].raw_capacity-old_capacity)*1000000/
- old_capacity);
-@@ -914,6 +940,9 @@
- }
- }
-
-+ if(noformat)
-+ return 0;
-+
- /* FIXME. Why is this needed? */
- fd[0].raw_capacity -= 30;
-
-@@ -971,7 +1000,11 @@
- parameters.head = heads;
- parameters.track = cylinders;
- parameters.size = cylinders * heads * sectors;
-- parameters.stretch = stretch;
-+ parameters.stretch = stretch
-+#ifdef FD_ZEROBASED
-+ | (zeroBased ? 4 : 0)
-+#endif
-+ | (swapSides ? 2 : 0);
- parameters.gap = fd[0].gap;
- if ( !use_2m)
- fd0.rate = fd[0].rate;
-@@ -1054,7 +1087,7 @@
- ioctl(fd[0].fd, FDFLUSH );
- close(fd[0].fd);
-
-- if (! (mask & SET_DOSDRIVE ) && fd[0].drive < 2)
-+ if (! (mask & SET_DOSDRIVE ) && fd[0].drive < 2 && !zeroBased)
- dosdrive = fd[0].drive+'a';
-
- if (dosdrive) {
-@@ -1085,8 +1118,9 @@
- dosverify = 0;
- }
- } else {
-- fprintf(stderr,
-- "\nwarning: mformat not called because DOS drive unknown\n");
-+ if(!zeroBased)
-+ fprintf(stderr,
-+ "\nwarning: mformat not called because DOS drive unknown\n");
- /*exit(1);*/
- dosverify = 0;
- }
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/superformat.h fdutils/src/superformat.h
---- fdutils-5.4/src/superformat.h Sun Apr 2 10:09:28 2000
-+++ fdutils/src/superformat.h Mon May 21 00:24:21 2001
-@@ -84,6 +84,7 @@
- int rotations; /* how many time do we have to go over 0 to read
- * the track */
- int zeroBased; /* 1 if sector numbering starts at zero */
-+ int swapSides; /* if logical side 0 is on physical 1 and vice-versa */
- };
-
-
-diff -ur --new-file --exclude-from=/home/aknaff/floppy/exclude fdutils-5.4/src/xdfcopy.c fdutils/src/xdfcopy.c
---- fdutils-5.4/src/xdfcopy.c Sat May 27 18:49:57 2000
-+++ fdutils/src/xdfcopy.c Mon May 21 00:24:21 2001
-@@ -2,6 +2,10 @@
- * Software patents declared unconstitutional, worldwide
- */
-
-+#include <sys/types.h>
-+#ifdef HAVE_SYS_SYSMACROS_H
-+# include <sys/sysmacros.h>
-+#endif
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
diff --git a/source/a/floppy/fdutils-5.5-20081027.diff b/source/a/floppy/fdutils-5.5-20081027.diff
new file mode 100644
index 00000000..d4033be3
--- /dev/null
+++ b/source/a/floppy/fdutils-5.5-20081027.diff
@@ -0,0 +1,905 @@
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/Changelog fdutils/Changelog
+--- fdutils-5.5/Changelog 2005-03-03 22:41:49.000000000 +0100
++++ fdutils/Changelog 2006-02-27 23:01:38.000000000 +0100
+@@ -1,3 +1,5 @@
++v20060227
++ * Fixed "zero-based" flag
+ v20050303
+ * Fixed instant verification in superformat (now based on
+ FDRAWCMD, rather than VFS' read which is plagued by excessive
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/diskd.1 fdutils/doc/diskd.1
+--- fdutils-5.5/doc/diskd.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/diskd.1 2008-10-27 20:53:44.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH diskd 1 "03Mar05" fdutils-5.5
++.TH diskd 1 "27oct08" fdutils-5.5
+ .SH Name
+ diskd - disk daemon; wait for disk to be inserted
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/diskseekd.1 fdutils/doc/diskseekd.1
+--- fdutils-5.5/doc/diskseekd.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/diskseekd.1 2008-10-27 20:53:44.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH diskseekd 1 "03Mar05" fdutils-5.5
++.TH diskseekd 1 "27oct08" fdutils-5.5
+ .SH Name
+ diskseek, diskseekd - disk seek daemon; simulates Messy Dos' drive cleaning effect
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/fdmount.1 fdutils/doc/fdmount.1
+--- fdutils-5.5/doc/fdmount.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/fdmount.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH fdmount 1 "03Mar05" fdutils-5.5
++.TH fdmount 1 "27oct08" fdutils-5.5
+ .SH Name
+ fdmount - Floppy disk mount utility
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/fdrawcmd.1 fdutils/doc/fdrawcmd.1
+--- fdutils-5.5/doc/fdrawcmd.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/fdrawcmd.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH fdrawcmd 1 "03Mar05" fdutils-5.5
++.TH fdrawcmd 1 "27oct08" fdutils-5.5
+ .SH Name
+ fdrawcmd - send raw commands to the floppy disk controller
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/floppycontrol.1 fdutils/doc/floppycontrol.1
+--- fdutils-5.5/doc/floppycontrol.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/floppycontrol.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH floppycontrol 1 "03Mar05" fdutils-5.5
++.TH floppycontrol 1 "27oct08" fdutils-5.5
+ .SH Name
+ floppycontrol - floppy driver configuration utility
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/floppymeter.1 fdutils/doc/floppymeter.1
+--- fdutils-5.5/doc/floppymeter.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/floppymeter.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH floppymeter 1 "03Mar05" fdutils-5.5
++.TH floppymeter 1 "27oct08" fdutils-5.5
+ .SH Name
+ floppymeter - measure raw capacity and exact rotation speed of floppy drive
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/formatlist.texi fdutils/doc/formatlist.texi
+--- fdutils-5.5/doc/formatlist.texi 2002-05-02 23:03:31.000000000 +0200
++++ fdutils/doc/formatlist.texi 2006-02-27 23:08:50.000000000 +0100
+@@ -221,7 +221,7 @@
+ setfdprm /dev/fd0H1520 1520 19 2 80 0 0x1b 0 0xcf 0x6c
+ @end example
+
+-@strong{Note:} This redefines the geometry for any device node with the
++@strong{NB:} This redefines the geometry for any device node with the
+ same format number, not just the new node.
+
+ The new geometry is only valid until the next reboot (or removal of the
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/getfdprm.1 fdutils/doc/getfdprm.1
+--- fdutils-5.5/doc/getfdprm.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/getfdprm.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH getfdprm 1 "03Mar05" fdutils-5.5
++.TH getfdprm 1 "27oct08" fdutils-5.5
+ .SH Name
+ getfdprm - print the current format information
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/makefloppies.1 fdutils/doc/makefloppies.1
+--- fdutils-5.5/doc/makefloppies.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/makefloppies.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH makefloppies 1 "03Mar05" fdutils-5.5
++.TH makefloppies 1 "27oct08" fdutils-5.5
+ .SH Name
+ MAKEFLOPPIES - Creates the default floppy device nodes.
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/setfdprm.1 fdutils/doc/setfdprm.1
+--- fdutils-5.5/doc/setfdprm.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/setfdprm.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH setfdprm 1 "03Mar05" fdutils-5.5
++.TH setfdprm 1 "27oct08" fdutils-5.5
+ .SH Name
+ setfdprm - sets user-provided floppy disk parameters
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/superformat.1 fdutils/doc/superformat.1
+--- fdutils-5.5/doc/superformat.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/superformat.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH superformat 1 "03Mar05" fdutils-5.5
++.TH superformat 1 "27oct08" fdutils-5.5
+ .SH Name
+ superformat - format floppies
+ '\" t
+@@ -79,7 +79,7 @@
+ .in +0.3i
+ \&\fR\&\f(CWsuperformat [\fR\&\f(CW-D \fIdos-drive\fR\&\f(CW] [\fR\&\f(CW-v \fIverbosity-level\fR\&\f(CW] [\fR\&\f(CW-b \fIbegin-track\fR\&\f(CW]
+ [\fR\&\f(CW-e \fIend-track\fR\&\f(CW] [\fR\&\f(CW--superverify] [\fR\&\f(CW--dosverify]
+-[\fR\&\f(CW--noverify] [\fR\&\f(CW--verify_later] [\fR\&\f(CW--zero-based]
++[\fR\&\f(CW--noverify] [\fR\&\f(CW--verify_later] [\fR\&\f(CW--first-sector-number \fIn\fR\&\f(CW] [\fR\&\f(CW--zero-based]
+ [\fR\&\f(CW-G \fIformat-gap\fR\&\f(CW] [\fR\&\f(CW-F \fIfinal-gap\fR\&\f(CW] [\fR\&\f(CW-i \fIinterleave\fR\&\f(CW] [\fR\&\f(CW-c \fIchunksize\fR\&\f(CW]
+ [\fR\&\f(CW-g \fIgap\fR\&\f(CW] [\fR\&\f(CW--absolute-skew \fIabsolute-skew\fR\&\f(CW] [\fR\&\f(CW--head-skew \fIhead-skew\fR\&\f(CW]
+ [\fR\&\f(CW--track-skew \fItrack-skew\fR\&\f(CW] [\fR\&\f(CW--biggest-last] \fIdrive\fR\&\f(CW [\fImedia-description\fR\&\f(CW]
+@@ -237,13 +237,12 @@
+ For MSS formats, make sure that the biggest sector is last on the track.
+ This makes the format more reliable on drives which are out of spec.
+ .TP
++\&\fR\&\f(CW--first-sector-number\ \fIn\fR\&\f(CW\fR\
++Formats the disk with sector numbers starting at \fIn\fR, rather than
++1. Certain CP/M boxes or Music synthesizers use this format.
++.TP
+ \&\fR\&\f(CW--zero-based\fR\
+-Formats the disk with sector numbers starting at 0, rather than
+-1. Certain CP/M boxes or Music synthesizers use this format. Those disks
+-can currently not be read/written to by the standard Linux read/write
+-API; you have to use fdrawcmd to access them. As disk verifying is done
+-by this API, verifying is automatically switched off when formatting
+-zero-based.
++Shorthand for \fR\&\f(CW--first-sector-number 0\fR
+ .PP
+ .SH Sector\ skewing\ options
+ .PP
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/superformat.texi fdutils/doc/superformat.texi
+--- fdutils-5.5/doc/superformat.texi 2002-11-02 14:35:11.000000000 +0100
++++ fdutils/doc/superformat.texi 2008-10-27 20:53:41.000000000 +0100
+@@ -6,7 +6,7 @@
+ @example
+ @code{superformat} [@code{-D} @var{dos-drive}] [@code{-v} @var{verbosity-level}] [@code{-b} @var{begin-track}]
+ [@code{-e} @var{end-track}] [@code{--superverify}] [@code{--dosverify}]
+-[@code{--noverify}] [@code{--verify_later}] [@code{--zero-based}]
++[@code{--noverify}] [@code{--verify_later}] [@code{--first-sector-number} @var{n}] [@code{--zero-based}]
+ [@code{-G} @var{format-gap}] [@code{-F} @var{final-gap}] [@code{-i} @var{interleave}] [@code{-c} @var{chunksize}]
+ [@code{-g} @var{gap}] [@code{--absolute-skew} @var{absolute-skew}] [@code{--head-skew} @var{head-skew}]
+ [@code{--track-skew} @var{track-skew}] [@code{--biggest-last}] @var{drive} [@var{media-description}]
+@@ -162,13 +162,12 @@
+ For MSS formats, make sure that the biggest sector is last on the track.
+ This makes the format more reliable on drives which are out of spec.
+
++@item --first-sector-number @var{n}
++Formats the disk with sector numbers starting at @var{n}, rather than
++1. Certain CP/M boxes or Music synthesizers use this format.
++
+ @item --zero-based
+-Formats the disk with sector numbers starting at 0, rather than
+-1. Certain CP/M boxes or Music synthesizers use this format. Those disks
+-can currently not be read/written to by the standard Linux read/write
+-API; you have to use fdrawcmd to access them. As disk verifying is done
+-by this API, verifying is automatically switched off when formatting
+-zero-based.
++Shorthand for @code{--first-sector-number 0}
+
+ @end table
+
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/doc/xdfcopy.1 fdutils/doc/xdfcopy.1
+--- fdutils-5.5/doc/xdfcopy.1 2005-03-03 22:55:18.000000000 +0100
++++ fdutils/doc/xdfcopy.1 2008-10-27 20:53:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-.TH xdfcopy 1 "03Mar05" fdutils-5.5
++.TH xdfcopy 1 "27oct08" fdutils-5.5
+ .SH Name
+ xdfcopy - Program to copy and format Xdf disks in Linux
+ '\" t
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/calc-format.c fdutils/src/calc-format.c
+--- fdutils-5.5/src/calc-format.c 2004-02-28 23:00:28.000000000 +0100
++++ fdutils/src/calc-format.c 2008-10-27 20:19:20.000000000 +0100
+@@ -10,8 +10,8 @@
+ #define SSIZE(j) ( (128<<j) + GAPSIZE(j) + header_size)
+
+
+-static inline int chunks_in_sect(struct params *fd, int i,
+- int gap, int chunksize)
++static inline unsigned int chunks_in_sect(struct params *fd, int i,
++ int gap, int chunksize)
+ {
+ return (SSIZE(i)-1) / chunksize + 1;
+ }
+@@ -28,22 +28,22 @@
+ }
+
+
+-static inline int firstSector(struct params *fd, int i)
++static inline unsigned int firstSector(struct params *fd, int i)
+ {
+ if(i>=MAX_SIZECODE-1)
+- return 1;
++ return 0;
+ else
+ return fd->last_sect[i+1];
+ }
+
+-static inline int lastSector(struct params *fd, int i)
++static inline unsigned int lastSector(struct params *fd, int i)
+ {
+ return fd->last_sect[i];
+ }
+
+-static inline int nrSectorsForSize(struct params *fd, int i)
++static inline unsigned int nrSectorsForSize(struct params *fd, int i)
+ {
+- return lastSector(fd, i) - firstSector(fd, i);
++ return lastSector(fd, i) - firstSector(fd, i);
+ }
+
+
+@@ -93,7 +93,7 @@
+ int i;
+ int nr_sectors;
+
+- cur_sector = 1;
++ cur_sector = 0;
+ sizes=0;
+ for (i=MAX_SIZECODE-1; i>=0; --i) {
+ if(i > max_sizecode)
+@@ -107,7 +107,7 @@
+ if(nr_sectors)
+ sizes++;
+ }
+- fd->dsect = cur_sector-1; /* number of data sectors */
++ fd->dsect = cur_sector; /* number of data sectors */
+ if(sizes > 1)
+ fd->need_init = 1;
+
+@@ -264,51 +264,54 @@
+ */
+ static void calc_sequence(struct params *fd, int tailsect)
+ {
+- int sec_id, cur_sector, i;
++ int sec_id, cur_slot, i;
++ int *occupied = SafeNewArray(fd->dsect, int);
++ int last_slot = fd->dsect - 1;
+
+- fd->sequence = SafeNewArray(fd->dsect,struct fparm2);
+- cur_sector = fd->dsect-1;
++ fd->sequence = SafeNewArray(fd->dsect, struct fparm2);
++ cur_slot = last_slot;
+
+- /* construct the sequence while working backwards. cur_sector
++ /* construct the sequence while working backwards. cur_slot
+ * points to the place where the next sector will be placed.
+ * We place it, then move circularily backwards placing more
+ * and more sectors */
+ sec_id = tailsect;
+ fd->rotations = 0;
+ for(i=0; i < fd->dsect;
+- i++, cur_sector -= fd->actual_interleave, sec_id--) {
+- if (sec_id == 0)
+- sec_id = fd->dsect;
+-
+- if ( cur_sector < 0) {
+- cur_sector += fd->dsect;
+- if(sec_id != fd->dsect)
++ i++, cur_slot -= fd->actual_interleave, sec_id--) {
++ if (sec_id < 0)
++ sec_id = last_slot;
++
++ if ( cur_slot < 0) {
++ cur_slot += fd->dsect;
++ if(sec_id != last_slot)
+ fd->rotations++;
+ }
+
+ /* slot occupied, look elsewhere */
+- while(fd->sequence[cur_sector].sect ){
+- cur_sector--;
+- if ( cur_sector < 0 ) {
+- cur_sector += fd->dsect;
+- if(sec_id != fd->dsect)
++ while(occupied[cur_slot]) {
++ cur_slot--;
++ if ( cur_slot < 0 ) {
++ cur_slot += fd->dsect;
++ if(sec_id != last_slot)
+ fd->rotations++;
+ }
+ }
+
+ /* place the sector */
+- fd->sequence[cur_sector].sect = sec_id;
+- fd->sequence[cur_sector].size = sizeOfSector(fd, sec_id);
++ fd->sequence[cur_slot].sect = sec_id;
++ fd->sequence[cur_slot].size = sizeOfSector(fd, sec_id);
++ occupied[cur_slot] = 1;
+ }
+
+ /* handle wrap-around between tailsect and tailsect+1 */
+- if(tailsect != fd->dsect) {
+- /* always add one rotation, because tailsect+1 cannot be
++ if(tailsect != last_slot) {
++ /* always add one rotation, because tailsect cannot be
+ * at the last position, thus is necessarily earlyer */
+ fd->rotations++;
+
+ if(fd->actual_interleave == 2 &&
+- cur_sector + fd->actual_interleave == 1)
++ cur_slot + fd->actual_interleave == 1)
+ /* if we use interleave, and the last sector was
+ * placed at the first last position, add one
+ * extra rotation for tailsect+1 following tailsect
+@@ -333,11 +336,11 @@
+ max_offset = cur_sector;
+
+ /* offset of the starting sector */
+- if ( fd->sequence[i].sect == 1 )
++ if ( fd->sequence[i].sect == 0 )
+ fd->min = cur_sector * fd->chunksize;
+
+ /* offset of the end of the of the highest sector */
+- if (fd->sequence[i].sect == fd->dsect)
++ if (fd->sequence[i].sect == fd->dsect - 1)
+ track_end = cur_sector * fd->chunksize +
+ header_size + index_size +
+ SSIZE(fd->sequence[i].size);
+@@ -509,7 +512,7 @@
+ fd->min = 0;
+
+ for(i=0; i<sectors; i++){
+- fd->sequence[i].sect = i+1;
++ fd->sequence[i].sect = i;
+ fd->sequence[i].size = 2;
+ fd->sequence[i].offset = i;
+ }
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/fdmount.c fdutils/src/fdmount.c
+--- fdutils-5.5/src/fdmount.c 2005-03-03 23:09:16.000000000 +0100
++++ fdutils/src/fdmount.c 2008-10-27 20:45:50.000000000 +0100
+@@ -629,7 +629,7 @@
+ struct mntent ms;
+ struct floppy_drive_struct drivstat;
+ char options[80+MAX_OPT];
+- char super[2048];
++ unsigned char super[2048];
+ char *mountpoint;
+
+ strncpy(curdev,devname, sizeof(curdev));
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/fdutils.h fdutils/src/fdutils.h
+--- fdutils-5.5/src/fdutils.h 2002-05-02 23:03:31.000000000 +0200
++++ fdutils/src/fdutils.h 2008-10-25 22:17:36.000000000 +0200
+@@ -1,4 +1,8 @@
++#ifndef __FDUTILS_H
++#define __FDUTILS_H
++
+ #include <assert.h>
++#include <linux/fd.h>
+ /* This file contains common structures understood by several of the
+ * fdutils
+ */
+@@ -22,3 +26,17 @@
+ #define SafeNew(type) ((type *)(safe_malloc(sizeof(type))))
+ void *safe_malloc(size_t size);
+ void *safe_calloc(size_t nmemb, size_t size);
++
++#ifndef FD_SWAPSIDES
++#define FD_SWAPSIDES 2
++#endif
++
++#ifndef FD_ZEROBASED
++#define FD_ZEROBASED 4
++#endif
++
++#ifndef FD_SECTBASEMASK
++#define FD_SECTBASEMASK 0x3fc
++#endif
++
++#endif
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/floppycontrol.c fdutils/src/floppycontrol.c
+--- fdutils-5.5/src/floppycontrol.c 2002-11-02 14:36:43.000000000 +0100
++++ fdutils/src/floppycontrol.c 2008-10-26 09:27:38.000000000 +0100
+@@ -379,7 +379,7 @@
+ }
+
+ if (mask & SET_RESET)
+- eioctl(fd, FDRESET, (void *)reset_now, "reset");
++ eioctl(fd, FDRESET, (void *)(long)reset_now, "reset");
+
+ if (mask & (PRINTSTATE | POLLSTATE) ){
+ if ( mask & POLLSTATE )
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/mediaprm.c fdutils/src/mediaprm.c
+--- fdutils-5.5/src/mediaprm.c 2005-03-03 21:51:06.000000000 +0100
++++ fdutils/src/mediaprm.c 2008-10-27 20:34:09.000000000 +0100
+@@ -21,6 +21,7 @@
+ FE_STRETCH,
+ FE_SWAPSIDES,
+ FE_ZEROBASED,
++ FE_FIRSTSECTORNUMBER,
+
+ FE_GAP,
+
+@@ -36,7 +37,7 @@
+ FE_DENSITY,
+ } field_t;
+
+-static int SIZE, SECT, VSECT, HEAD, CYL, TPI, STRETCH, SWAPSIDES, ZEROBASED;
++static int SIZE, SECT, VSECT, HEAD, CYL, TPI, STRETCH, SWAPSIDES, ZEROBASED, FIRSTSECTORNUMBER=1;
+ static int GAP, FM;
+ static int PERP, SSIZE, _2M, DTR, SPEC1, FMT_GAP, DENSITY;
+ static int ssize;
+@@ -51,6 +52,7 @@
+ #define F_STRETCH FE_STRETCH,&STRETCH
+ #define F_SWAPSIDES FE_SWAPSIDES,&SWAPSIDES
+ #define F_ZEROBASED FE_ZEROBASED,&ZEROBASED
++#define F_FIRSTSECTORNUMBER FE_FIRSTSECTORNUMBER,&FIRSTSECTORNUMBER
+
+ #define F_GAP FE_GAP,&GAP
+
+@@ -81,6 +83,8 @@
+
+ { "swapsides", F_SWAPSIDES, 1},
+ { "zerobased", F_ZEROBASED, 1},
++ { "zero-based", F_ZEROBASED, 1},
++ { "first-sector-number", F_FIRSTSECTORNUMBER, 0},
+
+ { "gap", F_GAP, 0},
+
+@@ -234,11 +238,25 @@
+ }
+ set_field(F_2M,0);
+
++ if(mask & (1 << FE_ZEROBASED)) {
++ if((mask & (1 << FE_FIRSTSECTORNUMBER)) &&
++ FIRSTSECTORNUMBER != 0) {
++ fprintf(stderr,
++ "Zerobased incompatible with first-sector-number=%d\n",
++ FIRSTSECTORNUMBER);
++ exit(1);
++ } else
++ FIRSTSECTORNUMBER = 0;
++ } else if(! (mask & (1 << FE_FIRSTSECTORNUMBER))) {
++ FIRSTSECTORNUMBER = 1;
++ }
++
+ medprm->size = SIZE;
+ medprm->sect = VSECT / 512;
+ medprm->head = HEAD;
+ medprm->track = CYL;
+- medprm->stretch = STRETCH | (SWAPSIDES << 1) | (ZEROBASED << 2);
++ medprm->stretch = STRETCH | (SWAPSIDES << 1) |
++ ((1^FIRSTSECTORNUMBER) << 2);
+ medprm->gap = GAP;
+ medprm->rate = (FM<<7) | (PERP<<6) | (ssize<<3) | (_2M<<2) | DTR;
+ medprm->spec1 = SPEC1;
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/mediaprm.lex fdutils/src/mediaprm.lex
+--- fdutils-5.5/src/mediaprm.lex 2002-05-02 23:03:31.000000000 +0200
++++ fdutils/src/mediaprm.lex 2006-02-27 22:56:21.000000000 +0100
+@@ -12,7 +12,7 @@
+ %option pointer
+
+ fid [^\"]+
+-vid [A-Za-z_][A-Za-z0-9_]*
++vid [A-Za-z_][A-Za-z0-9_-]*
+ number (0x[a-zA-Z0-9]+|-?[0-9]+)(KB|k|b)?
+
+ %%
+@@ -37,6 +37,8 @@
+ }
+
+ swapsides |
++zerobased |
++zero-based |
+ mss |
+ 2m |
+ 2M |
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/msdos_fs.h fdutils/src/msdos_fs.h
+--- fdutils-5.5/src/msdos_fs.h 2002-05-02 23:03:31.000000000 +0200
++++ fdutils/src/msdos_fs.h 2008-10-26 09:27:07.000000000 +0100
+@@ -6,41 +6,41 @@
+ #define p packed
+
+ struct msdos_boot_sector {
+- char jump[3] p; /* 0 - Boot strap short or near jump */
+- char banner[8] p; /* 3 - Name - can be used to special case
++ char jump[3]; /* 0 - Boot strap short or near jump */
++ char banner[8]; /* 3 - Name - can be used to special case
+ partition manager volumes */
+ unsigned short sector_size p; /* 11 - bytes per logical sector */
+- unsigned char cluster_size p; /* 13 - sectors/cluster */
++ unsigned char cluster_size; /* 13 - sectors/cluster */
+ unsigned short res_sect p; /* 14 - reserved sectors */
+- unsigned char fats p; /* 16 - number of FATs */
++ unsigned char fats; /* 16 - number of FATs */
+ unsigned short dir_entries p; /* 17 - root directory entries */
+ unsigned short sectors p; /* 19 - number of sectors */
+- unsigned char media p; /* 21 - media code (unused) */
++ unsigned char media; /* 21 - media code (unused) */
+ unsigned short fat_length p; /* 22 - sectors/FAT */
+ unsigned short secs_track p; /* 24 - sectors per track */
+ unsigned short heads p; /* 26 - number of heads */
+ unsigned long hidden p; /* 28 - hidden sectors (unused) */
+ unsigned long total_sect p; /* 32 - number of sectors (if sectors == 0) */
+- unsigned char physdrive p; /* 36 physical drive ? */
+- unsigned char _reserved p; /* 37 reserved */
+- unsigned char dos4 p; /* 38 DOS > 4.0 diskette */
++ unsigned char physdrive; /* 36 physical drive ? */
++ unsigned char _reserved; /* 37 reserved */
++ unsigned char dos4; /* 38 DOS > 4.0 diskette */
+ unsigned long serial p; /* 39 serial number */
+- unsigned char label[11] p; /* 43 disk label */
+- unsigned char fat_type[8] p; /* 54 FAT type */
++ unsigned char label[11]; /* 43 disk label */
++ char fat_type[8]; /* 54 FAT type */
+ #ifdef USE_2M
+- unsigned char res_2m p; /* 62 reserved by 2M */
+- unsigned char CheckSum p; /* 63 2M checksum (not used) */
+- unsigned char fmt_2mf p; /* 64 2MF format version */
+- unsigned char wt p; /* 65 1 if write track after format */
+- unsigned char rate_0 p; /* 66 data transfer rate on track 0 */
+- unsigned char rate_any p; /* 67 data transfer rate on track<>0 */
++ unsigned char res_2m; /* 62 reserved by 2M */
++ unsigned char CheckSum; /* 63 2M checksum (not used) */
++ unsigned char fmt_2mf; /* 64 2MF format version */
++ unsigned char wt; /* 65 1 if write track after format */
++ unsigned char rate_0; /* 66 data transfer rate on track 0 */
++ unsigned char rate_any; /* 67 data transfer rate on track<>0 */
+ unsigned short BootP p; /* 68 offset to boot program */
+ unsigned short Infp0 p; /* 70 T1: information for track 0 */
+ unsigned short InfpX p; /* 72 T2: information for track<>0 */
+ unsigned short InfTm p; /* 74 T3: track sectors size table */
+- unsigned char junk[126 - 76] p; /* 76 remaining data */
++ unsigned char junk[126 - 76]; /* 76 remaining data */
+ #else
+- unsigned char junk[126 - 62] p; /* 76 remaining data */
++ unsigned char junk[126 - 62]; /* 76 remaining data */
+ #endif
+ unsigned short bootid p; /* 510 should be 0xAA55 */
+ };
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/printfdprm.c fdutils/src/printfdprm.c
+--- fdutils-5.5/src/printfdprm.c 2004-03-13 11:02:45.000000000 +0100
++++ fdutils/src/printfdprm.c 2008-10-27 00:59:01.000000000 +0100
+@@ -1,5 +1,6 @@
+ #include <stdio.h>
+ #include "printfdprm.h"
++#include "fdutils.h"
+
+
+ void print_params(drivedesc_t *drivedesc,
+@@ -101,9 +102,9 @@
+ print("tpi=48",0);
+ break;
+ default:
+- if(level >= LEV_ALL || ft->stretch)
+- print("stretch=%d", ft->stretch);
+- break;
++ if(level >= LEV_ALL || (ft->stretch & 1))
++ print("stretch=%d", ft->stretch & 1);
++ break;
+ }
+
+ if(level >= LEV_ALL || ft->size != ft->sect * ft->head * ft->track)
+@@ -136,20 +137,20 @@
+ if(level >= LEV_EXPL || (ft->track != 80 && ft->track != 40))
+ print("cyl=%d", ft->track);
+
+-#ifdef FD_SWAPSIDES
+ if(ft->stretch & FD_SWAPSIDES)
+ print("swapsides",0);
+-#endif
+-
+-#ifdef FD_ZEROBASED
+- if(ft->stretch & FD_ZEROBASED)
+- print("zerobased",0);
+-#endif
+
++ if(ft->stretch & FD_SECTBASEMASK) {
++ int firstSectorNumber = ((ft->stretch & FD_SECTBASEMASK)>>2)^1;
++ if(firstSectorNumber > 1)
++ print("first-sector-number=%d",firstSectorNumber);
++ else if(firstSectorNumber==0)
++ print("zero-based",0);
++ }
+
+ if(ft->rate & FD_2M)
+ print("2M",0);
+-
++
+ if(level < LEV_ALL &&
+ ft->sect * 4 < (2 << ssize) && ft->sect * 4 % (1 << ssize))
+ print("mss", 0);
+@@ -163,7 +164,7 @@
+ }
+
+ /* useless stuff */
+- if(level >= LEV_MOST) {
++ if(level >= LEV_MOST) {
+ print("gap=0x%02x", (unsigned char) ft->gap);
+ print("fmt_gap=0x%02x", (unsigned char) ft->fmt_gap);
+ }
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/superformat.c fdutils/src/superformat.c
+--- fdutils-5.5/src/superformat.c 2005-03-03 22:41:05.000000000 +0100
++++ fdutils/src/superformat.c 2008-10-27 20:40:47.000000000 +0100
+@@ -296,7 +296,7 @@
+ fd += findex[cylinder][head];
+ skew = fd->min + lskews[cylinder][head] * fd->chunksize;
+ assert(skew >= fd->min);
+- assert(skew <= fd->max);
++ assert(skew <= fd->max);
+ } else
+ skew = 0;
+
+@@ -305,7 +305,8 @@
+ for (i=0; i<fd->dsect; ++i){
+ offset = fd->sequence[i].offset + lskews[cylinder][head];
+ offset = offset % fd->nssect;
+- data[offset].sector = fd->sequence[i].sect - fd->zeroBased;
++ data[offset].sector =
++ fd->sequence[i].sect + fd->firstSectorNumber;
+ data[offset].size = fd->sequence[i].size;
+ data[offset].cylinder = cylinder;
+ data[offset].head = head;
+@@ -339,7 +340,7 @@
+ raw_cmd.cmd[3] = nssect;
+ raw_cmd.cmd[4] = fd->fmt_gap;
+ raw_cmd.cmd[5] = 0;
+- raw_cmd.flags = FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN |
++ raw_cmd.flags = FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN |
+ FD_RAW_NEED_SEEK | FD_RAW_NEED_DISK;
+ raw_cmd.track = cylinder << stretch;
+ raw_cmd.rate = fd->rate & 0x43;
+@@ -363,14 +364,16 @@
+ static int rw_track(struct params *fd, int cylinder, int head, int mode)
+ {
+ int i;
+- int cur_sector;
++ int cur_sector; /* current sector, logical (based on 0) */
+ int retries;
+ struct floppy_raw_cmd raw_cmd;
+
+- cur_sector = 1 - fd->zeroBased;
++ cur_sector = 0;
+
+ for (i=MAX_SIZECODE-1; i>=0; --i) {
+- if ( fd->last_sect[i] <= cur_sector + fd->zeroBased)
++ if ( cur_sector >= fd->last_sect[i] )
++ /* last sector for size reached, move on to next
++ * sizecode */
+ continue;
+ retries=0;
+ retry:
+@@ -383,32 +386,31 @@
+ (fd->swapSides ? 4 : 0);
+ raw_cmd.cmd[2] = cylinder;
+ raw_cmd.cmd[3] = head;
+- raw_cmd.cmd[4] = cur_sector;
++ raw_cmd.cmd[4] = cur_sector + fd->firstSectorNumber;
+ raw_cmd.cmd[5] = i;
+- raw_cmd.cmd[6] = fd->last_sect[i] - 1 - fd->zeroBased;
++ raw_cmd.cmd[6] = fd->last_sect[i] + fd->firstSectorNumber - 1;
+ raw_cmd.cmd[7] = fd->gap;
+ if ( i )
+ raw_cmd.cmd[8] = 0xff;
+ else
+ raw_cmd.cmd[8] = 0xff;
+- raw_cmd.flags = (mode ? FD_RAW_WRITE : FD_RAW_READ) |
++ raw_cmd.flags = (mode ? FD_RAW_WRITE : FD_RAW_READ) |
+ FD_RAW_INTR | FD_RAW_SPIN |
+ FD_RAW_NEED_SEEK | FD_RAW_NEED_DISK;
+ raw_cmd.track = cylinder << stretch;
+ raw_cmd.rate = fd->rate & 0x43;
+
+- raw_cmd.length = (fd->last_sect[i] -
+- fd->zeroBased -
+- cur_sector) * 128 << i;
++ raw_cmd.length = (fd->last_sect[i] - cur_sector) * 128 << i;
+ /* debugging */
+ if (verbosity == 9)
+ printf("%s %ld sectors of size %d starting at %d\n",
+ mode ? "writing" : "reading",
+ raw_cmd.length / 512, i, cur_sector);
+- if(send_cmd(fd->fd, & raw_cmd,
++ if(send_cmd(fd->fd, & raw_cmd,
+ mode ? "format" : "verify")){
+ if ( !retries && mode && (raw_cmd.reply[1] & ST1_ND) ){
+- cur_sector = raw_cmd.reply[5];
++ cur_sector =
++ raw_cmd.reply[5] - fd->firstSectorNumber;
+ retries++;
+ goto retry;
+ }
+@@ -516,6 +518,7 @@
+
+ short retries;
+ short zeroBased=0;
++ short firstSectorNumber=1;
+ short swapSides=0;
+ int n,rsize;
+ char *verify_buffer = NULL;
+@@ -673,6 +676,10 @@
+ (void *) &zeroBased,
+ "Start numbering sectors from 0 instead of 1 (not readable by normal I/O)" },
+
++ { '\0', "first-sector-number", 1, EO_TYPE_SHORT, 1, 0,
++ (void *) &firstSectorNumber,
++ "Number of first sector (by default, 1)" },
++
+ { '\0', 0 }
+ };
+
+@@ -693,6 +700,15 @@
+ exit(1);
+ }
+
++ if(zeroBased) {
++ if(firstSectorNumber == 1)
++ firstSectorNumber = 0;
++ else if(firstSectorNumber > 1) {
++ fprintf(stderr, "Contradiction between zeroBased and firstSectorNumber");
++ exit(1);
++ }
++ }
++
+ /* sanity checking */
+ if (sizecode < 0 || sizecode >= MAX_SIZECODE) {
+ fprintf(stderr,"Bad sizecode %d\n", sizecode);
+@@ -730,7 +746,7 @@
+ while(1) {
+ fd[0].fd = open(fd[0].name, O_RDWR | O_NDELAY | O_EXCL);
+
+- /* we open the disk wronly/rdwr in order to check write
++ /* we open the disk wronly/rdwr in order to check write
+ * protect */
+ if (fd[0].fd < 0) {
+ perror("open");
+@@ -778,7 +794,7 @@
+
+
+ if(have_geom) {
+- if(mask & (SET_SECTORS | SET_CYLINDERS |
++ if(mask & (SET_SECTORS | SET_CYLINDERS |
+ SET_HEADS | SET_SIZECODE | SET_2M | SET_RATE)) {
+ fprintf(stderr,
+ "Cannot mix old style and new style geometry spec\n");
+@@ -805,17 +821,14 @@
+ break;
+ }
+ stretch = geometry.stretch & 1;
+-#ifdef FD_ZEROBASED
+- if(geometry.stretch & FD_ZEROBASED) {
+- zeroBased = 1;
++ if(geometry.stretch & FD_SECTBASEMASK) {
++ firstSectorNumber =
++ ((geometry.stretch & FD_SECTBASEMASK)>>2)^1;
+ }
+-#endif
+-#ifdef FD_SWAPSIDES
+ if(geometry.stretch & FD_SWAPSIDES) {
+ swapSides = 1;
+ }
+-#endif
+- mask |= SET_SECTORS | SET_CYLINDERS |
++ mask |= SET_SECTORS | SET_CYLINDERS |
+ SET_SIZECODE | SET_2M | SET_RATE;
+ } else {
+ /* density */
+@@ -831,7 +844,7 @@
+ density = DRIVE_DEFAULTS.density;
+ if ( mask & SET_RATE ){
+ for (i=0; i< density; ++i) {
+- if(fd[0].rate ==
++ if(fd[0].rate ==
+ DRIVE_DEFAULTS.fmt[i].rate)
+ density=i;
+ }
+@@ -867,13 +880,7 @@
+ }
+ }
+
+- fd[0].zeroBased = zeroBased;
+-#ifndef FD_ZEROBASED
+- if(zeroBased) {
+- noverify = 1;
+- }
+-#endif
+-
++ fd[0].firstSectorNumber = firstSectorNumber;
+ fd[0].swapSides = swapSides;
+
+ if (cylinders > fd[0].drvprm.tracks) {
+@@ -914,7 +921,7 @@
+ header_size = 62;
+
+ if(! (mask & (SET_DEVIATION | SET_MARGIN)) &&
+- (drivedesc.mask & (1 << FE__DEVIATION))) {
++ (drivedesc.mask & (1 << FE__DEVIATION))) {
+ deviation = drivedesc.type.deviation;
+ mask |= SET_DEVIATION;
+ }
+@@ -947,14 +954,14 @@
+ "add the following line to " DRIVEPRMFILE ":\n");
+ fprintf(stdout,
+ "drive%d: deviation=%d\n",
+- fd[0].drive,
++ fd[0].drive,
+ (fd[0].raw_capacity-old_capacity)*1000000/
+ old_capacity);
+ fprintf(stderr,
+ "CAUTION: The line is drive and controller "
+- "specific, so it should be\n"
++ "specific, so it should be\n"
+ "removed before installing a new "
+- "drive %d or floppy controller.\n\n",
++ "drive %d or floppy controller.\n\n",
+ fd[0].drive);
+ }
+ }
+@@ -981,7 +988,7 @@
+ if (verbosity == 9) {
+ for (i=0; i<fd[0].dsect; ++i)
+ printf("s=%2d S=%2d o=%2d\n",
+- fd[0].sequence[i].sect,
++ fd[0].sequence[i].sect + firstSectorNumber,
+ fd[0].sequence[i].size,
+ fd[0].sequence[i].offset);
+
+@@ -1004,9 +1011,10 @@
+ if (verbosity == 9){
+ for (i=0; i< fd0.dsect; i++)
+ printf("s=%2d S=%2d o=%2d\n",
+- fd0.sequence[i].sect,
+- fd0.sequence[i].size,
+- fd0.sequence[i].offset);
++ fd0.sequence[i].sect +
++ fd0.firstSectorNumber,
++ fd0.sequence[i].size,
++ fd0.sequence[i].offset);
+
+ printf("fd[0].sizecode=%d\n", fd0.sizecode);
+ printf("fd[0].fmt_gap=%d\n", fd0.fmt_gap);
+@@ -1019,11 +1027,9 @@
+ parameters.head = heads;
+ parameters.track = cylinders;
+ parameters.size = cylinders * heads * sectors;
+- parameters.stretch = stretch
+-#ifdef FD_ZEROBASED
+- | (zeroBased ? 4 : 0)
+-#endif
+- | (swapSides ? 2 : 0);
++ parameters.stretch = stretch
++ | (swapSides ? 2 : 0)
++ | ((1^firstSectorNumber) << 2);
+ parameters.gap = fd[0].gap;
+ if ( !use_2m)
+ fd0.rate = fd[0].rate;
+@@ -1109,7 +1115,8 @@
+ ioctl(fd[0].fd, FDFLUSH );
+ close(fd[0].fd);
+
+- if (! (mask & SET_DOSDRIVE ) && fd[0].drive < 2 && !zeroBased)
++ if (! (mask & SET_DOSDRIVE ) && fd[0].drive < 2 &&
++ firstSectorNumber == 1)
+ dosdrive = fd[0].drive+'a';
+
+ if (dosdrive) {
+@@ -1133,14 +1140,14 @@
+ setenv("MTOOLS_RATE_ANY", env_buffer,1);
+ if(system(command_buffer)){
+ fprintf(stderr,"\nwarning: mformat error\n");
+- /*exit(1);*/
+- /* Do not fail, if mformat happens to not be
++ /*exit(1);*/
++ /* Do not fail, if mformat happens to not be
+ * installed. The user might have wanted to make
+ * an ext2 disk for instance */
+ dosverify = 0;
+ }
+ } else {
+- if(!zeroBased)
++ if(firstSectorNumber != 1)
+ fprintf(stderr,
+ "\nwarning: mformat not called because DOS drive unknown\n");
+ /*exit(1);*/
+@@ -1173,7 +1180,7 @@
+ n = read(fd[0].fd,verify_buffer,rsize);
+ if ( n < 0){
+ perror("read");
+- fprintf(stderr,
++ fprintf(stderr,
+ "remaining %d\n", n);
+ exit(1);
+ }
+diff -ur --new-file --exclude-from=/home/alain/Projects/Fdutils/exclude fdutils-5.5/src/superformat.h fdutils/src/superformat.h
+--- fdutils-5.5/src/superformat.h 2002-11-02 14:36:45.000000000 +0100
++++ fdutils/src/superformat.h 2008-10-27 20:17:54.000000000 +0100
+@@ -83,7 +83,7 @@
+ int length; /* length of the track */
+ int rotations; /* how many time do we have to go over 0 to read
+ * the track */
+- int zeroBased; /* 1 if sector numbering starts at zero */
++ int firstSectorNumber; /* Number of first sector (1, by default) */
+ int swapSides; /* if logical side 0 is on physical 1 and vice-versa */
+ };
+
diff --git a/source/a/floppy/floppy.SlackBuild b/source/a/floppy/floppy.SlackBuild
index 04966d1c..adc39b46 100755
--- a/source/a/floppy/floppy.SlackBuild
+++ b/source/a/floppy/floppy.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,9 +20,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=5.4
-MTOOLS=3.9.8
-BUILD=${BUILD:-3}
+VERSION=5.5
+MTOOLS=4.0.18
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -50,34 +50,39 @@ rm -rf $PKG $TMP/fdutils-$VERSION $TMP/mtools-$MTOOLS
mkdir -p $TMP $PKG/{etc,usr/{bin,info,man/man{1,4,5}}}
cd $TMP
-tar xzvf $CWD/fdutils-$VERSION.tar.gz
+tar xvf $CWD/fdutils-$VERSION.tar.?z*
cd fdutils-$VERSION
-zcat $CWD/fdutils-5.4-20020222.diff.gz | patch -p1 --verbose --backup --suffix=.orig
-zcat $CWD/fdutils.mediaprm.diff.gz | patch -p1 --verbose --backup --suffix=.orig
+zcat $CWD/fdutils-5.5-20081027.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+zcat $CWD/fdutils.mediaprm.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+sed -i 's|<linux/ext2_fs.h>|<ext2fs/ext2_fs.h>|' src/fdmount.c
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
- $ARCH-slackware-linux
-make install prefix=$PKG/usr
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --build=$ARCH-slackware-linux || exit 1
+make || exit 1
+make install prefix=$PKG/usr exec_prefix=$PKG/usr bindir=$PKG/usr/bin \
+ infodir=$PKG/usr/info mandir=$PKG/usr/man sysconfdir=$PKG/etc
mkdir -p $PKG/usr/doc/fdutils-$VERSION
cp -a COPYING CREDITS Changelog INSTALL doc/FAQ.html doc/README \
$PKG/usr/doc/fdutils-$VERSION
chown root:root $PKG/usr/doc/fdutils-$VERSION/*
chmod 644 $PKG/usr/doc/fdutils-$VERSION/*
cd $TMP
-tar xzvf $CWD/mtools-$MTOOLS.tar.gz
+tar xvf $CWD/mtools-$MTOOLS.tar.?z*
cd mtools-$MTOOLS
CFLAGS="$SLKCFLAGS" \
./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- $ARCH-slackware-linux
-#make all floppyd floppyd_installtest
-make all
-make install prefix=$PKG/usr sysconfdir=$PKG/etc bindir=$PKG/usr/bin \
- MAN1DIR=$PKG/usr/man/man1 MAN5DIR=$PKG/usr/man/man5
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --sysconfdir=/etc \
+ --build=$ARCH-slackware-linux || exit 1
+make all || exit 1
+make install DESTDIR=$PKG || exit 1
cat $CWD/mtools.conf > $PKG/etc/mtools.conf
cat $CWD/mediaprm > $PKG/etc/mediaprm
mkdir -p $PKG/usr/doc/mtools-$MTOOLS
diff --git a/source/a/floppy/slack-desc b/source/a/floppy/slack-desc
index bb916942..0a60ea47 100644
--- a/source/a/floppy/slack-desc
+++ b/source/a/floppy/slack-desc
@@ -8,9 +8,9 @@
|-----handy-ruler------------------------------------------------------|
floppy: floppy (floppy disk utilities)
floppy:
-floppy: Contains fdutils-5.4, tools to test and format floppy disks; and
-floppy: mtools-3.9.8, a collection of utilities for using DOS/Windows floppy
-floppy: disks with Linux.
+floppy: Contains fdutils, tools to test and format floppy disks; and mtools,
+floppy: a collection of utilities to access FAT disks without mounting them.
+floppy:
floppy:
floppy:
floppy:
diff --git a/source/a/gawk/gawk.SlackBuild b/source/a/gawk/gawk.SlackBuild
index 157f7ce9..cb332aa7 100755
--- a/source/a/gawk/gawk.SlackBuild
+++ b/source/a/gawk/gawk.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,8 +21,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PKGNAM=gawk
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:--j6}
@@ -42,12 +42,16 @@ PKG=$TMP/package-gawk
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
rm -rf $PKG
@@ -69,6 +73,7 @@ find . \
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--infodir=/usr/info \
--build=$ARCH-slackware-linux
diff --git a/source/a/gettext/gettext-tools.SlackBuild b/source/a/gettext/gettext-tools.SlackBuild
index 8b3154b0..b231ad5f 100755
--- a/source/a/gettext/gettext-tools.SlackBuild
+++ b/source/a/gettext/gettext-tools.SlackBuild
@@ -20,8 +20,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=0.18.1.1
-BUILD=${BUILD:-3}
+VERSION=0.18.2.1
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j6 "}
@@ -60,7 +60,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf gettext-$VERSION
-tar xjvf $CWD/gettext-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/gettext-$VERSION.tar.xz || exit 1
cd gettext-$VERSION
chown -R root:root .
find . \
@@ -97,7 +97,7 @@ gzip $PKG/usr/man/man?/*
( cd $PKG/usr/doc/gettext-tools-$VERSION
# These take up a ton of space otherwise
tar cf examples.tar examples
- bzip2 -9 examples.tar
+ xz -9 examples.tar
rm -rf examples
# Move the HTML docs into a subdirectory:
mkdir html
@@ -109,7 +109,7 @@ gzip $PKG/usr/man/man?/*
)
cp -a \
- AUTHORS ../COPYING INSTALL NEWS README \
+ AUTHORS ../COPYING* INSTALL NEWS README* \
$PKG/usr/doc/gettext-tools-$VERSION
mkdir -p $PKG/install
diff --git a/source/a/gettext/gettext.SlackBuild b/source/a/gettext/gettext.SlackBuild
index cd86bf7e..ce4ef587 100755
--- a/source/a/gettext/gettext.SlackBuild
+++ b/source/a/gettext/gettext.SlackBuild
@@ -20,8 +20,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=0.18.1.1
-BUILD=${BUILD:-3}
+VERSION=0.18.2.1
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j6 "}
@@ -60,7 +60,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf gettext-$VERSION
-tar xjvf $CWD/gettext-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/gettext-$VERSION.tar.xz || exit 1
cd gettext-$VERSION
chown -R root:root .
find . \
@@ -101,7 +101,7 @@ gzip -9 $PKG/usr/man/man?/*
)
cp -a \
- AUTHORS BUGS intl/COPYING.LIB-2.0 intl/COPYING.LIB-2.1 INSTALL NEWS README \
+ AUTHORS BUGS intl/COPYING* INSTALL NEWS README* \
$PKG/usr/doc/gettext-$VERSION
mkdir -p $PKG/install
diff --git a/source/a/getty-ps/getty-ps.SlackBuild b/source/a/getty-ps/getty-ps.SlackBuild
index fb1a49f8..642256fe 100755
--- a/source/a/getty-ps/getty-ps.SlackBuild
+++ b/source/a/getty-ps/getty-ps.SlackBuild
@@ -22,7 +22,7 @@
VERSION=2.1.0b
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/a/getty-ps/getty.bugfixes.diff b/source/a/getty-ps/getty.bugfixes.diff
index 6a1ed29e..dd2e4858 100644
--- a/source/a/getty-ps/getty.bugfixes.diff
+++ b/source/a/getty-ps/getty.bugfixes.diff
@@ -132,7 +132,7 @@ Jan Rafaj
+
+void free_version(void)
+{
-+ if (Version)
++ if (Version && defvalue(def, "VERSION"))
+ free(Version);
+ Version = NULL;
+}
diff --git a/source/a/gpm/gpm-1.20.1-consolename.patch b/source/a/gpm/gpm-1.20.1-consolename.patch
deleted file mode 100644
index c5879fb4..00000000
--- a/source/a/gpm/gpm-1.20.1-consolename.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- gpm-1.20.1/src/lib/liblow.c.orig 2004-10-13 16:34:15.181502369 -0400
-+++ gpm-1.20.1/src/lib/liblow.c 2004-10-13 16:34:20.491778415 -0400
-@@ -262,13 +262,14 @@
- gpm_report(GPM_PR_ERR,"consolename not set");
- goto err;
- }
-+#if 0
- /* do we really need this check ? */
- if(strncmp(tty,consolename,strlen(consolename)-1)
- || !isdigit(tty[strlen(consolename)-1])) {
- gpm_report(GPM_PR_ERR,"strncmp/isdigit/consolename failed");
- goto err;
- }
--
-+#endif
- conn->vc=atoi(&tty[strlen(consolename)-1]);
- }
-
diff --git a/source/a/gpm/gpm-1.20.1-gpmopen.patch b/source/a/gpm/gpm-1.20.1-gpmopen.patch
deleted file mode 100644
index f36ad939..00000000
--- a/source/a/gpm/gpm-1.20.1-gpmopen.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- gpm-1.20.1/src/lib/liblow.c.gpmopen 2004-05-04 17:36:09.000000000 -0400
-+++ gpm-1.20.1/src/lib/liblow.c 2004-05-04 17:42:51.000000000 -0400
-@@ -200,8 +200,6 @@
- Gpm_Stst *new = NULL;
- char* sock_name = 0;
-
-- consolename = NULL;
--
- #if 0
- gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
- #endif
-@@ -260,6 +258,10 @@
- gpm_report(GPM_PR_ERR,"checking tty name failed");
- goto err;
- }
-+ if (consolename == NULL) {
-+ gpm_report(GPM_PR_ERR,"consolename not set");
-+ goto err;
-+ }
- /* do we really need this check ? */
- if(strncmp(tty,consolename,strlen(consolename)-1)
- || !isdigit(tty[strlen(consolename)-1])) {
diff --git a/source/a/gpm/gpm-1.20.1-idie.patch b/source/a/gpm/gpm-1.20.1-idie.patch
deleted file mode 100644
index 4594f078..00000000
--- a/source/a/gpm/gpm-1.20.1-idie.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- gpm-1.20.1/src/lib/liblow.c.orig 2004-05-06 14:14:03.000000000 -0400
-+++ gpm-1.20.1/src/lib/liblow.c 2004-05-06 14:18:05.000000000 -0400
-@@ -376,7 +376,9 @@
-
- /*....................................... Error: free all memory */
- err:
-+#if 0
- gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! ");
-+#endif
- do {
- new=gpm_stack->next;
- free(gpm_stack);
diff --git a/source/a/gpm/gpm-1.20.1-input-defines.diff b/source/a/gpm/gpm-1.20.1-input-defines.diff
deleted file mode 100644
index 4a925a6a..00000000
--- a/source/a/gpm/gpm-1.20.1-input-defines.diff
+++ /dev/null
@@ -1,26 +0,0 @@
---- ./src/headers/input-defines.h.orig 2006-12-11 19:56:14.000000000 -0600
-+++ ./src/headers/input-defines.h 2006-12-11 19:59:30.000000000 -0600
-@@ -59,23 +59,4 @@
- #define PSMOUSE_SYNAPTICS 7
- #endif
-
--#ifndef HAVE_INPUT_ID
--struct input_id {
-- unsigned short bustype;
-- unsigned short vendor;
-- unsigned short product;
-- unsigned short version;
--};
--#endif
--
--#ifndef HAVE_INPUT_ABSINFO
--struct input_absinfo {
-- int value;
-- int minimum;
-- int maximum;
-- int fuzz;
-- int flat;
--};
--#endif
--
- #endif
diff --git a/source/a/gpm/gpm-1.20.1-input.patch b/source/a/gpm/gpm-1.20.1-input.patch
deleted file mode 100644
index 152e6038..00000000
--- a/source/a/gpm/gpm-1.20.1-input.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -ur gpm-1.20.1.orig/src/headers/config.h.in gpm-1.20.1/src/headers/config.h.in
---- gpm-1.20.1.orig/src/headers/config.h.in 2004-09-04 10:24:11.000000000 -0400
-+++ gpm-1.20.1/src/headers/config.h.in 2004-09-04 10:26:02.000000000 -0400
-@@ -46,6 +46,12 @@
- /* Define if you have the <linux/input.h> header file. */
- #undef HAVE_LINUX_INPUT_H
-
-+/* Definedif you have the input_id structure */
-+#undef HAVE_INPUT_ID
-+
-+/* Definedif you have the input_absinfo structure */
-+#undef HAVE_INPUT_ABSINFO
-+
- /* Define if you have the <linux/joystick.h> header file. */
- #undef HAVE_LINUX_JOYSTICK_H
-
diff --git a/source/a/gpm/gpm-1.20.1-lib-silent.patch b/source/a/gpm/gpm-1.20.1-lib-silent.patch
index 099075b5..e7707415 100644
--- a/source/a/gpm/gpm-1.20.1-lib-silent.patch
+++ b/source/a/gpm/gpm-1.20.1-lib-silent.patch
@@ -15,5 +15,5 @@
+ return;
+
char *string = NULL;
+ int log_level;
va_list ap;
- va_start(ap,text);
diff --git a/source/a/gpm/gpm-1.20.1-math.patch b/source/a/gpm/gpm-1.20.1-math.patch
deleted file mode 100644
index 634a5fd8..00000000
--- a/source/a/gpm/gpm-1.20.1-math.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gpm-1.20.1/configure.in.math Tue Jun 24 10:52:44 2003
-+++ gpm-1.20.1/configure.in Tue Jun 24 10:53:54 2003
-@@ -128,7 +128,7 @@
- AC_SUBST(lispdir)
-
- CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""'
--LDFLAGS='-L$(srcdir)'
-+LDFLAGS='-lm -L$(srcdir)'
-
- dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir")
- dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir")
diff --git a/source/a/gpm/gpm-1.20.1-multilib.patch b/source/a/gpm/gpm-1.20.1-multilib.patch
deleted file mode 100644
index 723ee2b5..00000000
--- a/source/a/gpm/gpm-1.20.1-multilib.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- gpm-1.20.1/doc/Makefile.in.multilib 2002-12-24 17:57:16.000000000 -0500
-+++ gpm-1.20.1/doc/Makefile.in 2004-10-20 17:25:11.000000000 -0400
-@@ -97,7 +97,7 @@
-
- # Main portion
-
--all: $(srcdir)/gpm.info $(MANPAGES)
-+all: gpm.info $(MANPAGES)
-
- # why gpmdoc.ps and gpm.ps??
- # there is no gpm.ps in my tree and no rule to generate gpm.ps.
-@@ -131,8 +131,8 @@
- #i keep all my infopages compressed and i'm tired to do it by
- #hand, so check if there are any compressed pages and do this
- #one too
-- -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \
-- && gzip -f $(infodir)/gpm.info
-+ #-ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \
-+ # && gzip -f $(infodir)/gpm.info
- # Hmm.... shouldn't man pages be compressed too?
- # maybe they should, but at least at my system they are not.
-
---- gpm-1.20.1/contrib/Makefile.in.multilib 2002-12-24 17:57:16.000000000 -0500
-+++ gpm-1.20.1/contrib/Makefile.in 2004-10-20 17:11:38.000000000 -0400
-@@ -9,10 +9,10 @@
-
- include $(top_builddir)/Makefile.include
-
--all: $(srcdir)/$(ELISP)
-+all: $(filter-out %.elc,$(srcdir)/$(ELISP))
-
- install: all
-- if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \
-+ if [ -n "$(filter-out %.elc,$(ELISP))" ]; then for i in `echo $(filter-out %.elc,$(ELISP))`; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\
- done; fi
-
-@@ -20,7 +20,7 @@
- $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")'
-
- uninstall:
-- if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \
-+ if [ -n "$(filter-out %.elc,$(ELISP))" ]; then for i in `echo $(filter-out %.elc,$(ELISP))`; do \
- rm -f $(lispdir)/$$i ;\
- done; fi
-
-@@ -28,4 +28,4 @@
- $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/
-
- clean distclean:
-- $(RM) -f $(srcdir)/emacs/*.elc
-+ $(RM) $(srcdir)/emacs/*.elc
diff --git a/source/a/gpm/gpm-1.20.1-no-console-error.patch b/source/a/gpm/gpm-1.20.1-no-console-error.patch
deleted file mode 100644
index 20c177b4..00000000
--- a/source/a/gpm/gpm-1.20.1-no-console-error.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- gpm-1.20.1/src/console.c.no-console-error 2006-01-18 17:06:15.000000000 +0100
-+++ gpm-1.20.1/src/console.c 2006-01-18 17:08:19.000000000 +0100
-@@ -249,8 +249,10 @@
- /* Failed, try OLD console */
- else if (stat(GPM_OLD_CONSOLE, &buf) == 0)
- console.device = GPM_OLD_CONSOLE;
-- else
-- gpm_report(GPM_PR_OOPS, "Can't determine console device");
-+ else { // XXX handle this gracefully?
-+ fprintf( stderr, "no console device found" );
-+ exit( 1 );
-+ }
-
- return console.device;
- }
diff --git a/source/a/gpm/gpm-1.20.1-nodebug.patch b/source/a/gpm/gpm-1.20.1-nodebug.patch
deleted file mode 100644
index 945b576c..00000000
--- a/source/a/gpm/gpm-1.20.1-nodebug.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- gpm-1.20.1/src/lib/liblow.c.orig 2004-03-31 15:06:45.000000000 -0500
-+++ gpm-1.20.1/src/lib/liblow.c 2004-03-31 15:09:32.000000000 -0500
-@@ -202,7 +202,9 @@
-
- consolename = NULL;
-
-+#if 0
- gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
-+#endif
-
- /*....................................... First of all, check xterm */
-
diff --git a/source/a/gpm/gpm-1.20.1-select-1.patch b/source/a/gpm/gpm-1.20.1-select-1.patch
new file mode 100644
index 00000000..48dbed33
--- /dev/null
+++ b/source/a/gpm/gpm-1.20.1-select-1.patch
@@ -0,0 +1,30 @@
+Submitted By: Alexander E. Patrakov
+Date: 2006-02-10
+Initial Package Version: 1.20.1
+Upstream Status: Dead
+Origin: Alexander E. Patrakov
+Description: Fixes lockups when signals arrive.
+Details: the return value of -1 from select() that propagates into flag means
+that it was interrupted by a signal. In this case, at least with glibc
+from trunk (2.3.90), the return value from FD_ISSET is undefined. Thus,
+GET(win) can be called when there's no actual input. This results in the
+lockup until a key is pressed.
+
+--- gpm-1.20.1/src/lib/libcurses.c 2002-12-25 03:57:16.000000000 +0500
++++ gpm-1.20.1/src/lib/libcurses.c 2006-02-10 09:45:11.000000000 +0500
+@@ -71,12 +71,12 @@
+ }
+ while (!flag);
+
+- if (FD_ISSET(fd,&selSet))
+- return GET(win);
+-
+ if (flag==-1)
+ continue;
+
++ if (FD_ISSET(fd,&selSet))
++ return GET(win);
++
+ if (Gpm_GetEvent(&ev) && gpm_handler
+ && (result=(*gpm_handler)(&ev,gpm_data)))
+ {
diff --git a/source/a/gpm/gpm-1.20.1-subscript.patch b/source/a/gpm/gpm-1.20.1-subscript.patch
deleted file mode 100644
index bf4ca75b..00000000
--- a/source/a/gpm/gpm-1.20.1-subscript.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gpm-1.20.1/src/mice.c.lr 2004-02-15 09:19:48.000000000 +0100
-+++ gpm-1.20.1/src/mice.c 2004-02-15 09:22:18.000000000 +0100
-@@ -2112,7 +2112,7 @@
- for (i=0; i<4; i++)
- if (gunze_calib[i] & ~1023) calibok = 0;
- if (gunze_calib[0] == gunze_calib[2]) calibok = 0;
-- if (gunze_calib[1] == gunze_calib[4]) calibok = 0;
-+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0;
- fclose(f);
- }
- if (!calibok) {
diff --git a/source/a/gpm/gpm-1.20.1-weak-wgetch.patch b/source/a/gpm/gpm-1.20.1-weak-wgetch.patch
index 81e6a2b5..2546e17f 100644
--- a/source/a/gpm/gpm-1.20.1-weak-wgetch.patch
+++ b/source/a/gpm/gpm-1.20.1-weak-wgetch.patch
@@ -14,8 +14,8 @@
int Gpm_Wgetch(WINDOW *win)
{
---- gpm-1.20.1/configure.in.weak-wgetch 2004-03-22 15:49:51.000000000 -0500
-+++ gpm-1.20.1/configure.in 2004-03-22 15:51:24.000000000 -0500
+--- gpm-1.20.1/configure.ac.weak-wgetch 2004-03-22 15:49:51.000000000 -0500
++++ gpm-1.20.1/configure.ac 2004-03-22 15:51:24.000000000 -0500
@@ -115,7 +115,7 @@
AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
else :; fi
@@ -24,15 +24,3 @@
+ SHARED_LIBS="-lc"
LIBS=$SAVELIBS ;;
esac
-
---- gpm-1.20.1/configure.weak-wgetch 2004-03-22 15:49:55.000000000 -0500
-+++ gpm-1.20.1/configure 2004-03-22 15:51:24.000000000 -0500
-@@ -4295,7 +4295,7 @@
-
- else :; fi
- done
-- SHARED_LIBS="$LIBS $TERMLIBS -lc"
-+ SHARED_LIBS="-lc"
- LIBS=$SAVELIBS ;;
- esac
-
diff --git a/source/a/gpm/gpm-1.20.1.send-noise-to-syslogs.diff b/source/a/gpm/gpm-1.20.1.send-noise-to-syslogs.diff
deleted file mode 100644
index 111e7843..00000000
--- a/source/a/gpm/gpm-1.20.1.send-noise-to-syslogs.diff
+++ /dev/null
@@ -1,86 +0,0 @@
-diff -u -r gpm-1.20.1.orig/src/report.c gpm-1.20.1/src/report.c
---- gpm-1.20.1.orig/src/report.c 2006-08-20 14:34:30.000000000 -0500
-+++ gpm-1.20.1/src/report.c 2006-08-20 14:44:54.000000000 -0500
-@@ -48,15 +48,15 @@
- *
- * Startup Mode:
- * debug : - (ignore)
-- * info : syslog/stdout
-- * warn/err : syslog/stderr
-+ * info : syslog
-+ * warn/err : syslog
- * oops : syslog/stderr [exit]
- *
- * Running Mode: (daemon)
- * debug : - (ignore)
- * info : syslog
-- * warn : syslog+system console
-- * err : syslog+system console+current console
-+ * warn : syslog
-+ * err : syslog
- * oops : syslog/stderr [_exit]
- *
- * Debug Mode :
-@@ -85,9 +85,6 @@
- syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO);
- vsyslog(LOG_INFO | LOG_USER, text, ap);
- #endif
-- fprintf(stderr,GPM_STRING_INFO);
-- vfprintf(stderr,text,ap);
-- fprintf(stderr,"\n");
- break;
-
- case GPM_STAT_WARN:
-@@ -95,9 +92,6 @@
- syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap);
- #endif
-- fprintf(stderr,GPM_STRING_WARN);
-- vfprintf(stderr,text,ap);
-- fprintf(stderr,"\n");
- break;
-
- case GPM_STAT_ERR:
-@@ -105,9 +99,6 @@
- syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
- vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
- #endif
-- fprintf(stderr,GPM_STRING_ERR);
-- vfprintf(stderr,text,ap);
-- fprintf(stderr,"\n");
- break;
-
- case GPM_STAT_OOPS:
-@@ -139,12 +130,6 @@
- syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap);
- #endif
-- if ((f = fopen(GPM_SYS_CONSOLE, "a")) != NULL) {
-- fprintf(f, GPM_STRING_WARN);
-- vfprintf(f, text, ap);
-- fprintf(f, "\n");
-- fclose(f);
-- }
- break;
-
- case GPM_STAT_ERR:
-@@ -152,19 +137,6 @@
- syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
- vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
- #endif
-- if ((f = fopen(GPM_SYS_CONSOLE, "a")) != NULL) {
-- fprintf(f, GPM_STRING_ERR);
-- vfprintf(f, text, ap);
-- fprintf(f, "\n");
-- fclose(f);
-- }
--
-- if ((f = fopen(console.device, "a")) != NULL) {
-- fprintf(f, GPM_STRING_ERR);
-- vfprintf(f, text, ap);
-- fprintf(f, "\n");
-- fclose(f);
-- }
- break;
-
- case GPM_STAT_OOPS:
diff --git a/source/a/gpm/gpm-1.20.5-close-fds.patch b/source/a/gpm/gpm-1.20.5-close-fds.patch
new file mode 100644
index 00000000..f33f07c5
--- /dev/null
+++ b/source/a/gpm/gpm-1.20.5-close-fds.patch
@@ -0,0 +1,17 @@
+diff -up gpm-1.20.5/src/daemon/startup.c.close-fds gpm-1.20.5/src/daemon/startup.c
+--- gpm-1.20.5/src/daemon/startup.c.close-fds 2008-06-13 10:08:19.000000000 +0200
++++ gpm-1.20.5/src/daemon/startup.c 2008-12-02 10:11:12.000000000 +0100
+@@ -135,6 +135,13 @@ void startup(int argc, char **argv)
+ check_uniqueness();
+ gpm_report(GPM_PR_INFO,GPM_MESS_STARTED);
+
++ // close extra fds
++ if (option.run_status == GPM_RUN_STARTUP ) {
++ close(0);
++ close(1);
++ close(2);
++ }
++
+ //return mouse_table[1].fd; /* the second is handled in the main() */
+
+ /****************** OLD CODE from gpn.c END ***********************/
diff --git a/source/a/gpm/gpm-evdev-cumulative.patch b/source/a/gpm/gpm-evdev-cumulative.patch
deleted file mode 100644
index 2fd86d10..00000000
--- a/source/a/gpm/gpm-evdev-cumulative.patch
+++ /dev/null
@@ -1,7023 +0,0 @@
-diff -urN gpm-1.20.1/configure.in gpm/configure.in
---- gpm-1.20.1/configure.in 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/configure.in 2003-10-02 01:22:42.000000000 -0500
-@@ -61,6 +61,13 @@
-
- AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h)
-
-+EVDEV_SRCS=
-+if test ${ac_cv_header_linux_input_h} = yes ; then
-+ EVDEV_SRCS=evdev.c ;
-+ AC_CHECK_TYPE(struct input_absinfo,AC_DEFINE_UNQUOTED(HAVE_INPUT_ABSINFO, 1, [define if struct input_absinfo defined in linux/input.h]),,[#include <linux/input.h>])
-+ AC_CHECK_TYPE(struct input_id,AC_DEFINE_UNQUOTED(HAVE_INPUT_ID, 1, [define if struct input_id defined in linux/input.h]),,[#include <linux/input.h>])
-+fi
-+
- AC_ARG_WITH(curses,
- [ --without-curses disable curses support even if curses found])
-
-@@ -124,6 +131,7 @@
- AC_SUBST(PICFLAGS)
- AC_SUBST(SOLDFLAGS)
- AC_SUBST(CURSES_OBJS)
-+AC_SUBST(EVDEV_SRCS)
- AC_SUBST(SHARED_LIBS)
- AC_SUBST(lispdir)
-
-diff -urN gpm-1.20.1/src/client.c gpm/src/client.c
---- gpm-1.20.1/src/client.c 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/client.c 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,319 @@
-+/*
-+ * client.c - GPM client handling (server side)
-+ *
-+ * Copyright (C) 1993 Andreq Haylett <ajh@gec-mrc.co.uk>
-+ * Copyright (C) 1994-1999 Alessandro Rubini <rubini@linux.it>
-+ * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net>
-+ * Copyright (c) 2001,2002 Nico Schottelius <nico@schottelius.org>
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h> /* strerror(); ?!? */
-+#include <errno.h>
-+#include <unistd.h> /* select(); */
-+#include <signal.h> /* SIGPIPE */
-+#include <time.h> /* time() */
-+#include <sys/fcntl.h> /* O_RDONLY */
-+#include <sys/stat.h> /* mkdir() */
-+#include <sys/time.h> /* timeval */
-+#include <sys/types.h> /* socket() */
-+#include <sys/socket.h> /* socket() */
-+#include <sys/un.h> /* struct sockaddr_un */
-+
-+#include "headers/gpmInt.h"
-+#include "headers/message.h"
-+#include "headers/console.h"
-+#include "headers/selection.h"
-+#include "headers/client.h"
-+
-+/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */
-+#if !defined(__GLIBC__)
-+ typedef unsigned int __socklen_t;
-+#endif /* __GLIBC__ */
-+
-+#ifndef max
-+#define max(a,b) ((a)>(b) ? (a) : (b))
-+#endif
-+
-+extern int errno;
-+
-+struct client_info *cinfo[MAX_VC + 1];
-+
-+/*-------------------------------------------------------------------*
-+ * This was inline, and incurred in a compiler bug (2.7.0)
-+ *-------------------------------------------------------------------*/
-+static int get_data(int fd, Gpm_Connect *data)
-+{
-+ static int len;
-+
-+#ifdef GPM_USE_MAGIC
-+ while ((len = read(whence, &check, sizeof(int))) == 4 &&
-+ check != GPM_MAGIC)
-+ gpm_report(GPM_PR_INFO, GPM_MESS_NO_MAGIC);
-+
-+ if (len == 0) return 0;
-+
-+ if (check != GPM_MAGIC) {
-+ gpm_report(GPM_PR_INFO, GPM_MESS_NOTHING_MORE);
-+ return -1;
-+ }
-+#endif
-+
-+ len = read(fd, data, sizeof(Gpm_Connect));
-+
-+ return len ? (len == sizeof(Gpm_Connect) ? 1 : -1) : 0;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+int listen_for_clients(void)
-+{
-+ struct sockaddr_un ctladdr;
-+ int fd, len;
-+
-+ unlink(GPM_NODE_CTL);
-+
-+ if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_SOCKET_PROB);
-+
-+ memset(&ctladdr, 0, sizeof(ctladdr));
-+ ctladdr.sun_family = AF_UNIX;
-+ strcpy(ctladdr.sun_path, GPM_NODE_CTL);
-+ len = sizeof(ctladdr.sun_family) + strlen(GPM_NODE_CTL);
-+
-+ if (bind(fd, (struct sockaddr *)&ctladdr, len) == -1)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_BIND_PROB, ctladdr.sun_path);
-+
-+ /* needs to be 0777, so all users can _try_ to access gpm */
-+ chmod(GPM_NODE_CTL, 0777);
-+ listen(fd, 5); /* Queue up calls */
-+
-+ return fd;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+struct client_info *accept_client_connection(int fd)
-+{
-+ struct client_info *info;
-+ Gpm_Connect *request;
-+ int newfd;
-+#if !defined(__GLIBC__)
-+ int len;
-+#else /* __GLIBC__ */
-+ size_t len; /* isn't that generally defined in C ??? -- nico */
-+#endif /* __GLIBC__ */
-+ struct sockaddr_un addr; /* reuse this each time */
-+#ifndef SO_PEERCRED
-+ struct stat statbuf;
-+ time_t staletime;
-+#endif
-+ uid_t uid;
-+
-+ /*....................................... Accept */
-+ memset(&addr, 0, sizeof(addr));
-+ addr.sun_family = AF_UNIX;
-+
-+ len = sizeof(addr);
-+ if ((newfd = accept(fd, (struct sockaddr *)&addr, &len)) < 0) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_ACCEPT_FAILED, strerror(errno));
-+ return NULL;
-+ }
-+
-+ gpm_report(GPM_PR_INFO, GPM_MESS_CONECT_AT, newfd);
-+
-+ if (!(info = malloc(sizeof(struct client_info))))
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM);
-+
-+ request = &info->data;
-+ if (get_data(newfd, request) == -1)
-+ goto err;
-+
-+ if (request->vc > MAX_VC) {
-+ gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, request->vc, MAX_VC);
-+ goto err;
-+ }
-+
-+#ifndef SO_PEERCRED
-+ if (stat(addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) {
-+ gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path);
-+ goto err;
-+ }
-+
-+ unlink(addr.sun_path); /* delete socket */
-+
-+ staletime = time(0) - 30;
-+ if (statbuf.st_atime < staletime ||
-+ statbuf.st_ctime < staletime ||
-+ statbuf.st_mtime < staletime) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET_OLD);
-+ goto err;
-+ }
-+
-+ uid = statbuf.st_uid; /* owner of socket */
-+#else
-+ {
-+ struct ucred sucred;
-+ socklen_t credlen = sizeof(struct ucred);
-+
-+ if (getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) {
-+ gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno));
-+ goto err;
-+ }
-+ uid = sucred.uid;
-+ gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid);
-+ }
-+#endif
-+
-+ if (uid != 0 && !is_console_owner(request->vc, uid)) {
-+ gpm_report(GPM_PR_WARN, GPM_MESS_FAILED_CONNECT, uid, request->vc);
-+ goto err;
-+ }
-+
-+ /* register the connection information in the right place */
-+ info->next = cinfo[request->vc];
-+ info->fd = newfd;
-+ cinfo[request->vc] = info;
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_LONG_STATUS,
-+ request->pid, request->vc, request->eventMask, request->defaultMask,
-+ request->minMod, request->maxMod);
-+
-+ return info;
-+
-+err:
-+ free(info);
-+ close(newfd);
-+
-+ return NULL;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+void remove_client(struct client_info *ci, int vc)
-+{
-+ struct client_info *p, *prev = NULL;
-+
-+ for (p = cinfo[vc]; p; prev = p, p = p->next) {
-+ if (p == ci) {
-+ if (!prev) /* it is on top of the stack */
-+ cinfo[vc] = p->next;
-+ else
-+ prev->next = p->next;
-+ break;
-+ }
-+ }
-+ if (p) free(p);
-+}
-+
-+/*-------------------------------------------------------------------*/
-+void notify_clients_resize(void)
-+{
-+ struct client_info *ci;
-+ int i;
-+
-+ for (i = 0; i < MAX_VC + 1; i++)
-+ for (ci = cinfo[i]; ci; ci = ci->next)
-+ kill(ci->data.pid, SIGWINCH);
-+}
-+
-+/*-------------------------------------------------------------------*/
-+/* returns 0 if the event has not been processed, and 1 if it has */
-+int do_client(struct client_info *cinfo, Gpm_Event *event)
-+{
-+ Gpm_Connect *info = &cinfo->data;
-+ /* value to return if event is not used */
-+ int res = !(info->defaultMask & event->type);
-+
-+ /* instead of returning 0, scan the stack of clients */
-+ if ((info->minMod & event->modifiers) < info->minMod)
-+ goto try_next;
-+ if ((info->maxMod & event->modifiers) < event->modifiers)
-+ goto try_next;
-+
-+ /* if not managed, use default mask */
-+ if (!(info->eventMask & GPM_BARE_EVENTS(event->type))) {
-+ if (res) return res;
-+ else goto try_next;
-+ }
-+
-+ /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */
-+ MAGIC_P((write(cinfo->fd, &magic, sizeof(int))));
-+ write(cinfo->fd, event, sizeof(Gpm_Event));
-+
-+ return info->defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */
-+
-+ try_next:
-+ if (cinfo->next != 0)
-+ return do_client(cinfo->next, event); /* try the next */
-+
-+ return 0; /* no next, not used */
-+}
-+
-+/*-------------------------------------------------------------------*/
-+/* returns 0 if client disconnects, -1 - error, 1 -successs */
-+int process_client_request(struct client_info *ci, int vc,
-+ int x, int y, int buttons, int clicks,
-+ int three_button_mouse)
-+{
-+ int rc;
-+ Gpm_Connect conn;
-+ static Gpm_Event event;
-+
-+ gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc);
-+ if (vc > MAX_VC) return -1;
-+
-+ /* itz 10-22-96 this shouldn't happen now */
-+ if (vc == -1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD);
-+
-+ rc = get_data(ci->fd, &conn);
-+
-+ if (rc == 0) { /* no data */
-+ gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE);
-+ close(ci->fd);
-+ return 0;
-+ }
-+
-+ if (rc == -1) return -1; /* too few bytes */
-+
-+ if (conn.pid != 0) {
-+ ci->data = conn;
-+ return 1;
-+ }
-+
-+ /* Aha, request for information (so-called snapshot) */
-+ switch (conn.vc) {
-+ case GPM_REQ_SNAPSHOT:
-+ event.vc = get_console_state(&event.modifiers);
-+ event.x = x; event.y = y;
-+ event.buttons = buttons;
-+ event.clicks = clicks;
-+ event.dx = console.max_x; event.dy = console.max_y;
-+ /* fall through */
-+
-+ case GPM_REQ_BUTTONS:
-+ event.type = (three_button_mouse == 1 ? 3 : 2); /* buttons */
-+ write(ci->fd, &event, sizeof(Gpm_Event));
-+ break;
-+
-+ case GPM_REQ_NOPASTE:
-+ selection_disable_paste();
-+ gpm_report(GPM_PR_INFO, GPM_MESS_DISABLE_PASTE, vc);
-+ break;
-+ }
-+
-+ return 1;
-+}
-+
-diff -urN gpm-1.20.1/src/console.c gpm/src/console.c
---- gpm-1.20.1/src/console.c 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/console.c 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,257 @@
-+/*
-+ * console.c - GPM console and selection/paste handling
-+ *
-+ * Copyright (C) 1993 Andreq Haylett <ajh@gec-mrc.co.uk>
-+ * Copyright (C) 1994-1999 Alessandro Rubini <rubini@linux.it>
-+ * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net>
-+ * Copyright (c) 2001,2002 Nico Schottelius <nico@schottelius.org>
-+ * Copyright (c) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h> /* strerror(); ?!? */
-+#include <errno.h>
-+#include <unistd.h> /* select(); */
-+#include <time.h> /* time() */
-+#include <sys/fcntl.h> /* O_RDONLY */
-+#include <sys/stat.h> /* mkdir() */
-+#include <asm/types.h> /* __u32 */
-+
-+#include <linux/vt.h> /* VT_GETSTATE */
-+#include <sys/kd.h> /* KDGETMODE */
-+#include <termios.h> /* winsize */
-+
-+#include "headers/gpmInt.h"
-+#include "headers/console.h"
-+#include "headers/message.h"
-+
-+#ifndef HAVE___U32
-+# ifndef _I386_TYPES_H /* /usr/include/asm/types.h */
-+typedef unsigned int __u32;
-+# endif
-+#endif
-+
-+struct gpm_console console = { 0, DEF_LUT, 0, 0 };
-+
-+/*-------------------------------------------------------------------*/
-+static int count_digits(int num)
-+{
-+ int digits = 1;
-+
-+ while ((num /= 10))
-+ digits++;
-+
-+ return digits;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+char *compose_vc_name(int vc)
-+{
-+ char *tty;
-+
-+ tty = malloc(strlen(console.device) + count_digits(vc) + sizeof(char));
-+ if (tty) {
-+ /* console is /dev/vc/0 or /dev/tty0 and we trimming the ending 0 */
-+ strncpy(tty, console.device, strlen(console.device) - 1);
-+ sprintf(&tty[strlen(console.device) - 1], "%d", vc);
-+ }
-+
-+ return tty;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+int open_console(int mode)
-+{
-+ int fd;
-+
-+ if ((fd = open(console.device, mode)) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON);
-+
-+ return fd;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+int is_text_console(void)
-+{
-+ int fd;
-+ int kd_mode;
-+
-+ fd = open_console(O_RDONLY);
-+ if (ioctl(fd, KDGETMODE, &kd_mode)<0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_KDGETMODE);
-+ close(fd);
-+
-+ return kd_mode == KD_TEXT;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+void wait_text_console(void)
-+{
-+ do {
-+ sleep(2);
-+ } while (!is_text_console());
-+}
-+
-+/*-------------------------------------------------------------------*/
-+void refresh_console_size(void)
-+{
-+ struct winsize win;
-+ int fd = open_console(O_RDONLY);
-+
-+ ioctl(fd, TIOCGWINSZ, &win);
-+ close(fd);
-+
-+ if (!win.ws_col || !win.ws_row) {
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_ZERO_SCREEN_DIM);
-+ console.max_x = 80; console.max_y = 25;
-+ } else {
-+ console.max_x = win.ws_col; console.max_y = win.ws_row;
-+ }
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_SCREEN_SIZE, console.max_x, console.max_y);
-+}
-+
-+/*-------------------------------------------------------------------*/
-+int get_console_state(unsigned char *shift_state)
-+{
-+ struct vt_stat stat;
-+ int fd;
-+
-+ fd = open_console(O_RDONLY);
-+
-+ *shift_state = 6; /* code for the ioctl */
-+ if (ioctl(fd, TIOCLINUX, shift_state) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_GET_SHIFT_STATE);
-+
-+ if (ioctl(fd, VT_GETSTATE, &stat) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_GET_CONSOLE_STAT);
-+
-+ close(fd);
-+
-+ return stat.v_active;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+int is_console_owner(int vc, uid_t uid)
-+{
-+ struct stat statbuf;
-+ char *tty;
-+ int rc;
-+
-+ if ((tty = compose_vc_name(vc)) == NULL)
-+ gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
-+
-+ if ((rc = stat(tty, &statbuf)) == -1)
-+ gpm_report(GPM_PR_ERR, GPM_MESS_STAT_FAILS, tty);
-+
-+ free(tty);
-+
-+ return rc != -1 && uid == statbuf.st_uid;
-+}
-+
-+/*-------------------------------------------------------------------*/
-+/* octal digit */
-+static int isodigit(const unsigned char c)
-+{
-+ return ((c & ~7) == '0');
-+}
-+
-+/*-------------------------------------------------------------------*/
-+/* routine to convert digits from octal notation (Andries Brouwer) */
-+static int getsym(const unsigned char *p0, unsigned char *res)
-+{
-+ const unsigned char *p = p0;
-+ char c;
-+
-+ c = *p++;
-+ if (c == '\\' && *p) {
-+ c = *p++;
-+ if (isodigit(c)) {
-+ c -= '0';
-+ if (isodigit(*p)) c = 8*c + (*p++ - '0');
-+ if (isodigit(*p)) c = 8*c + (*p++ - '0');
-+ }
-+ }
-+ *res = c;
-+ return (p - p0);
-+}
-+
-+/*-------------------------------------------------------------------*/
-+/* description missing! FIXME */
-+void console_load_lut(void)
-+{
-+ extern int errno;
-+ int i, c, fd;
-+ unsigned char this, next;
-+ static __u32 long_array[9] = {
-+ 0x05050505, /* ugly, but preserves alignment */
-+ 0x00000000, /* control chars */
-+ 0x00000000, /* digits */
-+ 0x00000000, /* uppercase and '_' */
-+ 0x00000000, /* lowercase */
-+ 0x00000000, /* Latin-1 control */
-+ 0x00000000, /* Latin-1 misc */
-+ 0x00000000, /* Latin-1 uppercase */
-+ 0x00000000 /* Latin-1 lowercase */
-+ };
-+
-+#define inwordLut (long_array+1)
-+
-+ for (i = 0; console.charset[i]; ) {
-+ i += getsym(console.charset + i, &this);
-+ if (console.charset[i] == '-' && console.charset[i + 1] != '\0')
-+ i += getsym(console.charset + i + 1, &next) + 1;
-+ else
-+ next = this;
-+ for (c = this; c <= next; c++)
-+ inwordLut[c >> 5] |= 1 << (c & 0x1F);
-+ }
-+
-+ fd = open_console(O_WRONLY);
-+
-+ if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */
-+ if (errno == EPERM && getuid())
-+ gpm_report(GPM_PR_WARN, GPM_MESS_ROOT); /* why do we still continue?*/
-+ else if (errno == EINVAL)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_CSELECT);
-+ }
-+ close(fd);
-+}
-+
-+/*-------------------------------------------------------------------*/
-+/* Returns the name of the console (/dev/tty0 or /dev/vc/0) */
-+/* Also fills console.device */
-+char *get_console_name()
-+{
-+ struct stat buf;
-+
-+ /* first try the devfs device, because in the next time this will be
-+ * the preferred one. If that fails, take the old console */
-+
-+ /* Check for open new console */
-+ if (stat(GPM_DEVFS_CONSOLE, &buf) == 0)
-+ console.device = GPM_DEVFS_CONSOLE;
-+
-+ /* Failed, try OLD console */
-+ else if (stat(GPM_OLD_CONSOLE, &buf) == 0)
-+ console.device = GPM_OLD_CONSOLE;
-+ else
-+ gpm_report(GPM_PR_OOPS, "Can't determine console device");
-+
-+ return console.device;
-+}
-+
-diff -urN gpm-1.20.1/src/evdev.c gpm/src/evdev.c
---- gpm-1.20.1/src/evdev.c 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/evdev.c 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,851 @@
-+/*
-+ * evdev.c - support for event input devices in linux 2.4 & 2.6
-+ *
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ * Based on XFree86 driver by Stefan Gmeiner & Peter Osterlund
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <time.h>
-+#include <sys/select.h>
-+#include <sys/time.h>
-+
-+#include <linux/input.h>
-+#include "headers/input-defines.h" /* misisng bits in case <linux/input.h> is old */
-+
-+#include "headers/gpm.h"
-+#include "headers/gpmInt.h"
-+#include "headers/console.h"
-+#include "headers/message.h"
-+#include "headers/optparser.h"
-+
-+enum evdev_type {
-+ EVDEV_UNKNOWN,
-+ EVDEV_RELATIVE,
-+ EVDEV_ABSOLUTE,
-+ EVDEV_TOUCHPAD,
-+ EVDEV_SYNAPTICS
-+};
-+
-+enum touch_type {
-+ TOUCH_NONE,
-+ TOUCH_FINGERS,
-+ TOUCH_PALM
-+};
-+
-+enum gesture_type {
-+ GESTURE_NONE,
-+ GESTURE_TAP_PENDING,
-+ GESTURE_TAP,
-+ GESTURE_DRAG_PENDING,
-+ GESTURE_DRAG,
-+ GESTURE_DOUBLE_TAP
-+};
-+
-+enum edge_type {
-+ BOTTOM_EDGE = 1,
-+ TOP_EDGE = 2,
-+ LEFT_EDGE = 4,
-+ RIGHT_EDGE = 8,
-+ LEFT_BOTTOM_EDGE = BOTTOM_EDGE | LEFT_EDGE,
-+ RIGHT_BOTTOM_EDGE = BOTTOM_EDGE | RIGHT_EDGE,
-+ RIGHT_TOP_EDGE = TOP_EDGE | RIGHT_EDGE,
-+ LEFT_TOP_EDGE = TOP_EDGE | LEFT_EDGE
-+};
-+
-+struct event_data {
-+ int dx, dy;
-+ int wdx, wdy;
-+ int abs_x, abs_y;
-+ int buttons;
-+ int touch; /* dumb touchpad report touch events, smart ones - pressure */
-+ int pressure;
-+ int w;
-+ int finger_count;
-+ int synced;
-+};
-+
-+struct touch_data {
-+ int touching;
-+ int x, y;
-+ int finger_count;
-+ int buttons;
-+ int clicks;
-+ struct timeval start;
-+ enum gesture_type gesture;
-+};
-+
-+struct event_device {
-+ enum evdev_type type;
-+ int dont_sync;
-+
-+ struct event_data pkt;
-+ int pkt_count;
-+
-+ int prev_x[4], prev_y[4];
-+ int prev_pressure, avg_w;
-+ struct touch_data touch;
-+
-+ int left_edge, right_edge;
-+ int top_edge, bottom_edge;
-+ int touch_high, touch_low;
-+ int tap_time, tap_move;
-+ int y_inverted;
-+
-+ enum touch_type (*detect_touch)(struct event_device *evdev);
-+ void (*update_finger_count)(struct event_device *evdev);
-+};
-+
-+struct evdev_capabilities {
-+ unsigned char evbits[EV_MAX/8 + 1];
-+ unsigned char keybits[KEY_MAX/8 + 1];
-+ unsigned char absbits[ABS_MAX/8 + 1];
-+ unsigned char mscbits[MSC_MAX/8 + 1];
-+};
-+
-+#ifndef max
-+#define max(a,b) ((a)>(b) ? (a) : (b))
-+#endif
-+
-+#define fx(i) (evdev->prev_x[(evdev->pkt_count - (i)) & 03])
-+#define fy(i) (evdev->prev_y[(evdev->pkt_count - (i)) & 03])
-+
-+#define toggle_btn(btn, val) do { if (val) data->buttons |= (btn);\
-+ else data->buttons &= ~(btn);\
-+ } while (0)
-+#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
-+#define DIF_TIME(t1,t2) ((t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec) / 1000)
-+
-+#define test_bit(bit, array) (array[bit / 8] & (1 << (bit % 8)))
-+
-+/* ------------- evdev protocol handling routines ---------------------*/
-+
-+static void parse_input_event(struct input_event *event, struct event_data *data)
-+{
-+ switch (event->type) {
-+ case EV_REL:
-+ switch (event->code) {
-+ case REL_X:
-+ data->dx = (signed char)event->value;
-+ break;
-+ case REL_Y:
-+ data->dy = (signed char)event->value;
-+ break;
-+ case REL_WHEEL:
-+ data->wdy += event->value;
-+ break;
-+ case REL_HWHEEL:
-+ data->wdx += event->value;
-+ break;
-+ }
-+ break;
-+
-+ case EV_ABS:
-+ switch (event->code) {
-+ case ABS_X:
-+ data->abs_x = event->value;
-+ break;
-+
-+ case ABS_Y:
-+ data->abs_y = event->value;
-+ break;
-+
-+ case ABS_PRESSURE:
-+ data->pressure = event->value;
-+ break;
-+
-+ case ABS_TOOL_WIDTH:
-+ data->w = event->value;
-+ break;
-+ }
-+ break;
-+
-+ case EV_MSC:
-+ switch (event->code) {
-+ case MSC_GESTURE:
-+ data->w = event->value;
-+ break;
-+ }
-+ break;
-+
-+
-+ case EV_KEY:
-+ switch(event->code) {
-+ case BTN_0:
-+ case BTN_LEFT:
-+ toggle_btn(GPM_B_LEFT, event->value);
-+ break;
-+
-+ case BTN_2:
-+ case BTN_STYLUS2:
-+ case BTN_SIDE:
-+ case BTN_MIDDLE:
-+ toggle_btn(GPM_B_MIDDLE, event->value);
-+ break;
-+
-+ case BTN_STYLUS:
-+ case BTN_1:
-+ case BTN_RIGHT:
-+ toggle_btn(GPM_B_RIGHT, event->value);
-+ break;
-+
-+ case BTN_TOUCH:
-+ data->touch = event->value ? 1 : 0;
-+ break;
-+
-+ case BTN_TOOL_FINGER:
-+ if (event->value) data->finger_count = 1;
-+ break;
-+
-+ case BTN_TOOL_DOUBLETAP:
-+ if (event->value) data->finger_count = 2;
-+ break;
-+
-+ case BTN_TOOL_TRIPLETAP:
-+ if (event->value) data->finger_count = 3;
-+ break;
-+
-+ }
-+ break;
-+
-+ case EV_SYNC:
-+ switch(event->code) {
-+ case SYN_REPORT:
-+ data->synced = 1;
-+ break;
-+ }
-+ break;
-+ }
-+}
-+
-+static void tp_figure_deltas(struct event_device *evdev, struct Gpm_Event *state)
-+{
-+ struct event_data *pkt = &evdev->pkt;
-+
-+ state->dx = state->dy = 0;
-+ if (evdev->touch.touching) {
-+ fx(0) = pkt->abs_x;
-+ fy(0) = pkt->abs_y;
-+ if (evdev->pkt_count >= 2 &&
-+ evdev->touch.gesture != GESTURE_DRAG_PENDING) {
-+ state->dx = ((fx(0) - fx(1)) / 2 + (fx(1) - fx(2)) / 2) / 8; //SYN_REL_DECEL_FACTOR;
-+ state->dy = ((fy(0) - fy(1)) / 2 + (fy(1) - fy(2)) / 2) / 8; //SYN_REL_DECEL_FACTOR;
-+ }
-+ evdev->pkt_count++;
-+ } else {
-+ evdev->pkt_count = 0;
-+ }
-+}
-+
-+static enum touch_type dumb_tp_detect_touch(struct event_device *evdev)
-+{
-+ return evdev->pkt.touch ? TOUCH_FINGERS : TOUCH_NONE;
-+}
-+
-+static enum touch_type smart_tp_detect_touch(struct event_device *evdev)
-+{
-+ if (evdev->touch.touching)
-+ return evdev->pkt.pressure > evdev->touch_low ? TOUCH_FINGERS : TOUCH_NONE;
-+ else
-+ return evdev->pkt.pressure > evdev->touch_high ? TOUCH_FINGERS : TOUCH_NONE;
-+}
-+
-+static enum touch_type syn_detect_touch(struct event_device *evdev)
-+{
-+ struct event_data *pkt = &evdev->pkt;
-+ enum touch_type type = TOUCH_NONE;
-+
-+ if (pkt->pressure > 200 || pkt->w > 10)
-+ return TOUCH_PALM;
-+
-+ if (pkt->abs_x == 0)
-+ evdev->avg_w = 0;
-+ else
-+ evdev->avg_w = (pkt->w - evdev->avg_w + 1) / 2;
-+
-+ if (evdev->touch.touching) {
-+ type = pkt->pressure > evdev->touch_low ? TOUCH_FINGERS : TOUCH_NONE;
-+ } else if (pkt->pressure > evdev->touch_high) {
-+ int safe_w = max(pkt->w, evdev->avg_w);
-+
-+ if (pkt->finger_count > 1)
-+ type = TOUCH_FINGERS;
-+ else if (pkt->w < 2)
-+ type = TOUCH_FINGERS; /* more than one finger -> not a palm */
-+ else if (safe_w < 6 && evdev->prev_pressure < evdev->touch_high)
-+ type = TOUCH_FINGERS; /* thin finger, distinct touch -> not a palm */
-+ else if (safe_w < 7 && evdev->prev_pressure < evdev->touch_high / 2)
-+ type = TOUCH_FINGERS; /* thin finger, distinct touch -> not a palm */
-+ else if (pkt->pressure > evdev->prev_pressure + 1)
-+ type = TOUCH_NONE; /* pressure not stable, may be a palm */
-+ else if (pkt->pressure < evdev->prev_pressure - 5)
-+ type = TOUCH_NONE; /* pressure not stable, may be a palm */
-+ else
-+ type = TOUCH_FINGERS;
-+ }
-+
-+ evdev->prev_pressure = pkt->pressure;
-+ return type;
-+}
-+
-+static enum edge_type tp_detect_edges(struct event_device *evdev, int x, int y)
-+{
-+ enum edge_type edge = 0;
-+
-+ if (x > evdev->right_edge)
-+ edge |= RIGHT_EDGE;
-+ else if (x < evdev->left_edge)
-+ edge |= LEFT_EDGE;
-+
-+ if (y < evdev->top_edge)
-+ edge |= TOP_EDGE;
-+ else if (y > evdev->bottom_edge)
-+ edge |= BOTTOM_EDGE;
-+
-+ return edge;
-+}
-+
-+static int tp_touch_expired(struct event_device *evdev)
-+{
-+ struct timeval now;
-+
-+ GET_TIME(now);
-+ return DIF_TIME(evdev->touch.start, now) > evdev->tap_time;
-+}
-+
-+static int tp_detect_tap(struct event_device *evdev)
-+{
-+ return !tp_touch_expired(evdev) &&
-+ (evdev->touch.finger_count > 1 ||
-+ (abs(evdev->pkt.abs_x - evdev->touch.x) < evdev->tap_move &&
-+ abs(evdev->pkt.abs_y - evdev->touch.y) < evdev->tap_move));
-+}
-+
-+static int tp_tap_to_buttons(struct event_device *evdev)
-+{
-+ enum edge_type edge;
-+ if (evdev->touch.finger_count < 2) {
-+ edge = tp_detect_edges(evdev, evdev->pkt.abs_x, evdev->pkt.abs_y);
-+ switch (edge) {
-+ case RIGHT_TOP_EDGE:
-+ return GPM_B_MIDDLE;
-+ break;
-+ case RIGHT_BOTTOM_EDGE:
-+ return GPM_B_RIGHT;
-+ break;
-+ default:
-+ return GPM_B_LEFT;
-+ break;
-+ }
-+ } else {
-+ switch (evdev->touch.finger_count) {
-+ case 2:
-+ return GPM_B_MIDDLE;
-+ case 3:
-+ return GPM_B_RIGHT;
-+ default:
-+ return GPM_B_LEFT;
-+ }
-+ }
-+}
-+
-+static void tp_detect_gesture(struct event_device *evdev, int timed_out, enum touch_type touch_type)
-+{
-+ struct touch_data *touch = &evdev->touch;
-+ int was_touching = touch->touching;
-+
-+ touch->touching = touch_type == TOUCH_FINGERS;
-+
-+ if (touch->touching) {
-+ if (!was_touching) {
-+ GET_TIME(touch->start);
-+ touch->finger_count = 0;
-+ if (touch->gesture == GESTURE_TAP_PENDING) {
-+ touch->gesture = GESTURE_DRAG_PENDING;
-+ } else {
-+ touch->x = evdev->pkt.abs_x;
-+ touch->y = evdev->pkt.abs_y;
-+ touch->buttons = 0;
-+ }
-+ } else if (touch->gesture == GESTURE_DRAG_PENDING && tp_touch_expired(evdev)) {
-+ touch->gesture = GESTURE_DRAG;
-+ }
-+ } else {
-+ if (was_touching) {
-+ if (tp_detect_tap(evdev)) {
-+ if (touch->gesture == GESTURE_DRAG_PENDING) {
-+ touch->gesture = GESTURE_DOUBLE_TAP;
-+ touch->clicks = 4;
-+ } else {
-+ if ((touch->buttons = tp_tap_to_buttons(evdev)) == GPM_B_LEFT) {
-+ touch->gesture = GESTURE_TAP_PENDING;
-+ } else {
-+ touch->gesture = GESTURE_TAP;
-+ touch->clicks = 2;
-+ }
-+ }
-+ } else {
-+ touch->gesture = GESTURE_NONE;
-+ }
-+ } else {
-+ if (touch->gesture == GESTURE_TAP_PENDING && tp_touch_expired(evdev)) {
-+ touch->gesture = GESTURE_TAP;
-+ touch->clicks = 2;
-+ }
-+ }
-+ }
-+}
-+
-+static int tp_process_gesture(struct event_device *evdev, struct Gpm_Event *state)
-+{
-+ int next_timeout = -1;
-+
-+ switch(evdev->touch.gesture) {
-+ case GESTURE_DOUBLE_TAP:
-+ case GESTURE_TAP:
-+ if (--evdev->touch.clicks == 0)
-+ evdev->touch.gesture = GESTURE_NONE;
-+ else
-+ next_timeout = 0;
-+
-+ if (evdev->touch.clicks % 2)
-+ state->buttons |= evdev->touch.buttons;
-+ else
-+ state->buttons &= ~evdev->touch.buttons;
-+ break;
-+
-+ case GESTURE_DRAG:
-+ state->buttons |= evdev->touch.buttons;
-+ break;
-+
-+ case GESTURE_DRAG_PENDING:
-+ case GESTURE_TAP_PENDING:
-+ next_timeout = evdev->tap_time;
-+ break;
-+
-+ default:
-+ break;
-+ }
-+ return next_timeout;
-+}
-+
-+static void tp_update_finger_count(struct event_device *evdev)
-+{
-+ evdev->touch.finger_count = max(evdev->pkt.finger_count, evdev->touch.finger_count);
-+}
-+
-+static void syn_update_finger_count(struct event_device *evdev)
-+{
-+ if (evdev->pkt.w == 1)
-+ evdev->touch.finger_count = 3;
-+ else if (evdev->pkt.w == 0 && evdev->touch.finger_count != 3)
-+ evdev->touch.finger_count = 2;
-+ else
-+ evdev->touch.finger_count = 1;
-+}
-+
-+static int compose_gpm_event(struct event_device *evdev, int timed_out, Gpm_Event *state)
-+{
-+ struct event_data *pkt = &evdev->pkt;
-+ enum touch_type touch_type;
-+ int next_timeout = -1;
-+
-+ if (!timed_out) {
-+ state->buttons = pkt->buttons;
-+ state->wdx = pkt->wdx; state->wdy = pkt->wdy;
-+ }
-+
-+ switch (evdev->type) {
-+ case EVDEV_RELATIVE:
-+ if (!timed_out) {
-+ state->dx = pkt->dx; state->dy = pkt->dy;
-+ if (evdev->pkt.touch)
-+ state->buttons |= GPM_B_LEFT;
-+ else
-+ state->buttons &= ~GPM_B_LEFT;
-+ }
-+ break;
-+
-+ case EVDEV_ABSOLUTE:
-+ if (!timed_out) {
-+ if (pkt->abs_x < evdev->left_edge)
-+ pkt->abs_x = evdev->left_edge;
-+ else if (pkt->abs_x > evdev->right_edge)
-+ pkt->abs_x = evdev->right_edge;
-+
-+ if (pkt->abs_y > evdev->bottom_edge)
-+ pkt->abs_y = evdev->bottom_edge;
-+ else if (pkt->abs_y < evdev->top_edge)
-+ pkt->abs_y = evdev->top_edge;
-+
-+ state->x = (pkt->abs_x - evdev->left_edge) *
-+ console.max_x / (evdev->right_edge - evdev->left_edge);
-+ state->y = (pkt->abs_y - evdev->top_edge) *
-+ console.max_y / (evdev->bottom_edge - evdev->top_edge);
-+
-+ if (evdev->y_inverted) state->y = console.max_y - state->y;
-+
-+ if (evdev->pkt.touch)
-+ state->buttons |= GPM_B_LEFT;
-+ else
-+ state->buttons &= ~GPM_B_LEFT;
-+ }
-+ break;
-+
-+ case EVDEV_TOUCHPAD:
-+ case EVDEV_SYNAPTICS:
-+ touch_type = timed_out ? TOUCH_NONE : evdev->detect_touch(evdev);
-+
-+ if (touch_type != TOUCH_PALM) {
-+ tp_detect_gesture(evdev, timed_out, touch_type);
-+
-+ if (evdev->touch.touching && !tp_touch_expired(evdev))
-+ evdev->update_finger_count(evdev);
-+
-+ if (evdev->touch.finger_count < 2)
-+ tp_figure_deltas(evdev, state);
-+
-+ next_timeout = tp_process_gesture(evdev, state);
-+ }
-+ break;
-+
-+ default:
-+ /* should not happen */
-+ gpm_report(GPM_PR_OOPS, "Bad evdev type %d", evdev->type);
-+ break;
-+ }
-+
-+ if (evdev->y_inverted) state->dy = -state->dy;
-+
-+ return next_timeout;
-+}
-+
-+int M_evdev(struct micedev *dev, struct miceopt *opts,
-+ unsigned char *data, struct Gpm_Event *state)
-+{
-+ struct event_device *evdev = dev->private;
-+ struct input_event *event = (struct input_event *)data;
-+ int timed_out = data == NULL;
-+
-+ if (!timed_out)
-+ parse_input_event(event, &evdev->pkt);
-+
-+ if (timed_out || evdev->pkt.synced || evdev->dont_sync) {
-+ dev->timeout = compose_gpm_event(evdev, timed_out, state);
-+ evdev->pkt.dx = evdev->pkt.dy = 0;
-+ evdev->pkt.wdx = evdev->pkt.wdy = 0;
-+ evdev->pkt.finger_count = 0;
-+ evdev->pkt.synced = 0;
-+ return 0;
-+ }
-+
-+ dev->timeout = -1;
-+ return -1;
-+}
-+
-+/* ------------- evdev initialization routines ---------------------*/
-+
-+static int evdev_get_id(int fd, struct input_id *id)
-+{
-+ if (ioctl(fd, EVIOCGID, id) < 0) {
-+ gpm_report(GPM_PR_ERR, "evdev: cannot query device identification");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static int evdev_get_capabilities(int fd, struct evdev_capabilities *caps)
-+{
-+ memset(caps, 0, sizeof(*caps));
-+
-+ if (ioctl(fd, EVIOCGBIT(0, EV_MAX), caps->evbits) < 0) {
-+ gpm_report(GPM_PR_ERR, "evdev: cannot query device capabilities");
-+ return -1;
-+ }
-+
-+ if (test_bit(EV_ABS, caps->evbits) &&
-+ ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(caps->absbits)), caps->absbits) < 0) {
-+ gpm_report(GPM_PR_ERR, "evdev: cannot query ABS device capabilities");
-+ return -1;
-+ }
-+
-+ if (test_bit(EV_KEY, caps->evbits) &&
-+ ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(caps->keybits)), caps->keybits) < 0) {
-+ gpm_report(GPM_PR_ERR, "evdev: cannot query KEY device capabilities");
-+ return -1;
-+ }
-+
-+ if (test_bit(EV_MSC, caps->evbits) &&
-+ ioctl(fd, EVIOCGBIT(EV_MSC, sizeof(caps->mscbits)), caps->mscbits) < 0) {
-+ /* don't complain as 2.4 kernels didnt have it
-+ gpm_report(GPM_PR_ERR, "evdev: cannot query MSC device capabilities");
-+ return -1;
-+ */
-+ }
-+ return 0;
-+}
-+
-+static int evdev_query_axis(int fd, int axis, int *axis_min, int *axis_max)
-+{
-+ struct input_absinfo axis_info;
-+
-+ if (ioctl(fd, EVIOCGABS(axis), &axis_info) == -1) {
-+ gpm_report(GPM_PR_ERR, "evdev: could not query axis data");
-+ return -1;
-+ }
-+
-+ *axis_min = axis_info.minimum;
-+ *axis_max = axis_info.maximum;
-+ return 0;
-+}
-+
-+static int evdev_get_limits(int fd, struct event_device *evdev,
-+ struct evdev_capabilities *caps)
-+{
-+ if (test_bit(ABS_X, caps->absbits) &&
-+ evdev_query_axis(fd, ABS_X, &evdev->left_edge, &evdev->right_edge) < 0)
-+ return -1;
-+
-+ if (test_bit(ABS_Y, caps->absbits) &&
-+ evdev_query_axis(fd, ABS_Y, &evdev->top_edge, &evdev->bottom_edge) < 0)
-+ return -1;
-+
-+ return 0;
-+}
-+
-+static int is_synaptics(struct input_id *id)
-+{
-+ return id->bustype == BUS_I8042 && id->vendor == 0x0002 && id->product == PSMOUSE_SYNAPTICS;
-+}
-+
-+static enum evdev_type evdev_guess_type(struct input_id *id, struct evdev_capabilities *caps)
-+{
-+ if (test_bit(EV_ABS, caps->evbits)) {
-+ if (is_synaptics(id))
-+ return EVDEV_SYNAPTICS;
-+
-+ if (test_bit(BTN_TOUCH, caps->keybits) && caps->keybits[BTN_MOUSE / 8])
-+ return EVDEV_TOUCHPAD;
-+
-+ return EVDEV_ABSOLUTE;
-+ }
-+
-+ if (!test_bit(EV_REL, caps->evbits)) {
-+ gpm_report(GPM_PR_ERR,
-+ "evdev: device does not report neither absolute nor relative coordinates");
-+ return EVDEV_UNKNOWN;
-+ }
-+
-+ return EVDEV_RELATIVE;
-+}
-+
-+static enum evdev_type evdev_str_to_type(const char *type)
-+{
-+ if (!strcmp(type, "relative")) {
-+ return EVDEV_RELATIVE;
-+ } else if (!strcmp(type, "absolute")) {
-+ return EVDEV_ABSOLUTE;
-+ } else if (!strcmp(type, "touchpad")) {
-+ return EVDEV_TOUCHPAD;
-+ } else if (!strcmp(type, "synaptics")) {
-+ return EVDEV_SYNAPTICS;
-+ } else {
-+ gpm_report(GPM_PR_ERR, "evdev: unknown type '%s'", type);
-+ return EVDEV_UNKNOWN;
-+ }
-+}
-+
-+static void warn_if_present(struct option_helper *optinfo, const char *name, const char *type)
-+{
-+ if (is_option_present(optinfo, name))
-+ gpm_report(GPM_PR_WARN,
-+ "evdev: option '%s' is not valud for type '%s', ignored",
-+ name, type);
-+}
-+
-+// -o type=(auto|synaptics|touchpad|relative|absolute),y_inverse,
-+// left=1234,right=1234,top=1234,bottom=1234,
-+// touch_high=30,touch_low=25,tap_time=30,tap_move=100
-+static int evdev_apply_options(struct event_device *evdev, char *optstring)
-+{
-+ char *type = "auto";
-+ struct option_helper optinfo[] = {
-+ { "type", OPT_STRING, u: { sptr: &type } },
-+ { "y_inverted", OPT_BOOL, u: { iptr: &evdev->y_inverted }, value: 1 },
-+ { "left", OPT_INT, u: { iptr: &evdev->left_edge } },
-+ { "right", OPT_INT, u: { iptr: &evdev->right_edge } },
-+ { "top", OPT_INT, u: { iptr: &evdev->top_edge } },
-+ { "bottom", OPT_INT, u: { iptr: &evdev->bottom_edge } },
-+ { "touch_high", OPT_INT, u: { iptr: &evdev->touch_high } },
-+ { "touch_low", OPT_INT, u: { iptr: &evdev->touch_low } },
-+ { "tap_time", OPT_INT, u: { iptr: &evdev->tap_time } },
-+ { "tap_move", OPT_INT, u: { iptr: &evdev->tap_move } },
-+ { "", OPT_END }
-+ };
-+
-+ if (parse_options("evdev", optstring, ',', optinfo) < 0)
-+ return -1;
-+
-+ if (strcmp(type, "auto"))
-+ evdev->type = evdev_str_to_type(type);
-+
-+ switch (evdev->type) {
-+ case EVDEV_RELATIVE:
-+ warn_if_present(optinfo, "left", type);
-+ warn_if_present(optinfo, "right", type);
-+ warn_if_present(optinfo, "top", type);
-+ warn_if_present(optinfo, "bottom", type);
-+ warn_if_present(optinfo, "tap_move", type);
-+ warn_if_present(optinfo, "tap_time", type);
-+ warn_if_present(optinfo, "touch_high", type);
-+ warn_if_present(optinfo, "touch_low", type);
-+ break;
-+
-+ case EVDEV_ABSOLUTE:
-+ warn_if_present(optinfo, "tap_move", type);
-+ warn_if_present(optinfo, "tap_time", type);
-+ warn_if_present(optinfo, "touch_high", type);
-+ warn_if_present(optinfo, "touch_low", type);
-+ break;
-+
-+ case EVDEV_TOUCHPAD:
-+ break;
-+
-+ case EVDEV_SYNAPTICS:
-+ warn_if_present(optinfo, "y_inverted", type);
-+ break;
-+
-+ default:
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+int I_evdev(struct micedev *dev, struct miceopt *opts, Gpm_Type *type)
-+{
-+ struct input_id id;
-+ struct evdev_capabilities caps;
-+ struct event_device *evdev;
-+
-+ if (!dev->private) { /* called first time, not re-init */
-+ if (!(dev->private = evdev = malloc(sizeof(*evdev))))
-+ gpm_report(GPM_PR_OOPS, "Can't allocate memory for event device");
-+
-+ memset(evdev, 0, sizeof(*evdev));
-+
-+ if (evdev_get_id(dev->fd, &id))
-+ goto init_fail;
-+
-+ if (evdev_get_capabilities(dev->fd, &caps))
-+ goto init_fail;
-+
-+ evdev->type = evdev_guess_type(&id, &caps);
-+
-+ /* load default values - suitable for my synaptics ;P */
-+ evdev->left_edge = 1900;
-+ evdev->right_edge = 5300;
-+ evdev->top_edge = 2000;
-+ evdev->bottom_edge = 3900;
-+ evdev->tap_time = 180;
-+ evdev->tap_move = 220;
-+ evdev->touch_high = 30;
-+ evdev->touch_low = 25;
-+
-+ if (evdev->type == EVDEV_ABSOLUTE && evdev_get_limits(dev->fd, evdev, &caps) < 0)
-+ goto init_fail;
-+
-+ if (evdev_apply_options(evdev, opts->text) < 0)
-+ goto init_fail;
-+
-+ if (!test_bit(EV_SYNC, caps.evbits)) {
-+ evdev->dont_sync = 1;
-+ if (evdev->type == EVDEV_TOUCHPAD || evdev->type == EVDEV_SYNAPTICS) {
-+ gpm_report(GPM_PR_ERR,
-+ "evdev: The running kernel lacks EV_SYNC support which is required for touchpad/synaptics mode");
-+ goto init_fail;
-+ }
-+ }
-+
-+ switch (evdev->type) {
-+ case EVDEV_RELATIVE:
-+ gpm_report(GPM_PR_INFO, "evdev: selected Relative mode");
-+ if (!test_bit(EV_REL, caps.evbits))
-+ gpm_report(GPM_PR_WARN, "evdev: selected relative mode but device does not report any relative events");
-+ break;
-+
-+ case EVDEV_ABSOLUTE:
-+ gpm_report(GPM_PR_INFO, "evdev: selected Absolute mode");
-+ if (evdev->right_edge <= evdev->left_edge) {
-+ gpm_report(GPM_PR_ERR, "evdev: right edge value should be gerater than left");
-+ goto init_fail;
-+ }
-+ if (evdev->bottom_edge <= evdev->top_edge) {
-+ gpm_report(GPM_PR_ERR, "evdev: bottom edge value should be gerater than top");
-+ goto init_fail;
-+ }
-+ if (!test_bit(EV_ABS, caps.evbits))
-+ gpm_report(GPM_PR_WARN, "evdev: selected absolute mode but device does not report any absolute events");
-+ opts->absolute = 1;
-+ break;
-+
-+ case EVDEV_TOUCHPAD:
-+ gpm_report(GPM_PR_INFO, "evdev: selected Touchpad mode");
-+ if (!test_bit(EV_ABS, caps.evbits))
-+ gpm_report(GPM_PR_WARN, "evdev: selected touchpad mode but device does not report any absolute events");
-+ if (test_bit(ABS_PRESSURE, caps.absbits))
-+ evdev->detect_touch = smart_tp_detect_touch;
-+ else if (test_bit(BTN_TOUCH, caps.keybits))
-+ evdev->detect_touch = dumb_tp_detect_touch;
-+ else
-+ gpm_report(GPM_PR_WARN, "evdev: selected touchpad mode but device does not report pressure not touch events");
-+ evdev->update_finger_count = tp_update_finger_count;
-+ break;
-+
-+ case EVDEV_SYNAPTICS:
-+ gpm_report(GPM_PR_INFO, "evdev: selected Synaptics mode");
-+ if (!is_synaptics(&id))
-+ gpm_report(GPM_PR_WARN, "evdev: idevice isn't identified as Synaptics");
-+ if (!test_bit(EV_ABS, caps.evbits))
-+ gpm_report(GPM_PR_WARN, "evdev: selected synaptics mode but device does not report any absolute events");
-+ if (!test_bit(ABS_PRESSURE, caps.absbits))
-+ gpm_report(GPM_PR_WARN, "evdev: selected synaptics mode but device does not report pressure");
-+ if (test_bit(EV_MSC, caps.evbits) && test_bit(MSC_GESTURE, caps.mscbits)) {
-+ /* this is compatibility mode with pre 2.6-test6 kernels */
-+ evdev->update_finger_count = syn_update_finger_count;
-+ evdev->y_inverted = 1;
-+ } else {
-+ evdev->update_finger_count = tp_update_finger_count;
-+ }
-+ evdev->detect_touch = syn_detect_touch;
-+ break;
-+
-+ default:
-+ break;
-+ }
-+ }
-+
-+ return 0;
-+
-+init_fail:
-+ free(dev->private);
-+ return -1;
-+}
-+
-diff -urN gpm-1.20.1/src/gpm.c gpm/src/gpm.c
---- gpm-1.20.1/src/gpm.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/gpm.c 2003-10-02 01:22:42.000000000 -0500
-@@ -24,1108 +24,607 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h> /* strerror(); ?!? */
-+#include <limits.h>
- #include <errno.h>
- #include <unistd.h> /* select(); */
- #include <signal.h> /* SIGPIPE */
- #include <time.h> /* time() */
--#include <sys/param.h>
- #include <sys/fcntl.h> /* O_RDONLY */
- #include <sys/wait.h> /* wait() */
--#include <sys/stat.h> /* mkdir() */
- #include <sys/time.h> /* timeval */
--#include <sys/types.h> /* socket() */
--#include <sys/socket.h> /* socket() */
--#include <sys/un.h> /* struct sockaddr_un */
--
--#include <linux/vt.h> /* VT_GETSTATE */
--#include <sys/kd.h> /* KDGETMODE */
--#include <termios.h> /* winsize */
-
- #include "headers/gpmInt.h"
- #include "headers/message.h"
--
--/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */
--#if !defined(__GLIBC__)
-- typedef unsigned int __socklen_t;
--#endif /* __GLIBC__ */
-+#include "headers/console.h"
-+#include "headers/selection.h"
-+#include "headers/client.h"
-
- #ifndef max
- #define max(a,b) ((a)>(b) ? (a) : (b))
- #endif
-
--extern int errno;
--
--static void gpm_killed(int);
--
--/*
-- * all the values duplicated for dual-mouse operation are
-- * now in this structure (see gpmInt.h)
-- * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2]
-- * are copied data from mouse_table[0] for dual mouse operation.
-- */
--
--struct mouse_features mouse_table[3] = {
-- {
-- DEF_TYPE, DEF_DEV, DEF_SEQUENCE,
-- DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */,
-- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP,
-- (char *)NULL /* extra */,
-- (Gpm_Type *)NULL,
-- -1
-- }
--};
--struct mouse_features *which_mouse;
--
--/* These are only the 'global' options */
--
--char *opt_lut=DEF_LUT;
--int opt_test=DEF_TEST;
--int opt_ptrdrag=DEF_PTRDRAG;
--int opt_double=0;
--int opt_aged = 0;
--char *opt_special=NULL; /* special commands, like reboot or such */
--int opt_rawrep=0;
--Gpm_Type *repeated_type=0;
--
--static int opt_resize=0; /* not really an option */
--struct winsize win;
--int maxx, maxy;
--int fifofd=-1;
--
--int eventFlag=0;
--Gpm_Cinfo *cinfo[MAX_VC+1];
--fd_set selSet, readySet, connSet;
--
--time_t last_selection_time;
--time_t opt_age_limit = 0;
--
--/* BRAINDEAD..ok not really, but got to leave anyway... FIXME */
--/* argc and argv for mice initialization */
--static int mouse_argc[3]; /* 0 for default (unused) and two mice */
--static char **mouse_argv[3]; /* 0 for default (unused) and two mice */
--
--/*===================================================================*/
--/*
-- * first, all the stuff that used to be in gpn.c (i.e., not main-loop)
-- */
--/*-------------------------------------------------------------------*/
-+#ifndef min
-+#define min(a,b) ((a)<(b) ? (a) : (b))
-+#endif
-
--/* build_argv is used for mouse initialization routines */
--static char **build_argv(char *argv0, char *str, int *argcptr, char sep)
--{
-- int argc = 1;
-- char **argv;
-- char *s;
--
-- /* argv0 is never NULL, but the extra string may well be */
-- if (str)
-- for (s=str; sep && (s = strchr(s, sep)); argc++) s++;
--
-- argv = calloc(argc+2, sizeof(char **));
-- if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED);
-- argv[0] = argv0;
--
-- if (!str) {
-- *argcptr = argc; /* 1 */
-- return argv;
-- }
-- /* else, add arguments */
-- s = argv[1] = strdup(str);
-- argc = 2; /* first to fill */
--
-- /* ok, now split: the first one is in place, and s is the whole string */
-- for ( ; sep && (s = strchr(s, sep)) ; argc++) {
-- *s = '\0';
-- s++;
-- argv[argc] = s;
-- }
-- *argcptr = argc;
-- return argv;
--}
-+#define NULL_SET ((fd_set *)NULL)
-+#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
-+#define DIF_TIME(t1,t2) ((t2.tv_sec - t1.tv_sec)*1000 + (t2.tv_usec - t1.tv_usec)/1000)
-
--/*-------------------------------------------------------------------*/
--/* The old console option is removed. We are taking stderr now
-- * In the next update there should also be support for syslog
-- ********************************************************************/
-
--static inline int open_console(const int mode)
--{
-- int fd;
-+enum mouse_rslt { MOUSE_NO_DATA, MOUSE_DATA_OK, MOUSE_MORE_DATA };
-
-- if ((fd=open(option.consolename, mode)) < 0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON);
-- return fd;
--}
-+extern int errno;
-
--/*-------------------------------------------------------------------*/
--static inline int wait_text(int *fdptr)
--{
-- int fd;
-- int kd_mode;
-+char *opt_special=NULL; /* special commands, like reboot or such */
-+struct repeater repeater;
-
-- close(*fdptr);
-- do
-- {
-- sleep(2);
-- fd = open_console(O_RDONLY);
-- if (ioctl(fd, KDGETMODE, &kd_mode)<0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE);
-- close(fd);
-- }
-- while (kd_mode != KD_TEXT) ;
--
-- /* reopen, reinit (the function is only used if we have one mouse device) */
-- if ((*fdptr=open(opt_dev,O_RDWR))<0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,opt_dev);
-- if (m_type->init)
-- m_type=(m_type->init)(*fdptr, m_type->flags, m_type, mouse_argc[1],
-- mouse_argv[1]);
-- return (1);
--}
-+static int console_resized; /* not really an option */
-
- /*-------------------------------------------------------------------*/
--static inline void selection_copy(int x1, int y1, int x2, int y2, int mode)
-+static void gpm_killed(int signo)
- {
--/*
-- * The approach in "selection" causes a bus error when run under SunOS 4.1
-- * due to alignment problems...
-- */
-- unsigned char buf[6*sizeof(short)];
-- unsigned short *arg = (unsigned short *)buf + 1;
-- int fd;
--
-- buf[sizeof(short)-1] = 2; /* set selection */
--
-- arg[0]=(unsigned short)x1;
-- arg[1]=(unsigned short)y1;
-- arg[2]=(unsigned short)x2;
-- arg[3]=(unsigned short)y2;
-- arg[4]=(unsigned short)mode;
--
-- if ((fd=open_console(O_WRONLY))<0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON);
-- /* FIXME: should be replaced with string constant (headers/message.h) */
-- gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]);
-- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX);
-- close(fd);
--
-- if (mode < 3) {
-- opt_aged = 0;
-- last_selection_time = time(0);
-+ if (signo == SIGWINCH) {
-+ gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid());
-+ console_resized = 1;
-+ } else {
-+ if (signo == SIGUSR1)
-+ gpm_report(GPM_PR_WARN, GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname);
-+ exit(0);
- }
- }
-
--
--/*-------------------------------------------------------------------*/
--/* comment missing; FIXME */
--/*-------------------------------------------------------------------*/
--static inline void selection_paste(void)
--{
-- char c=3;
-- int fd;
--
-- if (!opt_aged && (0 != opt_age_limit) &&
-- (last_selection_time + opt_age_limit < time(0))) {
-- opt_aged = 1;
-- }
--
-- if (opt_aged) {
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE);
-- return;
-- }
--
-- fd=open_console(O_WRONLY);
-- if(ioctl(fd, TIOCLINUX, &c) < 0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX);
-- close(fd);
--}
--
--/*-------------------------------------------------------------------*/
--static inline int do_selection(Gpm_Event *event) /* returns 0, always */
--{
-- static int x1=1, y1=1, x2, y2;
--#define UNPOINTER() 0
--
-- x2=event->x; y2=event->y;
-- switch(GPM_BARE_EVENTS(event->type)) {
-- case GPM_MOVE:
-- if (x2<1) x2++; else if (x2>maxx) x2--;
-- if (y2<1) y2++; else if (y2>maxy) y2--;
-- selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */
-- return 0;
--
-- case GPM_DRAG:
-- if (event->buttons==GPM_B_LEFT) {
-- if (event->margin) /* fix margins */
-- switch(event->margin) {
-- case GPM_TOP: x2=1; y2++; break;
-- case GPM_BOT: x2=maxx; y2--; break;
-- case GPM_RGT: x2--; break;
-- case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break;
-- }
-- selection_copy(x1,y1,x2,y2,event->clicks);
-- if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */
-- selection_copy(x2,y2,x2,y2,3);
-- } /* if */
-- return 0;
--
-- case GPM_DOWN:
-- switch (event->buttons) {
-- case GPM_B_LEFT:
-- x1=x2; y1=y2;
-- selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */
-- return 0;
--
-- case GPM_B_MIDDLE:
-- selection_paste();
-- return 0;
--
-- case GPM_B_RIGHT:
-- if (opt_three==1)
-- selection_copy(x1,y1,x2,y2,event->clicks);
-- else
-- selection_paste();
-- return 0;
-- }
-- } /* switch above */
-- return 0;
--}
--
--/*-------------------------------------------------------------------*/
--/* returns 0 if the event has not been processed, and 1 if it has */
--static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event)
--{
-- Gpm_Connect info=cinfo->data;
-- int fd=cinfo->fd;
-- /* value to return if event is not used */
-- int res = !(info.defaultMask & event->type);
--
-- /* instead of returning 0, scan the stack of clients */
-- if ((info.minMod & event->modifiers) < info.minMod)
-- goto scan;
-- if ((info.maxMod & event->modifiers) < event->modifiers)
-- goto scan;
--
-- /* if not managed, use default mask */
-- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) {
-- if (res) return res;
-- else goto scan;
-- }
--
-- /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */
-- MAGIC_P((write(fd,&magic, sizeof(int))));
-- write(fd,event, sizeof(Gpm_Event));
--
-- return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */
--
-- scan:
-- if (cinfo->next != 0)
-- return do_client (cinfo->next, event); /* try the next */
-- return 0; /* no next, not used */
--}
--
- /*-------------------------------------------------------------------
- * fetch the actual device data from the mouse device, dependent on
- * what Gpm_Type is being passed.
- *-------------------------------------------------------------------*/
--static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode)
-+static char *getMouseData(int fd, Gpm_Type *type, int text_mode)
- {
- static unsigned char data[32]; /* quite a big margin :) */
-- char *edata=data+type->packetlen;
-- int howmany=type->howmany;
-- int i,j;
-+ unsigned char *pdata;
-+ int len, togo;
-
--/*....................................... read and identify one byte */
--
-- if (read(fd, data, howmany)!=howmany) {
-- if (opt_test) exit(0);
-+ /*....................................... read and identify one byte */
-+ if (read(fd, data, type->howmany) != type->howmany) {
- gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno));
- return NULL;
- }
-
-- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep)
-- write(fifofd, data, howmany);
-+ if (!text_mode && repeater.fd != -1 && repeater.raw)
-+ write(repeater.fd, data, type->howmany);
-
-- if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) {
-- if (m_type->getextra == 1) {
-- data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2;
-- gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]);
-+ if ((data[0] & type->proto[0]) != type->proto[1]) {
-+ if (type->getextra == 1) {
-+ data[1] = GPM_EXTRA_MAGIC_1; data[2] = GPM_EXTRA_MAGIC_2;
-+ gpm_report(GPM_PR_DEBUG, GPM_EXTRA_DATA, data[0]);
- return data;
- }
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR);
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_PROT_ERR);
- return NULL;
- }
-
--/*....................................... read the rest */
-+ /*....................................... read the rest */
-
- /*
- * well, this seems to work almost right with ps2 mice. However, I've never
- * tried ps2 with the original selection package, which called usleep()
- */
--
-- if((i=m_type->packetlen-howmany)) /* still to get */
-+ if ((togo = type->packetlen - type->howmany)) { /* still to get */
-+ pdata = &data[type->howmany];
- do {
-- j = read(fd,edata-i,i); /* edata is pointer just after data */
-- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0)
-- write(fifofd, edata-i, j);
-- i -= j;
-- } while (i && j);
--
-- if (i) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno));
-+ if ((len = read(fd, pdata, togo)) == 0)
-+ break;
-+ if (!text_mode && repeater.fd != -1 && repeater.raw && len > 0)
-+ write(repeater.fd, pdata, len);
-+ pdata += len;
-+ togo -= len;
-+ } while (togo);
-+ }
-+
-+ if (togo) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_READ_REST, strerror(errno));
- return NULL;
- }
-
-- if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) {
-- gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA);
-+ if ((data[1] & type->proto[2]) != type->proto[3]) {
-+ gpm_report(GPM_PR_INFO, GPM_MESS_SKIP_DATA);
- return NULL;
- }
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]);
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], data[3]);
- return data;
- }
-
--
--static int statusX,statusY,statusB; /* to return info */
--static int statusC=0; /* clicks */
--void get_console_size(Gpm_Event *ePtr);
--
--/*-------------------------------------------------------------------
-- * call getMouseData to get hardware device data, call mouse device's fun()
-- * to retrieve the hardware independent event data, then optionally repeat
-- * the data via repeat_fun() to the repeater device
-- *-------------------------------------------------------------------*/
--static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type,
-- int kd_mode)
-+/*-------------------------------------------------------------------*/
-+void handle_console_resize(Gpm_Event *event)
- {
-- char *data;
-- static int fine_dx, fine_dy;
-- static int i, j, m;
-- static Gpm_Event nEvent;
-- static struct vt_stat stat;
-- static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */
-- static struct timeval timeout={0,0};
-- fd_set fdSet;
-- static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */
-- /* static int buttonlock, buttonlockflag; */
--
--#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
--#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \
-- (t2.tv_usec-t1.tv_usec)/1000)
--
--
-- oldT=event->type;
--
-- if (eventFlag) {
-- eventFlag=0;
--
-- if (m_type->absolute) { /* a pen or other absolute device */
-- event->x=nEvent.x;
-- event->y=nEvent.y;
-- }
-- event->dx=nEvent.dx;
-- event->dy=nEvent.dy;
-- event->buttons=nEvent.buttons;
-- } else {
-- event->dx=event->dy=0;
-- event->wdx=event->wdy=0;
-- nEvent.modifiers = 0; /* some mice set them */
-- FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0;
--
-- do { /* cluster loop */
-- if(((data=getMouseData(fd,m_type,kd_mode))==NULL)
-- || ((*(m_type->fun))(&nEvent,data)==-1) ) {
-- if (!i) return 0;
-- else break;
-- }
--
-- event->modifiers = nEvent.modifiers; /* propagate modifiers */
--
-- /* propagate buttons */
-- nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7) |
-- (nEvent.buttons & ~7); /* change the order */
-- oldB=newB; newB=nEvent.buttons;
-- if (!i) event->buttons=nEvent.buttons;
--
-- if (oldB!=newB) {
-- eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */
-- break;
-- }
--
-- /* propagate movement */
-- if (!(m_type->absolute)) { /* mouse */
-- if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta)
-- nEvent.dx*=opt_accel, nEvent.dy*=opt_accel;
--
-- /* increment the reported dx,dy */
-- event->dx+=nEvent.dx;
-- event->dy+=nEvent.dy;
-- } else { /* a pen */
-- /* get dx,dy to check if there has been movement */
-- event->dx = (nEvent.x) - (event->x);
-- event->dy = (nEvent.y) - (event->y);
-- }
--
-- /* propagate wheel */
-- event->wdx += nEvent.wdx;
-- event->wdy += nEvent.wdy;
--
-- select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */);
--
-- } while (i++ <opt_cluster && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet));
--
-- } /* if(eventFlag) */
--
--/*....................................... update the button number */
-+ int old_x, old_y;
-+ struct micetab *mouse;
-
-- if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++;
-+ old_x = console.max_x; old_y = console.max_y;
-+ refresh_console_size();
-+ if (!old_x) { /* first invocation, place the pointer in the middle */
-+ event->x = console.max_x / 2;
-+ event->y = console.max_y / 2;
-+ } else { /* keep the pointer in the same position where it was */
-+ event->x = event->x * console.max_x / old_x;
-+ event->y = event->y * console.max_y / old_y;
-+ }
-
--/*....................................... we're a repeater, aren't we? */
-+ for (mouse = micelist; mouse; mouse = mouse->next) {
-+ /*
-+ * the following operation is based on the observation that 80x50
-+ * has square cells. (An author-centric observation ;-)
-+ */
-+ mouse->options.scaley = mouse->options.scalex * 50 * console.max_x / 80 / console.max_y;
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_X_Y_VAL,
-+ mouse->options.scalex, mouse->options.scaley);
-+ }
-+}
-
-- if (kd_mode!=KD_TEXT) {
-- if (fifofd != -1 && ! opt_rawrep) {
-- if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */
-- /* prepare the values from a absolute device for repeater mode */
-- static struct timeval rept1,rept2;
-- gettimeofday(&rept2, (struct timezone *)NULL);
-- if (((rept2.tv_sec -rept1.tv_sec)
-- *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) {
-- event->dx=0;
-- event->dy=0;
-- }
-- rept1=rept2;
--
-- event->dy=event->dy*((win.ws_col/win.ws_row)+1);
-- event->x=nEvent.x;
-- event->y=nEvent.y;
-- }
-- repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */
-+static void handle_repeater(int absolute_dev, Gpm_Event *new_event, Gpm_Event *event)
-+{
-+ static struct timeval last;
-+ struct timeval now;
-+
-+ if (absolute_dev) {
-+ /* prepare the values from a absolute device for repeater mode */
-+ GET_TIME(now);
-+ if (((now.tv_sec - last.tv_sec) * 1000 +
-+ (now.tv_usec - last.tv_usec) / 1000) > 250) {
-+ event->dx = 0;
-+ event->dy = 0;
- }
-- return 0; /* no events nor information for clients */
-- } /* first if of these three */
--
--/*....................................... no, we arent a repeater, go on */
-+ last = now;
-
-- /* use fine delta values now, if delta is the information */
-- if (!(m_type)->absolute) {
-- fine_dx+=event->dx; fine_dy+=event->dy;
-- event->dx=fine_dx/opt_scale; event->dy=fine_dy/opt_scaley;
-- fine_dx %= opt_scale; fine_dy %= opt_scaley;
-+ event->dy = event->dy * ((console.max_x / console.max_y) + 1);
-+ event->x = new_event->x;
-+ event->y = new_event->y;
- }
-+ repeater.type->repeat_fun(event, repeater.fd);
-+}
-
-- /* up and down, up and down, ... who does a do..while(0) loop ???
-- and then makes a break into it... argh ! */
--
-- if (!event->dx && !event->dy && (event->buttons==oldB))
-- do { /* so to break */
-- static long awaketime;
-- /*
-- * Ret information also if never happens, but enough time has elapsed.
-- * Note: return 1 will segfault due to missing event->vc; FIXME!
-- */
-- if (time(NULL)<=awaketime) return 0;
-- awaketime=time(NULL)+1;
-- break;
-- } while (0);
--
--/*....................................... fill missing fields */
--
-- event->x+=event->dx, event->y+=event->dy;
-- statusB=event->buttons;
--
-- i=open_console(O_RDONLY);
-- /* modifiers */
-- j = event->modifiers; /* save them */
-- event->modifiers=6; /* code for the ioctl */
-- if (ioctl(i,TIOCLINUX,&(event->modifiers))<0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE);
-- event->modifiers |= j; /* add mouse-specific bits */
--
-- /* status */
-- j = stat.v_active;
-- if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT);
--
-- /*
-- * if we changed console, request the current console size,
-- * as different consoles can be of different size
-- */
-- if (stat.v_active != j)
-- get_console_size(event);
-- close(i);
--
-- event->vc = stat.v_active;
--
-- if (oldB==event->buttons)
-- event->type = (event->buttons ? GPM_DRAG : GPM_MOVE);
-- else
-- event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP);
--
-+static void calculate_clicks(Gpm_Event *event, int click_tmo)
-+{
-+ static struct timeval release;
-+ struct timeval now;
-+
- switch(event->type) { /* now provide the cooked bits */
- case GPM_DOWN:
-- GET_TIME(tv2);
-- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<opt_time)) /* check first click */
-- statusC++, statusC%=3; /* 0, 1 or 2 */
-+ GET_TIME(now);
-+ if (release.tv_sec && (DIF_TIME(release, now) < click_tmo)) /* check first click */
-+ event->clicks++, event->clicks %= 3; /* 0, 1 or 2 */
- else
-- statusC=0;
-- event->type|=(GPM_SINGLE<<statusC);
-+ event->clicks = 0;
-+ event->type |= GPM_SINGLE << event->clicks;
- break;
-
- case GPM_UP:
-- GET_TIME(tv1);
-- event->buttons^=oldB; /* for button-up, tell which one */
-- event->type|= (oldT&GPM_MFLAG);
-- event->type|=(GPM_SINGLE<<statusC);
-+ GET_TIME(release);
-+ event->type |= GPM_SINGLE << event->clicks;
- break;
-
- case GPM_DRAG:
-- event->type |= GPM_MFLAG;
-- event->type|=(GPM_SINGLE<<statusC);
-+ event->type |= GPM_SINGLE << event->clicks;
- break;
-
- case GPM_MOVE:
-- statusC=0;
-+ event->clicks = 0;
-+
- default:
- break;
- }
-- event->clicks=statusC;
-+}
-+
-+static void snap_to_screen_limits(Gpm_Event *event)
-+{
-+ int extent;
-
--/* UGLY - FIXME! */
--/* The current policy is to force the following behaviour:
-- * - At buttons up, must fit inside the screen, though flags are set.
-- * - At button down, allow going outside by one single step
-- */
-+ /* The current policy is to force the following behaviour:
-+ * - At buttons up, must fit inside the screen, though flags are set.
-+ * - At button down, allow going outside by one single step
-+ * DTOR: Midnight Commander seems to want the opposite...
-+ */
-
-+ extent = (event->type & (GPM_DRAG|GPM_UP)) ? 1 : 0;
-
- /* selection used 1-based coordinates, so do I */
--
- /*
- * 1.05: only one margin is current. Y takes priority over X.
-- * The i variable is how much margin is allowed. "m" is which one is there.
- */
-
-- m = 0;
-- i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */
--
-- if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;}
-- else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;}
--
-- if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;}
-- else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;}
-+ event->margin = 0;
-
-- event->margin=m;
-+ if (event->y > console.max_y) {
-+ event->y = console.max_y + extent;
-+ extent = 0;
-+ event->margin = GPM_BOT;
-+ } else if (event->y <= 0) {
-+ event->y = 1 - extent;
-+ extent = 0;
-+ event->margin = GPM_TOP;
-+ }
-
-- gpm_report(GPM_PR_DEBUG,"M: %3i %3i (%3i %3i) - butt=%i vc=%i cl=%i",
-- event->dx,event->dy,
-- event->x,event->y,
-- event->buttons, event->vc,
-- event->clicks);
-+ if (event->x > console.max_x) {
-+ event->x = console.max_x + extent;
-+ if (!event->margin) event->margin = GPM_RGT;
-+ } else if (event->x <= 0) {
-+ event->x = 1 - extent;
-+ if (!event->margin) event->margin = GPM_LFT;
-+ }
-+}
-
-- /* update the global state */
-- statusX=event->x; statusY=event->y;
-+static int more_data_waiting(int fd)
-+{
-+ static struct timeval timeout = {0, 0};
-+ fd_set fdSet;
-
-- if (opt_special && event->type & GPM_DOWN)
-- return processSpecial(event);
-+ FD_ZERO(&fdSet);
-+ FD_SET(fd, &fdSet);
-+ select(fd + 1, &fdSet, NULL_SET, NULL_SET, &timeout/* zero */);
-
-- return 1;
-+ return FD_ISSET(fd, &fdSet);
- }
-
--/*-------------------------------------------------------------------*
-- * This was inline, and incurred in a compiler bug (2.7.0)
-- *-------------------------------------------------------------------*/
--static int get_data(Gpm_Connect *where, int whence)
-+static int multiplex_buttons(struct micetab *mouse, int new_buttons)
- {
-- static int i;
-+ static int left_btn_clicks, mid_btn_clicks, right_btn_clicks;
-+ int mask;
-+ int muxed_buttons = 0;
-+
-+ new_buttons =
-+ (mouse->options.sequence[new_buttons & 7] & 7) | (new_buttons & ~7);
-+ mask = new_buttons ^ mouse->buttons;
-+ mouse->buttons = new_buttons;
-
--#ifdef GPM_USE_MAGIC
-- while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC)
-- gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC);
--
-- if (!i) return 0;
-- if (check!=GPM_MAGIC) {
-- gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE);
-- return -1;
-+ if (mask & GPM_B_LEFT) {
-+ if (new_buttons & GPM_B_LEFT) left_btn_clicks++;
-+ else left_btn_clicks--;
- }
--#endif
-+ if (left_btn_clicks) muxed_buttons |= GPM_B_LEFT;
-
-- if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) {
-- return i ? -1 : 0;
-+ if (mask & GPM_B_MIDDLE) {
-+ if (new_buttons & GPM_B_MIDDLE) mid_btn_clicks++;
-+ else mid_btn_clicks--;
- }
-+ if (mid_btn_clicks) muxed_buttons |= GPM_B_MIDDLE;
-
-- return 1;
--}
-+ if (mask & GPM_B_RIGHT) {
-+ if (new_buttons & GPM_B_RIGHT) right_btn_clicks++;
-+ else right_btn_clicks--;
-+ }
-+ if (right_btn_clicks) muxed_buttons |= GPM_B_RIGHT;
-
--static void disable_paste(int vc)
--{
-- opt_aged++;
-- gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc);
-+ return muxed_buttons;
- }
-
--/*-------------------------------------------------------------------*/
-- /* returns -1 if closing connection */
--static inline int processRequest(Gpm_Cinfo *ci, int vc)
-+/*-------------------------------------------------------------------
-+ * call getMouseData to get hardware device data, call mouse device's fun()
-+ * to retrieve the hardware independent event data, then optionally repeat
-+ * the data via repeat_fun() to the repeater device
-+ *-------------------------------------------------------------------*/
-+static enum mouse_rslt processMouse(struct micetab *mouse, int timeout, int attempt,
-+ Gpm_Event *event, int text_mode)
- {
-+ static int last_active;
-+ static int fine_dx, fine_dy;
-+ static int oldB;
-+
-+ static Gpm_Event nEvent;
-+ struct Gpm_Type *type = mouse->type;
-+ struct miceopt *opt = &mouse->options;
-+ enum mouse_rslt rslt = MOUSE_DATA_OK;
-+ unsigned char shift_state;
-+ char *data = NULL;
- int i;
-- Gpm_Cinfo *cinfoPtr, *next;
-- Gpm_Connect conn;
-- static Gpm_Event event;
-- static struct vt_stat stat;
--
-- gpm_report(GPM_PR_INFO,GPM_MESS_CON_REQUEST, ci->fd, vc);
-- if (vc>MAX_VC) return -1;
--
-- /* itz 10-22-96 this shouldn't happen now */
-- if (vc==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_UNKNOWN_FD);
--
-- i=get_data(&conn,ci->fd);
--
-- if (!i) { /* no data */
-- gpm_report(GPM_PR_INFO,GPM_MESS_CLOSE);
-- close(ci->fd);
-- FD_CLR(ci->fd,&connSet);
-- FD_CLR(ci->fd,&readySet);
-- if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */
-- cinfoPtr = cinfo[vc];
-- cinfo[vc]=cinfo[vc]->next; /* pop the stack */
-- free(cinfoPtr);
-- return -1;
-- }
-- /* somewhere inside the stack, have to walk it */
-- cinfoPtr = cinfo[vc];
-- while (cinfoPtr && cinfoPtr->next) {
-- if (cinfoPtr->next->fd == ci->fd) {
-- next = cinfoPtr->next;
-- cinfoPtr->next = next->next;
-- free (next);
-+
-+ if (attempt > 1) { /* continue interrupted cluster loop */
-+ if (opt->absolute) {
-+ event->x = nEvent.x;
-+ event->y = nEvent.y;
-+ }
-+ event->dx = nEvent.dx;
-+ event->dy = nEvent.dy;
-+ event->buttons = nEvent.buttons;
-+ } else {
-+ event->dx = event->dy = 0;
-+ event->wdx = event->wdy = 0;
-+ nEvent.modifiers = 0; /* some mice set them */
-+ i = 0;
-+
-+ do { /* cluster loop */
-+ if (!timeout && (data = getMouseData(mouse->dev.fd, type, text_mode)) != NULL) {
-+ GET_TIME(mouse->timestamp);
-+ }
-+
-+ /* in case of timeout data passed to typr->fun() is NULL */
-+ if ((!timeout && data == NULL) ||
-+ type->fun(&mouse->dev, &mouse->options, data, &nEvent) == -1) {
-+ if (!i) return MOUSE_NO_DATA;
-+ else break;
-+ }
-+
-+ event->modifiers = nEvent.modifiers; /* propagate modifiers */
-+
-+ /* propagate buttons */
-+ nEvent.buttons = multiplex_buttons(mouse, nEvent.buttons);
-+
-+ if (!i) event->buttons = nEvent.buttons;
-+
-+ if (oldB != nEvent.buttons) {
-+ rslt = MOUSE_MORE_DATA;
- break;
- }
-- cinfoPtr = cinfoPtr->next;
-- }
-- return -1;
-- } /* not data */
--
-- if (i == -1) return -1; /* too few bytes */
-
-- if (conn.pid!=0) {
-- ci->data = conn;
-- return 0;
-- }
--
-- /* Aha, request for information (so-called snapshot) */
-- switch(conn.vc) {
-- case GPM_REQ_SNAPSHOT:
-- i=open_console(O_RDONLY);
-- ioctl(i,VT_GETSTATE,&stat);
-- event.modifiers=6; /* code for the ioctl */
-- if (ioctl(i,TIOCLINUX,&(event.modifiers))<0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE);
-- close(i);
-- event.vc = stat.v_active;
-- event.x=statusX; event.y=statusY;
-- event.dx=maxx; event.dy=maxy;
-- event.buttons= statusB;
-- event.clicks=statusC;
-- /* fall through */
-- /* missing break or do you want this ??? */
--
-- case GPM_REQ_BUTTONS:
-- event.type= (opt_three==1 ? 3 : 2); /* buttons */
-- write(ci->fd,&event,sizeof(Gpm_Event));
-- break;
-+ /* propagate movement */
-+ if (!opt->absolute) { /* mouse */
-+ if (abs(nEvent.dx) + abs(nEvent.dy) > opt->delta)
-+ nEvent.dx *= opt->accel, nEvent.dy *= opt->accel;
-
-- case GPM_REQ_NOPASTE:
-- disable_paste(vc);
-- break;
-+ /* increment the reported dx,dy */
-+ event->dx += nEvent.dx;
-+ event->dy += nEvent.dy;
-+ } else { /* a pen */
-+ /* get dx,dy to check if there has been movement */
-+ event->dx = nEvent.x - event->x;
-+ event->dy = nEvent.y - event->y;
-+ }
-+
-+ /* propagate wheel */
-+ event->wdx += nEvent.wdx;
-+ event->wdy += nEvent.wdy;
-+
-+ } while (i++ < opt->cluster && more_data_waiting(mouse->dev.fd));
-+ } /* if(eventFlag) */
-+
-+ /*....................................... update the button number */
-+
-+ if ((event->buttons & GPM_B_MIDDLE) && !opt->three_button) opt->three_button++;
-+
-+ /*....................................... we're a repeater, aren't we? */
-+
-+ if (!text_mode) {
-+ if (repeater.fd != -1 && !repeater.raw)
-+ handle_repeater(opt->absolute, &nEvent, event);
-+ oldB = nEvent.buttons;
-+ return MOUSE_NO_DATA; /* no events nor information for clients */
- }
-
-- return 0;
--}
-+/*....................................... no, we arent a repeater, go on */
-
--/*-------------------------------------------------------------------*/
--static inline int processConn(int fd) /* returns newfd or -1 */
--{
-- Gpm_Cinfo *info;
-- Gpm_Connect *request;
-- Gpm_Cinfo *next;
-- int vc, newfd;
--#if !defined(__GLIBC__)
-- int len;
--#else /* __GLIBC__ */
-- size_t len; /* isn't that generally defined in C ??? -- nico */
--#endif /* __GLIBC__ */
-- struct sockaddr_un addr; /* reuse this each time */
-- struct stat statbuf;
-- uid_t uid;
-- char *tty = NULL;
--
--/*....................................... Accept */
--
-- bzero((char *)&addr,sizeof(addr));
-- addr.sun_family=AF_UNIX;
--
-- len=sizeof(addr);
-- if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno));
-- return -1;
-- }
--
-- gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd);
--
-- info=malloc(sizeof(Gpm_Cinfo));
-- if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
-- request=&(info->data);
--
-- if(get_data(request,newfd)==-1) {
-- free(info);
-- close(newfd);
-- return -1;
-- }
--
-- if ((vc=request->vc)>MAX_VC) {
-- gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC);
-- free(info);
-- close(newfd);
-- return -1;
-- }
--
--#ifndef SO_PEERCRED
-- if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path);
-- free(info); /* itz 10-12-95 verify client's right */
-- close(newfd);
-- return -1; /* to read requested tty */
-+ /* use fine delta values now, if delta is the information */
-+ if (!opt->absolute) {
-+ fine_dx += event->dx;
-+ fine_dy += event->dy;
-+ event->dx = fine_dx / opt->scalex;
-+ event->dy = fine_dy / opt->scaley;
-+ fine_dx %= opt->scalex;
-+ fine_dy %= opt->scaley;
- }
--
-- unlink(addr.sun_path); /* delete socket */
-
-- staletime = time(0) - 30;
-- if (statbuf.st_atime < staletime
-- || statbuf.st_ctime < staletime
-- || statbuf.st_mtime < staletime) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD);
-- free (info);
-- close(newfd);
-- return -1; /* socket is ancient */
-+ /* up and down, up and down, ... who does a do..while(0) loop ???
-+ and then makes a break into it... argh ! */
-+
-+ if (!event->dx && !event->dy && event->buttons == oldB) {
-+ static time_t awaketime;
-+ /*
-+ * Ret information also if never happens, but enough time has elapsed.
-+ * Note: return 1 will segfault due to missing event->vc; FIXME!
-+ */
-+ if (time(NULL) <= awaketime) return MOUSE_NO_DATA;
-+ awaketime = time(NULL) + 1;
- }
-
-- uid = statbuf.st_uid; /* owner of socket */
--#else
-- {
-- struct ucred sucred;
-- socklen_t credlen = sizeof(struct ucred);
--
-- if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno));
-- free(info);
-- close(newfd);
-- return -1;
-- }
-- uid = sucred.uid;
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid);
-- }
--#endif
-- if (uid != 0) {
-- if(( tty =
-- malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
--
-- strncpy(tty,option.consolename,strlen(option.consolename)-1);
-- sprintf(&tty[strlen(option.consolename)-1],"%d",vc);
-+ /*....................................... fill missing fields */
-+ event->x += event->dx; event->y += event->dy;
-
-- if(stat(tty, &statbuf) == -1) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty);
-- free(info);
-- free(tty);
-- close(newfd);
-- return -1;
-- }
-- if (uid != statbuf.st_uid) {
-- gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/
-- free(info);
-- free(tty);
-- close(newfd);
-- return -1;
-+ event->vc = get_console_state(&shift_state);
-+ if (event->vc != last_active) {
-+ handle_console_resize(event);
-+ last_active = event->vc;
-+ }
-+ event->modifiers |= shift_state;
-+
-+ if (oldB == event->buttons)
-+ event->type = (event->buttons ? (GPM_DRAG | GPM_MFLAG) : GPM_MOVE);
-+ else {
-+ if (event->buttons > oldB)
-+ event->type = GPM_DOWN;
-+ else {
-+ event->type &= GPM_MFLAG;
-+ event->type |= GPM_UP;
-+ event->buttons ^= oldB; /* for button-up, tell which one */
- }
-- free(tty); /* at least here it's not needed anymore */
- }
-+ calculate_clicks(event, opt->time);
-+ snap_to_screen_limits(event);
-+
-+ gpm_report(GPM_PR_DEBUG,"M: %3i %3i (%3i %3i) - butt=%i vc=%i cl=%i",
-+ event->dx, event->dy, event->x, event->y,
-+ event->buttons, event->vc, event->clicks);
-
-- /* register the connection information in the right place */
-- info->next=next=cinfo[vc];
-- info->fd=newfd;
-- cinfo[vc]=info;
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS,
-- request->pid, request->vc, request->eventMask, request->defaultMask,
-- request->minMod, request->maxMod);
--
-- /* if the client gets motions, give it the current position */
-- if(request->eventMask & GPM_MOVE) {
-- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0};
-- do_client(info, &event);
-- }
-+ oldB = nEvent.buttons;
-
-- return newfd;
-+ if (opt_special && (event->type & GPM_DOWN) && !processSpecial(event))
-+ rslt = MOUSE_NO_DATA;
-+
-+ return rslt;
- }
-
--/*-------------------------------------------------------------------*/
--void get_console_size(Gpm_Event *ePtr)
-+static int wait_for_data(fd_set *connSet, int maxfd, fd_set *selSet)
- {
-- int i, prevmaxx, prevmaxy;
-- struct mouse_features *which_mouse; /* local */
-+ struct micetab *mouse;
-+ struct timeval now, timeout = { 0, 0 };
-+ int mouse_tmo, tmo = INT_MAX;
-
-- /* before asking the new console size, save the previous values */
-- prevmaxx = maxx; prevmaxy = maxy;
-+ GET_TIME(now);
-
-- i=open_console(O_RDONLY);
-- ioctl(i, TIOCGWINSZ, &win);
-- close(i);
-- if (!win.ws_col || !win.ws_row) {
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM);
-- win.ws_col=80; win.ws_row=25;
-- }
-- maxx=win.ws_col; maxy=win.ws_row;
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy);
--
-- if (!prevmaxx) { /* first invocation, place the pointer in the middle */
-- statusX = ePtr->x = maxx/2;
-- statusY = ePtr->y = maxy/2;
-- } else { /* keep the pointer in the same position where it was */
-- statusX = ePtr->x = ePtr->x * maxx / prevmaxx;
-- statusY = ePtr->y = ePtr->y * maxy / prevmaxy;
-- }
--
-- for (i=1; i <= 1+opt_double; i++) {
-- which_mouse=mouse_table+i; /* used to access options */
-- /*
-- * the following operation is based on the observation that 80x50
-- * has square cells. (An author-centric observation ;-)
-- */
-- opt_scaley=opt_scale*50*maxx/80/maxy;
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,opt_scale,opt_scaley);
-+ *selSet = *connSet;
-+ for (mouse = micelist; mouse; mouse = mouse->next) {
-+ FD_SET(mouse->dev.fd, selSet);
-+ maxfd = max(maxfd, mouse->dev.fd);
-+ if (mouse->dev.timeout >= 0) {
-+ mouse_tmo = mouse->dev.timeout - DIF_TIME(mouse->timestamp, now);
-+ tmo = min(tmo, mouse_tmo);
-+ }
- }
-+
-+ if (tmo == INT_MAX)
-+ timeout.tv_sec = SELECT_TIME;
-+ else if (tmo > 0) {
-+ timeout.tv_sec = tmo / 1000;
-+ timeout.tv_usec = (tmo % 1000) * 1000;
-+ }
-+
-+ return select(maxfd + 1, selSet, NULL_SET, NULL_SET, &timeout);
- }
-
--/*-------------------------------------------------------------------*/
--static void gpm_killed(int signo)
--{
-- if(signo==SIGWINCH) {
-- gpm_report(GPM_PR_WARN,GPM_MESS_RESIZING, option.progname, getpid());
-- opt_resize++;
-- return;
-- }
-- if (signo==SIGUSR1)
-- gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY,option.progname, getpid(),option.progname);
-- exit(0);
--}
-+
-
- /*-------------------------------------------------------------------*/
- int old_main()
- {
-- int ctlfd, newfd;
-- struct sockaddr_un ctladdr;
-- int i, len, kd_mode, fd;
-- struct timeval timeout;
-- int maxfd=-1;
-- int pending;
-+ int ctlfd;
-+ int i, text_mode;
-+ struct timeval now;
-+ int maxfd = -1;
-+ int pending, attempt;
-+ int timed_out;
- Gpm_Event event;
-+ struct micetab *mouse;
-+ struct client_info *ci;
-+ fd_set selSet, connSet;
-+ enum mouse_rslt rslt;
-
-- for (i = 1; i <= 1+opt_double; i++) {
-- which_mouse=mouse_table+i; /* used to access options */
--
-- if (!opt_dev) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV);
--
-- if(!strcmp(opt_dev,"-")) fd=0; /* use stdin */
-- else if( (fd=open(opt_dev,O_RDWR | O_NDELAY)) < 0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,opt_dev);
--
-- /* and then reset the flag */
-- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY);
--
-- /* create argc and argv for this device */
-- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ',');
--
-- /* init the device, and use the return value as new mouse type */
-- if (m_type->init)
-- m_type=(m_type->init)(fd, m_type->flags, m_type, mouse_argc[i],
-- mouse_argv[i]);
-- if (!m_type) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT);
--
-- which_mouse->fd=fd;
-- maxfd=max(fd, maxfd);
-- }
--
--/*....................................... catch interesting signals */
--
-+ /*....................................... catch interesting signals */
- signal(SIGTERM, gpm_killed);
- signal(SIGINT, gpm_killed);
- signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */
- signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */
-+ signal(SIGPIPE, SIG_IGN); /* WARN */
-
--/*....................................... create your nodes */
--
-- /* control node */
--
-- if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB);
-- bzero((char *)&ctladdr,sizeof(ctladdr));
-- ctladdr.sun_family=AF_UNIX;
-- strcpy(ctladdr.sun_path,GPM_NODE_CTL);
-- unlink(GPM_NODE_CTL);
--
-- len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL);
-- if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path);
-- maxfd=max(maxfd,ctlfd);
--
-- /* needs to be 0777, so all users can _try_ to access gpm */
-- chmod(GPM_NODE_CTL,0777);
--
-- get_console_size(&event); /* get screen dimensions */
--
--/*....................................... wait for mouse and connections */
--
-- listen(ctlfd, 5); /* Queue up calls */
--
--#define NULL_SET ((fd_set *)NULL)
--#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0)
-+ init_mice();
-+ handle_console_resize(&event); /* get screen dimensions */
-+ ctlfd = listen_for_clients();
-
-+ /*....................................... wait for mouse and connections */
- FD_ZERO(&connSet);
-- FD_SET(ctlfd,&connSet);
--
-- if (opt_double) FD_SET(mouse_table[2].fd,&connSet);
--
-- readySet=connSet;
-- FD_SET(mouse_table[1].fd,&readySet);
--
-- signal(SIGPIPE,SIG_IGN); /* WARN */
--
--/*--------------------------------------- main loop begins here */
-+ FD_SET(ctlfd, &connSet);
-+ maxfd = max(maxfd, ctlfd);
-+
-+ /*--------------------------------------- main loop begins here */
-
-- while(1) {
-- selSet=readySet;
-- resetTimeout();
-- if (opt_test) timeout.tv_sec=0;
-+ while (1) {
-
-- if (eventFlag) { /* an event left over by clustering */
-- pending=1;
-- FD_ZERO(&selSet);
-- FD_SET(mouse_table[eventFlag].fd,&selSet);
-- }
-- else
-- while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){
-- selSet=readySet;
-- resetTimeout();
-- } /* go on */
--
-- if(opt_resize) { /* did the console resize? */
-- get_console_size(&event);
-- opt_resize--;
-- signal(SIGWINCH,gpm_killed); /* reinstall handler */
--
-- /* and notify clients */
-- for(i=0; i<MAX_VC+1; i++) {
-- Gpm_Cinfo *ci;
-- for (ci = cinfo[i]; ci; ci = ci->next) kill(ci->data.pid,SIGWINCH);
-- }
-+ pending = wait_for_data(&connSet, maxfd, &selSet);
-+
-+ if (console_resized) { /* did the console resize? */
-+ handle_console_resize(&event);
-+ console_resized = 0;
-+ signal(SIGWINCH, gpm_killed); /* reinstall handler */
-+ notify_clients_resize();
- }
-
- if (pending < 0) {
-- if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB);
-- gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno));
-- selSet=readySet;
-- resetTimeout();
-+ if (errno == EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB);
-+ gpm_report(GPM_PR_ERR, GPM_MESS_SELECT_STRING, strerror(errno));
- continue;
- }
-
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending);
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_SELECT_TIMES, pending);
-
--/*....................................... manage graphic mode */
-+ /*....................................... manage graphic mode */
-
-- /*
-- * Be sure to be in text mode. This used to be before select,
-- * but actually it only matters if you have events.
-- */
-- {
-- int fd = open_console(O_RDONLY);
-- if (ioctl(fd, KDGETMODE, &kd_mode) < 0)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE);
-- close(fd);
-- if(kd_mode != KD_TEXT && !option.repeater) {
-- wait_text(&mouse_table[1].fd);
-- maxfd=max(maxfd,mouse_table[1].fd);
-- readySet=connSet;
-- FD_SET(mouse_table[1].fd,&readySet);
-+ /*
-+ * Be sure to be in text mode. This used to be before select,
-+ * but actually it only matters if you have events.
-+ */
-+ text_mode = is_text_console();
-+ if (!text_mode && !repeater.type && !repeater.raw) {
-+ /* if we don;t have repeater then there is only one mouse so
-+ * we can safely use micelist
-+ */
-+ close(micelist->dev.fd);
-+ wait_text_console();
-+ /* reopen, reinit (the function is only used if we have one mouse device) */
-+ if ((micelist->dev.fd = open(micelist->device, O_RDWR)) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, micelist->device);
-+ if (micelist->type->init)
-+ micelist->type->init(&micelist->dev, &micelist->options, micelist->type);
- continue; /* reselect */
- }
-- }
-
--/*....................................... got mouse, process event */
--/*
-- * Well, actually, run a loop to maintain inlining of functions without
-- * lenghtening the file. This is not too clean a code, but it works....
-- */
--
-- for (i=1; i <= 1+opt_double; i++) {
-- which_mouse=mouse_table+i; /* used to access options */
-- if (FD_ISSET(which_mouse->fd,&selSet)) {
-- FD_CLR(which_mouse->fd,&selSet); pending--;
-- if (processMouse(which_mouse->fd, &event, m_type, kd_mode))
-- /* pass it to the client, if any
-- * or to the default handler, if any
-- * or to the selection handler
-- */ /* FIXME -- check event.vc */
-- /* can't we please rewrite the following a bit nicer?*/
-- (cinfo[event.vc] && do_client(cinfo[event.vc], &event))
-- || (cinfo[0] && do_client(cinfo[0], &event))
-- || do_selection(&event);
-+ /*....................................... got mouse, process event */
-+ /*
-+ * Well, actually, run a loop to maintain inlining of functions without
-+ * lenghtening the file. This is not too clean a code, but it works....
-+ */
-+ GET_TIME(now);
-+ for (mouse = micelist; mouse; mouse = mouse->next) {
-+ timed_out = mouse->dev.timeout >= 0 &&
-+ DIF_TIME(mouse->timestamp, now) >= mouse->dev.timeout;
-+ if (timed_out || FD_ISSET(mouse->dev.fd, &selSet)) {
-+ if (FD_ISSET(mouse->dev.fd, &selSet)) {
-+ FD_CLR(mouse->dev.fd, &selSet);
-+ pending--;
- }
-+ attempt = 0;
-+ do {
-+ rslt = processMouse(mouse, timed_out, ++attempt, &event, text_mode);
-+ if (rslt != MOUSE_NO_DATA) {
-+ /* pass it to the client or to the default handler,
-+ * or to the selection handler
-+ */
-+ if (event.vc > MAX_VC) event.vc = 0;
-+ if (event.vc == 0 || !cinfo[event.vc] || !do_client(cinfo[event.vc], &event))
-+ if (!cinfo[0] || !do_client(cinfo[0], &event))
-+ do_selection(&event, mouse->options.three_button);
-+ }
-+ } while (rslt == MOUSE_MORE_DATA);
-+ }
- }
-
- /*..................... got connection, process it */
--
-- if (pending && FD_ISSET(ctlfd,&selSet)) {
-- FD_CLR(ctlfd,&selSet); pending--;
-- newfd=processConn(ctlfd);
-- if (newfd>=0) {
-- FD_SET(newfd,&connSet);
-- FD_SET(newfd,&readySet);
-- maxfd=max(maxfd,newfd);
-+ if (pending && FD_ISSET(ctlfd, &selSet)) {
-+ FD_CLR(ctlfd, &selSet);
-+ pending--;
-+ if ((ci = accept_client_connection(ctlfd))) {
-+ if (ci->data.eventMask & GPM_MOVE) {
-+ Gpm_Event e = { 0, 0, ci->data.vc, 0, 0,
-+ event.x, event.y, GPM_MOVE, 0, 0 };
-+ do_client(ci, &e);
-+ }
-+ FD_SET(ci->fd, &connSet);
-+ maxfd = max(maxfd, ci->fd);
- }
- }
-
- /*........................ got request */
--
-- /* itz 10-22-96 check _all_ clients, not just those on top! */
-- for (i=0; pending && (i<=MAX_VC); i++) {
-- Gpm_Cinfo* ci;
-+ /* itz 10-22-96 check _all_ clients, not just those on top! */
-+ for (i = 0; pending && i <= MAX_VC; i++) {
- for (ci = cinfo[i]; pending && ci; ci = ci->next) {
-- if (FD_ISSET(ci->fd,&selSet)) {
-- FD_CLR(ci->fd,&selSet); pending--;
-- /* itz Sat Sep 12 21:10:22 PDT 1998 */
-- /* this code is clearly incorrect; the next highest
-- descriptor after the one we're closing is not necessarily
-- being used. Fortunately, it doesn't hurt simply to leave this
-- out. */
--
--#ifdef NOTDEF
-- if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--;
--#else
-- (void)processRequest(ci,i);
--#endif
-+ if (FD_ISSET(ci->fd, &selSet)) {
-+ FD_CLR(ci->fd, &selSet);
-+ pending--;
-+ if (!process_client_request(ci, i, event.x, event.y, event.clicks,
-+ event.buttons, micelist->options.three_button)) {
-+ FD_CLR(ci->fd, &connSet);
-+ remove_client(ci, i);
-+ }
- }
- }
- }
-
- /*.................. look for a spare fd */
--
- /* itz 10-22-96 this shouldn't happen now! */
-- for (i=0; pending && i<=maxfd; i++) {
-- if (FD_ISSET(i,&selSet)) {
-- FD_CLR(i,&selSet);
-+ for (i = 0; pending && i <= maxfd; i++) {
-+ if (FD_ISSET(i, &selSet)) {
-+ FD_CLR(i, &selSet);
- pending--;
-- gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i);
-+ gpm_report(GPM_PR_WARN, GPM_MESS_STRANGE_DATA,i);
- }
- }
-
- /*................... all done. */
--
-- if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB);
-+ if (pending) gpm_report(GPM_PR_OOPS, GPM_MESS_SELECT_PROB);
- } /* while(1) */
- }
-diff -urN gpm-1.20.1/src/gpn.c gpm/src/gpn.c
---- gpm-1.20.1/src/gpn.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/gpn.c 2003-10-02 01:22:42.000000000 -0500
-@@ -28,201 +28,104 @@
- #include <stdlib.h>
- #include <string.h> /* strerror(); ?!? memcpy() */
- #include <ctype.h> /* isdigit */
--#include <signal.h>
--#include <stdarg.h> /* Log uses it */
--#include <errno.h>
- #include <unistd.h> /* getopt(),symlink() */
--#include <sys/stat.h> /* mkdir() */
--#include <sys/param.h>
--#include <sys/time.h> /* timeval */
--#include <sys/wait.h> /* wait() */
--#include <sys/types.h> /* socket() */
--#include <sys/socket.h> /* socket() */
--#include <sys/un.h> /* struct sockaddr_un */
--#include <asm/types.h> /* __u32 */
--
--#ifdef SIGTSTP /* true if BSD system */
--#include <sys/file.h>
--#include <sys/ioctl.h>
--#endif
--
--#ifndef HAVE___U32
--# ifndef _I386_TYPES_H /* /usr/include/asm/types.h */
--typedef unsigned int __u32;
--# endif
--#endif
-
- #include "headers/message.h"
- #include "headers/gpmInt.h"
- #include "headers/gpm.h"
-+#include "headers/console.h"
-+#include "headers/selection.h"
-
--extern int errno;
--
--/*===================================================================*/
--/* octal digit */
--static int isodigit(const unsigned char c)
-+/* usage: display for usage informations */
-+int usage(char *whofailed)
- {
-- return ((c & ~7) == '0');
-+ if (whofailed) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_SPEC_ERR, whofailed, option.progname);
-+ return 1;
-+ }
-+ printf(GPM_MESS_USAGE, option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE,
-+ DEF_DELTA, DEF_TIME, DEF_LUT, DEF_SCALE, DEF_SAMPLE, DEF_TYPE);
-+ return 1;
- }
-
--/* routine to convert digits from octal notation (Andries Brouwer) */
--static int getsym(const unsigned char *p0, unsigned char *res)
-+/*****************************************************************************
-+ * the function returns a valid type pointer or NULL if not found
-+ *****************************************************************************/
-+static struct Gpm_Type *find_mouse_by_name(char *name)
- {
-- const unsigned char *p = p0;
-- char c;
-+ Gpm_Type *type;
-+ char *s;
-+ int len = strlen(name);
-
-- c = *p++;
-- if (c == '\\' && *p) {
-- c = *p++;
-- if (isodigit(c)) {
-- c -= '0';
-- if (isodigit(*p)) c = 8*c + (*p++ - '0');
-- if (isodigit(*p)) c = 8*c + (*p++ - '0');
-+ for (type = mice; type->fun; type++) {
-+ if (!strcasecmp(name, type->name)) break;
-+ /* otherwise, look in the synonym list */
-+ for (s = type->synonyms; s; s = strchr(s, ' ')) {
-+ while (*s && isspace(*s)) s++; /* skip spaces */
-+ if (!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/
- }
-+ if (s) break; /* found a synonym */
- }
-- *res = c;
-- return (p - p0);
-+ return type->fun ? type : NULL;
- }
-
--/* description missing! FIXME */
--int loadlut(char *charset)
-+static void init_button_sequence(struct miceopt *opt, char *arg)
- {
-- int i, c, fd;
-- unsigned char this, next;
-- static __u32 long_array[9]={
-- 0x05050505, /* ugly, but preserves alignment */
-- 0x00000000, /* control chars */
-- 0x00000000, /* digits */
-- 0x00000000, /* uppercase and '_' */
-- 0x00000000, /* lowercase */
-- 0x00000000, /* Latin-1 control */
-- 0x00000000, /* Latin-1 misc */
-- 0x00000000, /* Latin-1 uppercase */
-- 0x00000000 /* Latin-1 lowercase */
-+ int i;
-+ static struct {
-+ char *in;
-+ char *out;
-+ } seq[] = {
-+ {"123", "01234567"},
-+ {"132", "02134657"},
-+ {"213", "01452367"}, /* warning: these must be readable as integers... */
-+ {"231", "02461357"},
-+ {"312", "04152637"},
-+ {"321", "04261537"},
-+ {NULL, NULL}
- };
-
-+ if (strlen(arg) != 3 || atoi(arg) < 100)
-+ exit(usage("sequence"));
-
--#define inwordLut (long_array+1)
--
-- for (i=0; charset[i]; ) {
-- i += getsym(charset+i, &this);
-- if (charset[i] == '-' && charset[i + 1] != '\0')
-- i += getsym(charset+i+1, &next) + 1;
-- else
-- next = this;
-- for (c = this; c <= next; c++)
-- inwordLut[c>>5] |= 1 << (c&0x1F);
-- }
--
-- if ((fd=open(option.consolename, O_WRONLY)) < 0) {
-- /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */
-- free(option.consolename); /* allocated by main */
-- if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
-- strcpy(option.consolename,GPM_SYS_CONSOLE);
--
-- if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON);
-- }
-- if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */
-- if (errno==EPERM && getuid())
-- gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/
-- else if (errno==EINVAL)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT);
-- }
-- close(fd);
--
-- return 0;
-+ for (i = 0; seq[i].in && strcmp(seq[i].in, arg); i++);
-+ if (!seq[i].in)
-+ exit(usage("button sequence"));
-+ opt->sequence = strdup(seq[i].out); /* I can rewrite on it */
- }
-
--/* usage: display for usage informations */
--int usage(char *whofailed)
-+static void validate_mouse(struct micetab *mouse, int mouse_no)
- {
-- if (whofailed) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname);
-- return 1;
-- }
-- printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE,
-- DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE);
-- return 1;
--}
--
--/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the
-- unwanted functionality in check_uniqueness. */
--
--void check_kill(void)
--{
-- int old_pid;
-- FILE* fp = fopen(GPM_NODE_PID, "r");
--
-- /* if we cannot find the old pid file, leave */
-- if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID);
--
-- /* else read the pid */
-- if (fscanf(fp,"%d",&old_pid) != 1)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID);
-- fclose(fp);
--
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid);
--
-- /* first check if we run */
-- if (kill(old_pid,0) == -1) {
-- gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID);
-- unlink(GPM_NODE_PID);
-+ if (!mouse->device) {
-+ if (!mouse->type && mouse_no > 1)
-+ gpm_report(GPM_PR_OOPS,
-+ "No device/protocol specified for mouse #%d, probably extra -M option?", mouse_no);
-+ else
-+ gpm_report(GPM_PR_OOPS, "No device specified for mouse #%d", mouse_no);
- }
-- /* then kill us (not directly, but the other instance ... ) */
-- if (kill(old_pid,SIGTERM) == -1)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid);
-
-- gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid);
-- exit(0);
--}
-+ if (!mouse->type)
-+ mouse->type = find_mouse_by_name(DEF_TYPE);
-
--/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two
-- completely different things; opening a socket to a running daemon
-- and checking that a running daemon existed. Ugly. */
--/* rewritten mostly on 20th of February 2002 - nico */
--void check_uniqueness(void)
--{
-- FILE *fp = 0;
-- int old_pid = -1;
-+ mouse->options.absolute = mouse->type->absolute;
-
-- if((fp = fopen(GPM_NODE_PID, "r")) != NULL) {
-- fscanf(fp, "%d", &old_pid);
-- if (kill(old_pid,0) == -1) {
-- gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID);
-- unlink(GPM_NODE_PID);
-- } else /* we are really running, exit asap! */
-- gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid);
-- }
-- /* now try to sign ourself */
-- if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) {
-- fprintf(fp,"%d\n",getpid());
-- fclose(fp);
-- } else {
-- gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID);
-- }
-+ if (!mouse->options.sequence)
-+ init_button_sequence(&mouse->options, DEF_SEQUENCE);
- }
-
--/*****************************************************************************
-- * the function returns a valid type pointer or NULL if not found
-- *****************************************************************************/
--struct Gpm_Type *find_mouse_by_name(char *name)
-+static void validate_repeater(char *type)
- {
-- Gpm_Type *type;
-- char *s;
-- int len = strlen(name);
--
-- for (type=mice; type->fun; type++) {
-- if (!strcasecmp(name, type->name)) break;
-- /* otherwise, look in the synonym list */
-- for (s = type->synonyms; s; s = strchr(s, ' ')) {
-- while (*s && isspace(*s)) s++; /* skip spaces */
-- if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/
-- }
-- if(s) break; /* found a synonym */
-+ if (strcmp(type, "raw") == 0)
-+ repeater.raw = 1;
-+ else {
-+ repeater.raw = 0;
-+
-+ if (!(repeater.type = find_mouse_by_name(type)))
-+ exit(M_listTypes()); /* not found */
-+
-+ if (!repeater.type->repeat_fun) /* unsupported translation */
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_NO_REPEAT, type);
- }
-- if (!type->fun) return NULL;
-- return type;
- }
-
- /*****************************************************************************
-@@ -230,60 +133,86 @@
- * Can't believe it, today cmdline() really does what the name tries to say
- *****************************************************************************/
- void cmdline(int argc, char **argv)
--{
-- extern struct options option;
-+{
-+ struct micetab *mouse;
-+ struct miceopt *opt;
- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23";
-- int opt;
-+ int opt_char, tmp;
-+ int mouse_no = 1;
-+
-+ mouse = add_mouse();
-+ opt = &mouse->options;
-
-- /* initialize for the dual mouse */
-- mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */
-- which_mouse=mouse_table+1; /* use the first */
--
-- while ((opt = getopt(argc, argv, options)) != -1) {
-- switch (opt) {
-- case 'a': opt_accel = atoi(optarg); break;
-- case 'A': opt_aged++;
-- if (optarg)
-- opt_age_limit = atoi(optarg); break;
-- case 'b': opt_baud = atoi(optarg); break;
-- case 'B': opt_sequence = optarg; break;
-- case 'd': opt_delta = atoi(optarg); break;
-- case 'D': option.run_status = GPM_RUN_DEBUG; break;
-- case 'g': opt_glidepoint_tap=atoi(optarg); break;
-- case 'h': exit(usage(NULL));
-- case 'i': opt_time=atoi(optarg); break;
-- case 'k': check_kill(); break;
-- case 'l': opt_lut = optarg; break;
-- case 'm': add_mouse(GPM_ADD_DEVICE,optarg);
-- opt_dev = optarg; break; /* GO AWAY!*/
-- case 'M': opt_double++; option.repeater++;
-- if (option.repeater_type == 0)
-- option.repeater_type = "msc";
-- which_mouse=mouse_table+2; break;
-- case 'o': add_mouse(GPM_ADD_OPTIONS,optarg);
-- gpm_report(GPM_PR_DEBUG,"options: %s",optarg);
-- opt_options = optarg; break; /* GO AWAY */
-- case 'p': opt_ptrdrag = 0; break;
-- case 'r':
-- /* being called responsiveness, I must take the inverse */
-- opt_scale=atoi(optarg);
-- if(!opt_scale || opt_scale > 100) opt_scale=100; /* the maximum */
-- else opt_scale=100/opt_scale; break;
-- case 'R':
-- option.repeater++;
-- if (optarg) option.repeater_type = optarg;
-- else option.repeater_type = "msc"; break;
-- case 's': opt_sample = atoi(optarg); break;
-- case 'S': if (optarg) opt_special = optarg;
-- else opt_special=""; break;
-- case 't': add_mouse(GPM_ADD_TYPE,optarg);
-- opt_type = optarg; break; /* GO AWAY */
-- case 'u': option.autodetect = 1; break;
-- case 'T': opt_test++; break;
-- case 'v': printf(GPM_MESS_VERSION "\n"); exit(0);
-- case '2': opt_three = -1; break;
-- case '3': opt_three = 1; break;
-- default: exit(usage("commandline"));
-+ while ((opt_char = getopt(argc, argv, options)) != -1) {
-+ switch (opt_char) {
-+ case 'a': if ((opt->accel = atoi(optarg)) < 1)
-+ exit(usage("acceleration"));
-+ break;
-+ case 'A': sel_opts.aged = 1;
-+ if (optarg)
-+ sel_opts.age_limit = atoi(optarg);
-+ break;
-+ case 'b': opt->baud = atoi(optarg);
-+ break;
-+ case 'B': init_button_sequence(opt, optarg);
-+ break;
-+ case 'd': if ((opt->delta = atoi(optarg)) < 2)
-+ exit(usage("delta"));
-+ break;
-+ case 'D': option.run_status = GPM_RUN_DEBUG;
-+ break;
-+ case 'g': if (atoi(optarg) > 3)
-+ exit(usage("glidepoint tap button"));
-+ opt->glidepoint_tap = GPM_B_LEFT >> (atoi(optarg) - 1);
-+ break;
-+ case 'h': exit(usage(NULL));
-+ case 'i': opt->time = atoi(optarg);
-+ break;
-+ case 'k': kill_gpm();
-+ break;
-+ case 'l': console.charset = optarg;
-+ break;
-+ case 'm': mouse->device = optarg;
-+ break;
-+ case 'M': validate_mouse(mouse, mouse_no);
-+ mouse = add_mouse();
-+ opt = &mouse->options;
-+ mouse_no++;
-+ if (!repeater.type && !repeater.raw)
-+ repeater.type = find_mouse_by_name(DEF_REP_TYPE);
-+ break;
-+ case 'o': gpm_report(GPM_PR_DEBUG,"options: %s", optarg);
-+ opt->text = optarg;
-+ break;
-+ case 'p': sel_opts.ptrdrag = 0;
-+ break;
-+ case 'r': /* being called responsiveness, I must take the inverse */
-+ tmp = atoi(optarg);
-+ if (!tmp || tmp > 100) tmp = 1;
-+ opt->scalex = 100 / tmp;
-+ break;
-+ case 'R': validate_repeater((optarg) ? optarg : DEF_REP_TYPE);
-+ break;
-+ case 's': opt->sample = atoi(optarg);
-+ break;
-+ case 'S': if (optarg) opt_special = optarg;
-+ else opt_special="";
-+ break;
-+ case 't': mouse->type = find_mouse_by_name(optarg);
-+ if (!mouse->type)
-+ exit(M_listTypes());
-+ break;
-+ case 'u': option.autodetect = 1;
-+ break;
-+ case 'v': printf(GPM_MESS_VERSION "\n");
-+ exit(0);
-+ case '2': opt->three_button = -1;
-+ break;
-+ case '3': opt->three_button = 1;
-+ break;
-+ default: exit(usage("commandline"));
- }
- }
-+
-+ validate_mouse(micelist, mouse_no);
- }
-diff -urN gpm-1.20.1/src/headers/client.h gpm/src/headers/client.h
---- gpm-1.20.1/src/headers/client.h 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/headers/client.h 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,57 @@
-+/* -*-mode:C;tab-width:3-*-
-+ * client.h - GPM client handling (server side)
-+ *
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#ifndef __GPM_CLIENT_H
-+#define __GPM_CLIENT_H_
-+
-+#ifdef HAVE_LINUX_TTY_H
-+#include <linux/tty.h>
-+#endif
-+
-+#include "headers/gpm.h"
-+
-+/* FIXME: still needed ?? */
-+/* How many virtual consoles are managed? */
-+#ifndef MAX_NR_CONSOLES
-+# define MAX_NR_CONSOLES 64 /* this is always sure */
-+#endif
-+
-+#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */
-+
-+struct client_info {
-+ Gpm_Connect data;
-+ int fd;
-+ struct client_info *next;
-+};
-+
-+struct Gpm_Event;
-+
-+extern struct client_info *cinfo[MAX_VC + 1];
-+
-+int listen_for_clients(void);
-+struct client_info *accept_client_connection(int fd);
-+void remove_client(struct client_info *ci, int vc);
-+void notify_clients_resize(void);
-+int do_client(struct client_info *cinfo, struct Gpm_Event *event);
-+int process_client_request(struct client_info *ci, int vc,
-+ int x, int y, int buttons, int clicks,
-+ int three_button_mouse);
-+
-+#endif /* __GPM_CLIENT_H_ */
-diff -urN gpm-1.20.1/src/headers/console.h gpm/src/headers/console.h
---- gpm-1.20.1/src/headers/console.h 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/headers/console.h 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,42 @@
-+/* -*-mode:C;tab-width:3-*-
-+ * console.h - GPM console and selection/paste handling
-+ *
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#ifndef __GPM_CONSOLE_H_
-+#define __GPM_CONSOLE_H_
-+
-+struct gpm_console {
-+ char *device;
-+ char *charset;
-+ int max_x, max_y;
-+};
-+
-+extern struct gpm_console console;
-+
-+int open_console(int mode);
-+char *get_console_name();
-+char *compose_vc_name(int vc);
-+int is_text_console(void);
-+void wait_text_console(void);
-+void refresh_console_size(void);
-+int is_console_owner(int vc, uid_t uid);
-+int get_console_state(unsigned char *shift_state);
-+void console_load_lut(void);
-+
-+#endif /* __GPM_CONSOLE_H_ */
-diff -urN gpm-1.20.1/src/headers/gpmInt.h gpm/src/headers/gpmInt.h
---- gpm-1.20.1/src/headers/gpmInt.h 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/headers/gpmInt.h 2003-10-02 01:22:42.000000000 -0500
-@@ -23,8 +23,7 @@
- #ifndef _GPMINT_INCLUDED
- #define _GPMINT_INCLUDED
-
--#include <sys/types.h> /* time_t */ /* for whom ???? FIXME */
--
-+#include <sys/time.h> /* timeval */
- #include "gpm.h"
-
- #if !defined(__GNUC__)
-@@ -35,23 +34,12 @@
- /* timeout for the select() syscall */
- #define SELECT_TIME 86400 /* one day */
-
--#ifdef HAVE_LINUX_TTY_H
--#include <linux/tty.h>
--#endif
--
--/* FIXME: still needed ?? */
--/* How many virtual consoles are managed? */
--#ifndef MAX_NR_CONSOLES
--# define MAX_NR_CONSOLES 64 /* this is always sure */
--#endif
--
--#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */
--
- /* How many buttons may the mouse have? */
- /* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */
-
- /* all the default values */
- #define DEF_TYPE "ms"
-+#define DEF_REP_TYPE "msc"
- #define DEF_DEV NULL /* use the type-related one */
- #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377"
- #define DEF_SEQUENCE "123" /* how buttons are reordered */
-@@ -62,12 +50,10 @@
- #define DEF_SCALE 10
- #define DEF_TIME 250 /* time interval (ms) for multiple clicks */
- #define DEF_THREE 0 /* have three buttons? */
--#define DEF_KERNEL 0 /* no kernel module, by default */
-
- /* 10 on old computers (<=386), 0 on current machines */
- #define DEF_CLUSTER 0 /* maximum number of clustered events */
-
--#define DEF_TEST 0
- #define DEF_PTRDRAG 1 /* double or triple click */
- #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */
-
-@@ -84,11 +70,6 @@
- #define GPM_DEVFS_CONSOLE "/dev/vc/0"
- #define GPM_OLD_CONSOLE "/dev/tty0"
-
--/* for adding a mouse; add_mouse */
--#define GPM_ADD_DEVICE 0
--#define GPM_ADD_TYPE 1
--#define GPM_ADD_OPTIONS 2
--
- /*** mouse commands ***/
-
- #define GPM_AUX_SEND_ID 0xF2
-@@ -117,126 +98,95 @@
-
- /*....................................... Structures */
-
-+struct micedev {
-+ int fd;
-+ int timeout; /* the protocol driver wants to be called
-+ after X msec even if there is no new data
-+ arrived (-1 to disable/default) */
-+ void *private; /* private data maintained by protocol driver */
-+};
-+
-+struct miceopt {
-+ char *sequence;
-+ int baud;
-+ int sample;
-+ int delta;
-+ int accel;
-+ int scalex, scaley;
-+ int time;
-+ int cluster;
-+ int three_button;
-+ int glidepoint_tap;
-+ int absolute; /* device reports absolute coordinates - initially copied
-+ from Gpm_Type; allows same protocol (type) control devices
-+ in absolute and relative mode */
-+ char *text; /* extra textual options supplied via '-o text' */
-+};
-+
- /*
- * and this is the entry in the mouse-type table
- */
- typedef struct Gpm_Type {
-- char *name;
-- char *desc; /* a descriptive line */
-- char *synonyms; /* extra names (the XFree name etc) as a list */
-- int (*fun)(Gpm_Event *state, unsigned char *data);
-- struct Gpm_Type *(*init)(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv);
-- unsigned short flags;
-- unsigned char proto[4];
-- int packetlen;
-- int howmany; /* how many bytes to read at a time */
-- int getextra; /* does it get an extra byte? (only mouseman) */
-- int absolute; /* flag indicating absolute pointing device */
-+ char *name;
-+ char *desc; /* a descriptive line */
-+ char *synonyms; /* extra names (the XFree name etc) as a list */
-+ int (*fun)(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state);
-+ int (*init)(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type);
-+ unsigned short flags;
-+ unsigned char proto[4];
-+ int packetlen;
-+ int howmany; /* how many bytes to read at a time */
-+ int getextra; /* does it get an extra byte? (only mouseman) */
-+ int absolute; /* flag indicating absolute pointing device */
-
-- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */
-+ int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */
- /* itz Mon Jan 11 23:27:54 PST 1999 */
- } Gpm_Type;
-
- #define GPM_EXTRA_MAGIC_1 0xAA
- #define GPM_EXTRA_MAGIC_2 0x55
-
--typedef struct Gpm_Cinfo {
-- Gpm_Connect data;
-- int fd;
-- struct Gpm_Cinfo *next;
--} Gpm_Cinfo;
--
--
--/*....................................... Global variables */
--
--/* this structure is used to hide the dual-mouse stuff */
--
--struct mouse_features {
-- char *opt_type, *opt_dev, *opt_sequence;
-- int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley;
-- int opt_time, opt_cluster, opt_three, opt_glidepoint_tap;
-- char *opt_options; /* extra textual configuration */
-- Gpm_Type *m_type;
-- int fd;
--};
--
--extern struct mouse_features mouse_table[3], *which_mouse; /*the current one*/
--
--// looks unused; delete
--//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type;
--
--/* this is not very clean, actually, but it works fine */
--#define opt_type (which_mouse->opt_type)
--#define opt_dev (which_mouse->opt_dev)
--#define opt_sequence (which_mouse->opt_sequence)
--#define opt_baud (which_mouse->opt_baud)
--#define opt_sample (which_mouse->opt_sample)
--#define opt_delta (which_mouse->opt_delta)
--#define opt_accel (which_mouse->opt_accel)
--#define opt_scale (which_mouse->opt_scale)
--#define opt_scaley (which_mouse->opt_scaley)
--#define opt_time (which_mouse->opt_time)
--#define opt_cluster (which_mouse->opt_cluster)
--#define opt_three (which_mouse->opt_three)
--#define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap)
--#define opt_options (which_mouse->opt_options)
--
--#define m_type (which_mouse->m_type)
--
--/* the other variables */
--
--extern char *opt_lut;
--extern int opt_test, opt_ptrdrag;
--extern int opt_kill;
--extern int opt_kernel, opt_explicittype;
--extern int opt_aged;
--extern time_t opt_age_limit;
- extern char *opt_special;
--extern int opt_rawrep;
--extern int fifofd;
--extern int opt_double;
--
--extern Gpm_Type *repeated_type;
- extern Gpm_Type mice[]; /* where the hell are the descriptions...*/
--extern struct winsize win;
--extern int maxx, maxy;
--extern Gpm_Cinfo *cinfo[MAX_VC+1];
-
- /* new variables <CLEAN> */
-
- /* structure prototypes */
-+struct repeater {
-+ int fd;
-+ int raw;
-+ Gpm_Type *type;
-+};
-
- /* contains all mice */
- struct micetab {
- struct micetab *next;
-- char *device;
-- char *protocol;
-- char *options;
-+ struct micedev dev;
-+ struct miceopt options;
-+ Gpm_Type *type;
-+ char *device;
-+ int buttons; /* mouse's button state from last read */
-+ struct timeval timestamp; /* last time mouse data arrived */
- };
-
- struct options {
- int autodetect; /* -u [aUtodetect..'A' is not available] */
-- int no_mice; /* number of mice */
-- int repeater; /* repeat data */
-- char *repeater_type; /* repeat data as which mouse type */
- int run_status; /* startup/daemon/debug */
- char *progname; /* hopefully gpm ;) */
-- struct micetab *micelist; /* mice and their options */
-- char *consolename; /* /dev/tty0 || /dev/vc/0 */
- };
-
- /* global variables */
- struct options option; /* one should be enough for us */
-+extern struct repeater repeater; /* again, only one */
-+extern struct micetab *micelist;
-
- /* new variables </CLEAN> */
-
--
- /*....................................... Prototypes */
- /* server_tools.c */
--void add_mouse (int type, char *value);
--int init_mice (struct micetab *micelist);
--int reset_mice(struct micetab *micelist);
-+struct micetab *add_mouse(void);
-+void init_mice(void);
-+void cleanup_mice(void);
-
- /* startup.c */
- void startup(int argc, char **argv);
-@@ -246,17 +196,15 @@
-
- /* gpn.c */
- void cmdline(int argc, char **argv);
--int giveInfo(int request, int fd);
--int loadlut(char *charset);
--int usage(char *whofailed);
--struct Gpm_Type *find_mouse_by_name(char *name);
-+int giveInfo(int request, int fd);
-+int usage(char *whofailed);
- void check_uniqueness(void);
--void check_kill(void);
--
-+void kill_gpm(void);
-
- /* mice.c */
- extern int M_listTypes(void);
-- /* special.c */
-+
-+ /* special.c */
- int processSpecial(Gpm_Event *event);
- int twiddler_key(unsigned long message);
- int twiddler_key_init(void);
-diff -urN gpm-1.20.1/src/headers/input-defines.h gpm/src/headers/input-defines.h
---- gpm-1.20.1/src/headers/input-defines.h 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/headers/input-defines.h 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,81 @@
-+/*
-+ * input-defines.h - complements <linux/input.h> adding missing bits
-+ *
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+#ifndef __GPM_INPUT_DEFINES_H
-+#define __GPM_INPUT_DEFINES_H
-+
-+#include <linux/input.h>
-+#include "headers/config.h"
-+
-+#ifndef ABS_TOOL_WIDTH
-+#define ABS_TOOL_WIDTH 0x1c
-+#endif
-+
-+#ifndef BTN_TOOL_FINGER
-+#define BTN_TOOL_FINGER 0x145
-+#endif
-+
-+#ifndef BTN_TOUCH
-+#define BTN_TOUCH 0x14a
-+#endif
-+
-+#ifndef BTN_TOOL_DOUBLETAP
-+#define BTN_TOOL_DOUBLETAP 0x14d
-+#endif
-+
-+#ifndef BTN_TOOL_TRIPLETAP
-+#define BTN_TOOL_TRIPLETAP 0x14e
-+#endif
-+
-+#ifndef MSC_GESTURE
-+#define MSC_GESTURE 2
-+#endif
-+
-+#ifndef EV_SYNC
-+#define EV_SYNC 0
-+#endif
-+
-+#ifndef SYN_REPORT
-+#define SYN_REPORT 0
-+#endif
-+
-+#ifndef PSMOUSE_SYNAPTICS
-+#define PSMOUSE_SYNAPTICS 7
-+#endif
-+
-+#ifndef HAVE_INPUT_ID
-+struct input_id {
-+ unsigned short bustype;
-+ unsigned short vendor;
-+ unsigned short product;
-+ unsigned short version;
-+};
-+#endif
-+
-+#ifndef HAVE_INPUT_ABSINFO
-+struct input_absinfo {
-+ int value;
-+ int minimum;
-+ int maximum;
-+ int fuzz;
-+ int flat;
-+};
-+#endif
-+
-+#endif
-diff -urN gpm-1.20.1/src/headers/message.h gpm/src/headers/message.h
---- gpm-1.20.1/src/headers/message.h 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/headers/message.h 2003-10-02 01:22:42.000000000 -0500
-@@ -96,7 +96,6 @@
- " -S [commands] enable special commands (see man page)\n" \
- " -t mouse-type sets mouse type (default '%s')\n" \
- " Use a non-existent type (e.g. \"help\") to get a list\n" \
-- " -T test: read mouse, no clients\n" \
- " -v print version and exit\n" \
- " -V verbosity increase number of logged messages\n\n\n" \
- " Examples:\n\n" \
-@@ -168,7 +167,8 @@
- #define GPM_MESS_SELECT_TIMES "selected %i times"
-
- #define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\""
--#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\""
-+#define GPM_MESS_INVALID_ARG "%s: Invalid argument \"%s\" for option \"%s\""
-+#define GPM_MESS_MISSING_ARG "%s: Option \"%s\" requires an argument"
- #define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing"
- #define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\""
-
-@@ -196,7 +196,7 @@
-
- /* warnings */
- #define GPM_MESS_REQUEST_ON "Request on vc %i > %i"
--#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s"
-+#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %d"
- #define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25"
- #define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d"
- #define GPM_MESS_RESIZING "%s pid %i is resizing :-)"
-diff -urN gpm-1.20.1/src/headers/optparser.h gpm/src/headers/optparser.h
---- gpm-1.20.1/src/headers/optparser.h 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/headers/optparser.h 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,50 @@
-+/*
-+ * optparser.h - GPM mouse options parser
-+ *
-+ * Copyright (C) 1993 Andrew Haylett <ajh@gec-mrc.co.uk>
-+ * Copyright (C) 1994-2000 Alessandro Rubini <rubini@linux.it>
-+ * Copyright (C) 1998,1999 Ian Zimmerman <itz@rahul.net>
-+ * Copyright (C) 2001,2002 Nico Schottelius <nicos@pcsystems.de>
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+#ifndef __GPM_OPTPARSER_H_
-+#define __GPM_OPTPARSER_H_
-+
-+enum option_type {
-+ OPT_BOOL = 1,
-+ OPT_INT, /* "%i" */
-+ OPT_DEC, /* "%d" */
-+ OPT_STRING,
-+ /* other types must be added */
-+ OPT_END = 0
-+};
-+
-+struct option_helper {
-+ char *name;
-+ enum option_type type;
-+ union u {
-+ int *iptr; /* used for int and bool arguments */
-+ char **sptr; /* used for string arguments, by strdup()ing the value */
-+ } u;
-+ int value; /* used for boolean arguments */
-+ int present;
-+};
-+
-+int parse_options(const char *who, const char *opt, char sep, struct option_helper *info);
-+int check_no_options(const char *proto, const char *opts, char sep);
-+int is_option_present(struct option_helper *info, const char *name);
-+#endif
-diff -urN gpm-1.20.1/src/headers/selection.h gpm/src/headers/selection.h
---- gpm-1.20.1/src/headers/selection.h 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/headers/selection.h 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,37 @@
-+/*
-+ * console.h - GPM selection/paste handling
-+ *
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#ifndef __GPM_SELECTION_H_
-+#define __GPM_SELECTION_H_
-+
-+struct sel_options {
-+ int aged;
-+ int age_limit;
-+ int ptrdrag;
-+};
-+
-+struct Gpm_Event;
-+
-+extern struct sel_options sel_opts; /* only one exists */
-+
-+void do_selection(struct Gpm_Event *event, int three_button_mode);
-+void selection_disable_paste(void);
-+
-+#endif /* __GPM_CONSOLE_H_ */
-diff -urN gpm-1.20.1/src/headers/synaptics.h gpm/src/headers/synaptics.h
---- gpm-1.20.1/src/headers/synaptics.h 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/headers/synaptics.h 2003-10-02 01:22:42.000000000 -0500
-@@ -62,7 +62,7 @@
- **
- ** Process the touchpad 6/7/8 byte data.
- */
--void syn_process_serial_data (Gpm_Event *state,
-+void syn_process_serial_data (int fd, Gpm_Event *state,
- unsigned char *data);
-
-
-@@ -72,7 +72,7 @@
- **
- ** Process the touchpad 6 byte data.
- */
--void syn_process_ps2_data (Gpm_Event *state,
-+void syn_process_ps2_data (int fd, Gpm_Event *state,
- unsigned char *data);
-
-
-diff -urN gpm-1.20.1/src/lib/liblow.c gpm/src/lib/liblow.c
---- gpm-1.20.1/src/lib/liblow.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/lib/liblow.c 2003-10-02 01:22:42.000000000 -0500
-@@ -80,6 +80,8 @@
- int gpm_consolefd=-1; /* used to invoke ioctl() */
- int gpm_morekeys=0;
-
-+static char *consolename;
-+
- int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr);
-
- /*----------------------------------------------------------------------------*
-@@ -192,14 +194,13 @@
- char *tty = NULL;
- char *term = NULL;
- int i;
-- extern struct options option;
- static int checked_con = 0;
- struct sockaddr_un addr;
- struct winsize win;
- Gpm_Stst *new = NULL;
- char* sock_name = 0;
-
-- option.consolename = NULL;
-+ consolename = NULL;
-
- gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
-
-@@ -216,7 +217,7 @@
-
- /* check whether we know what name the console is: what's with the lib??? */
- if(checked_con == 0) {
-- option.consolename = Gpm_get_console();
-+ consolename = Gpm_get_console();
- checked_con++;
- }
-
-@@ -245,10 +246,10 @@
- conn->vc=0; /* default handler */
- if (flag > 0) { /* forced vc number */
- conn->vc=flag;
-- if((tty = malloc(strlen(option.consolename)+Gpm_cnt_digits(flag))) == NULL)
-+ if((tty = malloc(strlen(consolename)+Gpm_cnt_digits(flag))) == NULL)
- gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
-- memcpy(tty,option.consolename,strlen(option.consolename)-1);
-- sprintf(&tty[strlen(option.consolename)-1],"%i",flag);
-+ memcpy(tty,consolename,strlen(consolename)-1);
-+ sprintf(&tty[strlen(consolename)-1],"%i",flag);
- } else { /* use your current vc */
- if (isatty(0)) tty = ttyname(0); /* stdin */
- if (!tty && isatty(1)) tty = ttyname(1); /* stdout */
-@@ -258,13 +259,13 @@
- goto err;
- }
- /* do we really need this check ? */
-- if(strncmp(tty,option.consolename,strlen(option.consolename)-1)
-- || !isdigit(tty[strlen(option.consolename)-1])) {
-- gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed");
-+ if(strncmp(tty,consolename,strlen(consolename)-1)
-+ || !isdigit(tty[strlen(consolename)-1])) {
-+ gpm_report(GPM_PR_ERR,"strncmp/isdigit/consolename failed");
- goto err;
- }
-
-- conn->vc=atoi(&tty[strlen(option.consolename)-1]);
-+ conn->vc=atoi(&tty[strlen(consolename)-1]);
- }
-
- if (gpm_consolefd == -1)
-@@ -272,6 +273,8 @@
- gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno));
- goto err;
- }
-+
-+ if (flag > 0) free(tty);
- }
-
- new->info=*conn;
-diff -urN gpm-1.20.1/src/lib/tools.c gpm/src/lib/tools.c
---- gpm-1.20.1/src/lib/tools.c 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/lib/tools.c 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,93 @@
-+/*
-+ * tools.c - tools which are needed by client and server
-+ *
-+ * Copyright (c) 2001 Nico Schottelius <nico@schottelius.org>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#include <stdio.h> /* NULL */
-+#include <string.h>
-+#include <stdlib.h>
-+#include <sys/types.h> /* these three are */
-+#include <sys/stat.h> /* needed for */
-+#include <unistd.h> /* stat() */
-+
-+#include "headers/gpmInt.h" /* only used for some defines */
-+#include "headers/message.h"
-+
-+/*****************************************************************************
-+ * check, whether devfs is used or not.
-+ * See /usr/src/linux/Documentation/filesystems/devfs/ for details.
-+ * Returns: the name of the console (/dev/tty0 or /dev/vc/0)
-+ *****************************************************************************/
-+char *Gpm_get_console( void )
-+{
-+
-+ char *back = NULL, *tmp = NULL;
-+ struct stat buf;
-+
-+ /* first try the devfs device, because in the next time this will be
-+ * the preferred one. If that fails, take the old console */
-+
-+ /* Check for open new console */
-+ if (stat(GPM_DEVFS_CONSOLE,&buf) == 0)
-+ tmp = GPM_DEVFS_CONSOLE;
-+
-+ /* Failed, try OLD console */
-+ else if(stat(GPM_OLD_CONSOLE,&buf) == 0)
-+ tmp = GPM_OLD_CONSOLE;
-+
-+ if(tmp != NULL)
-+ if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL)
-+ strcpy(back,tmp);
-+
-+ return(back);
-+}
-+
-+/* what's the english name for potenz ? */
-+int Gpm_x_high_y(int base, int pot_y)
-+{
-+ int val = 1;
-+
-+ if(pot_y == 0) val = 1;
-+ else if(pot_y < 0) val = 0; /* ugly hack ;) */
-+ else while(pot_y > 0) {
-+ val = val * base;
-+ pot_y--;
-+ }
-+ return val;
-+}
-+
-+/* return characters needed to display int */
-+int Gpm_cnt_digits(int number)
-+{
-+ /* 0-9 = 1 10^0 <-> (10^1)-1
-+ * 10 - 99 = 2 10^1 <-> (10^2)-1
-+ * 100 - 999 = 3 10^2 <-> (10^3)-1
-+ * 1000 - 9999 = 4 ... */
-+
-+ int ret = 0, num = 0;
-+
-+ /* non negative, please */
-+ if(number < 0) number *= -1;
-+ else if(number == 0) ret = 1;
-+ else while(number > num) {
-+ ret++;
-+ num = (Gpm_x_high_y(10,ret) - 1);
-+ }
-+
-+ return(ret);
-+}
-diff -urN gpm-1.20.1/src/Makefile.in gpm/src/Makefile.in
---- gpm-1.20.1/src/Makefile.in 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/Makefile.in 2003-10-02 01:22:42.000000000 -0500
-@@ -12,15 +12,16 @@
- include $(top_builddir)/Makefile.include
-
- # Main portion: regular build rules
-+MICESRC = mice.c twiddler.c synaptics.c @EVDEV_SRCS@
-
--GSRC = main.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c \
-- startup.c server_tools.c
-+GSRC = main.c gpm.c gpn.c special.c startup.c server_tools.c console.c \
-+ selection.c client.c optparser.c $(MICESRC)
-
--GOBJ = $(GSRC:.c=.o) report.o tools.o
-+GOBJ = $(GSRC:.c=.o) report.o
-
--LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c
-+LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c lib/tools.c
-
--LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@
-+LOBJ = $(LSRC:.c=.o) @CURSES_OBJS@
-
- PICS = $(LOBJ:.o=.lo)
-
-@@ -143,7 +144,7 @@
- $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $<
- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a
-
--prog/mouse-test: mice.o twiddler.o synaptics.o
-+prog/mouse-test: $(MICESRC:.c=.o) console.o optparser.o
-
- $(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a
-
-diff -urN gpm-1.20.1/src/mice.c gpm/src/mice.c
---- gpm-1.20.1/src/mice.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/mice.c 2003-10-02 01:22:42.000000000 -0500
-@@ -46,15 +46,11 @@
- #include <string.h>
- #include <stdlib.h>
- #include <termios.h>
--#include <fcntl.h>
--#include <termios.h>
- #include <errno.h>
- #include <unistd.h>
- #include <ctype.h>
-
--#include <sys/types.h>
- #include <sys/stat.h> /* stat() */
--#include <sys/time.h> /* select() */
-
- #include <linux/kdev_t.h> /* MAJOR */
- #include <linux/keyboard.h>
-@@ -72,135 +68,40 @@
-
-
- #include "headers/gpmInt.h"
-+#include "headers/console.h"
- #include "headers/twiddler.h"
- #include "headers/synaptics.h"
- #include "headers/message.h"
--
--/*========================================================================*/
--/* Parsing argv: helper dats struct function (should they get elsewhere?) */
--/*========================================================================*/
--
--enum argv_type {
-- ARGV_BOOL = 1,
-- ARGV_INT, /* "%i" */
-- ARGV_DEC, /* "%d" */
-- ARGV_STRING,
-- /* other types must be added */
-- ARGV_END = 0
--};
--
--typedef struct argv_helper {
-- char *name;
-- enum argv_type type;
-- union u {
-- int *iptr; /* used for int and bool arguments */
-- char **sptr; /* used for string arguments, by strdup()ing the value */
-- } u;
-- int value; /* used for boolean arguments */
--} argv_helper;
--
--static int parse_argv(argv_helper *info, int argc, char **argv)
--{
-- int i, j = 0, errors = 0;
-- long l;
-- argv_helper *p;
-- char *s, *t;
-- int base = 0; /* for strtol */
--
--
-- for (i=1; i<argc; i++) {
-- for (p = info; p->type != ARGV_END; p++) {
-- j = strlen(p->name);
-- if (strncmp(p->name, argv[i], j))
-- continue;
-- if (isalnum(argv[i][j]))
-- continue;
-- break;
-- }
-- if (p->type == ARGV_END) { /* not found */
-- fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n",
-- option.progname, argv[i], argv[0]);
-- errors++;
-- continue;
-- }
-- /* Found. Look for trailing stuff, if any */
-- s = argv[i]+j;
-- while (*s && isspace(*s)) s++; /* skip spaces */
-- if (*s == '=') s++; /* skip equal */
-- while (*s && isspace(*s)) s++; /* skip other spaces */
--
-- /* Now parse what s is */
-- switch(p->type) {
-- case ARGV_BOOL:
-- if (*s) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG,option.progname,p->name,s);
-- errors++;
-- }
-- *(p->u.iptr) = p->value;
-- break;
--
-- case ARGV_DEC:
-- base = 10; /* and fall through */
-- case ARGV_INT:
-- l = strtol(s, &t, base);
-- if (*t) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name);
-- errors++;
-- break;
-- }
-- *(p->u.iptr) = (int)l;
-- break;
--
-- case ARGV_STRING:
-- *(p->u.sptr) = strdup(s);
-- break;
--
-- case ARGV_END: /* let's please "-Wall" */
-- break;
-- }
-- } /* for i in argc */
-- if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname);
-- return errors;
--}
--
--/*========================================================================*/
--/* Provide a common error engine by parsing with an empty option-set */
--/*========================================================================*/
--static volatile int check_no_argv(int argc, char **argv)
--{
-- static argv_helper optioninfo[] = {
-- {"", ARGV_END}
-- };
-- return parse_argv(optioninfo, argc, argv);
--}
-+#include "headers/optparser.h"
-
- /*========================================================================*/
- /* Parse the "old" -o options */
- /*========================================================================*/
--static int option_modem_lines(int fd, int argc, char **argv)
-+static int option_modem_lines(int fd, char *proto, char *opts)
- {
-- static unsigned int err, lines, reallines;
-+ static unsigned int lines, reallines;
-+ static struct option_helper optioninfo[] = {
-+ {"dtr", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_DTR},
-+ {"rts", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_RTS},
-+ {"both", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS},
-+ {"", OPT_END}
-+ };
-
-- static argv_helper optioninfo[] = {
-- {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR},
-- {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS},
-- {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS},
-- {"", ARGV_END}
-- };
-+ int rslt = parse_options(proto, opts, ',', optioninfo);
-
-- if (argc<2) return 0;
-- if (argc > 2) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]);
-+ if (rslt < 0) {
-+ errno = EINVAL;
-+ return -1;
-+ } else if (rslt > 1) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_TOO_MANY_OPTS, option.progname, proto);
- errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */
- return -1;
-+ } else if (rslt == 1) {
-+ /* ok, move the lines */
-+ ioctl(fd, TIOCMGET, &reallines);
-+ reallines &= ~lines;
-+ ioctl(fd, TIOCMSET, &reallines);
- }
-- err = parse_argv(optioninfo, argc, argv);
-- if(err) return 0; /* a message has been printed, but go on as good */
--
-- /* ok, move the lines */
-- ioctl(fd, TIOCMGET, &reallines);
-- reallines &= ~lines;
-- ioctl(fd, TIOCMSET, &reallines);
- return 0;
- }
-
-@@ -233,28 +134,12 @@
- /*========================================================================*/
-
- #ifdef HAVE_LINUX_INPUT_H
--static int M_evdev (Gpm_Event * state, unsigned char *data)
--{
-- struct input_event thisevent;
-- (void) memcpy (&thisevent, data, sizeof (struct input_event));
-- if (thisevent.type == EV_REL) {
-- if (thisevent.code == REL_X)
-- state->dx = (signed char) thisevent.value;
-- else if (thisevent.code == REL_Y)
-- state->dy = (signed char) thisevent.value;
-- } else if (thisevent.type == EV_KEY) {
-- switch(thisevent.code) {
-- case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break;
-- case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break;
-- case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break;
-- case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break;
-- }
-- }
-- return 0;
--}
-+/* defined in evdev.c */
-+extern int M_evdev(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state);
-+extern int I_evdev(struct micedev *dev, struct miceopt *opt, Gpm_Type *type);
- #endif /* HAVE_LINUX_INPUT_H */
-
--static int M_ms(Gpm_Event *state, unsigned char *data)
-+static int M_ms(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /*
- * some devices report a change of middle-button state by
-@@ -273,7 +158,7 @@
- return 0;
- }
-
--static int M_ms_plus(Gpm_Event *state, unsigned char *data)
-+static int M_ms_plus(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- static unsigned char prev=0;
-
-@@ -293,7 +178,7 @@
- return 0;
- }
-
--static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data)
-+static int M_ms_plus_lr(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /*
- * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS
-@@ -329,19 +214,19 @@
- int SUMMA_BORDER=100;
- int summamaxx,summamaxy;
- char summaid=-1;
--static int M_summa(Gpm_Event *state, unsigned char *data)
-+static int M_summa(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- int x, y;
-
- x = ((data[2]<<7) | data[1])-SUMMA_BORDER;
- if (x<0) x=0;
- if (x>summamaxx) x=summamaxx;
-- state->x = (x * win.ws_col / summamaxx);
-+ state->x = (x * console.max_x / summamaxx);
- realposx = (x * 16383 / summamaxx);
-
- y = ((data[4]<<7) | data[3])-SUMMA_BORDER;
- if (y<0) y=0; if (y>summamaxy) y=summamaxy;
-- state->y = 1 + y * (win.ws_row-1)/summamaxy;
-+ state->y = 1 + y * (console.max_y-1)/summamaxy;
- realposy = y * 16383 / summamaxy;
-
- state->buttons=
-@@ -396,7 +281,7 @@
-
-
- /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */
--static int M_geni(Gpm_Event *state, unsigned char *data)
-+static int M_geni(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /* this is a little confusing. If we use the stylus, we
- * have three buttons (tip, lower, upper), and if
-@@ -419,7 +304,7 @@
-
-
- /* m$ 'Intellimouse' (steveb 20/7/97) */
--static int M_ms3(Gpm_Event *state, unsigned char *data)
-+static int M_ms3(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->wdx = state->wdy = 0;
- state->buttons= ((data[0] & 0x20) >> 3) /* left */
-@@ -470,7 +355,7 @@
- }
-
- /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */
--static int M_brw(Gpm_Event *state, unsigned char *data)
-+static int M_brw(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= ((data[0] & 0x20) >> 3) /* left */
- | ((data[3] & 0x20) >> 4) /* middle */
-@@ -491,7 +376,7 @@
- return 0;
- }
-
--static int M_bare(Gpm_Event *state, unsigned char *data)
-+static int M_bare(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /* a bare ms protocol */
- state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4);
-@@ -500,7 +385,7 @@
- return 0;
- }
-
--static int M_sun(Gpm_Event *state, unsigned char *data)
-+static int M_sun(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= (~data[0]) & 0x07;
- state->dx= (signed char)(data[1]);
-@@ -508,7 +393,7 @@
- return 0;
- }
-
--static int M_msc(Gpm_Event *state, unsigned char *data)
-+static int M_msc(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= (~data[0]) & 0x07;
- state->dx= (signed char)(data[1]) + (signed char)(data[3]);
-@@ -558,7 +443,7 @@
-
- }
-
--static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */
-+static int M_logimsc(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= (~data[0]) & 0x07;
- state->dx= (signed char)(data[1]) + (signed char)(data[3]);
-@@ -566,7 +451,7 @@
- return 0;
- }
-
--static int M_mm(Gpm_Event *state, unsigned char *data)
-+static int M_mm(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= data[0] & 0x07;
- state->dx= (data[0] & 0x10) ? data[1] : - data[1];
-@@ -574,7 +459,7 @@
- return 0;
- }
-
--static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */
-+static int M_logi(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= data[0] & 0x07;
- state->dx= (data[0] & 0x10) ? data[1] : - data[1];
-@@ -582,7 +467,7 @@
- return 0;
- }
-
--static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */
-+static int M_bm(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- state->buttons= (~data[0]) & 0x07;
- state->dx= (signed char)data[1];
-@@ -590,7 +475,7 @@
- return 0;
- }
-
--static int M_ps2(Gpm_Event *state, unsigned char *data)
-+static int M_ps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- static int tap_active=0; /* there exist glidepoint ps2 mice */
-
-@@ -599,8 +484,8 @@
- !!(data[0]&2) * GPM_B_RIGHT +
- !!(data[0]&4) * GPM_B_MIDDLE;
-
-- if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */
-- state->buttons = tap_active = opt_glidepoint_tap;
-+ if (data[0]==0 && opt->glidepoint_tap) /* by default this is false */
-+ state->buttons = tap_active = opt->glidepoint_tap;
- else if (tap_active) {
- if (data[0]==8)
- state->buttons = tap_active = 0;
-@@ -623,10 +508,11 @@
- state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]);
- else
- state->dy = 0;
-+
- return 0;
- }
-
--static int M_imps2(Gpm_Event *state, unsigned char *data)
-+static int M_imps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
-
- static int tap_active=0; /* there exist glidepoint ps2 mice */
-@@ -636,8 +522,8 @@
- state->buttons= ((data[0] & 1) << 2) /* left */
- | ((data[0] & 6) >> 1); /* middle and right */
-
-- if (data[0]==0 && opt_glidepoint_tap) // by default this is false
-- state->buttons = tap_active = opt_glidepoint_tap;
-+ if (data[0]==0 && opt->glidepoint_tap) // by default this is false
-+ state->buttons = tap_active = opt->glidepoint_tap;
- else if (tap_active) {
- if (data[0]==8)
- state->buttons = tap_active = 0;
-@@ -667,7 +553,7 @@
-
- }
-
--static int M_netmouse(Gpm_Event *state, unsigned char *data)
-+static int M_netmouse(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /* Avoid these beasts if you can. They connect to normal PS/2 port,
- * but their protocol is one byte longer... So if you have notebook
-@@ -706,47 +592,45 @@
- }
-
- /* standard ps2 */
--static Gpm_Type *I_ps2(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+int I_ps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, };
-- write (fd, s, sizeof (s));
-+ write(dev->fd, s, sizeof (s));
- usleep (30000);
-- tcflush (fd, TCIFLUSH);
-- return type;
-+ tcflush (dev->fd, TCIFLUSH);
-+ return 0;
- }
-
--static Gpm_Type *I_netmouse(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_netmouse(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 };
- int i;
-
-- if (check_no_argv(argc, argv)) return NULL;
-+ if (!check_no_options(type->name, opt->text, ',')) return -1;
- for (i=0; i<6; i++) {
- unsigned char c = 0;
-- write( fd, magic+i, 1 );
-- read( fd, &c, 1 );
-+ write(dev->fd, magic+i, 1 );
-+ read(dev->fd, &c, 1 );
- if (c != 0xfa) {
- gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c);
-- return NULL;
-+ return -1;
- }
- }
- {
- unsigned char rep[3] = { 0, 0, 0 };
-- read( fd, rep, 1 );
-- read( fd, rep+1, 1 );
-- read( fd, rep+2, 1 );
-+ read( dev->fd, rep, 1 );
-+ read( dev->fd, rep+1, 1 );
-+ read( dev->fd, rep+2, 1 );
- if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) {
- gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]);
-- return NULL;
-+ return -1;
- }
- }
-- return type;
-+ return 0;
- }
-
- #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT)
--static int M_mman(Gpm_Event *state, unsigned char *data)
-+static int M_mman(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /*
- * the damned MouseMan has 3/4 bytes packets. The extra byte
-@@ -784,7 +668,7 @@
- mytype->getextra=1;
- } else {
- if (b & 0x2) prev |= GPM_B_MIDDLE;
-- if (b & 0x1) prev |= opt_glidepoint_tap;
-+ if (b & 0x1) prev |= opt->glidepoint_tap;
- }
- }
- state->buttons=prev;
-@@ -828,7 +712,7 @@
-
- #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name))
-
--static int M_wacom(Gpm_Event *state, unsigned char *data)
-+static int M_wacom(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- static int ox=-1, oy;
- int x, y;
-@@ -878,8 +762,8 @@
- if (WacomAbsoluteWanted) { /* Absolute Mode */
- if (x>wmaxx) x=wmaxx; if (x<0) x=0;
- if (y>wmaxy) y=wmaxy; if (y<0) y=0;
-- state->x = (x * win.ws_col / wmaxx);
-- state->y = (y * win.ws_row / wmaxy);
-+ state->x = (x * console.max_x / wmaxx);
-+ state->y = (y * console.max_y / wmaxy);
-
- realposx = (x / wmaxx); /* this two lines come from the summa driver. */
- realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */
-@@ -889,8 +773,8 @@
- if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold)
- || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y;
-
-- state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold);
-- state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold);
-+ state->dx= (x-ox) / (wmaxx / console.max_x / wcmodell[WacomModell].treshold);
-+ state->dy= (y-oy) / (wmaxy / console.max_y / wcmodell[WacomModell].treshold);
- }
-
- ox=x; oy=y;
-@@ -918,7 +802,7 @@
- #define CAL_Y_MAX 0xF40
- #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN)
-
--static int M_calus(Gpm_Event *state, unsigned char *data)
-+static int M_calus(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- int x, y;
-
-@@ -932,12 +816,12 @@
- state->dx = 0; state->dy = 0;
-
- state->x = x < CAL_X_MIN ? 0
-- : x > CAL_X_MAX ? win.ws_col+1
-- : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2;
-+ : x > CAL_X_MAX ? console.max_x+1
-+ : (long)(x-CAL_X_MIN) * (long)(console.max_x-1) / CAL_X_SIZE+2;
-
-- state->y = y < CAL_Y_MIN ? win.ws_row + 1
-+ state->y = y < CAL_Y_MIN ? console.max_y + 1
- : y > CAL_Y_MAX ? 0
-- : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1;
-+ : (long)(CAL_Y_MAX-y) * (long)console.max_y / CAL_Y_SIZE + 1;
-
- realposx = x < CAL_X_MIN ? 0
- : x > CAL_X_MAX ? 16384
-@@ -950,7 +834,7 @@
- return 0;
- }
-
--static int M_calus_rel(Gpm_Event *state, unsigned char *data)
-+static int M_calus_rel(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- static int ox=-1, oy;
- int x, y;
-@@ -984,7 +868,7 @@
- #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X)
- #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y)
-
--static int M_ncr(Gpm_Event *state, unsigned char *data)
-+static int M_ncr(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- int x,y;
-
-@@ -1002,14 +886,14 @@
- state->x = x < NCR_LEFT_X
- ? 0
- : x > NCR_RIGHT_X
-- ? win.ws_col+1
-- : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2;
-+ ? console.max_x+1
-+ : (long)(x-NCR_LEFT_X) * (long)(console.max_x-1) / NCR_DELTA_X+2;
-
- state->y = y < NCR_BOTTOM_Y
-- ? win.ws_row + 1
-+ ? console.max_y + 1
- : y > NCR_TOP_Y
- ? 0
-- : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1;
-+ : (long)(NCR_TOP_Y-y) * (long)console.max_y / NCR_DELTA_Y + 1;
-
- realposx = x < NCR_LEFT_X
- ? 0
-@@ -1026,7 +910,7 @@
- return 0;
- }
-
--static int M_twid(Gpm_Event *state, unsigned char *data)
-+static int M_twid(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- unsigned long message=0UL; int i,h,v;
- static int lasth, lastv, lastkey, key, lock=0, autorepeat=0;
-@@ -1144,7 +1028,7 @@
- #ifdef HAVE_LINUX_JOYSTICK_H
- /* Joystick mouse emulation (David Given) */
-
--static int M_js(Gpm_Event *state, unsigned char *data)
-+static int M_js(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- struct JS_DATA_TYPE *jdata = (void*)data;
- static int centerx = 0;
-@@ -1193,21 +1077,21 @@
- #endif /* have joystick.h */
-
- /* Synaptics TouchPad mouse emulation (Henry Davies) */
--static int M_synaptics_serial(Gpm_Event *state, unsigned char *data)
-+static int M_synaptics_serial(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
-- syn_process_serial_data (state, data);
-+ syn_process_serial_data(dev->fd, state, data);
- return 0;
- }
-
-
- /* Synaptics TouchPad mouse emulation (Henry Davies) */
--static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data)
-+static int M_synaptics_ps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
-- syn_process_ps2_data(state, data);
-+ syn_process_ps2_data(dev->fd, state, data);
- return 0;
- }
-
--static int M_mtouch(Gpm_Event *state, unsigned char *data)
-+static int M_mtouch(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /*
- * This is a simple decoder for the MicroTouch touch screen
-@@ -1219,8 +1103,8 @@
- static int upx, upy; /* keep track of last finger-up place */
- static struct timeval uptv, tv; /* time of last up, and down events */
-
-- #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF)
-- #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF)
-+ #define REAL_TO_XCELL(x) (x * console.max_x / 0x3FFF)
-+ #define REAL_TO_YCELL(y) (y * console.max_y / 0x3FFF)
-
- #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
- #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \
-@@ -1245,7 +1129,7 @@
-
- if (avgx < 0) { /* press event */
- GET_TIME(tv);
-- if (DIF_TIME(uptv, tv) < opt_time) {
-+ if (DIF_TIME(uptv, tv) < opt->time) {
- /* count as button press placed at finger-up pixel */
- state->buttons = GPM_B_LEFT;
- realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx);
-@@ -1287,7 +1171,7 @@
- static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */
- static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */
-
--static int M_gunze(Gpm_Event *state, unsigned char *data)
-+static int M_gunze(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- /*
- * This generates button-1 events, by now.
-@@ -1300,8 +1184,8 @@
- static struct timeval uptv, tv; /* time of last up, and down events */
- int timediff;
-
-- #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF)
-- #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF)
-+ #define REAL_TO_XCELL(x) (x * console.max_x / 0x3FFF)
-+ #define REAL_TO_YCELL(y) (y * console.max_y / 0x3FFF)
-
- #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
- #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \
-@@ -1350,7 +1234,7 @@
- GET_TIME(tv);
- timediff = DIF_TIME(uptv, tv);
- released = 0;
-- if (timediff > gunze_debounce && timediff < opt_time) {
-+ if (timediff > gunze_debounce && timediff < opt->time) {
- /* count as button press placed at finger-up pixel */
- dragging = 1;
- state->buttons = GPM_B_LEFT;
-@@ -1399,7 +1283,7 @@
- /* corresponding correction of the protocol identification */
- /* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */
-
--static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data)
-+static int M_vsxxx_aa(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
-
- /* The mouse protocol is as follows:
-@@ -1449,16 +1333,16 @@
- /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */
- static int wizardpad_width = -1;
- static int wizardpad_height = -1;
--static int M_wp(Gpm_Event *state, unsigned char *data)
-+static int M_wp(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state)
- {
- int x, y, pressure;
-
- x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f);
-- state->x = x * win.ws_col / (wizardpad_width * 40);
-+ state->x = x * console.max_x / (wizardpad_width * 40);
- realposx = x * 16383 / (wizardpad_width * 40);
-
- y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f);
-- state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1;
-+ state->y = console.max_y - y * console.max_y / (wizardpad_height * 40) - 1;
- realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1;
-
- pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f);
-@@ -1475,11 +1359,9 @@
- /*========================================================================*/
- /* Then, mice should be initialized */
-
--static Gpm_Type* I_empty(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_empty(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
-- if (check_no_argv(argc, argv)) return NULL;
-- return type;
-+ return check_no_options(type->name, opt->text, ',') ? 0 : -1;
- }
-
- static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags)
-@@ -1536,28 +1418,27 @@
- {125,"Q"},
- {1E9,"N"}, };
-
--static Gpm_Type* I_serial(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_serial(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- int i; unsigned char c;
- fd_set set; struct timeval timeout={0,0}; /* used when not debugging */
-
- /* accept "-o dtr", "-o rts" and "-o both" */
-- if (option_modem_lines(fd, argc, argv)) return NULL;
-+ if (option_modem_lines(dev->fd, type->name, opt->text)) return -1;
-
- #ifndef DEBUG
- /* flush any pending input (thanks, Miguel) */
- FD_ZERO(&set);
- for(i=0; /* always */ ; i++) {
-- FD_SET(fd,&set);
-- switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){
-- case 1: if (read(fd,&c,1)==0) break;
-+ FD_SET(dev->fd,&set);
-+ switch(select(dev->fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){
-+ case 1: if (read(dev->fd,&c,1)==0) break;
- case -1: continue;
- }
- break;
- }
-
-- if (type->fun==M_logimsc) write(fd, "QU", 2 );
-+ if (type->fun==M_logimsc) write(dev->fd, "QU", 2 );
-
- #if 0 /* Did this ever work? -- I don't know, but should we not remove it,
- * if it doesn't work ??? -- Nico */
-@@ -1570,7 +1451,7 @@
-
- /* Non mman: change from any available speed to the chosen one */
- for (i=9600; i>=1200; i/=2)
-- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags);
-+ setspeed(dev->fd, i, opt->baud, (type->fun != M_mman) /* write */, type->flags);
-
- /*
- * reset the MouseMan/TrackMan to use the 3/4 byte protocol
-@@ -1578,51 +1459,50 @@
- * Changed after 1.14; why not having "I_mman" now?
- */
- if (type->fun==M_mman) {
-- setspeed(fd, 1200, 1200, 0, flags); /* no write */
-- write(fd, "*X", 2);
-- setspeed(fd, 1200, opt_baud, 0, flags); /* no write */
-- return type;
-+ setspeed(dev->fd, 1200, 1200, 0, type->flags); /* no write */
-+ write(dev->fd, "*X", 2);
-+ setspeed(dev->fd, 1200, opt->baud, 0, type->flags); /* no write */
-+ return 0;
- }
-
- if(type->fun==M_geni) {
- gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI);
-- setspeed(fd, 1200, 9600, 1, flags); /* write */
-- write(fd, ":" ,1);
-- write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */
-- write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */
-+ setspeed(dev->fd, 1200, 9600, 1, type->flags); /* write */
-+ write(dev->fd, ":" ,1);
-+ write(dev->fd, "E" ,1); /* setup tablet. relative mode, resolution... */
-+ write(dev->fd, "@" ,1); /* setup tablet. relative mode, resolution... */
- }
-
- if (type->fun==M_synaptics_serial) {
- int packet_length;
-
-- setspeed (fd, 1200, 1200, 1, flags);
-- packet_length = syn_serial_init (fd);
-- setspeed (fd, 1200, 9600, 1, flags);
-+ setspeed (dev->fd, 1200, 1200, 1, type->flags);
-+ packet_length = syn_serial_init (dev->fd);
-+ setspeed (dev->fd, 1200, 9600, 1, type->flags);
-
- type->packetlen = packet_length;
- type->howmany = packet_length;
- }
-
- if (type->fun==M_vsxxx_aa) {
-- setspeed (fd, 4800, 4800, 0, flags); /* no write */
-- write(fd, "R", 1); /* initialize a mouse; without getting an "R" */
-+ setspeed (dev->fd, 4800, 4800, 0, type->flags); /* no write */
-+ write(dev->fd, "R", 1); /* initialize a mouse; without getting an "R" */
- /* a mouse does not send a bytestream */
- }
-
-- return type;
-+ return 0;
- }
-
--static Gpm_Type* I_logi(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_logi(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- int i;
- struct stat buf;
- int busmouse;
-
-- if (check_no_argv(argc, argv)) return NULL;
-+ if (!check_no_options(type->name, opt->text, ',')) return -1;
-
- /* is this a serial- or a bus- mouse? */
-- if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT);
-+ if(fstat(dev->fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT);
- i=MAJOR(buf.st_rdev);
-
- /* I don't know why this is herein, but I remove it. I don't think a
-@@ -1635,21 +1515,20 @@
- type->howmany = busmouse ? 3 : 1;
-
- /* change from any available speed to the chosen one */
-- for (i=9600; i>=1200; i/=2) setspeed(fd, i, opt_baud, 1 /* write */, flags);
-+ for (i=9600; i>=1200; i/=2) setspeed(dev->fd, i, opt->baud, 1 /* write */, type->flags);
-
- /* this stuff is peculiar of logitech mice, also for the serial ones */
-- write(fd, "S", 1);
-- setspeed(fd, opt_baud, opt_baud, 1 /* write */,
-+ write(dev->fd, "S", 1);
-+ setspeed(dev->fd, opt->baud, opt->baud, 1 /* write */,
- CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL);
-
- /* configure the sample rate */
-- for (i=0;opt_sample<=sampletab[i].sample;i++) ;
-- write(fd,sampletab[i].code,1);
-- return type;
-+ for (i=0;opt->sample<=sampletab[i].sample;i++) ;
-+ write(dev->fd,sampletab[i].code,1);
-+ return 0;
- }
-
--static Gpm_Type *I_wacom(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_wacom(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- /* wacom graphire tablet */
- #define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */
-@@ -1664,19 +1543,19 @@
- {
- /* Init Wacom communication; this is modified from xf86Wacom.so module */
- /* Set speed to 19200 */
-- setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL);
-+ setspeed (dev->fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL);
- /* Send Reset Baudrate Command */
-- write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
-+ write(dev->fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
- usleep(250000);
- /* Send Reset Command */
-- write(fd, UD_RESET, strlen(UD_RESET));
-+ write(dev->fd, UD_RESET, strlen(UD_RESET));
- usleep(75000);
- /* Set speed to 9600bps */
-- setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL);
-+ setspeed (dev->fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL);
- /* Send Reset Command */
-- write(fd, UD_RESET, strlen(UD_RESET));
-+ write(dev->fd, UD_RESET, strlen(UD_RESET));
- usleep(250000);
-- write(fd, UD_STOP, strlen(UD_STOP));
-+ write(dev->fd, UD_STOP, strlen(UD_STOP));
- usleep(100000);
- }
-
-@@ -1690,7 +1569,7 @@
- struct timeval timeout;
- fd_set readfds;
- int err;
-- FD_ZERO(&readfds); FD_SET(fd, &readfds);
-+ FD_ZERO(&readfds); FD_SET(dev->fd, &readfds);
- timeout.tv_sec = 0; timeout.tv_usec = 200000;
- err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
- return((err>0)?1:err);
-@@ -1706,11 +1585,11 @@
- * Get Data to buffer until full or timeout.
- * Give back 0 for timeout and !0 for buffer full
- */
-- if (cmd) write(fd,cmd,strlen(cmd));
-+ if (cmd) write(dev->fd,cmd,strlen(cmd));
- memset(buffer,0,sizeof(buffer)); p=buffer;
- err=wait_wacom();
- while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) {
-- p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer));
-+ p+= read(dev->fd,p,(sizeof(buffer)-1)-(p-buffer));
- err=wait_wacom();
- }
- /* return 1 for buffer full */
-@@ -1728,13 +1607,14 @@
- */
-
- /* accept boolean options absolute and relative */
-- static argv_helper optioninfo[] = {
-- {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0},
-- {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0},
-- {"", ARGV_END}
-+ static struct option_helper optioninfo[] = {
-+ {"absolute", OPT_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0},
-+ {"relative", OPT_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0},
-+ {"", OPT_END}
- };
-- parse_argv(optioninfo, argc, argv);
-- type->absolute = WacomAbsoluteWanted;
-+
-+ parse_options(type->name, opt->text, ',', optioninfo);
-+ opt->absolute = WacomAbsoluteWanted;
- reset_wacom();
-
- /* "Flush" input queque */
-@@ -1756,7 +1636,7 @@
- }
- if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL)))
- WacomModell=-1;
-- gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R',
-+ gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, opt->absolute? 'A':'R',
- (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name,
- buffer+2);
-
-@@ -1767,24 +1647,23 @@
- wmaxx = (wmaxx-wcmodell[WacomModell].border);
- wmaxy = (wmaxy-wcmodell[WacomModell].border);
- }
-- write(fd,UD_SENDCOORDS,4);
-+ write(dev->fd,UD_SENDCOORDS,4);
-
-- return type;
-+ return 0;
- }
-
--static Gpm_Type *I_pnp(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_pnp(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- struct termios tty;
-
- /* accept "-o dtr", "-o rts" and "-o both" */
-- if (option_modem_lines(fd, argc, argv)) return NULL;
-+ if (option_modem_lines(dev->fd, type->name, opt->text)) return -1;
-
- /*
- * Just put the device to 1200 baud. Thanks to Francois Chastrette
- * for his great help and debugging with his own pnp device.
- */
-- tcgetattr(fd, &tty);
-+ tcgetattr(dev->fd, &tty);
-
- tty.c_iflag = IGNBRK | IGNPAR;
- tty.c_oflag = 0;
-@@ -1792,15 +1671,15 @@
- tty.c_line = 0;
- tty.c_cc[VTIME] = 0;
- tty.c_cc[VMIN] = 1;
-- tty.c_cflag = flags | B1200;
-- tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */
-+ tty.c_cflag = type->flags | B1200;
-+ tcsetattr(dev->fd, TCSAFLUSH, &tty); /* set parameters */
-
- /*
- * Don't read the silly initialization string. I don't want to see
- * the vendor name: it is only propaganda, with no information.
- */
-
-- return type;
-+ return 0;
- }
-
- /*
-@@ -1848,8 +1727,7 @@
-
- /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */
- /* Autodetect: Steve Bennett */
--static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type,
-- int argc, char **argv)
-+static int I_imps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- int id;
- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 };
-@@ -1857,36 +1735,36 @@
- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, };
-
- /* Do a basic init in case the mouse is confused */
-- write_to_mouse(fd, basic_init, sizeof (basic_init));
-+ write_to_mouse(dev->fd, basic_init, sizeof (basic_init));
-
- /* Now try again and make sure we have a PS/2 mouse */
-- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) {
-+ if (write_to_mouse(dev->fd, basic_init, sizeof (basic_init)) != 0) {
- gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT);
-- return(NULL);
-+ return -1;
- }
-
- /* Try to switch to 3 button mode */
-- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) {
-+ if (write_to_mouse(dev->fd, imps2_init, sizeof (imps2_init)) != 0) {
- gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED);
-- return(NULL);
-+ return -1;
- }
-
- /* Read the mouse id */
-- id = read_mouse_id(fd);
-+ id = read_mouse_id(dev->fd);
- if (id == GPM_AUX_ID_ERROR) {
- gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL);
- id = GPM_AUX_ID_PS2;
- }
-
- /* And do the real initialisation */
-- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) {
-+ if (write_to_mouse(dev->fd, ps2_init, sizeof (ps2_init)) != 0) {
- gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL);
- }
-
- if (id == GPM_AUX_ID_IMPS2) {
- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */
- gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO);
-- return type;
-+ return 0;
- }
- if (id != GPM_AUX_ID_PS2) {
- gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id);
-@@ -1894,69 +1772,64 @@
- else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2);
-
- for (type=mice; type->fun; type++)
-- if (strcmp(type->name, "ps2") == 0) return(type);
-+ if (strcmp(type->name, "ps2") == 0) return 0;
-
- /* ps2 was not found!!! */
-- return(NULL);
-+ return -1;
- }
-
- /*
- * This works with Dexxa Optical Mouse, but because in X same initstring
- * is named ExplorerPS/2 so I named it in the same way.
- */
--static Gpm_Type *I_exps2(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_exps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, };
-
-- if (check_no_argv(argc, argv)) return NULL;
-+ if (!check_no_options(type->name, opt->text, ',')) return -1;
-
-- write (fd, s1, sizeof (s1));
-+ write (dev->fd, s1, sizeof (s1));
- usleep (30000);
-- tcflush (fd, TCIFLUSH);
-- return type;
-+ tcflush (dev->fd, TCIFLUSH);
-+ return 0;
- }
-
--static Gpm_Type *I_twid(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_twid(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
-
-- if (check_no_argv(argc, argv)) return NULL;
-+ if (!check_no_options(type->name, opt->text, ',')) return -1;
-
-- if (twiddler_key_init() != 0) return NULL;
-+ if (twiddler_key_init() != 0) return -1;
- /*
- * the twiddler is a serial mouse: just drop dtr
- * and run at 2400 (unless specified differently)
- */
-- if(opt_baud==DEF_BAUD) opt_baud = 2400;
-- argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */
-- return I_serial(fd, flags, type, argc, argv);
-+ if (opt->baud == DEF_BAUD) opt->baud = 2400;
-+ opt->text = "dtr";
-+ return I_serial(dev, opt, type);
- }
-
--static Gpm_Type *I_calus(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_calus(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
-- if (check_no_argv(argc, argv)) return NULL;
-+ if (!check_no_options(type->name, opt->text, ',')) return -1;
-
-- if (opt_baud == 1200) opt_baud=9600; /* default to 9600 */
-- return I_serial(fd, flags, type, argc, argv);
-+ if (opt->baud == 1200) opt->baud = 9600; /* default to 9600 */
-+ return I_serial(dev, opt, type);
- }
-
- /* synaptics touchpad, ps2 version: Henry Davies */
--static Gpm_Type *I_synps2(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_synps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
-- syn_ps2_init (fd);
-- return type;
-+ syn_ps2_init (dev->fd);
-+ return 0;
- }
-
-
--static Gpm_Type *I_summa(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_summa(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- void resetsumma()
- {
-- write(fd,0,1); /* Reset */
-+ write(dev->fd,0,1); /* Reset */
- usleep(400000); /* wait */
- }
- int waitsumma()
-@@ -1964,7 +1837,7 @@
- struct timeval timeout;
- fd_set readfds;
- int err;
-- FD_ZERO(&readfds); FD_SET(fd, &readfds);
-+ FD_ZERO(&readfds); FD_SET(dev->fd, &readfds);
- timeout.tv_sec = 0; timeout.tv_usec = 200000;
- err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
- return(err);
-@@ -1987,34 +1860,34 @@
- char GEN_MODELL=0x7f;
-
- /* Set speed to 9600bps */
-- setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD);
-+ setspeed (dev->fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD);
- resetsumma();
-
-- write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE));
-+ write(dev->fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE));
-
- if (strstr(type->name,"acecad")!=NULL) summaid=11;
-
- if (summaid<0) { /* Summagraphics test */
- /* read the Summa Firm-ID */
-- write(fd, SS_FIRMID, strlen(SS_FIRMID));
-+ write(dev->fd, SS_FIRMID, strlen(SS_FIRMID));
- err=waitsumma();
- if (!((err == -1) || (!err))) {
- summaid=10; /* Original Summagraphics */
-- read(fd, buffer, 255); /* Read Firm-ID */
-+ read(dev->fd, buffer, 255); /* Read Firm-ID */
- }
- }
-
- if (summaid<0) { /* Genius-test */
- resetsumma();
-- write(fd,GEN_MMSERIES,1);
-- write(fd,&GEN_MODELL,1); /* Read modell */
-+ write(dev->fd,GEN_MMSERIES,1);
-+ write(dev->fd,&GEN_MODELL,1); /* Read modell */
- err=waitsumma();
- if (!((err == -1) || (!err))) { /* read Genius-ID */
- err=waitsumma();
- if (!((err == -1) || (!err))) {
- err=waitsumma();
- if (!((err == -1) || (!err))) {
-- read(fd,&config,1);
-+ read(dev->fd,&config,1);
- summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/
- }
- }
-@@ -2024,30 +1897,29 @@
- /* unknown tablet ?*/
- if ((summaid<0) || (summaid==11)) {
- resetsumma();
-- write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3);
-+ write(dev->fd, SS_BINARY_FMT SS_PROMPT_MODE, 3);
- }
-
- /* read tablet size */
- err=waitsumma();
-- if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer));
-- write(fd,SS_READCONFIG,1);
-- read(fd,&config,5);
-+ if (!((err == -1) || (!err))) read(dev->fd,buffer,sizeof(buffer));
-+ write(dev->fd,SS_READCONFIG,1);
-+ read(dev->fd,&config,5);
- summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2);
- summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2);
-
-- write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3);
-- if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4);
-+ write(dev->fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3);
-+ if (summaid<0) write(dev->fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4);
-
-- return type;
-+ return 0;
- }
-
--static Gpm_Type *I_mtouch(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_mtouch(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- struct termios tty;
-
- /* Set speed to 9600bps (copied from I_summa, above :) */
-- tcgetattr(fd, &tty);
-+ tcgetattr(dev->fd, &tty);
- tty.c_iflag = IGNBRK | IGNPAR;
- tty.c_oflag = 0;
- tty.c_lflag = 0;
-@@ -2055,18 +1927,17 @@
- tty.c_cc[VTIME] = 0;
- tty.c_cc[VMIN] = 1;
- tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL;
-- tcsetattr(fd, TCSAFLUSH, &tty);
-+ tcsetattr(dev->fd, TCSAFLUSH, &tty);
-
-
- /* Turn it to "format tablet" and "mode stream" */
-- write(fd,"\001MS\r\n\001FT\r\n",10);
-+ write(dev->fd,"\001MS\r\n\001FT\r\n",10);
-
-- return type;
-+ return 0;
- }
-
- /* simple initialization for the gunze touchscreen */
--static Gpm_Type *I_gunze(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_gunze(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- struct termios tty;
- FILE *f;
-@@ -2075,29 +1946,29 @@
-
- #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration"
- /* accept a few options */
-- static argv_helper optioninfo[] = {
-- {"smooth", ARGV_INT, u: {iptr: &gunze_avg}},
-- {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}},
-+ static struct option_helper optioninfo[] = {
-+ {"smooth", OPT_INT, u: {iptr: &gunze_avg}},
-+ {"debounce", OPT_INT, u: {iptr: &gunze_debounce}},
- /* FIXME: add corner tapping */
-- {"", ARGV_END}
-+ {"", OPT_END}
- };
-- parse_argv(optioninfo, argc, argv);
-+ parse_options(type->name, opt->text, ',', optioninfo);
-
- /* check that the baud rate is valid */
-- if (opt_baud == DEF_BAUD) opt_baud = 19200; /* force 19200 as default */
-- if (opt_baud != 9600 && opt_baud != 19200) {
-- gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]);
-- opt_baud = 19200;
-+ if (opt->baud == DEF_BAUD) opt->baud = 19200; /* force 19200 as default */
-+ if (opt->baud != 9600 && opt->baud != 19200) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_GUNZE_WRONG_BAUD, option.progname, type->name);
-+ opt->baud = 19200;
- }
-- tcgetattr(fd, &tty);
-+ tcgetattr(dev->fd, &tty);
- tty.c_iflag = IGNBRK | IGNPAR;
- tty.c_oflag = 0;
- tty.c_lflag = 0;
- tty.c_line = 0;
- tty.c_cc[VTIME] = 0;
- tty.c_cc[VMIN] = 1;
-- tty.c_cflag = (opt_baud == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL;
-- tcsetattr(fd, TCSAFLUSH, &tty);
-+ tty.c_cflag = (opt->baud == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL;
-+ tcsetattr(dev->fd, TCSAFLUSH, &tty);
-
- /* FIXME: try to find some information about the device */
-
-@@ -2120,19 +1991,18 @@
- gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */
- gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */
- }
-- return type;
-+ return 0;
- }
-
- /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */
--static Gpm_Type *I_wp(int fd, unsigned short flags,
-- struct Gpm_Type *type, int argc, char **argv)
-+static int I_wp(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type)
- {
- struct termios tty;
- char tablet_info[256];
- int count, pos, size;
-
- /* Set speed to 9600bps (copied from I_summa, above :) */
-- tcgetattr(fd, &tty);
-+ tcgetattr(dev->fd, &tty);
- tty.c_iflag = IGNBRK | IGNPAR;
- tty.c_oflag = 0;
- tty.c_lflag = 0;
-@@ -2140,22 +2010,22 @@
- tty.c_cc[VTIME] = 0;
- tty.c_cc[VMIN] = 1;
- tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL;
-- tcsetattr(fd, TCSAFLUSH, &tty);
-+ tcsetattr(dev->fd, TCSAFLUSH, &tty);
-
- /* Reset the tablet (':') and put it in remote mode ('S') so that
- it isn't sending anything to us. */
-- write(fd, ":S", 2);
-- tcsetattr(fd, TCSAFLUSH, &tty);
-+ write(dev->fd, ":S", 2);
-+ tcsetattr(dev->fd, TCSAFLUSH, &tty);
-
- /* Query the model of the tablet */
-- write(fd, "T", 1);
-+ write(dev->fd, "T", 1);
- sleep(1);
-- count = read(fd, tablet_info, 255);
-+ count = read(dev->fd, tablet_info, 255);
-
- /* The tablet information should start with "KW" followed by the rest of
- the model number. If it isn't there, it probably isn't a WizardPad. */
-- if(count < 2) return NULL;
-- if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL;
-+ if(count < 2) return -1;
-+ if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return -1;
-
- /* Now, we want the width and height of the tablet. They should be
- of the form "X###" and "Y###" where ### is the number of units of
-@@ -2177,9 +2047,9 @@
- }
-
- /* Set the tablet to stream mode with 180 updates per sec. ('O') */
-- write(fd, "O", 1);
-+ write(dev->fd, "O", 1);
-
-- return type;
-+ return 0;
- }
-
- /*========================================================================*/
-@@ -2241,7 +2111,7 @@
- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0},
- #ifdef HAVE_LINUX_INPUT_H
- {"evdev", "Linux Event Device",
-- "", M_evdev, I_empty, STD_FLG,
-+ "", M_evdev, I_evdev, STD_FLG,
- {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL},
- #endif /* HAVE_LINUX_INPUT_H */
- {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused",
-diff -urN gpm-1.20.1/src/optparser.c gpm/src/optparser.c
---- gpm-1.20.1/src/optparser.c 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/optparser.c 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,155 @@
-+/*
-+ * optparser.c - GPM mouse options parser
-+ *
-+ * Copyright (C) 1993 Andrew Haylett <ajh@gec-mrc.co.uk>
-+ * Copyright (C) 1994-2000 Alessandro Rubini <rubini@linux.it>
-+ * Copyright (C) 1998,1999 Ian Zimmerman <itz@rahul.net>
-+ * Copyright (C) 2001,2002 Nico Schottelius <nicos@pcsystems.de>
-+ * Copyright (C) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <ctype.h>
-+
-+#include "headers/gpmInt.h"
-+#include "headers/message.h"
-+#include "headers/optparser.h"
-+
-+int parse_options(const char *proto, const char *opts, char sep, struct option_helper *info)
-+{
-+ int len, n, n_opts = 0, errors = 0;
-+ long l;
-+ struct option_helper *p;
-+ char *s, *t, *str;
-+ int base; /* for strtol */
-+
-+ for (p = info; p->type != OPT_END; p++)
-+ p->present = 0;
-+
-+ if (!opts)
-+ return 0;
-+
-+ if (!(str = strdup(opts)))
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_ALLOC_FAILED);
-+
-+ /* split input string */
-+ for (s = str, n = 1; sep && (s = strchr(s, sep)); s++, n++)
-+ *s = '\0';
-+
-+ for (s = str; n; s += strlen(s) + 1, n--) {
-+ if (strlen(s) == 0)
-+ continue;
-+
-+ for (p = info; p->type != OPT_END; p++) {
-+ len = strlen(p->name);
-+ if (!strncmp(p->name, s, len) && !isalnum(s[len]))
-+ break;
-+ }
-+ if (p->type == OPT_END) { /* not found */
-+ gpm_report(GPM_PR_ERR, "%s: Uknown option \"%s\" for protocol \"%s\"\n",
-+ option.progname, s, proto);
-+ errors++;
-+ continue;
-+ }
-+ if (p->present) {
-+ gpm_report(GPM_PR_ERR, "%s: option \"%s\" has already been seen, ignored (\"%s\")\n",
-+ option.progname, s, proto);
-+ continue;
-+ }
-+ p->present = 1;
-+ n_opts++;
-+ /* Found. Look for trailing stuff, if any */
-+ s += len;
-+ while (*s && isspace(*s)) s++; /* skip spaces */
-+ if (*s == '=') s++; /* skip equal */
-+ while (*s && isspace(*s)) s++; /* skip other spaces */
-+
-+ /* Now parse what s is */
-+ base = 0;
-+ switch(p->type) {
-+ case OPT_BOOL:
-+ if (*s) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_OPTION_NO_ARG, option.progname, p->name, s);
-+ errors++;
-+ }
-+ *(p->u.iptr) = p->value;
-+ break;
-+
-+ case OPT_DEC:
-+ base = 10; /* and fall through */
-+
-+ case OPT_INT:
-+ if (*s == '\0') {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_MISSING_ARG, option.progname, p->name);
-+ } else {
-+ l = strtol(s, &t, base);
-+ if (*t) {
-+ gpm_report(GPM_PR_ERR, GPM_MESS_INVALID_ARG, option.progname, s, p->name);
-+ errors++;
-+ break;
-+ }
-+ *(p->u.iptr) = (int)l;
-+ }
-+ break;
-+
-+ case OPT_STRING:
-+ if (*s == '\0')
-+ gpm_report(GPM_PR_ERR, GPM_MESS_MISSING_ARG, option.progname, p->name);
-+ else
-+ *(p->u.sptr) = strdup(s);
-+ break;
-+
-+ case OPT_END: /* let's please "-Wall" */
-+ break;
-+ }
-+ } /* for i in argc */
-+
-+ free(str);
-+
-+ if (errors) {
-+ gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname);
-+ return -errors;
-+ }
-+ return n_opts;
-+}
-+
-+int check_no_options(const char *proto, const char *opts, char sep)
-+{
-+ static struct option_helper info[] = {
-+ { "", OPT_END }
-+ };
-+
-+ return parse_options(proto, opts, sep, info) == 0;
-+}
-+
-+int is_option_present(struct option_helper *info, const char *name)
-+{
-+ struct option_helper *p;
-+ int len;
-+
-+ for (p = info; p->type != OPT_END; p++) {
-+ len = strlen(p->name);
-+ if (!strncmp(p->name, name, len) && !isalnum(name[len]))
-+ return p->present;
-+ }
-+
-+ gpm_report(GPM_PR_ERR, "%s: Uknown option \"%s\"\n", option.progname, name);
-+ return 0;
-+}
-+
-diff -urN gpm-1.20.1/src/prog/mouse-test.c gpm/src/prog/mouse-test.c
---- gpm-1.20.1/src/prog/mouse-test.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/prog/mouse-test.c 2003-10-02 01:22:42.000000000 -0500
-@@ -50,22 +50,9 @@
- #define max(a,b) ((a)>(b)?(a):(b))
- #endif
-
--
--/* this material is needed to pass options to mice.c */
--struct mouse_features mymouse = {
-- DEF_TYPE, DEF_DEV, DEF_SEQUENCE,
-- DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/,
-- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP,
-- (char *)NULL /* extra */,
-- (Gpm_Type *)NULL,
-- -1 /* fd */
--};
--
- /* and this is a workaroud */
- struct winsize win;
-
--struct mouse_features *which_mouse=&mymouse;
--
- char *progname;
- char *consolename;
- int devcount=0;
-@@ -78,9 +65,9 @@
-
- struct device {
- char *name;
-- int fd;
-+ struct micedev mdev;
- struct device *next;
--};
-+} *devlist;
-
- static int message(void)
- {
-@@ -148,47 +135,48 @@
- /*-----------------------------------------------------------------------------
- Place the description here.
- -----------------------------------------------------------------------------*/
--struct device **gpm_makedev(struct device **current, char *name)
-+void gpm_makedev(char *name)
- {
-- int fd; int modes;
-+ struct device *dev;
-+ int fd;
-+ int modes;
-+
- if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) {
- perror(name);
-- return current;
-- }
-- modes = fcntl(fd, F_GETFL);
-- if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) {
-- close(fd);
-- perror(name);
-- return current;
-+ } else {
-+ modes = fcntl(fd, F_GETFL);
-+ if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) {
-+ close(fd);
-+ perror(name);
-+ } else {
-+ dev = malloc(sizeof(struct device));
-+ if (!dev) gpm_report(GPM_PR_OOPS,"malloc()");
-+ dev->name=strdup(name);
-+ if (!dev->name) gpm_report(GPM_PR_OOPS,"malloc()");
-+ dev->mdev.fd=fd;
-+ dev->mdev.private = NULL;
-+ dev->next=devlist;
-+ devlist = dev;
-+ devcount++;
-+ }
- }
--
-- *current=malloc(sizeof(struct device));
-- if (!*current) gpm_report(GPM_PR_OOPS,"malloc()");
-- (*current)->name=strdup(name);
-- if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()");
-- (*current)->fd=fd;
-- (*current)->next=NULL;
-- devcount++;
-- return &((*current)->next);
- }
-
--Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type,
-- int argc, char **argv);
-+int (*I_serial)(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type);
-
-
- /*-----------------------------------------------------------------------------
- Place the description here.
- -----------------------------------------------------------------------------*/
--int mousereopen(int oldfd, char *name, Gpm_Type *type)
-+int mousereopen(struct micedev *dev, char *name, Gpm_Type *type, struct miceopt *opts)
- {
-- int fd;
- if (!type) type=mice+1; /* ms */
-- close(oldfd);
-+ close(dev->fd);
- usleep(100000);
-- fd=open(name,O_RDWR);
-- if (fd < 0) gpm_report(GPM_PR_OOPS,name);
-- (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */
-- return fd;
-+ dev->fd=open(name,O_RDWR);
-+ if (dev->fd < 0) gpm_report(GPM_PR_OOPS,name);
-+ I_serial(dev, opts, type); /* ms initialization */
-+ return dev->fd;
- }
-
- int noneofthem(void)
-@@ -281,10 +269,9 @@
- {
- struct item *list=NULL;
- struct item **nextitem;
-- struct device *devlist=NULL;
-- struct device **nextdev;
-+ struct device *nextdev;
- Gpm_Type *cursor;
-- int i, mousefd;
-+ int i;
- char *mousename;
- #define BUFLEN 512
- char buf[BUFLEN];
-@@ -294,6 +281,9 @@
- int trial, readamount,packetsize,got;
- int baudtab[4]={1200,9600,4800,2400};
- #define BAUD(i) (baudtab[(i)%4])
-+ struct miceopt opt = {0};
-+ struct micedev mdev = {0};
-+
- consolename = Gpm_get_console();
-
- if (!isatty(fileno(stdin))) {
-@@ -306,8 +296,8 @@
-
- /* init the list of possible devices */
-
-- for (nextdev=&devlist, i=1; i<argc; i++)
-- nextdev=gpm_makedev(nextdev,argv[i]);
-+ for (i=1; i<argc; i++)
-+ gpm_makedev(argv[i]);
-
- if (argc==1) { /* no cmdline, get all devices */
- FILE *f;
-@@ -320,7 +310,7 @@
- if (!f) gpm_report(GPM_PR_OOPS,"popen()");
- while (fgets(s,64,f)) {
- s[strlen(s)-1]='\0'; /* trim '\n' */
-- nextdev=gpm_makedev(nextdev,s);
-+ gpm_makedev(s);
- }
- pclose(f);
- }
-@@ -345,19 +335,18 @@
-
- /* BUG */ /* Logitech initialization is not performed */
-
-- opt_baud=BAUD(trial);
-- printf("\r\nTrying with %i baud\r\n",opt_baud);
-+ opt.baud=BAUD(trial);
-+ printf("\r\nTrying with %i baud\r\n",opt.baud);
- trial++;
-
- FD_ZERO(&devSet); FD_ZERO(&gotSet);
- FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin);
- printf("\r\n The possible device nodes are:\r\n");
-- for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) {
-- printf("\t%s\r\n", (*nextdev)->name);
-- FD_SET((*nextdev)->fd,&devSet);
-- maxfd=max((*nextdev)->fd,maxfd);
-- (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1,
-- 1, &(mice+1)->name); /* try ms mode */
-+ for (nextdev=devlist; nextdev; nextdev=nextdev->next) {
-+ printf("\t%s\r\n", nextdev->name);
-+ FD_SET(nextdev->mdev.fd, &devSet);
-+ maxfd=max(nextdev->mdev.fd,maxfd);
-+ I_serial(&nextdev->mdev, &opt, mice+1); /* try ms mode */
- }
-
- savSet=devSet;
-@@ -379,43 +368,43 @@
- getchar();
- break;
- }
-- for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next))
-- if (FD_ISSET((*nextdev)->fd,&devSet)) {
-+ for (nextdev=devlist; nextdev; nextdev=nextdev->next)
-+ if (FD_ISSET(nextdev->mdev.fd,&devSet)) {
- gotthem++;
-- FD_CLR((*nextdev)->fd,&savSet);
-- FD_SET((*nextdev)->fd,&gotSet);
-+ FD_CLR(nextdev->mdev.fd,&savSet);
-+ FD_SET(nextdev->mdev.fd,&gotSet);
- }
- }
-- if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) {
-- cur=*nextdev;
-- if (!FD_ISSET(cur->fd,&gotSet)) {
-+ if (gotthem) for (nextdev=devlist; nextdev; /* nothing */ ) {
-+ cur=nextdev;
-+ if (!FD_ISSET(cur->mdev.fd,&gotSet)) {
- printf("removing \"%s\" from the list\r\n",cur->name);
-- *nextdev=cur->next;
-- close(cur->fd);
-+ nextdev=cur->next;
-+ close(cur->mdev.fd);
- free(cur->name);
- free(cur);
- devcount--;
- } else {
-- read(cur->fd,buf,80); /* flush */
-- nextdev=&(cur->next); /* follow list */
-+ read(cur->mdev.fd,buf,80); /* flush */
-+ nextdev=cur->next; /* follow list */
- }
- }
-
- } /* devcount>1 */
-
-- mousefd=devlist->fd;
-+ mdev=devlist->mdev;
- mousename=devlist->name;
- free(devlist);
- printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename);
-
- /* now close and reopen it, complete with initialization */
-- opt_baud=BAUD(0);
-- mousefd=mousereopen(mousefd,mousename,NULL);
--
-+ opt.baud=BAUD(0);
-+ mousereopen(&mdev, mousename, NULL,&opt);
-+
- FD_ZERO(&checkSet);
-- FD_SET(mousefd,&checkSet);
-+ FD_SET(mdev.fd,&checkSet);
- FD_SET(fileno(stdin),&checkSet);
-- maxfd=max(mousefd,fileno(stdin));
-+ maxfd=max(mdev.fd, fileno(stdin));
-
- /*====================================== Identify mouse type */
-
-@@ -440,7 +429,7 @@
- printf("\r\nNow please press and release your left mouse button,\r\n"
- "one time only\r\n\r\n");
-
-- i=read(mousefd,buf,1);
-+ i=read(mdev.fd, buf, 1);
- if (i==-1 && errno==EINVAL)
- readamount=3;
- else
-@@ -466,7 +455,7 @@
- else
- nextitem=&(cur->next);
- }
-- read(mousefd,buf,BUFLEN); /* flush */
-+ read(mdev.fd, buf, BUFLEN); /* flush */
-
- /*====================================== Packet size - second step */
-
-@@ -484,12 +473,12 @@
- while (packetsize==1) {
- int success3=0,success5=0;
-
-- opt_baud=BAUD(trial);
-- printf("\tBaud rate is %i\r\n",opt_baud);
-- mousefd=mousereopen(mousefd,mousename,NULL);
-+ opt.baud=BAUD(trial);
-+ printf("\tBaud rate is %i\r\n",opt.baud);
-+ mousereopen(&mdev, mousename,NULL, &opt);
-
- printf("\r\n==> Detecting the packet size\r\n");
-- got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount);
-+ got=eventlist(mdev.fd,buf,BUFLEN,GPM_B_LEFT,readamount);
-
- /* try three -- look at repeating arrays of 6 bytes */
- for (i=0;i<got-12;i++)
-@@ -512,8 +501,7 @@
- trial++;
- }
-
--/*====================================== Use that info to discard protocols */
--
-+/*====================================== Use that info to discard protocols */
- for (nextitem=&list; *nextitem; /* nothing */) {
- struct item *cur=*nextitem;
- int packetheads=0;
-@@ -530,7 +518,7 @@
- if ( ((buf[i] &(cur->this->proto)[0]) == (cur->this->proto)[1])
- && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) {
- packetheads++;
-- if ((*(cur->this->fun))(&event,buf+i)==-1) {
-+ if ((*(cur->this->fun))(&mdev, &opt, buf+i, &event)==-1) {
- packetheads--;
- continue;
- }
-@@ -594,7 +582,7 @@
- * First trial: remove the "-t ms" extension if spurious buttons come in
- */
-
-- got=eventlist(mousefd,buf,BUFLEN,0,readamount);
-+ got=eventlist(mdev.fd,buf,BUFLEN,0,readamount);
- pending=0;
- for (nextitem=&list; *nextitem; /* nothing */) {
- struct item *cur=*nextitem;
-@@ -604,7 +592,7 @@
- for (i=0;i<got;i++) {
- if ( ((buf[i] &(cur->this->proto)[0]) == (cur->this->proto)[1])
- && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) {
-- if ((*(cur->this->fun))(&event,buf+i)==-1) continue;
-+ if ((*(cur->this->fun))(&mdev, &opt, buf+i, &event)==-1) continue;
- i+=packetsize-1;
- if (event.buttons) pending--;
- }
-@@ -624,8 +612,8 @@
- */
-
- printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n");
-- mousefd=mousereopen(mousefd,mousename, mice /* mman */);
-- got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount);
-+ mousereopen(&mdev, mousename, mice /* mman */, &opt);
-+ got=eventlist(mdev.fd, buf, BUFLEN, GPM_B_MIDDLE, readamount);
-
- /* if it uses the 4-byte protocol, find it in a rude way */
- for (pending=0,i=0;i<got-16;i++)
-@@ -646,7 +634,7 @@
- for (i=0;i<got;i++) {
- if ( ((buf[i] &(cur->this->proto)[0]) == (cur->this->proto)[1])
- && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) {
-- if ((*(cur->this->fun))(&event,buf+i)==-1) continue;
-+ if ((*(cur->this->fun))(&mdev,&opt,buf+i,&event)==-1) continue;
- i+=packetsize-1;
- if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--;
- if (event.buttons==GPM_B_MIDDLE) pending++;
-@@ -677,16 +665,16 @@
- char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"};
- int alllines,lines, index;
-
-- ioctl(mousefd, TIOCMGET, &alllines);
-+ ioctl(mdev.fd, TIOCMGET, &alllines);
-
- printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n"
- "\r\ncontrol lines are toggled after opening\r\n");
- for (index=0;index<3;index++) {
-- mousereopen(mousefd,mousename,NULL);
-+ mousereopen(&mdev, mousename, NULL, &opt);
- lines = alllines & ~toggle[index];
-- ioctl(mousefd, TIOCMSET, &lines);
-+ ioctl(mdev.fd, TIOCMSET, &lines);
- printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]);
-- got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount);
-+ got=eventlist(mdev.fd, buf, BUFLEN, GPM_B_MIDDLE, readamount);
-
- /* if it uses the 5-byte protocol, find it in a rude way */
- for (pending=0,i=0;i<got-20;i++)
-@@ -717,7 +705,7 @@
-
- getchar();
-
-- got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount);
-+ got=eventlist(mdev.fd,buf,BUFLEN,GPM_B_MIDDLE,readamount);
-
- /* if it uses the 5-byte protocol, find it in a rude way */
- for (pending=0,i=0;i<got-20;i++)
-diff -urN gpm-1.20.1/src/report.c gpm/src/report.c
---- gpm-1.20.1/src/report.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/report.c 2003-10-02 01:22:42.000000000 -0500
-@@ -31,6 +31,7 @@
-
- #include "headers/gpmInt.h"
- #include "headers/message.h"
-+#include "headers/console.h"
-
- /*
- * gpm_report
-@@ -70,7 +71,7 @@
-
- void gpm_report(int line, char *file, int stat, char *text, ... )
- {
-- FILE *console = NULL;
-+ FILE *f = NULL;
- va_list ap;
-
- va_start(ap,text);
-@@ -138,11 +139,11 @@
- syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap);
- #endif
-- if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) {
-- fprintf(console,GPM_STRING_WARN);
-- vfprintf(console,text,ap);
-- fprintf(console,"\n");
-- fclose(console);
-+ if ((f = fopen(GPM_SYS_CONSOLE, "a")) != NULL) {
-+ fprintf(f, GPM_STRING_WARN);
-+ vfprintf(f, text, ap);
-+ fprintf(f, "\n");
-+ fclose(f);
- }
- break;
-
-@@ -151,18 +152,18 @@
- syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
- vsyslog(LOG_DAEMON | LOG_ERR, text, ap);
- #endif
-- if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) {
-- fprintf(console,GPM_STRING_ERR);
-- vfprintf(console,text,ap);
-- fprintf(console,"\n");
-- fclose(console);
-+ if ((f = fopen(GPM_SYS_CONSOLE, "a")) != NULL) {
-+ fprintf(f, GPM_STRING_ERR);
-+ vfprintf(f, text, ap);
-+ fprintf(f, "\n");
-+ fclose(f);
- }
-
-- if((console = fopen(option.consolename,"a")) != NULL) {
-- fprintf(console,GPM_STRING_ERR);
-- vfprintf(console,text,ap);
-- fprintf(console,"\n");
-- fclose(console);
-+ if ((f = fopen(console.device, "a")) != NULL) {
-+ fprintf(f, GPM_STRING_ERR);
-+ vfprintf(f, text, ap);
-+ fprintf(f, "\n");
-+ fclose(f);
- }
- break;
-
-@@ -184,24 +185,24 @@
- case GPM_RUN_DEBUG:
- switch(stat) {
- case GPM_STAT_INFO:
-- console = stdout;
-- fprintf(console,GPM_STRING_INFO); break;
-+ f = stdout;
-+ fprintf(f, GPM_STRING_INFO); break;
- case GPM_STAT_WARN:
-- console = stderr;
-- fprintf(console,GPM_STRING_WARN); break;
-+ f = stderr;
-+ fprintf(f, GPM_STRING_WARN); break;
- case GPM_STAT_ERR:
-- console = stderr;
-- fprintf(console,GPM_STRING_ERR); break;
-+ f = stderr;
-+ fprintf(f, GPM_STRING_ERR); break;
- case GPM_STAT_DEBUG:
-- console = stderr;
-- fprintf(console,GPM_STRING_DEBUG); break;
-+ f = stderr;
-+ fprintf(f, GPM_STRING_DEBUG); break;
- case GPM_STAT_OOPS:
-- console = stderr;
-- fprintf(console,GPM_STRING_OOPS); break;
-+ f = stderr;
-+ fprintf(f, GPM_STRING_OOPS); break;
- }
-
-- vfprintf(console,text,ap);
-- fprintf(console,"\n");
-+ vfprintf(f, text, ap);
-+ fprintf(f, "\n");
-
- if(stat == GPM_STAT_OOPS) exit(1);
-
-diff -urN gpm-1.20.1/src/selection.c gpm/src/selection.c
---- gpm-1.20.1/src/selection.c 1969-12-31 19:00:00.000000000 -0500
-+++ gpm/src/selection.c 2003-10-02 01:22:42.000000000 -0500
-@@ -0,0 +1,156 @@
-+/*
-+ * console.c - GPM console and selection/paste handling
-+ *
-+ * Copyright (C) 1993 Andreq Haylett <ajh@gec-mrc.co.uk>
-+ * Copyright (C) 1994-1999 Alessandro Rubini <rubini@linux.it>
-+ * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net>
-+ * Copyright (c) 2001,2002 Nico Schottelius <nico@schottelius.org>
-+ * Copyright (c) 2003 Dmitry Torokhov <dtor@mail.ru>
-+ *
-+ * 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 of the License, 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-+ ********/
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h> /* strerror(); ?!? */
-+#include <errno.h>
-+#include <unistd.h> /* select(); */
-+#include <time.h> /* time() */
-+#include <sys/fcntl.h> /* O_RDONLY */
-+#include <sys/stat.h> /* mkdir() */
-+#include <asm/types.h> /* __u32 */
-+
-+#include <linux/vt.h> /* VT_GETSTATE */
-+#include <sys/kd.h> /* KDGETMODE */
-+#include <termios.h> /* winsize */
-+
-+#include "headers/gpmInt.h"
-+#include "headers/message.h"
-+#include "headers/console.h"
-+#include "headers/selection.h"
-+
-+struct sel_options sel_opts = { 0, 0, DEF_PTRDRAG };
-+static time_t last_selection_time;
-+
-+/*-------------------------------------------------------------------*/
-+static void selection_copy(int x1, int y1, int x2, int y2, int mode)
-+{
-+/*
-+ * The approach in "selection" causes a bus error when run under SunOS 4.1
-+ * due to alignment problems...
-+ */
-+ unsigned char buf[6 * sizeof(short)];
-+ unsigned short *arg = (unsigned short *)buf + 1;
-+ int fd;
-+
-+ buf[sizeof(short) - 1] = 2; /* set selection */
-+
-+ arg[0] = (unsigned short)x1;
-+ arg[1] = (unsigned short)y1;
-+ arg[2] = (unsigned short)x2;
-+ arg[3] = (unsigned short)y2;
-+ arg[4] = (unsigned short)mode;
-+
-+ if ((fd = open_console(O_WRONLY)) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON);
-+
-+ gpm_report(GPM_PR_DEBUG, "ctl %i, mode %i", (int)*buf, arg[4]);
-+ if (ioctl(fd, TIOCLINUX, buf + sizeof(short) - 1) < 0)
-+ gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX);
-+ close(fd);
-+
-+ if (mode < 3) {
-+ sel_opts.aged = 0;
-+ last_selection_time = time(0);
-+ }
-+}
-+
-+/*-------------------------------------------------------------------*/
-+static void selection_paste(void)
-+{
-+ char c = 3;
-+ int fd;
-+
-+ if (!sel_opts.aged &&
-+ sel_opts.age_limit != 0 &&
-+ last_selection_time + sel_opts.age_limit < time(0)) {
-+ sel_opts.aged = 1;
-+ }
-+
-+ if (sel_opts.aged) {
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_SKIP_PASTE);
-+ } else {
-+ fd = open_console(O_WRONLY);
-+ if (ioctl(fd, TIOCLINUX, &c) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX);
-+ close(fd);
-+ }
-+}
-+
-+/*-------------------------------------------------------------------*/
-+void do_selection(Gpm_Event *event, int three_button_mode)
-+{
-+ static int x1 = 1, y1 = 1;
-+ int x2, y2;
-+
-+ x2 = event->x; y2 = event->y;
-+ switch(GPM_BARE_EVENTS(event->type)) {
-+ case GPM_MOVE:
-+ if (x2 < 1) x2++; else if (x2 > console.max_x) x2--;
-+ if (y2 < 1) y2++; else if (y2 > console.max_y) y2--;
-+ selection_copy(x2, y2, x2, y2, 3); /* just highlight pointer */
-+ break;
-+
-+ case GPM_DRAG:
-+ if (event->buttons == GPM_B_LEFT) {
-+ switch(event->margin) { /* fix margins */
-+ case GPM_TOP: x2 = 1; y2++; break;
-+ case GPM_BOT: x2 = console.max_x; y2--; break;
-+ case GPM_RGT: x2--; break;
-+ case GPM_LFT: y2 <= y1 ? x2++ : (x2 = console.max_x, y2--); break;
-+ default: break;
-+ }
-+ selection_copy(x1, y1, x2, y2, event->clicks);
-+ if (event->clicks >= sel_opts.ptrdrag && !event->margin) /* pointer */
-+ selection_copy(x2, y2, x2, y2, 3);
-+ } /* if */
-+ break;
-+
-+ case GPM_DOWN:
-+ switch (event->buttons) {
-+ case GPM_B_LEFT:
-+ x1 = x2; y1 = y2;
-+ selection_copy(x1, y1, x2, y2, event->clicks); /* start selection */
-+ break;
-+
-+ case GPM_B_MIDDLE:
-+ selection_paste();
-+ break;
-+
-+ case GPM_B_RIGHT:
-+ if (three_button_mode == 1)
-+ selection_copy(x1, y1, x2, y2, event->clicks);
-+ else
-+ selection_paste();
-+ break;
-+ }
-+ } /* switch above */
-+}
-+
-+/*-------------------------------------------------------------------*/
-+void selection_disable_paste(void)
-+{
-+ sel_opts.aged = 1;
-+}
-diff -urN gpm-1.20.1/src/server_tools.c gpm/src/server_tools.c
---- gpm-1.20.1/src/server_tools.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/server_tools.c 2003-10-02 01:22:42.000000000 -0500
-@@ -21,151 +21,80 @@
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- ********/
-
-+#include <string.h>
-+#include <stdlib.h> /* malloc() */
-+#include <sys/fcntl.h>
-+
- #include "headers/gpmInt.h"
- #include "headers/message.h"
-
--#include <stdlib.h> /* malloc() */
-+struct micetab *micelist;
-
--/* DESCR: add this to the list of mice. initialization follows later */
--/* RETURN: - */
-+/* DESCR: allocate a new mouse and to the list of mice. initialization follows later */
-+/* RETURN: new mouse structure */
- /* COMMENT: does error handling and exiting itself */
--void add_mouse(int type, char *value)
-+struct micetab *add_mouse(void)
- {
-- struct micetab *tmp = option.micelist;
-+ struct micetab *mouse;
-
-- /* PREAMBLE for all work: */
-- /* -m /dev/misc/psaux -t ps2 [ -o options ] */
-+ gpm_report(GPM_PR_DEBUG, "adding mouse device");
-+ if (!(mouse = malloc(sizeof(struct micetab))))
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM);
-+
-+ memset(mouse, 0, sizeof(struct micetab));
-+
-+ mouse->dev.timeout = -1;
-+
-+ mouse->options.sequence = NULL;
-+ mouse->options.sample = DEF_SAMPLE;
-+ mouse->options.delta = DEF_DELTA;
-+ mouse->options.accel = DEF_ACCEL;
-+ mouse->options.scalex = DEF_SCALE;
-+ mouse->options.scaley = DEF_SCALE;
-+ mouse->options.time = DEF_TIME;
-+ mouse->options.cluster = DEF_CLUSTER;
-+ mouse->options.three_button = DEF_THREE;
-+ mouse->options.glidepoint_tap = DEF_GLIDEPOINT_TAP;
-+ mouse->options.text = NULL;
-
-- switch(type) {
-+ mouse->next = micelist;
-+ micelist = mouse;
-
-- /*---------------------------------------------------------------------*/
-- /********************** -m mousedevice *********************************/
-- /*---------------------------------------------------------------------*/
--
-- case GPM_ADD_DEVICE:
--
-- /* first invocation */
-- if(option.micelist == NULL) {
-- gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value);
-- option.micelist = (struct micetab *) malloc(sizeof(struct micetab));
-- if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
-- option.micelist->next = NULL;
-- option.micelist->device = value;
-- option.micelist->protocol = NULL;
-- option.micelist->options = NULL;
-- return;
-- }
--
-- /* find actual mouse */
-- while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL)
-- tmp = tmp->next;
--
-- gpm_report(GPM_PR_DEBUG,"finished searching");
--
-- /* found end of micelist, add new mouse */
-- if(tmp->next == NULL && tmp->protocol != NULL) {
-- gpm_report(GPM_PR_DEBUG,"next mouse making");
-- tmp->next = (struct micetab *) malloc(sizeof(struct micetab));
-- if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM);
-- tmp->next = NULL;
-- tmp->device = value;
-- tmp->protocol = NULL;
-- tmp->options = NULL;
-- return;
-- } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV);
--
-- //} else if(tmp->device != NULL && tmp->protocol == NULL)
-- // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */
--
--
-- break;
--
-- /*---------------------------------------------------------------------*/
-- /************************* -t type / protocol **************************/
-- /*---------------------------------------------------------------------*/
--
-- case GPM_ADD_TYPE:
-- if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV);
--
-- /* skip to next mouse, where either device or protocol is missing */
-- while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL)
-- tmp = tmp->next;
--
-- /* check whether device (-m) is there, if so, write protocol */
-- if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV);
-- else {
-- gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value);
-- tmp->protocol = value;
-- option.no_mice++; /* finally we got our mouse */
-- }
--
-- break;
--
-- /*---------------------------------------------------------------------*/
-- /*************************** -o options ********************************/
-- /*---------------------------------------------------------------------*/
--
-- case GPM_ADD_OPTIONS:
-- if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV);
--
-- /* look for the last mouse */
-- tmp = option.micelist;
-- while(tmp->next != NULL) tmp = tmp->next;
--
-- /* if -m or -t are missing exit */
-- if(tmp->device == NULL || tmp->protocol == NULL)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV);
-- else {
-- gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value);
-- tmp->options = value;
-- }
-- break;
-- }
-+ return mouse;
- }
-
--/* DESCR: mice initialization. currently print mice. */
--/* RETURN: 0 - failed to init one or more devices
-- 1 - init was fine */
-+/* DESCR: mice initialization. calls appropriate init functions. */
- /* COMMENT: does error handling and exiting itself */
--int init_mice(struct micetab *micelist)
-+void init_mice(void)
- {
-- struct micetab *tmp = micelist;
-+ struct micetab *mouse;
-+
-+ for (mouse = micelist; mouse; mouse = mouse->next) {
-+ if (!strcmp(mouse->device, "-"))
-+ mouse->dev.fd = 0; /* use stdin */
-+ else if ((mouse->dev.fd = open(mouse->device, O_RDWR | O_NDELAY)) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, mouse->device);
-
-- while(tmp != NULL) { /* there are still mice to init */
-- gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol);
-- if(tmp->options != NULL) {
-- gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options);
-- }
-- tmp = tmp->next;
-+ /* and then reset the flag */
-+ fcntl(mouse->dev.fd, F_SETFL, fcntl(mouse->dev.fd, F_GETFL) & ~O_NDELAY);
-+
-+ /* init the device, and use the return value as new mouse type */
-+ if (mouse->type->init)
-+ if (mouse->type->init(&mouse->dev, &mouse->options, mouse->type))
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_MOUSE_INIT);
- }
--
-- gpm_report(GPM_PR_DEBUG,"finished initialization");
-- return 1;
- }
-
- /* DESCR: when leaving, we should reset mice to their normal state */
--/* RETURN: 0 - failed to reset one or more devices
-- 1 - reset was fine */
- /* COMMENT: does error handling and exiting itself */
--int reset_mice(struct micetab *micelist)
-+void cleanup_mice(void)
- {
-- struct micetab *tmp = micelist;
-- struct micetab *end = tmp;
--
-- while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */
-- end = tmp;
-- while(tmp->next != NULL) { /* set end to the last mouse */
-- end = tmp;
-- tmp = tmp->next;
-- }
--
-- gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol);
-- if(tmp->options != NULL) {
-- gpm_report(GPM_PR_DEBUG,"and options %s",end->options);
-- }
-- free(end); /* be clean() */
-- tmp = micelist; /* reset to the first mice again */
-+ struct micetab *tmp;
-+
-+ while ((tmp = micelist)) {
-+ if (micelist->dev.private)
-+ free(micelist->dev.private);
-+ micelist = micelist->next;
-+ free(tmp);
- }
--
-- return 1;
- }
-diff -urN gpm-1.20.1/src/special.c gpm/src/special.c
---- gpm-1.20.1/src/special.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/special.c 2003-10-02 01:22:42.000000000 -0500
-@@ -37,6 +37,7 @@
- #include <sys/param.h>
-
- #include "headers/gpmInt.h"
-+#include "headers/console.h"
-
- /*
- * This function is only called at button press, to avoid unnecessary
-@@ -78,7 +79,7 @@
- return 1;
-
- /* devfs change */
-- consolef=fopen(option.consolename,"w");
-+ consolef = fopen(console.device, "w");
- if (!consolef) consolef=stderr;
- if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */
- {
-@@ -153,7 +154,7 @@
- case 0: /* child */
- close(0); close(1); close(2);
- open(GPM_NULL_DEV,O_RDONLY); /* stdin */
-- open(option.consolename,O_WRONLY); /* stdout */
-+ open(console.device, O_WRONLY); /* stdout */
- dup(1); /* stderr */
- for (i=3;i<OPEN_MAX; i++) close(i);
- execl("/bin/sh","sh","-c",command,(char *)NULL);
-diff -urN gpm-1.20.1/src/startup.c gpm/src/startup.c
---- gpm-1.20.1/src/startup.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/startup.c 2003-10-02 01:22:42.000000000 -0500
-@@ -26,6 +26,7 @@
- #include <string.h> /* strlen() */
- #include <errno.h> /* errno */
- #include <unistd.h> /* unlink,geteuid */
-+#include <signal.h>
- #include <sys/types.h> /* geteuid, mknod */
- #include <sys/stat.h> /* mknod */
- #include <fcntl.h> /* mknod */
-@@ -34,11 +35,13 @@
-
- #include "headers/gpmInt.h"
- #include "headers/message.h"
-+#include "headers/console.h"
-+#include "headers/selection.h"
-
- /* what todo atexit */
- static void gpm_exited(void)
- {
-- gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL);
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL);
- unlink(GPM_NODE_PID);
- unlink(GPM_NODE_CTL);
- }
-@@ -48,34 +51,12 @@
- extern struct options option;
- extern int errno;
-
-- int i,opt;
--
-- static struct {
-- char *in;
-- char *out;
-- } seq[] = {
-- {"123","01234567"},
-- {"132","02134657"},
-- {"213","01452367"}, /* warning: these must be readable as integers... */
-- {"231","02461357"},
-- {"312","04152637"},
-- {"321","04261537"},
-- {NULL,NULL}
-- };
--
- /* basic settings */
- option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */
- option.autodetect = 0; /* no mouse autodection */
- option.progname = argv[0]; /* who we are */
-- option.consolename = Gpm_get_console(); /* get consolename */
--
-- /* basic2: are not necessary for oops()ing, if not root */
-- option.no_mice = 0; /* counts -m + -t */
-- option.micelist = NULL; /* no mice found yet */
-- option.repeater = 0; /* repeat data */
-- option.repeater_type = NULL; /* type of */
--
-
-+ get_console_name();
- cmdline(argc, argv); /* parse command line */
-
- if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */
-@@ -87,54 +68,18 @@
- /****************** OLD CODE from gpn.c ***********************/
-
- openlog(option.progname, LOG_PID,
-- option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER);
-- loadlut(opt_lut);
--
-- if (option.repeater) {
-- if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST)
-- gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO);
-- if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0)
-- gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO);
-- }
--
-- /* duplicate initialization */
-- for (i=1; i <= 1+opt_double; i++) {
-- which_mouse=mouse_table+i; /* used to access options */
-- if (opt_accel < 1) exit(usage("acceleration"));
-- if (opt_delta < 2) exit(usage("delta"));
-- if (strlen(opt_sequence) != 3 || atoi(opt_sequence)<100)
-- exit(usage("sequence"));
-- if (opt_glidepoint_tap > 3) exit(usage("glidepoint tap button"));
-- if (opt_glidepoint_tap)
-- opt_glidepoint_tap=GPM_B_LEFT >> (opt_glidepoint_tap-1);
--
-- /* choose the sequence */
-- for (opt=0; seq[opt].in && strcmp(seq[opt].in,opt_sequence); opt++) ;
-- if(!seq[opt].in) exit(usage("button sequence"));
-- opt_sequence=strdup(seq[opt].out); /* I can rewrite on it */
--
-- /* look for the mouse type */
-- m_type = find_mouse_by_name(opt_type);
-- if (!m_type) /* not found */
-- exit(M_listTypes());
-- }
-+ option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER);
-
-- /* Check repeater status */
-- if (option.repeater) {
-- if (strcmp(option.repeater_type,"raw") == 0)
-- opt_rawrep = 1;
-- else {
-- /* look for the type */
-- repeated_type = find_mouse_by_name(option.repeater_type);
-+ console_load_lut();
-
-- if(!repeated_type) exit(M_listTypes()); /* not found */
--
-- if (!(repeated_type->repeat_fun)) /* unsupported translation */
-- gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type);
-- }
-+ if (repeater.raw || repeater.type) {
-+ if (mkfifo(GPM_NODE_FIFO, 0666) && errno != EEXIST)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_CREATE_FIFO, GPM_NODE_FIFO);
-+ if ((repeater.fd = open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO);
- }
-
-- if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */
-+ if(option.run_status == GPM_RUN_STARTUP) { /* else is debugging */
- /* goto background and become a session leader (Stefan Giessler) */
- switch(fork()) {
- case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */
-@@ -152,13 +97,63 @@
- /* is changing to root needed, because of relative paths ? or can we just
- * remove and ignore it ?? FIXME */
- if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED);
--
-
-- //return mouse_table[1].fd; /* the second is handled in the main() */
-+ atexit(gpm_exited); /* call gpm_exited at the end */
-+}
-
-- /****************** OLD CODE from gpn.c END ***********************/
-+/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two
-+ completely different things; opening a socket to a running daemon
-+ and checking that a running daemon existed. Ugly. */
-+/* rewritten mostly on 20th of February 2002 - nico */
-+void check_uniqueness(void)
-+{
-+ FILE *fp = 0;
-+ int old_pid = -1;
-
-- init_mice(option.micelist); /* reads option.micelist */
-- atexit(gpm_exited); /* call gpm_exited at the end */
-+ if ((fp = fopen(GPM_NODE_PID, "r")) != NULL) {
-+ fscanf(fp, "%d", &old_pid);
-+ if (kill(old_pid, 0) == -1) {
-+ gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID);
-+ unlink(GPM_NODE_PID);
-+ } else /* we are really running, exit asap! */
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_ALREADY_RUN, old_pid);
-+ }
-+ /* now try to sign ourself */
-+ if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) {
-+ fprintf(fp,"%d\n",getpid());
-+ fclose(fp);
-+ } else {
-+ gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID);
-+ }
-+}
-
-+/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the
-+ unwanted functionality in check_uniqueness. */
-+void kill_gpm(void)
-+{
-+ int old_pid;
-+ FILE* fp = fopen(GPM_NODE_PID, "r");
-+
-+ /* if we cannot find the old pid file, leave */
-+ if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID);
-+
-+ /* else read the pid */
-+ if (fscanf(fp, "%d", &old_pid) != 1)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_READ_PROB, GPM_NODE_PID);
-+ fclose(fp);
-+
-+ gpm_report(GPM_PR_DEBUG, GPM_MESS_KILLING, old_pid);
-+
-+ /* first check if we run */
-+ if (kill(old_pid,0) == -1) {
-+ gpm_report(GPM_PR_INFO, GPM_MESS_STALE_PID, GPM_NODE_PID);
-+ unlink(GPM_NODE_PID);
-+ }
-+ /* then kill us (not directly, but the other instance ... ) */
-+ if (kill(old_pid, SIGTERM) == -1)
-+ gpm_report(GPM_PR_OOPS, GPM_MESS_CANT_KILL, old_pid);
-+
-+ gpm_report(GPM_PR_INFO, GPM_MESS_KILLED, old_pid);
-+ exit(0);
- }
-+
-diff -urN gpm-1.20.1/src/synaptics.c gpm/src/synaptics.c
---- gpm-1.20.1/src/synaptics.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/synaptics.c 2003-10-02 01:22:42.000000000 -0500
-@@ -865,7 +865,7 @@
- static int scrolling_speed_timer = 0;
- static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */
-
--
-+static int mouse_fd;
-
-
-
-@@ -882,6 +882,7 @@
- ** which makes reading the debug data harder, only dump the report if it is different
- ** than the previously dumped.
- */
-+#if DEBUG_REPORTS
- static void tp_dump_report_data (report_type report,
- int edges,
- Gpm_Event* state)
-@@ -934,7 +935,7 @@
- (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' '));
-
- }
--
-+#endif
-
- /* syn_dump_info
- **
-@@ -1158,8 +1159,8 @@
- status = GPM_B_NOT_SET;
- break;
- case Reset_Touchpad_Action:
-- syn_ps2_reset(which_mouse->fd);
-- syn_ps2_absolute_mode(which_mouse->fd);
-+ syn_ps2_reset(mouse_fd);
-+ syn_ps2_absolute_mode(mouse_fd);
- status = GPM_B_NOT_SET;
- break;
- case Toggle_Four_Way_Button_Action:
-@@ -2950,10 +2951,8 @@
- data [0],data [1],data [2],data [3],data [4],data [5]);
-
- if (reset_on_error_enabled) {
-- /* Hack to get the fd: which_mouse is the current mouse,
-- and as the synaptic code is called, it is the current mouse. */
-- syn_ps2_reset(which_mouse->fd);
-- syn_ps2_absolute_mode(which_mouse->fd);
-+ syn_ps2_reset(mouse_fd);
-+ syn_ps2_absolute_mode(mouse_fd);
- }
-
- report->left = 0;
-@@ -3108,7 +3107,7 @@
- **
- ** Process the touchpad 6 byte report.
- */
--void syn_process_serial_data (Gpm_Event *state,
-+void syn_process_serial_data (int fd, Gpm_Event *state,
- unsigned char *data)
- {
- /* initialize the state */
-@@ -3116,6 +3115,8 @@
- state->dx = 0;
- state->dy = 0;
-
-+ mouse_fd = fd; /* cheat */
-+
- syn_serial_translate_data (data, &cur_report);
- if (wmode_enabled){
- syn_process_wmode_report(&cur_report);
-@@ -3196,7 +3197,7 @@
- **
- ** Process the touchpad 6 byte report.
- */
--void syn_process_ps2_data (Gpm_Event *state,
-+void syn_process_ps2_data (int fd, Gpm_Event *state,
- unsigned char *data)
- {
- /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */
-@@ -3206,6 +3207,7 @@
- state->dx = 0;
- state->dy = 0;
-
-+ mouse_fd = fd; /* cheat */
-
- if (wmode_enabled) {
- syn_ps2_translate_wmode_data (data, &cur_report);
-diff -urN gpm-1.20.1/src/tools.c gpm/src/tools.c
---- gpm-1.20.1/src/tools.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/tools.c 1969-12-31 19:00:00.000000000 -0500
-@@ -1,93 +0,0 @@
--/*
-- * tools.c - tools which are needed by client and server
-- *
-- * Copyright (c) 2001 Nico Schottelius <nico@schottelius.org>
-- *
-- * 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 of the License, 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.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-- ********/
--
--#include <stdio.h> /* NULL */
--#include <string.h>
--#include <stdlib.h>
--#include <sys/types.h> /* these three are */
--#include <sys/stat.h> /* needed for */
--#include <unistd.h> /* stat() */
--
--#include "headers/gpmInt.h" /* only used for some defines */
--#include "headers/message.h"
--
--/*****************************************************************************
-- * check, whether devfs is used or not.
-- * See /usr/src/linux/Documentation/filesystems/devfs/ for details.
-- * Returns: the name of the console (/dev/tty0 or /dev/vc/0)
-- *****************************************************************************/
--char *Gpm_get_console( void )
--{
--
-- char *back = NULL, *tmp = NULL;
-- struct stat buf;
--
-- /* first try the devfs device, because in the next time this will be
-- * the preferred one. If that fails, take the old console */
--
-- /* Check for open new console */
-- if (stat(GPM_DEVFS_CONSOLE,&buf) == 0)
-- tmp = GPM_DEVFS_CONSOLE;
--
-- /* Failed, try OLD console */
-- else if(stat(GPM_OLD_CONSOLE,&buf) == 0)
-- tmp = GPM_OLD_CONSOLE;
--
-- if(tmp != NULL)
-- if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL)
-- strcpy(back,tmp);
--
-- return(back);
--}
--
--/* what's the english name for potenz ? */
--int Gpm_x_high_y(int base, int pot_y)
--{
-- int val = 1;
--
-- if(pot_y == 0) val = 1;
-- else if(pot_y < 0) val = 0; /* ugly hack ;) */
-- else while(pot_y > 0) {
-- val = val * base;
-- pot_y--;
-- }
-- return val;
--}
--
--/* return characters needed to display int */
--int Gpm_cnt_digits(int number)
--{
-- /* 0-9 = 1 10^0 <-> (10^1)-1
-- * 10 - 99 = 2 10^1 <-> (10^2)-1
-- * 100 - 999 = 3 10^2 <-> (10^3)-1
-- * 1000 - 9999 = 4 ... */
--
-- int ret = 0, num = 0;
--
-- /* non negative, please */
-- if(number < 0) number *= -1;
-- else if(number == 0) ret = 1;
-- else while(number > num) {
-- ret++;
-- num = (Gpm_x_high_y(10,ret) - 1);
-- }
--
-- return(ret);
--}
-diff -urN gpm-1.20.1/src/twiddler.c gpm/src/twiddler.c
---- gpm-1.20.1/src/twiddler.c 2002-12-24 17:57:16.000000000 -0500
-+++ gpm/src/twiddler.c 2003-10-02 01:22:42.000000000 -0500
-@@ -54,6 +54,7 @@
- #include "headers/gpm.h"
- #include "headers/gpmInt.h"
- #include "headers/message.h"
-+#include "headers/console.h"
- #include "headers/twiddler.h"
-
-
-@@ -134,17 +135,6 @@
- int (*fun)(char *string);
- };
-
--
--/* The same silly function as in gpm.c */
--static inline int open_console(const int mode)
--{
-- int fd;
-- extern struct options option;
-- if ((fd=open(option.consolename, mode)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,option.consolename);
-- return fd;
--}
--
--
- /*===================================================================*/
- /* This part deals with pushing keys */
-
-@@ -175,7 +165,7 @@
- int twiddler_exec(char *s)
- {
- int pid;
-- extern struct options option;
-+
- switch(pid=fork()) {
- case -1: return -1;
- case 0:
-@@ -184,7 +174,7 @@
- close(2); /* very rude! */
-
- open(GPM_NULL_DEV,O_RDONLY);
-- open(option.consolename,O_WRONLY);
-+ open(console.device, O_WRONLY);
- dup(1);
- execl("/bin/sh", "sh", "-c", s, NULL);
- exit(1); /* shouldn't happen */
diff --git a/source/a/gpm/gpm.SlackBuild b/source/a/gpm/gpm.SlackBuild
index a79ce2b6..25ac63b0 100755
--- a/source/a/gpm/gpm.SlackBuild
+++ b/source/a/gpm/gpm.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,8 +22,8 @@
# by: volkerdi@slackware.com
-VERSION=1.20.1
-BUILD=${BUILD:-5}
+VERSION=1.20.7
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -54,10 +54,10 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
-rm -rf gpm-$VERSION
-tar xjvf $CWD/gpm-$VERSION.tar.bz2
-cd gpm-$VERSION
-sed -i -e "s/OPEN_MAX/NR_OPEN/" $(grep -lr OPEN_MAX *)
+rm -rf gpm-$VERSION || exit 1
+tar xvf $CWD/gpm-$VERSION.tar.xz || exit 1
+cd gpm-$VERSION || exit 1
+
chown -R root:root .
find . \
\( -perm 700 -o -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -65,90 +65,80 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-zcat $CWD/gpm-evdev-cumulative.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm.evdevmakefile.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-math.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-weak-wgetch.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-nodebug.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-gpmopen.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-idie.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-subscript.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-input.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-consolename.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-multilib.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-no-console-error.patch.gz | patch -p1 --verbose || exit 1
zcat $CWD/gpm-1.20.1-lib-silent.patch.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1.send-noise-to-syslogs.diff.gz | patch -p1 --verbose || exit 1
-zcat $CWD/gpm-1.20.1-input-defines.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/gpm-1.20.5-close-fds.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/gpm-1.20.1-select-1.patch.gz | patch -p1 --verbose || exit 1
+
+sh autogen.sh
+
+# This is *supposed* to prevent linking libgpm.so with -lncurses,
+# but for some reason it doesn't have the desired effect here.
+# Any ideas? The patch is supposed to resolve a circular dependency
+# between libgpm.so and libncurses.so. I don't notice any ill effects
+# here, but perhaps the problem would occur if prelinking was used.
+# Also, ncurses has not shown an ldd link to libgpm for several releases,
+# so perhaps any problem that existed was fixed on their end.
+# NOTE: Since this isn't preventing gpm from linking to ncurses, I'm
+# commenting this patch out until we understand better if it's even
+# useful for anything. Half a patch seems worse than no patch.
+#zcat $CWD/gpm-1.20.1-weak-wgetch.patch.gz | patch -p1 --verbose || exit 1
+# Since we just patched configure.ac, run this again to carry the change
+# into configure:
autoconf
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
- $ARCH-slackware-linux
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --build=$ARCH-slackware-linux
make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+rm -f $PKG/usr/share/emacs/site-lisp/*.elc
+
+chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.so.*
+mkdir $PKG/lib${LIBDIRSUFFIX}
+mv $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.so.* $PKG/lib${LIBDIRSUFFIX}
+rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.so
+( cd $PKG/usr/lib${LIBDIRSUFFIX}
+ ln -sf ../../lib${LIBDIRSUFFIX}/libgpm.so.? libgpm.so )
+
zcat $CWD/inputattach.c.gz > inputattach.c
gcc $SLKCFLAGS -o inputattach inputattach.c || exit
-
-mkdir -p $PKG/usr/bin $PKG/etc/rc.d
cat inputattach > $PKG/usr/bin/inputattach
-( cd src
- mkdir -p $PKG/usr/sbin
- cat gpm > $PKG/usr/sbin/gpm
- cat prog/disable-paste > $PKG/usr/bin/disable-paste
- cat prog/gpm-root > $PKG/usr/bin/gpm-root
- cat prog/hltest > $PKG/usr/bin/hltest
- cat prog/mev > $PKG/usr/bin/mev
- cat prog/mouse-test > $PKG/usr/bin/mouse-test
- mkdir -p $PKG/usr/include
- cp headers/gpm.h $PKG/usr/include/gpm.h
- chmod 644 $PKG/usr/include/gpm.h
- mkdir -p $PKG/usr/lib${LIBDIRSUFFIX} $PKG/lib${LIBDIRSUFFIX}
- cat lib/libgpm.a > $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.a
- cat lib/libgpm.so.1.19.0 > $PKG/lib${LIBDIRSUFFIX}/libgpm.so.1.19.0
- chmod 755 $PKG/lib${LIBDIRSUFFIX}/libgpm.so.1.19.0
-)
+
+mkdir -p $PKG/etc/rc.d
+
( cd conf
- mkdir -p $PKG/etc
cat gpm-root.conf > $PKG/etc/gpm-root.conf
cat gpm-syn.conf > $PKG/etc/gpm-syn.conf
cat gpm-twiddler.conf > $PKG/etc/gpm-twiddler.conf
)
-( cd contrib/emacs
- mkdir -p $PKG/usr/share/emacs/site-lisp
- cat t-mouse.el > $PKG/usr/share/emacs/site-lisp/t-mouse.el
-)
+
+mv $PKG/usr/share/{info,man} $PKG/usr
+gzip -9 $PKG/usr/man/man*/*.?
+gzip -9 $PKG/usr/info/*
+
mkdir -p $PKG/usr/doc/gpm-$VERSION
cp -a \
- BUGS COPYING Changelog Changes MANIFEST README TODO \
+ BUGS COPYING* Changelog Changes MANIFEST README* TODO \
+ doc/{Announce,FAQ,HACK_GPM,README*,changelog} \
$PKG/usr/doc/gpm-$VERSION
-( cd doc
- for page in *.1 *.7 *.8 ; do
- CHAPTER=`echo $page | cut -f 2 -d .`
- mkdir -p $PKG/usr/man/man$CHAPTER
- cat $page | gzip -9c > $PKG/usr/man/man${CHAPTER}/$page.gz
- done
- mkdir -p $PKG/usr/info
- cat gpm.info | gzip -9c > $PKG/usr/info/gpm.info.gz
- cp -a \
- Announce FAQ HACK_GPM README* \
- $PKG/usr/doc/gpm-$VERSION
-)
-( cd $PKG/usr/lib${LIBDIRSUFFIX}
- ln -sf ../../lib${LIBDIRSUFFIX}/libgpm.so.1 libgpm.so )
-( cd $PKG/lib${LIBDIRSUFFIX} ; ln -sf libgpm.so.1.19.0 libgpm.so.1 )
+
zcat $CWD/mouseconfig.gz > $PKG/usr/sbin/mouseconfig
chmod 755 $PKG/usr/bin/* $PKG/usr/sbin/*
mkdir -p $PKG/var/log/setup
zcat $CWD/setup.mouse.gz > $PKG/var/log/setup/setup.mouse
chmod 755 $PKG/var/log/setup/setup.mouse
+
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
diff --git a/source/a/gpm/gpm.evdevmakefile.patch b/source/a/gpm/gpm.evdevmakefile.patch
deleted file mode 100644
index bd56c3aa..00000000
--- a/source/a/gpm/gpm.evdevmakefile.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./src/Makefile.in.orig 2006-02-07 15:24:17.000000000 -0600
-+++ ./src/Makefile.in 2006-02-07 15:26:03.000000000 -0600
-@@ -12,7 +12,7 @@
- include $(top_builddir)/Makefile.include
-
- # Main portion: regular build rules
--MICESRC = mice.c twiddler.c synaptics.c @EVDEV_SRCS@
-+MICESRC = mice.c twiddler.c synaptics.c evdev.c
-
- GSRC = main.c gpm.c gpn.c special.c startup.c server_tools.c console.c \
- selection.c client.c optparser.c $(MICESRC)
diff --git a/source/a/gpm/slack-desc b/source/a/gpm/slack-desc
index 17774f10..7d0bdc95 100644
--- a/source/a/gpm/slack-desc
+++ b/source/a/gpm/slack-desc
@@ -14,6 +14,6 @@ gpm: server for applications running on the Linux console, such as the
gpm: Midnight Commander file manager.
gpm:
gpm: NOTE: This program may cause problems when you start X on systems
-gpm: that do not use a serial mouse. If you get an 'unable to open mouse
-gpm: device' error from X, disable /etc/rc.d/rc.gpm.
+gpm: that use a bus mouse (not common). If you get an 'unable to open
+gpm: mouse device' error from X, disable /etc/rc.d/rc.gpm.
gpm:
diff --git a/source/a/gptfdisk/gptfdisk.SlackBuild b/source/a/gptfdisk/gptfdisk.SlackBuild
index 6c6f5fc9..c6155653 100755
--- a/source/a/gptfdisk/gptfdisk.SlackBuild
+++ b/source/a/gptfdisk/gptfdisk.SlackBuild
@@ -24,7 +24,7 @@
PKGNAM=gptfdisk
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/a/grub/doinst.sh b/source/a/grub/doinst.sh
new file mode 100644
index 00000000..20b6c34e
--- /dev/null
+++ b/source/a/grub/doinst.sh
@@ -0,0 +1,16 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/grub.d/40_custom.new
+rm -f etc/grub.d/40_custom.new
+config etc/default/grub.new
diff --git a/source/a/grub/etc.default.grub b/source/a/grub/etc.default.grub
new file mode 100644
index 00000000..f612a35a
--- /dev/null
+++ b/source/a/grub/etc.default.grub
@@ -0,0 +1,28 @@
+# If you change this file, run grub-mkconfig -o /boot/grub/grub.cfg
+# afterwards to update /boot/grub/grub.cfg.
+
+GRUB_DEFAULT=0
+#GRUB_HIDDEN_TIMEOUT=0
+GRUB_HIDDEN_TIMEOUT_QUIET=false
+GRUB_TIMEOUT=10
+GRUB_DISTRIBUTOR=$( sed 's/Slackware /Slackware-/' /etc/slackware-version )
+GRUB_CMDLINE_LINUX_DEFAULT=""
+GRUB_CMDLINE_LINUX=""
+
+# Uncomment to disable graphical terminal (grub-pc only)
+#GRUB_TERMINAL=console
+
+# The resolution used on graphical terminal
+# note that you can use only modes which your graphic card supports via VBE
+# you can see them in real GRUB with the command `vbeinfo'
+#GRUB_GFXMODE=640x480
+#GRUB_GFXMODE=1024x768x32
+
+# Font used on the graphical terminal:
+#GRUB_FONT=/usr/share/grub/dejavusansmono.pf2
+
+# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entrys
+#GRUB_DISABLE_LINUX_RECOVERY="true"
diff --git a/source/a/grub/grub.SlackBuild b/source/a/grub/grub.SlackBuild
new file mode 100755
index 00000000..5a0c27e8
--- /dev/null
+++ b/source/a/grub/grub.SlackBuild
@@ -0,0 +1,192 @@
+#!/bin/sh
+
+# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PKGNAM=grub
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7lh ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
+fi
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2"
+ EFI_FLAGS=" --with-platform=efi --target=x86_64 --program-prefix= "
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Use /boot/initrd.gz as a valid initrd name:
+zcat $CWD/initrd_naming.patch | patch -p1 --verbose || exit 1
+
+# Patch for recent glibc:
+zcat $CWD/txtHRnXiHYUrM.txt.gz | patch -p0 --verbose || exit 1
+
+# Support DejaVuSansMono font (dejavusansmono.pf2) by default:
+zcat $CWD/grub.dejavusansmono.gfxterm.font.diff.gz | patch -p1 --verbose || exit 1
+
+# Terminate EFI several times. This is a workaround for broken UEFI firmware.
+zcat $CWD/grub.e75fdee420a7ad95e9a465c9699adc2e2e970440.terminate.efi.several.times.diff.gz | patch -p1 --verbose || exit 1
+
+for i in 1 2 ; do
+ # Skip to regular build if EFI support is not requested:
+ if [ i = 1 -a -z "$EFI_FLAGS" ]; then
+ continue;
+ fi
+
+ # Configure:
+ CFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --infodir=/usr/info \
+ --mandir=/usr/man \
+ --disable-werror \
+ $EFI_FLAGS
+
+ # Build and install:
+ make clean
+ make $NUMJOBS || make || exit 1
+ make install DESTDIR=$PKG || exit 1
+
+ # Clear $EFI_FLAGS for a regular build:
+ unset EFI_FLAGS
+done
+
+# Preserve the contents of /etc/grub.d/40_custom:
+mv $PKG/etc/grub.d/40_custom $PKG/etc/grub.d/40_custom.new
+
+# Strip binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+mkdir -p $PKG/etc/default
+cat $CWD/etc.default.grub > $PKG/etc/default/grub.new
+
+# Add fonts, if found on the system:
+FONT_SIZE=${FONT_SIZE:-19}
+if [ -r /usr/share/fonts/TTF/unifont.ttf ]; then
+ $PKG/usr/bin/grub-mkfont -o $PKG/usr/share/grub/unifont.pf2 -abv \
+ -s $FONT_SIZE /usr/share/fonts/TTF/unifont.ttf
+fi
+if [ -r /usr/share/fonts/TTF/DejaVuSansMono.ttf ]; then
+ $PKG/usr/bin/grub-mkfont -o $PKG/usr/share/grub/dejavusansmono.pf2 -abv \
+ -s $FONT_SIZE /usr/share/fonts/TTF/DejaVuSansMono.ttf
+fi
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AUTHORS BUGS COPYING* INSTALL NEWS README* THANKS TODO \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+# Compress and if needed symlink the man pages:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Compress info files, if any:
+if [ -d $PKG/usr/info ]; then
+ ( cd $PKG/usr/info
+ rm -f dir
+ gzip -9 *
+ )
+fi
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/a/grub/grub.dejavusansmono.gfxterm.font.diff b/source/a/grub/grub.dejavusansmono.gfxterm.font.diff
new file mode 100644
index 00000000..53c21ba8
--- /dev/null
+++ b/source/a/grub/grub.dejavusansmono.gfxterm.font.diff
@@ -0,0 +1,43 @@
+--- ./util/grub.d/00_header.in.orig 2012-05-03 18:04:39.000000000 -0500
++++ ./util/grub.d/00_header.in 2013-09-17 01:43:37.870841064 -0500
+@@ -143,7 +143,7 @@
+ EOF
+ else
+ for dir in "${pkgdatadir}" "`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`" /usr/share/grub ; do
+- for basename in unicode unifont ascii; do
++ for basename in unicode unifont dejavusansmono ascii; do
+ path="${dir}/${basename}.pf2"
+ if is_path_readable_by_grub "${path}" > /dev/null ; then
+ font_path="${path}"
+@@ -156,7 +156,7 @@
+ if [ -n "${font_path}" ] ; then
+ cat << EOF
+ if [ x\$feature_default_font_path = xy ] ; then
+- font=unicode
++ font=dejavusansmono
+ else
+ EOF
+ # Make the font accessible
+@@ -169,7 +169,7 @@
+ EOF
+ else
+ cat << EOF
+-if loadfont unicode ; then
++if loadfont dejavusansmono ; then
+ EOF
+ fi
+ fi
+--- ./util/grub-install.in.orig 2012-06-26 16:31:03.000000000 -0500
++++ ./util/grub-install.in 2013-09-17 01:42:02.678834196 -0500
+@@ -552,6 +552,11 @@
+ cp "${pkgdatadir}"/themes/starfield/* "${grubdir}"/themes/starfield
+ fi
+
++if test -f "${pkgdatadir}"/dejavusansmono.pf2; then
++ mkdir -p "${grubdir}"/fonts
++ cp "${pkgdatadir}"/dejavusansmono.pf2 "${grubdir}"/fonts
++fi
++
+ if test -f "${pkgdatadir}"/unicode.pf2; then
+ mkdir -p "${grubdir}"/fonts
+ cp "${pkgdatadir}"/unicode.pf2 "${grubdir}"/fonts
diff --git a/source/a/grub/grub.e75fdee420a7ad95e9a465c9699adc2e2e970440.terminate.efi.several.times.diff b/source/a/grub/grub.e75fdee420a7ad95e9a465c9699adc2e2e970440.terminate.efi.several.times.diff
new file mode 100644
index 00000000..d4552848
--- /dev/null
+++ b/source/a/grub/grub.e75fdee420a7ad95e9a465c9699adc2e2e970440.terminate.efi.several.times.diff
@@ -0,0 +1,75 @@
+From e75fdee420a7ad95e9a465c9699adc2e2e970440 Mon Sep 17 00:00:00 2001
+From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
+Date: Tue, 26 Mar 2013 10:34:56 +0000
+Subject: * grub-core/kern/efi/mm.c (grub_efi_finish_boot_services):
+
+ Try terminating EFI services several times due to quirks in some
+ implementations.
+---
+(limited to 'grub-core/kern/efi/mm.c')
+
+diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
+index 351317b..77c9384 100644
+--- a/grub-core/kern/efi/mm.c
++++ b/grub-core/kern/efi/mm.c
+@@ -160,27 +160,41 @@ grub_efi_finish_boot_services (grub_efi_uintn_t *outbuf_size, void *outbuf,
+ apple, sizeof (apple)) == 0);
+ #endif
+
+- if (grub_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key,
+- &finish_desc_size, &finish_desc_version) < 0)
+- return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map");
++ while (1)
++ {
++ if (grub_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key,
++ &finish_desc_size, &finish_desc_version) < 0)
++ return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map");
+
+- if (outbuf && *outbuf_size < finish_mmap_size)
+- return grub_error (GRUB_ERR_IO, "memory map buffer is too small");
++ if (outbuf && *outbuf_size < finish_mmap_size)
++ return grub_error (GRUB_ERR_IO, "memory map buffer is too small");
+
+- finish_mmap_buf = grub_malloc (finish_mmap_size);
+- if (!finish_mmap_buf)
+- return grub_errno;
++ finish_mmap_buf = grub_malloc (finish_mmap_size);
++ if (!finish_mmap_buf)
++ return grub_errno;
+
+- if (grub_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key,
+- &finish_desc_size, &finish_desc_version) <= 0)
+- return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map");
++ if (grub_efi_get_memory_map (&finish_mmap_size, finish_mmap_buf, &finish_key,
++ &finish_desc_size, &finish_desc_version) <= 0)
++ {
++ grub_free (finish_mmap_buf);
++ return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map");
++ }
+
+- b = grub_efi_system_table->boot_services;
+- status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle,
+- finish_key);
+- if (status != GRUB_EFI_SUCCESS)
+- return grub_error (GRUB_ERR_IO, "couldn't terminate EFI services");
++ b = grub_efi_system_table->boot_services;
++ status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle,
++ finish_key);
++ if (status == GRUB_EFI_SUCCESS)
++ break;
+
++ if (status != GRUB_EFI_INVALID_PARAMETER)
++ {
++ grub_free (finish_mmap_buf);
++ return grub_error (GRUB_ERR_IO, "couldn't terminate EFI services");
++ }
++
++ grub_free (finish_mmap_buf);
++ grub_printf ("Trying to terminate EFI services again\n");
++ }
+ grub_efi_is_finished = 1;
+ if (outbuf_size)
+ *outbuf_size = finish_mmap_size;
+--
+cgit v0.9.0.2
+
diff --git a/source/a/grub/initrd_naming.patch b/source/a/grub/initrd_naming.patch
new file mode 100644
index 00000000..6b62778b
--- /dev/null
+++ b/source/a/grub/initrd_naming.patch
@@ -0,0 +1,13 @@
+diff -Naur grub-2.00.orig/util/grub.d/10_linux.in grub-2.00/util/grub.d/10_linux.in
+--- grub-2.00.orig/util/grub.d/10_linux.in 2012-04-18 23:24:38.000000000 +0200
++++ grub-2.00/util/grub.d/10_linux.in 2012-06-30 07:53:03.765625589 +0200
+@@ -198,7 +198,8 @@
+ "initramfs-genkernel-${version}" \
+ "initramfs-genkernel-${alt_version}" \
+ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
+- "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
++ "initrd.gz"; do
+ if test -e "${dirname}/${i}" ; then
+ initrd="$i"
+ break
diff --git a/source/a/grub/slack-desc b/source/a/grub/slack-desc
new file mode 100644
index 00000000..a8159e64
--- /dev/null
+++ b/source/a/grub/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+grub: GRUB (the GRand Unified Bootloader)
+grub:
+grub: GNU GRUB is a multiboot boot loader.
+grub:
+grub: Website: http://www.gnu.org/software/grub/
+grub:
+grub:
+grub:
+grub:
+grub:
+grub:
diff --git a/source/a/grub/txtHRnXiHYUrM.txt b/source/a/grub/txtHRnXiHYUrM.txt
new file mode 100644
index 00000000..b67251f1
--- /dev/null
+++ b/source/a/grub/txtHRnXiHYUrM.txt
@@ -0,0 +1,49 @@
+# Bazaar merge directive format 2 (Bazaar 0.90)
+# revision_id: address@hidden
+# target_branch: http://bzr.savannah.gnu.org/r/grub/trunk/grub/
+# testament_sha1: 1c14caf607a0200c0f6c4357baa520d6d5a0297b
+# timestamp: 2012-07-04 17:30:47 +0200
+# base_revision_id: address@hidden
+#
+# Begin patch
+=== modified file 'grub-core/gnulib/stdio.in.h'
+--- grub-core/gnulib/stdio.in.h 2010-09-20 10:35:33 +0000
++++ grub-core/gnulib/stdio.in.h 2012-07-04 15:18:15 +0000
+@@ -140,8 +140,10 @@
+ /* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning. Assume it is
+ always declared, since it is required by C89. */
++#if defined gets
+ #undef gets
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+
+# Begin bundle
+IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWaToPesAAfhfgAAQ2Pf/91s2
+2kq////wUAUNaebQdnLC2nS7GCUQQJiaT0xMVPAFPSHqeSPUekDT1DxIMkmp4CMjQKYIZTQaBkAA
+AAlCBJmmkGEGqP1QDQBkyeoyAAHMAmAmRgBGJiYTCYIaYmmAkhETaU2jKeiaaMo00ybTRAMhoAZE
+8tJd05M/VpkKqZr1UWlZidFLnZHIFGBpA6iFmCP+enOp6RDhNhWZylIRZ+P1Oc1VUs/HzCkLPAxt
+XwunBn7vOjjziSdUxqx9ub8/jEdn54odK76GXxknCKa3994J9cFbmU0TjYVx4PuSkX45S7lsu6fB
+11tpevByhSKUFgynati1fZO2qnwXbsOnRj3eSMVDcR01oxGDH70eZVV8eHKuG/16A8oZX4GRA3HY
+WkgOtgkaVTSP2e+4fqq+AdFSyaWzqIMSbODi0FMCs5i4tK754ns80FDKZDi7pJaux5hYGJNNqZJP
+zqB04nTwgmOMnWmSaSehwVSt8isXiDIhjFH3WwPkYZoYudtHD1+dli7GkDvrkbPDnlQzcO42UIST
+ZBHIlFlQKJxbulrJVwmiKz1E4kmKcvEYpUpWUIESBoc5sXKigHQ1wWB1DoXUYiExOCWCbUEDIz2X
+B0mZugsLQzU7eyo5iF2J3SEDscqwFBNGo+8Ls4birmk8x/MQ3O7kfHfekQWJbuJUC5O1osgKvlDY
+HaYcZFabX2SSVlVC06WUWBiM+xtOEiAk+vIHJhu4hU5zOaC7UMuUKogM8IIrIP2RuFu6UXzmu6CE
+b0KkW+dLcUWvCemnZbAq4967czYKS2OjhUyjmIskEaKwNQQvWngeNMePErVz/fXjStE+PWKVRVXn
+OefXfA5O8TDavj6OOyu79pepI9rcDfrmZdffAht1uGQNDMfM2MuwQon23kn00U6rilRZzBWI7an9
+r1YNKrA7PHvE0dMjOj49RZHkOLjYjhfgemY9+IYMMacxhAYnRVZBHcNG1jejWHLdmKD5e7Q/DwM+
+o8NN1T4cVciq3yGD/Yk4hXYQpFALHFoUHjMZUxk+rbkak6tSdY6Ukgasy2OCsE6LyS+GJiEZE5Y9
+9YC3sznc2z5s9SLjlLQkVO4EI39Hi177Ba51BYWkaaO3QuL1V+xn8M92bnq+oFjESvXvXs/LGspc
+ftjWvcipQN+TJtvzlXlJzZ58oLZxRLQrIJCRLY28qKLY9g4tKxzyI2rydlUlTbtztcOv6tS41I9p
+DZdILnAmv2yXiI8O0yJhUpubNtN6frcf0hLBMEzLZEc55HAGOONL0RzW3h1ostOibFK8hC4mg1Rd
+UzNgmFEbwqV/23fvbpnnCloMFq0is6wj8G67yyY0FgLQY6x+fRLWEicxF4UCjhmqJnXx7IRG6S3g
+bbqtsYeWBBaJBT4AhDyHMJvvLlSGr8Y5hrQoN11iyQm72Nmp1IQ1CjmeUNoHHBybqbKXo87gTSky
+xTqMvhw55hsy6lPPBngJJFQTZHr4yYWBHRwj1BZ4lhQdmR5PbUqECl+1EOivQsYqELAwpwFvcvug
+4CbjkVYIDKqMVFC1rY3A6yWDFaxCbY4ickntghlpplCdtpl/NKNQZwH1JMqLaTwaOmUVSDoLh1NJ
+toHJWULox5WMMVOgRQ5mpxVvixydLNaFbQaDtvYvvzSIJvsLLzgyaK3CqqMy02jpRbS4YDWsJtBo
+A2QEyiKmT5i9Z6YW9BV/giVaTrhSp1GNpiaC9jXVDSx2AHUDgCsYj04hhF59vBUI0Hq0eO+H/F3J
+FOFCQpOg96w=
diff --git a/source/a/gzip/gzip.SlackBuild b/source/a/gzip/gzip.SlackBuild
index 19ef42fb..333f8d33 100755
--- a/source/a/gzip/gzip.SlackBuild
+++ b/source/a/gzip/gzip.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2006-2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006-2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PKGNAM=gzip
-VERSION=${VERSION:-1.5}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j6}
@@ -68,10 +68,6 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# The following command renames the internal implementation of futimens
-# to gl_futimens as newer versions of Glibc provide an incompatible version:
-sed -i -e "s/futimens/gl_&/" $(grep -lr futimens *)
-
# Configure:
CFLAGS="$SLKCFLAGS" \
./configure \
diff --git a/source/a/infozip/infozip.SlackBuild b/source/a/infozip/infozip.SlackBuild
index 5ac456d1..9205fca6 100755
--- a/source/a/infozip/infozip.SlackBuild
+++ b/source/a/infozip/infozip.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
VERSION=6.0
ZIP=3.0
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -65,12 +65,14 @@ cd $TMP
rm -rf unzip$(echo $VERSION | tr -d .)
tar xvf $CWD/unzip$(echo $VERSION | tr -d .).tar.?z* || exit 1
cd unzip$(echo $VERSION | tr -d .)
+zcat $CWD/unzip.use.system.libbz2.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/unzip.process.c.diff.gz | patch -p1 --verbose || exit 1
chown -R root:root .
mkdir -p $PKG/usr/doc/unzip-$VERSION
cp -a BUGS COPYING* Contents History.* INSTALL LICENSE README ToDo WHERE \
$PKG/usr/doc/unzip-$VERSION
chmod 644 $PKG/usr/doc/unzip-$VERSION/*
-make -f unix/Makefile generic || exit 1
+make -f unix/Makefile generic LOCAL_UNZIP=-DIZ_HAVE_UXUIDGID || exit 1
cat unzip > $PKG/usr/bin/unzip
cat unzipsfx > $PKG/usr/bin/unzipsfx
cat funzip > $PKG/usr/bin/funzip
diff --git a/source/a/infozip/unzip.process.c.diff b/source/a/infozip/unzip.process.c.diff
new file mode 100644
index 00000000..5894f7b0
--- /dev/null
+++ b/source/a/infozip/unzip.process.c.diff
@@ -0,0 +1,28 @@
+--- ./process.c.orig 2009-03-06 02:25:10.000000000 +0100
++++ ./process.c 2013-09-12 10:51:16.000000000 +0200
+@@ -2895,9 +2895,9 @@
+ */
+
+ #ifdef IZ_HAVE_UXUIDGID
+- if (eb_len >= EB_UX3_MINLEN
+- && z_uidgid != NULL
+- && (*((EB_HEADSIZE + 0) + ef_buf) == 1)
++ if ((eb_len >= EB_UX3_MINLEN)
++ && (z_uidgid != NULL)
++ && ((*((EB_HEADSIZE + 0) + ef_buf) == 1)))
+ /* only know about version 1 */
+ {
+ uch uid_size;
+@@ -2909,10 +2909,10 @@
+ flags &= ~0x0ff; /* ignore any previous UNIX field */
+
+ if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf,
+- uid_size, z_uidgid[0])
++ uid_size, &z_uidgid[0])
+ &&
+ read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf,
+- gid_size, z_uidgid[1]) )
++ gid_size, &z_uidgid[1]) )
+ {
+ flags |= EB_UX2_VALID; /* signal success */
+ }
diff --git a/source/a/infozip/unzip.use.system.libbz2.diff b/source/a/infozip/unzip.use.system.libbz2.diff
new file mode 100644
index 00000000..ab10997d
--- /dev/null
+++ b/source/a/infozip/unzip.use.system.libbz2.diff
@@ -0,0 +1,28 @@
+--- ./unix/configure.orig 2009-04-16 14:25:12.000000000 -0500
++++ ./unix/configure 2013-09-12 13:32:24.274604436 -0500
+@@ -640,7 +640,24 @@
+ D_USE_BZ2="-DUSE_BZIP2"
+ L_BZ2="${BZLF} -lbz2"
+ else
+- echo "-- bzip2 sources not found - no bzip2 support"
++ echo " Check if OS already has bzip2 library installed"
++ cat > conftest.c << _EOF_
++#include "bzlib.h"
++int main()
++{
++ bz_stream strm;
++ BZ2_bzCompressEnd(&strm);
++ return 0;
++}
++_EOF_
++ $CC $CFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
++ if test $? -eq 0; then
++ echo "-- OS supports bzip2 - linking in bzip2"
++ D_USE_BZ2="-DUSE_BZIP2"
++ L_BZ2="${BZLF} -lbz2"
++ else
++ echo "-- Either bzlib.h or libbz2.a not found - no bzip2"
++ fi
+ fi
+ fi
+
diff --git a/source/a/kernel-firmware/kernel-firmware.SlackBuild b/source/a/kernel-firmware/kernel-firmware.SlackBuild
index 66445ea8..c7b50a5c 100755
--- a/source/a/kernel-firmware/kernel-firmware.SlackBuild
+++ b/source/a/kernel-firmware/kernel-firmware.SlackBuild
@@ -40,6 +40,15 @@ chown -R root:root .
mkdir -p lib
mv linux-firmware lib/firmware
+# Remove sources for carl9170fw:
+( cd $PKG/lib/firmware
+ if [ -d carl9170fw ]; then
+ mv carl9170fw/COPYRIGHT COPYRIGHT.carl9170fw
+ mv carl9170fw/GPL LICENSE.carl9170fw
+ rm -rf carl9170fw
+ fi
+)
+
# Install documentation link:
mkdir -p $PKG/usr/doc
( cd $PKG/usr/doc
diff --git a/source/a/kmod/kmod-15.tar.sign b/source/a/kmod/kmod-15.tar.sign
new file mode 100644
index 00000000..0e79dd5b
--- /dev/null
+++ b/source/a/kmod/kmod-15.tar.sign
@@ -0,0 +1,17 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.21 (GNU/Linux)
+
+iQIcBAABAgAGBQJSFhpaAAoJEJuipaYwy+pT55AP/jZK04iAzoyrGYXlFWo+ngBP
+f34CueSb3OJs+JQ6CJZNS5qg83XmOWhTSt2r41nH+N5kWmrF2NsDJ58zzqWy/Rwq
+VW4AmSImeJSAi4jtV5T3gjp25htqO1pW57dPwugX4F13PkxqD+l8lJ28X0FcY32k
+POR0uiYc0qLOssUASVdFJeRgrYA9V3/Se+fOr118GYWji5S+NlwYSCKb3Khu/j2U
+cUHeVrEhbRbYGZ5sQ2ylC0RoM+9G/fJz9cSCxeZh1F6KuCfgJDOzfzLwTQzcRjSA
+sBflTMWcw6KcLa5AvNYIrQHIDXHrVn0kR1yQb4glgYygPfU2LhAA20VGPyYsp4JS
+6C55VrkXmhX6IlwA0LTdVGkNBOWmuPxzxtMInPoOVapCRHl1KnLMa68T38VSDwS8
+8g6fKM7gUEM5wu3w1ica9yXy9panaom7HBrMFouOjk9YU1DqkIV+ItbBfE9HdW1X
+x5LqoOktiuVtJCNbj8Ll6OsjMfKROa+pnRxMT95wA5l2e5rZljR6Ie0deTaRDFX/
+IOMHQn/oK3CIfYcjM5SOn3AaFNHE9KleYSewV/XC/m4YOnaKmUoCrhMJSJQxPUue
+9qLh3fqqSQSD3cZmRPfBFaT2cGnehbmx5oPh8uZIxqV8z21y6oNF3CbKSij9ZaeO
+sigBwb3OIcf7K5jCrdJl
+=qu/t
+-----END PGP SIGNATURE-----
diff --git a/source/a/kmod/kmod.SlackBuild b/source/a/kmod/kmod.SlackBuild
index 0863d0e3..4eb58cfa 100755
--- a/source/a/kmod/kmod.SlackBuild
+++ b/source/a/kmod/kmod.SlackBuild
@@ -2,7 +2,8 @@
# Slackware build script for kmod
-# Copyright 2011, 2012 Robby Workman, Northport, Alabama, USA
+# Copyright 2011,2012,2013 Robby Workman, Northport, Alabama, USA
+# Copyright 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,8 +24,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PKGNAM=kmod
-VERSION=${VERSION:-9}
-BUILD=${BUILD:-3}
+VERSION=${VERSION:-15}
+BUILD=${BUILD:-1}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
diff --git a/source/a/libcgroup/libcgroup.SlackBuild b/source/a/libcgroup/libcgroup.SlackBuild
index 286a7fa2..cc4cd421 100755
--- a/source/a/libcgroup/libcgroup.SlackBuild
+++ b/source/a/libcgroup/libcgroup.SlackBuild
@@ -23,7 +23,7 @@
PKGNAM=libcgroup
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/a/libcgroup/libcgroup.init.diff b/source/a/libcgroup/libcgroup.init.diff
index 75491295..72dcaa31 100644
--- a/source/a/libcgroup/libcgroup.init.diff
+++ b/source/a/libcgroup/libcgroup.init.diff
@@ -1,5 +1,5 @@
---- ./scripts/init.d/cgred.in.orig 2011-03-03 02:29:41.000000000 -0600
-+++ ./scripts/init.d/cgred.in 2011-03-03 14:23:03.000000000 -0600
+--- ./scripts/init.d/cgred.in.orig 2011-03-08 05:29:42.000000000 -0600
++++ ./scripts/init.d/cgred.in 2013-02-23 16:15:54.054745738 -0600
@@ -39,9 +39,8 @@
# Sanity checks
[ -x $CGRED_BIN ] || exit 1
@@ -60,8 +60,8 @@
fi
;;
*)
---- ./scripts/init.d/cgconfig.in.orig 2011-03-03 02:29:41.000000000 -0600
-+++ ./scripts/init.d/cgconfig.in 2011-03-03 14:21:27.000000000 -0600
+--- ./scripts/init.d/cgconfig.in.orig 2011-12-06 03:42:15.000000000 -0600
++++ ./scripts/init.d/cgconfig.in 2013-02-23 16:23:51.530775095 -0600
@@ -36,11 +36,6 @@
servicename=cgconfig
lockfile=/var/lock/subsys/$servicename
@@ -109,7 +109,7 @@
return 1
fi
fi
-@@ -123,10 +118,10 @@
+@@ -123,18 +118,18 @@
touch "$lockfile"
retval=$?
if [ $retval -ne 0 ]; then
@@ -122,9 +122,10 @@
return 0
}
-@@ -134,7 +129,7 @@
+ stop() {
echo -n "Stopping cgconfig service: "
- cgclear
+- cgclear
++ /usr/sbin/cgclear
rm -f "$lockfile"
- log_success_msg
+ #log_success_msg
diff --git a/source/a/lilo/lilo.SlackBuild b/source/a/lilo/lilo.SlackBuild
index 2df7618d..c481b015 100755
--- a/source/a/lilo/lilo.SlackBuild
+++ b/source/a/lilo/lilo.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2011, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,8 +21,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-23.2}
-BUILD=${BUILD:-3}
+VERSION=${VERSION:-24.0}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -47,12 +47,6 @@ tar xvf $CWD/lilo-$VERSION.tar.gz || exit 1
cd lilo-$VERSION
chown -R root:root .
-# Obsolete patch?
-## This is needed for LVM+udev+devtmpfs
-#( cd src
-# zcat $CWD/lilo.use_major_minor_instead_lvm_name.diff.gz | patch -p1 --verbose || exit 1
-#)
-
make || exit 1
make -i install DESTDIR=$PKG || exit 1
@@ -75,7 +69,7 @@ mkdir -p $PKG/sbin
cp -a $CWD/liloconfig $PKG/sbin/liloconfig
chmod 755 $PKG/sbin/liloconfig
# Hey, you're stomping on our name! Plus, it doesn't work.
-rm -f $PKG/usr/sbin/liloconfig
+rm -f $PKG/usr/sbin/liloconfig $PKG/usr/share/man/man8/liloconfig.8
mkdir -p $PKG/var/log/setup
cp -a $CWD/setup.liloconfig $PKG/var/log/setup/setup.liloconfig
cp -a $CWD/text.lilohelp $PKG/var/log/setup/text.lilohelp
diff --git a/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff b/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff
deleted file mode 100644
index 860347eb..00000000
--- a/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff
+++ /dev/null
@@ -1,47 +0,0 @@
---- lilo-22.8/geometry.c 2006-12-17 01:46:17.000000000 -0200
-+++ lilo-22.8-new/geometry.c 2009-12-18 02:09:54.000000000 -0200
-@@ -903,24 +903,17 @@
- void *next = NULL;
- char dmdev[PATH_MAX+1];
- char buf[PATH_MAX+1];
-- char *slash;
- int result;
-
- dev_open(&dev, device, -1);
- strncpy(dmdev, dev.name, PATH_MAX);
- dmdev[PATH_MAX] = 0;
-+
- do {
- memset(buf, 0, PATH_MAX + 1);
- if ((result = readlink(dmdev, buf, PATH_MAX)) < 0 && errno != EINVAL)
- die("device-mapper: readlink(\"%s\") failed with: %s",buf,
- strerror(errno));
-- if (result >= 0) {
-- if (buf[0] != '/' && (slash = strrchr(dmdev, '/')) != NULL)
-- slash++;
-- else
-- slash = dmdev;
-- strncpy(slash, buf, PATH_MAX - (slash-dmdev));
-- }
- if (realpath(dmdev, buf) == NULL)
- die("device-mapper: realpath(\"%s\") failed with: %s",dmdev,
- strerror(errno));
-@@ -930,13 +923,11 @@
-
- if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
- die("device-mapper: dm_task_create(DM_DEVICE_TABLE) failed");
-- slash = strrchr(dmdev, '/');
-- if (slash)
-- slash++;
-- else
-- slash = dmdev;
-- if (!dm_task_set_name(dmt, slash))
-- die("device-mapper: dm_task_set_name(\"%s\") failed",dmdev);
-+ // Using device name is flawed. Better to use device major and minor
-+ if (!dm_task_set_major(dmt, MAJOR(device)))
-+ die("device-mapper: dm_task_set_major(DM_DEVICE_TABLE) failed");
-+ if (!dm_task_set_minor(dmt, MINOR(device)))
-+ die("device-mapper: dm_task_set_minor(DM_DEVICE_TABLE) failed");
- if (!dm_task_run(dmt))
- die("device-mapper: dm_task_run(DM_DEVICE_TABLE) failed");
-
diff --git a/source/a/lilo/liloconfig b/source/a/lilo/liloconfig
index d8bc02dd..75e3b0eb 100644
--- a/source/a/lilo/liloconfig
+++ b/source/a/lilo/liloconfig
@@ -2,7 +2,7 @@
#
# Copyright 1994, 1998, 1999 Patrick Volkerding, Moorhead, Minnesota USA
# Copyright 2002, 2003 Slackware Linux, Inc, Concord, CA
-# Copyright 2007, 2008, 2011 Patrick Volkerding, Sebeka, Minnesota, USA
+# Copyright 2007, 2008, 2011, 2013 Patrick Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -26,6 +26,32 @@ TMP=/var/log/setup/tmp
CONSOLETYPE=standard
unset UTFVT
+# Most of the time LILO is not used on UEFI machines (in fact, it is useless
+# unless the machine is running in legacy BIOS mode). So, we'll detect if
+# this is a machine running UEFI and suggest skipping LILO installation.
+# We'll still allow it if the user wants it, though. It won't hurt anything,
+# and might be useful for booting in Legacy BIOS mode later.
+if [ -d /sys/firmware/efi ]; then
+ dialog --title "UEFI FIRMWARE DETECTED" \
+--backtitle "LILO (Linux Loader) installation" \
+--menu \
+"Since LILO (the traditional Linux Loader) does not work with machines \
+running UEFI firmware (except in Legacy BIOS mode), you probably do not \
+need to install it. Instead, you'll need ELILO, which is a version of \
+LILO designed to work with EFI/UEFI systems." \
+12 70 2 \
+"skip" "Skip installing LILO and proceed to ELILO installation" \
+"install" "Install LILO anyway" 2> $TMP/reply
+ if [ $? = 1 -o $? = 255 ]; then
+ exit
+ fi
+ REPLY="`cat $TMP/reply`"
+ rm -f $TMP/reply
+ if [ "$REPLY" = "skip" ]; then
+ exit
+ fi
+fi
+
# Set the OS root directory (called T_PX for some unknown reason).
# If an argument is given to this script and it is a directory, it
# is taken to be the root directory. First though, we check for a
@@ -52,6 +78,15 @@ if [ ! -d "$T_PX" ]; then
fi
fi
+# If os-prober is availible, we will use it to filter out unbootable
+# FAT/NTFS partitions. If it is not availble, we'll use /bin/true
+# instead to avoid filtering.
+if which os-prober > /dev/null ; then
+ OSPROBER=os-prober
+else
+ OSPROBER=true
+fi
+
# Determine LILO documentation directory:
LILODOCDIR="$(ls -d $T_PX/usr/doc/lilo-* 2> /dev/null | tail -n 1)"
if [ ! -d "$LILODOCDIR" ]; then
@@ -294,6 +329,7 @@ EOF
cat << EOF >> $T_PX/etc/lilo.conf
boot = $ROOT_DEVICE
#delay = 5
+#compact # faster, but won't work on all systems.
EOF
if [ $CONSOLETYPE = standard ]; then
cat << EOF >> $T_PX/etc/lilo.conf
@@ -396,6 +432,8 @@ EOF
cat << EOF >> $T_PX/etc/lilo.conf
boot = $LILO_TARGET
+#compact # faster, but won't work on all systems.
+
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
@@ -474,13 +512,18 @@ cat << EOF >> $T_PX/etc/lilo.conf
# End LILO global section
EOF
# OK, now let's look for Windows partitions:
- DOSP="`PROBE -l | grep "DOS
+ # If we have os-prober, use the Windows partition list from that:
+ if which os-prober > /dev/null ; then
+ DOSP="$(os-prober 2> /dev/null | grep Windows | cut -f 1 -d :)"
+ else # use PROBE output:
+ DOSP="$(PROBE -l | grep "DOS
Win
W95
FAT12
FAT16
-HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort`"
- DOSP="`echo $DOSP | cut -f 1 -d ' '`"
+HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort )"
+ DOSP="`echo $DOSP | cut -f 1 -d ' '`"
+ fi
if [ ! "$DOSP" = "" ]; then
TABLE="`echo $DOSP | cut -b1-8`"
cat << EOF >> $T_PX/etc/lilo.conf
@@ -896,7 +939,9 @@ default." 13 74 4 \
#
# Start LILO global section
boot = $LILO_TARGET
+
#compact # faster, but won't work on all systems.
+
EOF
# Boot splash
if [ "$PROMPT" = "prompt" ]; then
@@ -1096,7 +1141,7 @@ Win
W95
FAT12
FAT16
-HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort >> $TMP/tmpmsg
+HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort | grep "$($OSPROBER 2> /dev/null | grep Windows | cut -f 1 -d :)" >> $TMP/tmpmsg
echo >> $TMP/tmpmsg
echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
dialog --title "SELECT WINDOWS PARTITION" --no-collapse --inputbox \
diff --git a/source/a/logrotate/logrotate.SlackBuild b/source/a/logrotate/logrotate.SlackBuild
index e38f2715..63670a0a 100755
--- a/source/a/logrotate/logrotate.SlackBuild
+++ b/source/a/logrotate/logrotate.SlackBuild
@@ -20,7 +20,7 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-3.8.2}
+VERSION=${VERSION:-3.8.6}
BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
diff --git a/source/a/logrotate/logrotate.slackware.diff b/source/a/logrotate/logrotate.slackware.diff
index 6fa0436d..9e5160f3 100644
--- a/source/a/logrotate/logrotate.slackware.diff
+++ b/source/a/logrotate/logrotate.slackware.diff
@@ -11,15 +11,14 @@ diff -Nur logrotate-3.8.0.orig//config.c logrotate-3.8.0/config.c
};
static int defTabooCount = sizeof(defTabooExts) / sizeof(char *);
-diff -Nur logrotate-3.8.0.orig//logrotate.8 logrotate-3.8.0/logrotate.8
---- logrotate-3.8.0.orig//logrotate.8 2011-06-21 03:12:02.000000000 -0500
-+++ logrotate-3.8.0/logrotate.8 2011-08-22 15:56:12.247672243 -0500
-@@ -472,7 +472,7 @@
+--- logrotate-3.8.6/logrotate.8.orig 2013-08-02 16:28:41.591589317 +0700
++++ logrotate-3.8.6/logrotate.8 2013-08-02 16:29:09.280202548 +0700
+@@ -506,7 +506,7 @@
for information on the taboo extensions). If a + precedes the list of
extensions, the current taboo extension list is augmented, otherwise it
is replaced. At startup, the taboo extension list
--contains .rpmsave, .rpmorig, ~, .disabled, .dpkg-old, .dpkg-dist, .dpkg-new, .cfsaved, .ucf-old, .ucf-dist, .ucf-new, .rpmnew, .swp, .cfsaved, .rhn-cfg-tmp-*
-+contains .rpmsave, .rpmorig, ~, .disabled, .dpkg-old, .dpkg-dist, .dpkg-new, .cfsaved, .ucf-old, .ucf-dist, .ucf-new, .rpmnew, .swp, .cfsaved, .rhn-cfg-tmp-*, .new, .old, .orig, .bak
+-contains .rpmsave, .rpmorig, ~, .disabled, .dpkg\-old, .dpkg\-dist, .dpkg\-new, .cfsaved, .ucf\-old, .ucf\-dist, .ucf\-new, .rpmnew, .swp, .cfsaved, .rhn\-cfg\-tmp\-*
++contains .rpmsave, .rpmorig, ~, .disabled, .dpkg\-old, .dpkg\-dist, .dpkg\-new, .cfsaved, .ucf\-old, .ucf\-dist, .ucf\-new, .rpmnew, .swp, .cfsaved, .rhn\-cfg\-tmp\-*, .new, .old, .orig, .bak
.TP
\fBweekly\fR
diff --git a/source/a/lrzip/lrzip.SlackBuild b/source/a/lrzip/lrzip.SlackBuild
index b45a8a5a..5cc09be6 100755
--- a/source/a/lrzip/lrzip.SlackBuild
+++ b/source/a/lrzip/lrzip.SlackBuild
@@ -82,6 +82,8 @@ CFLAGS="$SLKCFLAGS" \
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
+rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
+
if [ -r doc/lrzip.conf.example ]; then
mkdir -p $PKG/etc
cp -a doc/lrzip.conf.example $PKG/etc/lrzip.conf.new
@@ -89,8 +91,11 @@ if [ -r doc/lrzip.conf.example ]; then
chmod 644 $PKG/etc/lrzip.conf.new
fi
-find $PKG | xargs file | grep -e "executable" -e "shared object" \
- | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+# Strip binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
# Compress and link manpages, if any:
if [ -d $PKG/usr/man ]; then
diff --git a/source/a/lvm2/lvm2.SlackBuild b/source/a/lvm2/lvm2.SlackBuild
index 349d5486..d662476c 100755
--- a/source/a/lvm2/lvm2.SlackBuild
+++ b/source/a/lvm2/lvm2.SlackBuild
@@ -22,7 +22,7 @@
VERSION=$(echo LVM2.*.tar.xz | cut -f 2- -d . | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
-BUILD=${BUILD:-4}
+BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j7 "}
diff --git a/source/a/minicom/minicom.SlackBuild b/source/a/minicom/minicom.SlackBuild
index 19ec515f..3d38d251 100755
--- a/source/a/minicom/minicom.SlackBuild
+++ b/source/a/minicom/minicom.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=2.6
+VERSION=2.6.2
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j6}
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch
deleted file mode 100644
index a012a706..00000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ash.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- busybox-1.20.1/shell/ash.c
-+++ busybox-1.20.1-ash/shell/ash.c
-@@ -6846,8 +6846,7 @@ evalvar(char *p, int flags, struct strli
- patloc = expdest - (char *)stackblock();
- if (NULL == subevalvar(p, /* varname: */ NULL, patloc, subtype,
- startloc, varflags,
--//TODO: | EXP_REDIR too? All other such places do it too
-- /* quotes: */ flags & (EXP_FULL | EXP_CASE),
-+ /* quotes: */ flags & (EXP_FULL | EXP_CASE | EXP_REDIR),
- var_str_list)
- ) {
- int amount = expdest - (
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch
deleted file mode 100644
index b2a94561..00000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-ifupdown.patch
+++ /dev/null
@@ -1,75 +0,0 @@
---- busybox-1.20.1/networking/ifupdown.c
-+++ busybox-1.20.1-ifupdown/networking/ifupdown.c
-@@ -140,8 +140,6 @@ static const char keywords_up_down[] ALI
- "up\0"
- "down\0"
- "pre-up\0"
-- "pre-down\0"
-- "post-up\0"
- "post-down\0"
- ;
-
-@@ -895,6 +893,11 @@ static struct interfaces_file_t *read_in
- if (rest_of_line[0] == '\0')
- bb_error_msg_and_die("option with empty value \"%s\"", buf);
-
-+ if (strcmp(first_word, "post-up") == 0)
-+ first_word += 5; /* "up" */
-+ else if (strcmp(first_word, "pre-down") == 0)
-+ first_word += 4; /* "down" */
-+
- /* If not one of "up", "down",... words... */
- if (index_in_strings(keywords_up_down, first_word) < 0) {
- int i;
-@@ -963,7 +966,7 @@ static char *setlocalenv(const char *for
- return result;
- }
-
--static void set_environ(struct interface_defn_t *iface, const char *mode)
-+static void set_environ(struct interface_defn_t *iface, const char *mode, const char *opt)
- {
- int i;
- char **pp;
-@@ -976,7 +979,7 @@ static void set_environ(struct interface
- }
-
- /* note: last element will stay NULL: */
-- G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 6));
-+ G.my_environ = xzalloc(sizeof(char *) * (iface->n_options + 7));
- pp = G.my_environ;
-
- for (i = 0; i < iface->n_options; i++) {
-@@ -990,6 +993,7 @@ static void set_environ(struct interface
- *pp++ = setlocalenv("%s=%s", "ADDRFAM", iface->address_family->name);
- *pp++ = setlocalenv("%s=%s", "METHOD", iface->method->name);
- *pp++ = setlocalenv("%s=%s", "MODE", mode);
-+ *pp++ = setlocalenv("%s=%s", "PHASE", opt);
- if (G.startup_PATH)
- *pp++ = setlocalenv("%s=%s", "PATH", G.startup_PATH);
- }
-@@ -1044,21 +1048,21 @@ static int check(char *str)
- static int iface_up(struct interface_defn_t *iface)
- {
- if (!iface->method->up(iface, check)) return -1;
-- set_environ(iface, "start");
-+ set_environ(iface, "start", "pre-up");
- if (!execute_all(iface, "pre-up")) return 0;
- if (!iface->method->up(iface, doit)) return 0;
-+ set_environ(iface, "start", "post-up");
- if (!execute_all(iface, "up")) return 0;
-- if (!execute_all(iface, "post-up")) return 0;
- return 1;
- }
-
- static int iface_down(struct interface_defn_t *iface)
- {
- if (!iface->method->down(iface,check)) return -1;
-- set_environ(iface, "stop");
-- if (!execute_all(iface, "pre-down")) return 0;
-+ set_environ(iface, "stop", "pre-down");
- if (!execute_all(iface, "down")) return 0;
- if (!iface->method->down(iface, doit)) return 0;
-+ set_environ(iface, "stop", "post-down");
- if (!execute_all(iface, "post-down")) return 0;
- return 1;
- }
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch
deleted file mode 100644
index f382e078..00000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-man.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- busybox-1.20.1/miscutils/man.c
-+++ busybox-1.20.1-man/miscutils/man.c
-@@ -129,27 +129,21 @@ static int show_manpage(const char *page
- #endif
- #if ENABLE_FEATURE_SEAMLESS_XZ
- strcpy(ext, "xz");
-- if (run_pipe(pager, man_filename, man, level))
-+ if (run_pipe(pager, filename_with_zext, man, level))
- return 1;
- #endif
- #if ENABLE_FEATURE_SEAMLESS_BZ2
- strcpy(ext, "bz2");
-- if (run_pipe(pager, man_filename, man, level))
-+ if (run_pipe(pager, filename_with_zext, man, level))
- return 1;
- #endif
- #if ENABLE_FEATURE_SEAMLESS_GZ
- strcpy(ext, "gz");
-- if (run_pipe(pager, man_filename, man, level))
-+ if (run_pipe(pager, filename_with_zext, man, level))
- return 1;
- #endif
-
--#if SEAMLESS_COMPRESSION
-- ext[-1] = '\0';
--#endif
-- if (run_pipe(pager, man_filename, man, level))
-- return 1;
--
-- return 0;
-+ return run_pipe(pager, man_filename, man, level);
- }
-
- int man_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch b/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch
deleted file mode 100644
index 4129b651..00000000
--- a/source/a/mkinitrd/fixes-1.20.1/busybox-1.20.1-tar.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- busybox-1.20.1/archival/libarchive/get_header_tar.c
-+++ busybox-1.20.1-tar/archival/libarchive/get_header_tar.c
-@@ -84,7 +84,7 @@ static unsigned long long getOctal(char
- first >>= 1; /* now 7th bit = 6th bit */
- v = first; /* sign-extend 8 bits to 64 */
- while (--len != 0)
-- v = (v << 8) + (unsigned char) *str++;
-+ v = (v << 8) + (uint8_t) *++str;
- }
- return v;
- }
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch
new file mode 100644
index 00000000..456fb08e
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-kernel_ver.patch
@@ -0,0 +1,25 @@
+--- busybox-1.20.2/libbb/kernel_version.c
++++ busybox-1.20.2-kernel_ver/libbb/kernel_version.c
+@@ -20,18 +20,15 @@
+ int FAST_FUNC get_linux_version_code(void)
+ {
+ struct utsname name;
+- char *s;
++ char *s, *t;
+ int i, r;
+
+- if (uname(&name) == -1) {
+- bb_perror_msg("can't get system information");
+- return 0;
+- }
+-
++ uname(&name); /* never fails */
+ s = name.release;
+ r = 0;
+ for (i = 0; i < 3; i++) {
+- r = r * 256 + atoi(strtok(s, "."));
++ t = strtok(s, ".");
++ r = r * 256 + (t ? atoi(t) : 0);
+ s = NULL;
+ }
+ return r;
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch
new file mode 100644
index 00000000..17fc0b1c
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-ntpd.patch
@@ -0,0 +1,11 @@
+--- busybox-1.20.2/networking/ntpd.c
++++ busybox-1.20.2-ntpd/networking/ntpd.c
+@@ -1840,7 +1840,7 @@ recv_and_process_client_pkt(void /*int f
+
+ /* Build a reply packet */
+ memset(&msg, 0, sizeof(msg));
+- msg.m_status = G.stratum < MAXSTRAT ? G.ntp_status : LI_ALARM;
++ msg.m_status = G.stratum < MAXSTRAT ? (G.ntp_status & LI_MASK) : LI_ALARM;
+ msg.m_status |= (query_status & VERSION_MASK);
+ msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ?
+ MODE_SERVER : MODE_SYM_PAS;
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch
new file mode 100644
index 00000000..f39250c8
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-pkg-config-selinux.patch
@@ -0,0 +1,67 @@
+From b1cec5003b73080a8aa7ea277621bf1c71c3e8d6 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 20 Oct 2012 15:01:26 -0400
+Subject: [PATCH] build system: use pkg-config to look up selinux libs
+
+Newer versions of libselinux has started linking against more libs.
+Rather than continuing hardcoding things, switch to using pkg-config
+to query for its dependencies.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 1 +
+ Makefile.flags | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index fccde4a..3a0a5e1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -297,6 +297,7 @@ NM = $(CROSS_COMPILE)nm
+ STRIP = $(CROSS_COMPILE)strip
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+ OBJDUMP = $(CROSS_COMPILE)objdump
++PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
+ AWK = awk
+ GENKSYMS = scripts/genksyms/genksyms
+ DEPMOD = /sbin/depmod
+diff --git a/Makefile.flags b/Makefile.flags
+index c43c8dc..15dcc1f 100644
+--- a/Makefile.flags
++++ b/Makefile.flags
+@@ -74,6 +74,12 @@ ARCH_FPIC ?= -fpic
+ ARCH_FPIE ?= -fpie
+ ARCH_PIE ?= -pie
+
++# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
++define pkg_check_modules
++$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2))
++$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2))
++endef
++
+ ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+ # on i386: 14% smaller libbusybox.so
+ # (code itself is 9% bigger, we save on relocs/PLT/GOT)
+@@ -85,6 +91,7 @@ endif
+
+ ifeq ($(CONFIG_STATIC),y)
+ CFLAGS_busybox += -static
++PKG_CONFIG_FLAGS += --static
+ endif
+
+ ifeq ($(CONFIG_PIE),y)
+@@ -127,7 +134,10 @@ LDLIBS += pam pam_misc pthread
+ endif
+
+ ifeq ($(CONFIG_SELINUX),y)
+-LDLIBS += selinux sepol
++SELINUX_PC_MODULES = libselinux libsepol
++$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
++CPPFLAGS += $(SELINUX_CFLAGS)
++LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
+ endif
+
+ ifeq ($(CONFIG_EFENCE),y)
+--
+1.7.12
+
diff --git a/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch
new file mode 100644
index 00000000..7b185008
--- /dev/null
+++ b/source/a/mkinitrd/fixes-1.20.2/busybox-1.20.2-sys-resource.patch
@@ -0,0 +1,123 @@
+From 5a5dfcad6ba96d12d68bd7b39279215a8fee70d3 Mon Sep 17 00:00:00 2001
+From: Tias Guns <tias@ulyssis.org>
+Date: Sun, 10 Jun 2012 14:19:01 +0200
+Subject: [PATCH] inetd: fix build failure in Android
+
+Signed-off-by: Tias Guns <tias@ulyssis.org>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+(cherry picked from commit 64f763b42a43cbf36e401690ff6767c25575e520)
+---
+ networking/inetd.c | 1 +
+ 1 file changed, 1 insertion(+)
+--
+1.7.12
+
+From 246ea72843d5b7e9d4cd902dc5e9d71359196303 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 5 Jul 2012 23:19:09 -0400
+Subject: [PATCH] include sys/resource.h where needed
+
+We use functions from sys/resource.h in misc applets, but don't include
+the header. This breaks building with newer glibc versions, so add the
+include where needed.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit c5fe9f7b723f949457263ef8e22ab807d5b549ce)
+---
+ loginutils/passwd.c | 1 +
+ miscutils/time.c | 1 +
+ networking/inetd.c | 1 +
+ networking/ntpd.c | 1 +
+ networking/ntpd_simple.c | 1 +
+ runit/chpst.c | 1 +
+ shell/shell_common.c | 1 +
+ 7 files changed, 7 insertions(+)
+
+diff --git a/loginutils/passwd.c b/loginutils/passwd.c
+index b83db00..a7006f0 100644
+--- a/loginutils/passwd.c
++++ b/loginutils/passwd.c
+@@ -15,6 +15,7 @@
+
+ #include "libbb.h"
+ #include <syslog.h>
++#include <sys/resource.h> /* setrlimit */
+
+ static void nuke_str(char *str)
+ {
+diff --git a/miscutils/time.c b/miscutils/time.c
+index 945f15f..ffed386 100644
+--- a/miscutils/time.c
++++ b/miscutils/time.c
+@@ -16,6 +16,7 @@
+ //usage: "\n -v Verbose"
+
+ #include "libbb.h"
++#include <sys/resource.h> /* getrusage */
+
+ /* Information on the resources used by a child process. */
+ typedef struct {
+diff --git a/networking/inetd.c b/networking/inetd.c
+index 1308d74..00baf69 100644
+--- a/networking/inetd.c
++++ b/networking/inetd.c
+@@ -165,6 +165,8 @@
+ //usage: "\n (default: 0 - disabled)"
+
+ #include <syslog.h>
++#include <sys/resource.h> /* setrlimit */
++#include <sys/socket.h> /* un.h may need this */
+ #include <sys/un.h>
+
+ #include "libbb.h"
+diff --git a/networking/ntpd.c b/networking/ntpd.c
+index 603801e..b885215 100644
+--- a/networking/ntpd.c
++++ b/networking/ntpd.c
+@@ -46,6 +46,7 @@
+ #include "libbb.h"
+ #include <math.h>
+ #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
++#include <sys/resource.h> /* setpriority */
+ #include <sys/timex.h>
+ #ifndef IPTOS_LOWDELAY
+ # define IPTOS_LOWDELAY 0x10
+diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c
+index 4ad44e4..1b7c66b 100644
+--- a/networking/ntpd_simple.c
++++ b/networking/ntpd_simple.c
+@@ -7,6 +7,7 @@
+ */
+ #include "libbb.h"
+ #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
++#include <sys/resource.h> /* setpriority */
+ #ifndef IPTOS_LOWDELAY
+ # define IPTOS_LOWDELAY 0x10
+ #endif
+diff --git a/runit/chpst.c b/runit/chpst.c
+index ac296ba..ed72c8b 100644
+--- a/runit/chpst.c
++++ b/runit/chpst.c
+@@ -91,6 +91,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ //usage: "\n a SIGXCPU after N seconds"
+
+ #include "libbb.h"
++#include <sys/resource.h> /* getrlimit */
+
+ /*
+ Five applets here: chpst, envdir, envuidgid, setuidgid, softlimit.
+diff --git a/shell/shell_common.c b/shell/shell_common.c
+index 51c92d6..780e27e 100644
+--- a/shell/shell_common.c
++++ b/shell/shell_common.c
+@@ -18,6 +18,7 @@
+ */
+ #include "libbb.h"
+ #include "shell_common.h"
++#include <sys/resource.h> /* getrlimit */
+
+ const char defifsvar[] ALIGN1 = "IFS= \t\n";
+
+--
+1.7.12
+
diff --git a/source/a/mkinitrd/init b/source/a/mkinitrd/init
index ae475d89..b31eb0e4 100755
--- a/source/a/mkinitrd/init
+++ b/source/a/mkinitrd/init
@@ -4,7 +4,7 @@
# This requires that your kernel supports initramfs!!!
#
# Copyright 2004 Slackware Linux, Inc., Concord, CA, USA
-# Copyright 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,8 +23,8 @@
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
+#
+##################################################################################
# With a generic kernel, you need to load the modules needed to mount the
# root partition. This might mean a SCSI, RAID, or other drive controller
# module, as well as the module to support the root filesystem. Once the
@@ -62,6 +62,13 @@
# need to make it executable:
#
# chmod 755 load_kernel_modules
+##################################################################################
+# Changelog
+# 10-Dec-2012 <mozes@slackware.com>
+# * Added support for the official Kernel parameters to select root filesystem
+# type ('rootfstype') and pause before attempting to mount the root filesystem
+# ('rootdelay'). The original parameters may continue to be used.
+##################################################################################
INITRD=$(cat /initrd-name)
ROOTDEV=$(cat /rootdev)
@@ -115,10 +122,10 @@ for ARG in $(cat /proc/cmdline); do
root=UUID=*)
ROOTDEV=$(echo $ARG | cut -f2- -d=)
;;
- rootfs=*)
+ rootfs=*|rootfstype=*)
ROOTFS=$(echo $ARG | cut -f2 -d=)
;;
- waitforroot=*)
+ waitforroot=*|rootdelay=*)
WAIT=$(echo $ARG | cut -f2 -d=)
;;
esac
@@ -163,11 +170,15 @@ fi
if [ "$RESCUE" = "" ]; then
# Initialize RAID:
if [ -x /sbin/mdadm ]; then
- /sbin/mdadm -E -s >/etc/mdadm.conf
- /sbin/mdadm -S -s
- /sbin/mdadm -A -s
- # This seems to make the kernel see partitions more reliably:
- fdisk -l /dev/md* 1> /dev/null 2> /dev/null
+ # If /etc/mdadm.conf is present, udev should DTRT on its own;
+ # If not, we'll make one and go from there:
+ if [ ! -r /etc/mdadm.conf ]; then
+ /sbin/mdadm -E -s >/etc/mdadm.conf
+ /sbin/mdadm -S -s
+ /sbin/mdadm -A -s
+ # This seems to make the kernel see partitions more reliably:
+ fdisk -l /dev/md* 1> /dev/null 2> /dev/null
+ fi
fi
# Unlock any encrypted partitions necessary to access the
diff --git a/source/a/mkinitrd/mkinitrd b/source/a/mkinitrd/mkinitrd
index c5e30218..fdc26934 100644
--- a/source/a/mkinitrd/mkinitrd
+++ b/source/a/mkinitrd/mkinitrd
@@ -45,7 +45,7 @@
# Modified by Patrick Volkerding <volkerdi@slackware.com> 21 August 2012
# Add Btrfs multi-device filesystem support option (-B).
-MKINITRD_VERSION=1.4.7
+MKINITRD_VERSION=1.4.8
# Don't include these things from /lib/udev/ in the initrd image
LIBUDEV_BLACKLIST="\
@@ -101,7 +101,7 @@ initrd, and the script is easy to modify. Be creative. :-)
then you need to pass: -K LABEL=TRAVELSTICK:/keys/alien.luks
-B Add /sbin/btrfs to enable scanning for a root filesystem that is
part of a Btrfs multi-device filesystem.
- -M Add the files in /etc/modprobe.d/ to the initrd
+ -M Add the files in /etc/modprobe.d/ and /lib/modprobe.d/ to the initrd
-R Add support for RAID partitions
-V Display version number
@@ -422,6 +422,10 @@ fi
# (unless we find that value is already set in the initrd-tree):
if [ -z "$WAIT" -a -z "$(cat $SOURCE_TREE/wait-for-root)" ]; then
WAIT=1
+ # ARM devices need even more time:
+ case "$( uname -m )" in
+ arm*) WAIT=4;;
+ esac
fi
if [ ! -z "$WAIT" ]; then
echo $WAIT > $SOURCE_TREE/wait-for-root
@@ -479,6 +483,9 @@ if [ ! -z "$RAID" ]; then
mkdir -p $SOURCE_TREE/lib/udev/rules.d
echo 'KERNEL=="dm-[0-9]*", OPTIONS+="db_persist"' > \
$SOURCE_TREE/lib/udev/rules.d/95-dm-initrd.rules
+ if [ -r /etc/mdadm.conf ] ; then
+ cp /etc/mdadm.conf $SOURCE_TREE/etc
+ fi
else
echo "ERROR: mdadm and/or mdmon binary is missing, RAID support not installed"
fi
@@ -674,7 +681,7 @@ if [ ! -z "$MODULE_LIST" ]; then
# Pregenerate the module dependency information
depmod -a -b $SOURCE_TREE ${KERNEL_VERSION}
- # Copy /etc/modprobe.d/* if desired
+ # Copy /{etc,lib}/modprobe.d/* if desired
if [ ! -z $MODCONF ]; then
copy_modconf
fi
diff --git a/source/a/mkinitrd/mkinitrd.SlackBuild b/source/a/mkinitrd/mkinitrd.SlackBuild
index 322fa8c5..4683a17f 100755
--- a/source/a/mkinitrd/mkinitrd.SlackBuild
+++ b/source/a/mkinitrd/mkinitrd.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2007, 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,9 +21,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-1.4.7}
-BB=1.20.1
-BUILD=${BUILD:-6}
+VERSION=${VERSION:-1.4.8}
+BB=1.20.2
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -83,6 +83,11 @@ chmod 644 $PKG/usr/share/mkinitrd/keymaps.tar.gz
( cd $PKG/usr/share/mkinitrd/initrd-tree
tar xf $CWD/_initrd-tree.tar.gz
cat $CWD/init > init
+
+ # These are useful for ARM:
+ mknod -m 644 dev/random c 1 8
+ mknod -m 644 dev/urandom c 1 9
+
tar czf ../initrd-tree.tar.gz .
)
rm -rf $PKG/usr/share/mkinitrd/initrd-tree
@@ -107,6 +112,11 @@ cat $CWD/mkinitrd.conf.5 | gzip -9c > $PKG/usr/man/man5/mkinitrd.conf.5.gz
mkdir -p $PKG/etc
cp -a $CWD/mkinitrd.conf.sample $PKG/etc/mkinitrd.conf.sample
+# ARM systems often need more time to find devices:
+case "$( uname -m )" in
+ arm*) sed -e 's@#WAIT="1"@#WAIT="4"@g' \
+ -i $PKG/etc/mkinitrd.conf.sample;;
+esac
chown root:root $PKG/etc/mkinitrd.conf.sample
chmod 644 $PKG/etc/mkinitrd.conf.sample
diff --git a/source/a/mkinitrd/mkinitrd_command_generator.sh b/source/a/mkinitrd/mkinitrd_command_generator.sh
index 04c0c2a0..16893b05 100644
--- a/source/a/mkinitrd/mkinitrd_command_generator.sh
+++ b/source/a/mkinitrd/mkinitrd_command_generator.sh
@@ -1,5 +1,6 @@
#!/bin/sh
# $Id: mkinitrd_command_generator.sh,v 1.45 2011/02/17 09:27:05 eha Exp eha $
+# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2008, 2009, 2010, 2011 Eric Hameleers, Eindhoven, Netherlands
# Contact: <alien@slackware.com>
# Copyright 2008, 2009 PiterPUNK, Sao Paulo, SP, Brazil
@@ -50,7 +51,12 @@ SOURCE_TREE=${SOURCE_TREE:-"/boot/initrd-tree"}
CLEAR_TREE=${CLEAR_TREE:-1}
KEYMAP=${KEYMAP:-"us"}
UDEV=${UDEV:-1}
-WAIT=${WAIT:-1}
+# ARM devices need more time:
+case "$( uname -m )" in
+ arm*) WAIT_DEFAULT=4;;
+ *) WAIT_DEFAULT=1;;
+esac
+WAIT=${WAIT:-$WAIT_DEFAULT}
# A basic explanation of the commandline parameters:
basic_usage() {
@@ -108,7 +114,7 @@ extended_usage() {
the script determines, you can pass then to the script using the '-m'
parameter as follows:
- $(basename $0) -m "uhci-hcd:usbhid"
+ $(basename $0) -m "uhci-hcd:usbhid:hid_generic"
The above example adds support for USB keyboards to the initrd - you
may need that if you have encrypted your root partition and need to
@@ -219,7 +225,7 @@ function add_usb_keyboard() {
local USBMOD
if cat /proc/bus/input/devices | sed -e 's/^$/\$/g' | \
tr "\n$" " \n" | grep -q " Phys=.*usb.* .*Handlers=.*kbd.*B:"; then
- USBMOD="usbhid"
+ USBMOD="usbhid:hid_generic"
[ -n "$MLIST" ] && MLIST="$MLIST:$USBMOD" \
|| MLIST="$USBMOD"
fi
@@ -375,7 +381,7 @@ while [ ! -z "$1" ]; do
KFILE=$(basename $KFILE)
fi
KFILE=${KFILEPATH}/$KFILE
- if [ -z "$(file $KFILE | grep 'Linux kernel x86 boot')" ]; then
+ if [ -z "$(file $KFILE | grep -E 'Linux kernel x86 boot|x86 boot sector')" ]; then
echo "File '$KFILE' does not look like it is a kernel file!"
exit 1
fi
@@ -439,7 +445,8 @@ if echo $MLIST | grep -q "virtio"; then
MLIST="$MLIST:virtio:virtio_balloon:virtio_blk:virtio_ring:virtio_pci:virtio_net"
fi
-# Determine if a USB keyboard is in use and include usbhid to module list
+# Determine if a USB keyboard is in use and include usbhid and hid_generic
+# to module list
MLIST=$(add_usb_keyboard)
# If we use any USB module, try to determine the Host Controller
@@ -546,7 +553,7 @@ configurations are optional and you can stick to the defaults." 11 72 3 \
$([ $USING_LUKS = 1 ] && echo on || echo off) \
"RESUMEDEV" "Select device for 'suspend-to-disk' feature" off \
"UDEV" "Use UDEV in the initrd for device configuration" $(test $UDEV -eq 1 && echo on || echo off) \
-"WAIT" "Add delay to allow detection of slow disks at boot" $(test WAIT -gt 1 && echo on || echo off) )
+"WAIT" "Add delay to allow detection of slow disks at boot" $(test $WAIT -gt $WAIT_DEFAULT && echo on || echo off) )
if [ "$?" != "0" ]; then
exit 1
fi
@@ -794,7 +801,7 @@ if [ $UDEV -eq 1 ]; then
# Add UDEV support:
MKINIT="$MKINIT -u"
fi
-if [ -n "$WAIT" -a $WAIT -ne 1 ]; then
+if [ -n "$WAIT" -a $WAIT -ne $WAIT_DEFAULT ]; then
# Add non-default wait time:
MKINIT="$MKINIT -w $WAIT"
fi
diff --git a/source/a/ntfs-3g/ntfs-3g.SlackBuild b/source/a/ntfs-3g/ntfs-3g.SlackBuild
index 086cb3e8..ca5c46e5 100755
--- a/source/a/ntfs-3g/ntfs-3g.SlackBuild
+++ b/source/a/ntfs-3g/ntfs-3g.SlackBuild
@@ -3,7 +3,7 @@
# Slackware build script for ntfs-3g
# Copyright 2008 Antonio Hernandez Blas <hba.nihilismus@gmail.com>
-# Copyright 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -27,8 +27,8 @@
# Modified by Eric Hameleers <alien@slackware.com>
PKGNAM=ntfs-3g
-VERSION=2012.1.15
-BUILD=${BUILD:-2}
+VERSION=2013.1.13
+BUILD=${BUILD:-1}
SRCNAM=ntfs-3g_ntfsprogs
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -97,11 +97,11 @@ make install DESTDIR=$PKG || exit 1
# any better ideas, I'd like to hear them.
chmod 4711 $PKG/bin/ntfs-3g
-# Add the HAL fdi file so that automount uses ntfs-3g for mounting
-# This should work with the "volume.fstype.alternative.*" in hal-0.5.12+
-mkdir -p $PKG/usr/share/hal/fdi/policy/10osvendor
-cat $CWD/10-ntfs-3g-policy.fdi \
- > $PKG/usr/share/hal/fdi/policy/10osvendor/10-ntfs-3g-policy.fdi
+## Add the HAL fdi file so that automount uses ntfs-3g for mounting
+## This should work with the "volume.fstype.alternative.*" in hal-0.5.12+
+#mkdir -p $PKG/usr/share/hal/fdi/policy/10osvendor
+#cat $CWD/10-ntfs-3g-policy.fdi \
+# > $PKG/usr/share/hal/fdi/policy/10osvendor/10-ntfs-3g-policy.fdi
# Create a mount.ntfs -> mount.ntfs-3g symlink.
# This causes ntfs-3g to always be used when mounting NTFS filesystems.
diff --git a/source/a/os-prober/os-prober.SlackBuild b/source/a/os-prober/os-prober.SlackBuild
new file mode 100755
index 00000000..4e443e68
--- /dev/null
+++ b/source/a/os-prober/os-prober.SlackBuild
@@ -0,0 +1,141 @@
+#!/bin/sh
+
+# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PKGNAM=os-prober
+VERSION=${VERSION:-$(echo $PKGNAM_*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d _ | rev)}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7lh ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
+fi
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/${PKGNAM}_$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+# Don't drop support for reiserfs. It's still in the kernel (for now):
+zcat $CWD/os-prober.reiserfs.diff.gz | patch -p1 --verbose || exit 1
+
+# Edit the scripts to use $LIBDIRSUFFIX=64 if needed:
+if [ "$LIBDIRSUFFIX" = "64" ]; then
+ find -type f -exec sed -i -e 's|usr/lib|usr/lib64|g' {} \;
+fi
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+make || exit 1
+
+mkdir -p $PKG/usr/bin
+cp -a linux-boot-prober os-prober $PKG/usr/bin
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
+cp -a linux-boot-probes os-probes $PKG/usr/lib${LIBDIRSUFFIX}
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/linux-boot-probes
+ for probe in common/* ; do
+ ln -sf $probe .
+ done
+ cd mounted
+ for probe in common/* x86/* ; do
+ ln -sf $probe .
+ done
+)
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/os-probes
+ for probe in common/* ; do
+ ln -sf $probe .
+ done
+ cd init
+ for probe in common/* ; do
+ ln -sf $probe .
+ done
+ cd ../mounted
+ for probe in common/* x86/* ; do
+ ln -sf $probe .
+ done
+)
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/os-prober
+cp -a newns $PKG/usr/lib${LIBDIRSUFFIX}/os-prober
+mkdir -p $PKG/usr/share/os-prober
+cp -a common.sh $PKG/usr/share/os-prober
+mkdir -p $PKG/var/lib/os-prober
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a README TODO $PKG/usr/doc/$PKGNAM-$VERSION
+
+# Strip binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+mkdir $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/a/os-prober/os-prober.reiserfs.diff b/source/a/os-prober/os-prober.reiserfs.diff
new file mode 100644
index 00000000..2daa89f5
--- /dev/null
+++ b/source/a/os-prober/os-prober.reiserfs.diff
@@ -0,0 +1,11 @@
+--- ./os-probes/init/common/10filesystems.orig 2013-07-23 02:38:08.000000000 -0500
++++ ./os-probes/init/common/10filesystems 2013-08-30 15:21:07.382157112 -0500
+@@ -2,7 +2,7 @@
+ # Make sure filesystems are available.
+ set +e # ignore errors from modprobe
+
+-FILESYSTEMS='ext2 ext3 ext4 xfs jfs msdos vfat ntfs minix hfs hfsplus qnx4 ufs btrfs'
++FILESYSTEMS='ext2 ext3 ext4 reiserfs xfs jfs msdos vfat ntfs minix hfs hfsplus qnx4 ufs btrfs'
+ # fuse is needed to make grub-mount work.
+ FILESYSTEMS="$FILESYSTEMS fuse"
+ # The Ubuntu kernel udebs put a number of filesystem modules in
diff --git a/source/a/os-prober/slack-desc b/source/a/os-prober/slack-desc
new file mode 100644
index 00000000..36c5ef2c
--- /dev/null
+++ b/source/a/os-prober/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+os-prober: os-prober (an OS detector)
+os-prober:
+os-prober: os-prober detects OSes on other partitions than the current system
+os-prober: partition, and outputs the results in a generic machine-readable
+os-prober: format. This information can be used to add other OSes to the boot
+os-prober: loader.
+os-prober:
+os-prober: Homepage: http://packages.debian.org/unstable/utils/os-prober
+os-prober:
+os-prober:
+os-prober:
diff --git a/source/a/pciutils/pciutils-3.2.0.tar.sign b/source/a/pciutils/pciutils-3.2.0.tar.sign
new file mode 100644
index 00000000..5cc46614
--- /dev/null
+++ b/source/a/pciutils/pciutils-3.2.0.tar.sign
@@ -0,0 +1,17 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.12 (GNU/Linux)
+
+iQIVAwUAUXFFN8KOeEftcPgtAQLG3w/8C2cNMhW3v4romdMzTFJ0StgayKsQhvNk
+BxG1FLexwswGWO91TPz52bwOcgN+8OZODsTLf2iMmnt5wVnskov/z73KHPEXKFW7
+Q7fpbSszaAWklDL0G4Pp6kdt7yxFKgqPDSIbKbmMNTzFdTF5QyqajAJ6/3ah1cEt
+z75Nb3II24Yaip7ibRjb8d1OS9EpN64J+pEbrGLPh7FFOfqfY6yQtFdajdLor31x
+/zs/VcI1gjlGaKym8zQkamH561NDQLUoWxSNjnNDLbSEn369r4pBBuQbr4iXrPDB
+dGV+g6FXLFGb7QRODrLsRO+xLswQG7Jpn7dyd7Uxf1HoYuy8USXMg5gZPjNctWA3
+ZRF4RAP4AgxLSIwQBZqDjjDIwf52cJsrKC37AFLqmWMn5zyPNcLdFlkYbN2DiwPE
+5Q2egQMB13xeURwOgEeQ3BA5AbAOx4JdlctyM+WUl5zhzheUqlmZRN6rg/cJt1HY
+NhsbA4Gkt2OZYXJdpPixBJENxV8RJftNMVd4WKhLktJ8uzLoG/sWfyI6NBOXC17x
+7+fZTFV9MeY9/JJsyY8WMYT94ut7wyR7nSFfe6ZsPSRV8DTZNlSITF9Qb3czTGOY
+te4jC/oH+yNzyWCLvRD0uuf/cxmZKQqfsfosU4w+0nONoe15CCWkx7laYwBx0hN3
+l7tsXYaGnbk=
+=fcLj
+-----END PGP SIGNATURE-----
diff --git a/source/a/pciutils/pciutils.SlackBuild b/source/a/pciutils/pciutils.SlackBuild
index 03268420..c7936106 100755
--- a/source/a/pciutils/pciutils.SlackBuild
+++ b/source/a/pciutils/pciutils.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-$(echo pciutils-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=${VERSION:-$(echo pciutils-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j3}
@@ -55,7 +55,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf pciutils-$VERSION
-tar xvf $CWD/pciutils-$VERSION.tar.?z* || exit 1
+tar xvf $CWD/pciutils-$VERSION.tar.xz || exit 1
cd pciutils-$VERSION
chown -R root:root .
@@ -68,7 +68,6 @@ find . \
zcat $CWD/pciutils.dontcompress.diff.gz | patch -p1 || exit 1
zcat $CWD/pciutils.update.pci.ids.url.diff.gz | patch -p1 || exit 1
-# Make and install the shared library
make \
PREFIX=/usr \
SBINDIR=/sbin \
diff --git a/source/a/pkgtools/pkgtools.SlackBuild b/source/a/pkgtools/pkgtools.SlackBuild
index c5bc2d43..d2930638 100755
--- a/source/a/pkgtools/pkgtools.SlackBuild
+++ b/source/a/pkgtools/pkgtools.SlackBuild
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -27,7 +27,7 @@ fi
PKG=$TMP/package-pkgtools
# *** UPDATE THESE WITH EACH BUILD:
-VERSION=14.0
+VERSION=14.1
ARCH=${ARCH:-noarch}
BUILD=2
@@ -50,7 +50,9 @@ mkdir -p $PKG
( cd $CWD/scripts
# Install the core Slackware package tools:
mkdir -p $PKG/sbin
- for file in explodepkg installpkg makebootdisk makepkg pkgtool removepkg upgradepkg ; do
+ # Don't include makebootdisk... it's useless since a kernel won't fit on a
+ # floppy disk, and nobody uses floppies any more anyway.
+ for file in explodepkg installpkg makepkg pkgtool removepkg upgradepkg ; do
cp -a $CWD/scripts/$file $PKG/sbin
done
chown root:root $PKG/sbin/*
@@ -63,6 +65,8 @@ mkdir -p $PKG
done
chown root:root $PKG/var/log/setup/setup.*
chmod 755 $PKG/var/log/setup/setup.*
+ # Add a link for makebootstick:
+ ( cd $PKG/sbin ; ln -sf ../var/log/setup/setup.80.make-bootdisk makebootstick )
)
mkdir -p $PKG/install
diff --git a/source/a/pkgtools/scripts/pkgtool b/source/a/pkgtools/scripts/pkgtool
index ba8ecd0a..dd9d6816 100644
--- a/source/a/pkgtools/scripts/pkgtool
+++ b/source/a/pkgtools/scripts/pkgtool
@@ -4,7 +4,7 @@
# 1998, 1999 Patrick Volkerding, Moorhead, MN USA
# Copyright 2001, 2004 Slackware Linux, Inc., Concord, CA USA
# All rights reserved.
-# Copyright 2007, 2009, 2010, 2011 Patrick Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2009, 2010, 2011, 2013 Patrick Volkerding, Sebeka, MN, USA
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
@@ -212,7 +212,7 @@ else # there were no arguments, so we'll get the needed information from the
CMD_START="true"
rm -f $TMP/SeT*
while [ 0 ]; do
- dialog --title "Slackware Package Tool (pkgtool version 14.0)" \
+ dialog --title "Slackware Package Tool (pkgtool version 14.1)" \
--menu "\nWelcome to the Slackware package tool.\n\
\nWhich option would you like?\n" 17 75 7 \
"Current" "Install packages from the current directory" \
diff --git a/source/a/pkgtools/scripts/setup.80.make-bootdisk b/source/a/pkgtools/scripts/setup.80.make-bootdisk
index d9b4012f..a5d44235 100644
--- a/source/a/pkgtools/scripts/setup.80.make-bootdisk
+++ b/source/a/pkgtools/scripts/setup.80.make-bootdisk
@@ -1,14 +1,26 @@
#!/bin/sh
#BLURB="Create a USB Linux boot stick"
-RDIR=/dev/tty4
+if [ -r /usr/lib/setup/setup ]; then
+ RDIR=/dev/tty4
+else
+ RDIR=/dev/null
+fi
NDIR=/dev/null
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
-T_PX="$1"
-ROOT_DEVICE="$2"
+if [ -z "$T_PX" ]; then
+ T_PX=/
+else
+ T_PX="$1"
+fi
+if [ -z "$2" ]; then
+ ROOT_DEVICE=$(mount | head -n 1 | cut -f 1 -d ' ')
+else
+ ROOT_DEVICE="$2"
+fi
while [ 0 ]; do # the bootdisk menu loop
# Run "rescan-scsi-bus -l" to get an up to date overview of devices:
@@ -19,7 +31,12 @@ while [ 0 ]; do # the bootdisk menu loop
[ -r /sys/block/$BDEV/removable -a "$(cat /sys/block/$BDEV/removable)" == "1" ] \
&& echo $BDEV >> $TMP/remov_prior
done
- dialog --title "MAKE USB FLASH BOOT" --default-item "Skip" --menu \
+ if [ "$T_PX" = "/" ]; then
+ DEFAULTITEM="Create"
+ else
+ DEFAULTITEM="Skip"
+ fi
+ dialog --title "MAKE USB FLASH BOOT" --default-item "$DEFAULTITEM" --menu \
"If your computer supports booting from a USB device, it is recommended that you make \
a USB boot stick for your system at this time. It will boot your computer straight \
into the root filesystem on $ROOT_DEVICE. \n\
@@ -151,14 +168,53 @@ EOF
F2 returns to the previous page.
EOF
+ if [ "$(uname -m)" == "x86_64" ]; then # also install an EFI bootloader
+ mkdir -p $TMP/bootdisk/EFI/BOOT 1> /dev/null 2> /dev/null
+ cp $T_PX/boot/elilo-x86_64.efi $TMP/bootdisk/EFI/BOOT/BOOTX64.EFI 1> /dev/null 2> /dev/null
+ cat << EOF > $TMP/bootdisk/EFI/BOOT/message.txt 2> /dev/null
+
+Welcome to the Slackware Linux custom USB boot stick!
+
+By default, this stick boots a root Linux partition on $ROOT_DEVICE when you
+hit ENTER. If you'd like to boot some other partition, use a command like
+this on the prompt below:
+
+ huge.s root=/dev/sda1 ro
+
+Where "/dev/sda1" is the partition you want to boot, and "ro" specifies that
+the partition should be initially mounted as read-only. If you wish to mount
+the partition read-write, use "rw" instead. You may also add any other
+kernel parameters you might need depending on your hardware, and which
+drivers are included in your kernel.
+
+Hit ENTER to boot:
+
+EOF
+ cat << EOF > $TMP/bootdisk/EFI/BOOT/elilo.conf 2> /dev/null
+chooser=simple
+message=message.txt
+delay=300
+timeout=300
+#
+image=/vmlinuz
+ label=huge.s
+ read-only
+ append="root=$ROOT_DEVICE vga=normal ro"
+EOF
+ fi # end EFI installation
umount /dev/$STICK
rm -r $TMP/bootdisk
# Make the device bootable:
syslinux -s /dev/$STICK 1> /dev/null 2> /dev/null
+ if [ "$T_PX" = "/" ]; then
+ dialog --title "USB BOOT STICK CREATED" --msgbox \
+ "The USB boot stick has been successfully created on device /dev/$STICK." 6 60
+ exit
+ fi
dialog --title "USB BOOT STICK CREATED" --ok-label Continue --cancel-label Create --menu \
-"The USB boot stick has been successfully created in /dev/$STICK. If you would like to \
+"The USB boot stick has been successfully created on device /dev/$STICK. If you would like to \
create an additional boot stick, please select 'Create' and we'll go back and make another \
-one, otherwise select 'Continue' to continue configuring your system." 12 70 2 \
+one, otherwise select 'Continue' to continue configuring your system." 12 71 2 \
"Continue" "Continue the configuration (done making boot sticks)" \
"Create" "Make a spare Linux boot stick in /dev/$STICK" \
2> $TMP/return
diff --git a/source/a/procps/procps-3.2.8.makefile.diff b/source/a/procps/procps-3.2.8.makefile.diff
new file mode 100644
index 00000000..383d328c
--- /dev/null
+++ b/source/a/procps/procps-3.2.8.makefile.diff
@@ -0,0 +1,11 @@
+--- ./Makefile.orig 2009-05-10 13:50:48.000000000 -0500
++++ ./Makefile 2013-06-25 16:19:06.058320108 -0500
+@@ -174,7 +174,7 @@
+ # want this rule first, use := on ALL, and ALL not filled in yet
+ all: do_all
+
+--include */module.mk
++-include proc/module.mk ps/module.mk
+
+ do_all: $(ALL)
+
diff --git a/source/a/procps/procps.SlackBuild b/source/a/procps/procps.SlackBuild
index e5e85ffc..255ece40 100755
--- a/source/a/procps/procps.SlackBuild
+++ b/source/a/procps/procps.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2011 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +25,7 @@ VERSION=3.2.8
# Sometimes this number lags behind...
SOVER=3.2.8
PSMISCVER=22.13
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -100,8 +100,11 @@ zcat $CWD/procps-3.2.8-ps-cgroup-suppress-root-group.patch.gz | patch -p1 --verb
# Init contructors in correct order to avoid "Unknown HZ value!":
zcat $CWD/procps-3.2.8.unknown.hz.value.diff.gz | patch -p1 --verbose || exit 1
+# Fix an ordering problem in the Makefile:
+zcat $CWD/procps-3.2.8.makefile.diff.gz | patch -p1 --verbose || exit 1
+
make OPT="$SLKCFLAGS" || make OPT="$SLKCFLAGS" || exit 1
-mkdir -p $PKG/lib${LIBDIRSUFFIX} $PKG/bin $PKG/sbin $PKG/usr/bin
+mkdir -p $PKG/lib${LIBDIRSUFFIX} $PKG/bin $PKG/sbin $PKG/usr/bin $PKG/usr/include/proc
cat free > $PKG/bin/free
cat ps/ps> $PKG/bin/ps
cat proc/libproc-${SOVER}.so > $PKG/lib${LIBDIRSUFFIX}/libproc-${SOVER}.so
@@ -123,6 +126,9 @@ cat watch > $PKG/usr/bin/watch
ln -sf /bin/free .
ln -sf /bin/ps .
)
+cp -a proc/*.h $PKG/usr/include/proc
+chown -R root:root $PKG/usr/include/proc
+chmod 644 $PKG/usr/include/proc/*
cp -a ps/ps.1 .
mkdir -p $PKG/usr/man/man1
for page in free.1 pgrep.1 pkill.1 ps.1 slabtop.1 skill.1 snice.1 tload.1 top.1 uptime.1 w.1 watch.1 ; do
diff --git a/source/a/reiserfsprogs/reiserfsprogs.SlackBuild b/source/a/reiserfsprogs/reiserfsprogs.SlackBuild
index fc38990d..83467e32 100755
--- a/source/a/reiserfsprogs/reiserfsprogs.SlackBuild
+++ b/source/a/reiserfsprogs/reiserfsprogs.SlackBuild
@@ -20,7 +20,7 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=3.6.21
+VERSION=${VERSION:-3.6.23}
BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
@@ -85,19 +85,13 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
ln -sf reiserfsck fsck.reiserfs
)
-# These were renamed, it seems
-# --> Deleting /usr/man/man8/debugreiserfs.8.gz
-# --> Deleting /usr/man/man8/mkreiserfs.8.gz
-# --> Deleting /usr/man/man8/reiserfsck.8.gz
-# --> Deleting /usr/man/man8/reiserfstune.8.gz
-# --> Deleting /usr/man/man8/resize_reiserfs.8.gz
-# Do we want symlinks for backwards compatibility? If so...
+# Do we want symlinks for compatibility? If so...
( cd $PKG/usr/man/man8
- ln -s mkfs.reiserfs.8 mkreiserfs.8
- ln -s debugfs.reiserfs.8 debugreiserfs.8
- ln -s fsck.reiserfs.8 reiserfsck.8
- ln -s tunefs.reiserfs.8 reiserfstune.8
- ln -s resizefs.reiserfs.8 resize_reiserfs.8
+ ln -s debugreiserfs.8 debugfs.reiserfs.8
+ ln -s mkreiserfs.8 mkfs.reiserfs.8
+ ln -s reiserfsck.8 fsck.reiserfs.8
+ ln -s reiserfstune.8 tunefs.reiserfs.8
+ ln -s resize_reiserfs.8 resizefs.reiserfs.8
)
# Compress the man pages
@@ -111,6 +105,7 @@ cp -a \
AUTHORS COPYING* CREDITS INSTALL NEWS README* \
$PKG/usr/doc/reiserfsprogs-$VERSION
chmod 644 $PKG/usr/doc/reiserfsprogs-$VERSION/*
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
diff --git a/source/a/reiserfsprogs/slack-desc b/source/a/reiserfsprogs/slack-desc
index 3358fdf7..a82a82b4 100644
--- a/source/a/reiserfsprogs/slack-desc
+++ b/source/a/reiserfsprogs/slack-desc
@@ -9,11 +9,11 @@
reiserfsprogs: reiserfsprogs (Reiserfs filesystem utilities)
reiserfsprogs:
reiserfsprogs: These utilities are used for Reiserfs. Reiserfs is a file system
-reiserfsprogs: based on balanced tree algorithms. Learn more at the home site:
-reiserfsprogs: http://www.namesys.com
+reiserfsprogs: based on balanced tree algorithms.
reiserfsprogs:
reiserfsprogs: Reiserfs is the work of Hans Reiser and many others. See the file
reiserfsprogs: /usr/doc/reiserfs*/README for full credits.
reiserfsprogs:
reiserfsprogs:
reiserfsprogs:
+reiserfsprogs:
diff --git a/source/a/sed/sed.SlackBuild b/source/a/sed/sed.SlackBuild
index 7684a10d..48b1cdcd 100755
--- a/source/a/sed/sed.SlackBuild
+++ b/source/a/sed/sed.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +21,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=4.2.1
+PKGNAM=sed
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
CWD=$(pwd)
diff --git a/source/a/shadow/patches/r3054.diff b/source/a/shadow/patches/r3054.diff
deleted file mode 100644
index dc1eab13..00000000
--- a/source/a/shadow/patches/r3054.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-* src/useradd.c: Fixed wrong format string.
-* lib/gshadow.c: Removed declaration of unused variable.
-
-===================================================================
---- src/useradd.c (revision 3052)
-+++ src/useradd.c (revision 3054)
-@@ -684,7 +684,7 @@
- static void usage (void)
- {
- (void) fprintf (stderr,
-- _("Usage: useradd [options] LOGIN\n"
-+ _("Usage: %s [options] LOGIN\n"
- "\n"
- "Options:\n"),
- Prog);
-
-===================================================================
---- lib/gshadow.c (revision 3052)
-+++ lib/gshadow.c (revision 3054)
-@@ -216,7 +216,6 @@
- static char *buf = NULL;
-
- char *cp;
-- struct sgrp *ret;
-
- if (0 == buflen) {
- buf = (char *) malloc (BUFSIZ);
diff --git a/source/a/shadow/patches/r3055.diff b/source/a/shadow/patches/r3055.diff
deleted file mode 100644
index a2af6f39..00000000
--- a/source/a/shadow/patches/r3055.diff
+++ /dev/null
@@ -1,1515 +0,0 @@
-===================================================================
---- src/userdel.c (revision 3054)
-+++ src/userdel.c (revision 3055)
-@@ -94,7 +94,7 @@
- static bool spw_locked = false;
-
- /* local function prototypes */
--static void usage (void);
-+static void usage (int status);
- static void update_groups (void);
- static void close_files (void);
- static void fail_exit (int);
-@@ -111,7 +111,7 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
- fputs (_("Usage: userdel [options] LOGIN\n"
- "\n"
-@@ -120,8 +120,8 @@
- " even if not owned by user\n"
- " -h, --help display this help message and exit\n"
- " -r, --remove remove home directory and mail spool\n"
-- "\n"), stderr);
-- exit (E_USAGE);
-+ "\n"), status ? stderr : stdout);
-+ exit (status);
- }
-
- /*
-@@ -774,17 +774,19 @@
- case 'f': /* force remove even if not owned by user */
- fflg = true;
- break;
-+ case 'h':
-+ usage (E_SUCCESS);
- case 'r': /* remove home dir and mailbox */
- rflg = true;
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
- }
-
- if ((optind + 1) != argc) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- OPENLOG ("userdel");
-Index: src/lastlog.c
-===================================================================
---- src/lastlog.c (revision 3054)
-+++ src/lastlog.c (revision 3055)
-@@ -71,7 +71,7 @@
-
- #define NOW (time ((time_t *) 0))
-
--static void usage (void)
-+static void usage (int status)
- {
- fputs (_("Usage: lastlog [options]\n"
- "\n"
-@@ -80,8 +80,8 @@
- " -h, --help display this help message and exit\n"
- " -t, --time DAYS print only lastlog records more recent than DAYS\n"
- " -u, --user LOGIN print lastlog record of the specified LOGIN\n"
-- "\n"), stderr);
-- exit (EXIT_FAILURE);
-+ "\n"), status ? stderr : stdout);
-+ exit (status);
- }
-
- static void print_one (/*@null@*/const struct passwd *pw)
-@@ -208,7 +208,7 @@
- NULL)) != -1) {
- switch (c) {
- case 'h':
-- usage ();
-+ usage (EXIT_SUCCESS);
- break;
- case 't':
- {
-@@ -267,7 +267,7 @@
- break;
- }
- default:
-- usage ();
-+ usage (EXIT_FAILURE);
- break;
- }
- }
-@@ -275,7 +275,7 @@
- fprintf (stderr,
- _("lastlog: unexpected argument: %s\n"),
- argv[optind]);
-- usage();
-+ usage (EXIT_FAILURE);
- }
- }
-
-Index: src/gpasswd.c
-===================================================================
---- src/gpasswd.c (revision 3054)
-+++ src/gpasswd.c (revision 3055)
-@@ -94,7 +94,7 @@
- #endif
-
- /* local function prototypes */
--static void usage (void);
-+static void usage (int status);
- static RETSIGTYPE catch_signals (int killed);
- static bool is_valid_user_list (const char *users);
- static void process_flags (int argc, char **argv);
-@@ -128,14 +128,15 @@
- /*
- * usage - display usage message
- */
--static void usage (void)
-+static void usage (int status)
- {
-- fprintf (stderr,
-+ fprintf (status ? stderr : stdout,
- _("Usage: %s [option] GROUP\n"
- "\n"
- "Options:\n"
- " -a, --add USER add USER to GROUP\n"
- " -d, --delete USER remove USER from GROUP\n"
-+ " -h, --help display this help message and exit\n"
- " -r, --remove-password remove the GROUP's password\n"
- " -R, --restrict restrict access to GROUP to its members\n"
- " -M, --members USER,... set the list of members of GROUP\n"
-@@ -150,7 +151,7 @@
- _("The options cannot be combined.\n")
- #endif
- );
-- exit (E_USAGE);
-+ exit (status);
- }
-
- /*
-@@ -235,6 +236,7 @@
- static struct option long_options[] = {
- {"add", required_argument, NULL, 'a'},
- {"delete", required_argument, NULL, 'd'},
-+ {"help", no_argument, NULL, 'h'},
- {"remove-password", no_argument, NULL, 'r'},
- {"restrict", no_argument, NULL, 'R'},
- {"administrators", required_argument, NULL, 'A'},
-@@ -242,7 +244,7 @@
- {NULL, 0, NULL, '\0'}
- };
-
-- while ((flag = getopt_long (argc, argv, "a:A:d:gM:rR", long_options, &option_index)) != -1) {
-+ while ((flag = getopt_long (argc, argv, "a:A:d:ghM:rR", long_options, &option_index)) != -1) {
- switch (flag) {
- case 'a': /* add a user */
- aflg = true;
-@@ -276,6 +278,8 @@
- break;
- case 'g': /* no-op from normal password */
- break;
-+ case 'h':
-+ usage (E_SUCCESS);
- case 'M': /* set the list of members */
- members = optarg;
- if (!is_valid_user_list (members)) {
-@@ -290,7 +294,7 @@
- Rflg = true;
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-@@ -325,14 +329,14 @@
- exclusive++;
- }
- if (exclusive > 1) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- /*
- * Make sure one (and only one) group was provided
- */
- if ((argc != (opt_index+1)) || (NULL == group)) {
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-Index: src/newusers.c
-===================================================================
---- src/newusers.c (revision 3054)
-+++ src/newusers.c (revision 3055)
-@@ -92,7 +92,7 @@
- static bool spw_locked = false;
-
- /* local function prototypes */
--static void usage (void);
-+static void usage (int status);
- static void fail_exit (int);
- static int add_group (const char *, const char *, gid_t *, gid_t);
- static int get_user_id (const char *, uid_t *);
-@@ -110,15 +110,16 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- (void) fprintf (stderr,
-+ FILE *usageout = status ? stderr : stdout;
-+ (void) fprintf (usageout,
- _("Usage: %s [options]\n"
- "\n"
- "Options:\n"),
- Prog);
- #ifndef USE_PAM
-- (void) fprintf (stderr,
-+ (void) fprintf (usageout,
- _(" -c, --crypt-method the crypt method (one of %s)\n"),
- #ifndef USE_SHA_CRYPT
- "NONE DES MD5"
-@@ -127,18 +128,18 @@
- #endif /* USE_SHA_CRYPT */
- );
- #endif /* !USE_PAM */
-- (void) fputs (_(" -h, --help display this help message and exit\n"), stderr);
-- (void) fputs (_(" -r, --system create system accounts\n"), stderr);
-+ (void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
-+ (void) fputs (_(" -r, --system create system accounts\n"), usageout);
- #ifndef USE_PAM
- #ifdef USE_SHA_CRYPT
- (void) fputs (_(" -s, --sha-rounds number of SHA rounds for the SHA*\n"
- " crypt algorithms\n"),
-- stderr);
-+ usageout);
- #endif /* USE_SHA_CRYPT */
- #endif /* !USE_PAM */
-- (void) fputs ("\n", stderr);
-+ (void) fputs ("\n", usageout);
-
-- exit (EXIT_FAILURE);
-+ exit (status);
- }
-
- /*
-@@ -548,7 +549,7 @@
- long_options, &option_index)) != -1) {
- switch (c) {
- case 'h':
-- usage ();
-+ usage (EXIT_SUCCESS);
- break;
- case 'r':
- rflg = true;
-@@ -565,13 +566,13 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (EXIT_FAILURE);
- }
- break;
- #endif /* USE_SHA_CRYPT */
- #endif /* !USE_PAM */
- default:
-- usage ();
-+ usage (EXIT_FAILURE);
- break;
- }
- }
-@@ -602,7 +603,7 @@
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-s", "-c");
-- usage ();
-+ usage (EXIT_FAILURE);
- }
- #endif /* USE_SHA_CRYPT */
-
-@@ -618,7 +619,7 @@
- fprintf (stderr,
- _("%s: unsupported crypt method: %s\n"),
- Prog, crypt_method);
-- usage ();
-+ usage (EXIT_FAILURE);
- }
- }
- #endif /* !USE_PAM */
-Index: src/chpasswd.c
-===================================================================
---- src/chpasswd.c (revision 3054)
-+++ src/chpasswd.c (revision 3055)
-@@ -74,7 +74,7 @@
-
- /* local function prototypes */
- static void fail_exit (int code);
--static void usage (void);
-+static void usage (int status);
- static void process_flags (int argc, char **argv);
- static void check_flags (void);
- static void check_perms (void);
-@@ -112,15 +112,16 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- (void) fprintf (stderr,
-+ FILE *usageout = status ? stderr : stdout;
-+ (void) fprintf (usageout,
- _("Usage: %s [options]\n"
- "\n"
- "Options:\n"),
- Prog);
- #ifndef USE_PAM
-- (void) fprintf (stderr,
-+ (void) fprintf (usageout,
- _(" -c, --crypt-method the crypt method (one of %s)\n"),
- #ifndef USE_SHA_CRYPT
- "NONE DES MD5"
-@@ -128,22 +129,22 @@
- "NONE DES MD5 SHA256 SHA512"
- #endif /* USE_SHA_CRYPT */
- );
-- (void) fputs (_(" -e, --encrypted supplied passwords are encrypted\n"), stderr);
-+ (void) fputs (_(" -e, --encrypted supplied passwords are encrypted\n"), usageout);
- #endif /* !USE_PAM */
-- (void) fputs (_(" -h, --help display this help message and exit\n"), stderr);
-+ (void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
- #ifndef USE_PAM
- (void) fputs (_(" -m, --md5 encrypt the clear text password using\n"
- " the MD5 algorithm\n"),
-- stderr);
-+ usageout);
- #ifdef USE_SHA_CRYPT
- (void) fputs (_(" -s, --sha-rounds number of SHA rounds for the SHA*\n"
- " crypt algorithms\n"),
-- stderr);
-+ usageout);
- #endif /* USE_SHA_CRYPT */
- #endif /* !USE_PAM */
-- (void) fputs ("\n", stderr);
-+ (void) fputs ("\n", usageout);
-
-- exit (E_USAGE);
-+ exit (status);
- }
-
- /*
-@@ -181,7 +182,7 @@
- long_options, &option_index)) != -1) {
- switch (c) {
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- #ifndef USE_PAM
- case 'c':
-@@ -201,13 +202,13 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- #endif /* USE_SHA_CRYPT */
- #endif /* !USE_PAM */
- default:
-- usage ();
-+ usage (E_USAGE);
- break;
- }
- }
-@@ -229,7 +230,7 @@
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-s", "-c");
-- usage ();
-+ usage (E_USAGE);
- }
- #endif
-
-@@ -238,7 +239,7 @@
- fprintf (stderr,
- _("%s: the -c, -e, and -m flags are exclusive\n"),
- Prog);
-- usage ();
-+ usage (E_USAGE);
- }
-
- if (cflg) {
-@@ -253,7 +254,7 @@
- fprintf (stderr,
- _("%s: unsupported crypt method: %s\n"),
- Prog, crypt_method);
-- usage ();
-+ usage (E_USAGE);
- }
- }
- #endif /* USE_PAM */
-Index: src/groupmems.c
-===================================================================
---- src/groupmems.c (revision 3054)
-+++ src/groupmems.c (revision 3055)
-@@ -88,7 +88,7 @@
- const struct group *grp);
- static void purge_members (const struct group *grp);
- static void display_members (const char *const *members);
--static void usage (void);
-+static void usage (int status);
- static void process_flags (int argc, char **argv);
- static void check_perms (void);
- static void fail_exit (int code);
-@@ -361,7 +361,7 @@
- }
- }
-
--static void usage (void)
-+static void usage (int status)
- {
- (void) fputs (_("Usage: groupmems [options] [action]\n"
- "\n"
-@@ -372,10 +372,11 @@
- "Actions:\n"
- " -a, --add username add username to the members of the group\n"
- " -d, --delete username remove username from the members of the group\n"
-+ " -h, --help display this help message and exit\n"
- " -p, --purge purge all members from the group\n"
- " -l, --list list the members of the group\n"
-- "\n"), stderr);
-- fail_exit (EXIT_USAGE);
-+ "\n"), status ? stderr : stdout);
-+ fail_exit (status);
- }
-
- /*
-@@ -389,12 +390,13 @@
- {"add", required_argument, NULL, 'a'},
- {"delete", required_argument, NULL, 'd'},
- {"group", required_argument, NULL, 'g'},
-+ {"help", no_argument, NULL, 'h'},
- {"list", no_argument, NULL, 'l'},
- {"purge", no_argument, NULL, 'p'},
- {NULL, 0, NULL, '\0'}
- };
-
-- while ((arg = getopt_long (argc, argv, "a:d:g:lp", long_options,
-+ while ((arg = getopt_long (argc, argv, "a:d:g:hlp", long_options,
- &option_index)) != EOF) {
- switch (arg) {
- case 'a':
-@@ -408,6 +410,8 @@
- case 'g':
- thisgroup = xstrdup (optarg);
- break;
-+ case 'h':
-+ usage (EXIT_SUCCESS);
- case 'l':
- list = true;
- ++exclusive;
-@@ -417,12 +421,12 @@
- ++exclusive;
- break;
- default:
-- usage ();
-+ usage (EXIT_USAGE);
- }
- }
-
- if ((exclusive > 1) || (optind < argc)) {
-- usage ();
-+ usage (EXIT_USAGE);
- }
-
- /* local, no need for xgetpwnam */
-Index: src/usermod.c
-===================================================================
---- src/usermod.c (revision 3054)
-+++ src/usermod.c (revision 3055)
-@@ -149,7 +149,7 @@
- static void date_to_str (char *buf, size_t maxsize,
- long int date, const char *negativ);
- static int get_groups (char *);
--static void usage (void);
-+static void usage (int status);
- static void new_pwent (struct passwd *);
- #ifdef WITH_SELINUX
- static void selinux_update_mapping (void);
-@@ -300,9 +300,9 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- fprintf (stderr,
-+ fprintf (status ? stderr : stdout,
- _("Usage: usermod [options] LOGIN\n"
- "\n"
- "Options:\n"
-@@ -334,7 +334,7 @@
- ""
- #endif
- );
-- exit (E_USAGE);
-+ exit (status);
- }
-
- /*
-@@ -815,7 +815,7 @@
- bool anyflag = false;
-
- if ((1 == argc) || ('-' == argv[argc - 1][0])) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- {
-@@ -955,7 +955,7 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- fflg = true;
- break;
-@@ -976,6 +976,8 @@
- }
- Gflg = true;
- break;
-+ case 'h':
-+ usage (E_SUCCESS);
- case 'l':
- if (!is_valid_user_name (optarg)) {
- fprintf (stderr,
-@@ -1036,7 +1038,7 @@
- break;
- #endif
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- anyflag = true;
- }
-@@ -1092,14 +1094,14 @@
- }
-
- if (optind != argc - 1) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- if (aflg && (!Gflg)) {
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-a", "-G");
-- usage ();
-+ usage (E_USAGE);
- exit (E_USAGE);
- }
-
-@@ -1107,7 +1109,7 @@
- fprintf (stderr,
- _("%s: the -L, -p, and -U flags are exclusive\n"),
- Prog);
-- usage ();
-+ usage (E_USAGE);
- exit (E_USAGE);
- }
-
-@@ -1115,7 +1117,7 @@
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-o", "-u");
-- usage ();
-+ usage (E_USAGE);
- exit (E_USAGE);
- }
-
-@@ -1123,7 +1125,7 @@
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-m", "-d");
-- usage ();
-+ usage (E_USAGE);
- exit (E_USAGE);
- }
-
-Index: src/chgpasswd.c
-===================================================================
---- src/chgpasswd.c (revision 3054)
-+++ src/chgpasswd.c (revision 3055)
-@@ -78,7 +78,7 @@
-
- /* local function prototypes */
- static void fail_exit (int code);
--static void usage (void);
-+static void usage (int status);
- static void process_flags (int argc, char **argv);
- static void check_flags (void);
- static void check_perms (void);
-@@ -114,9 +114,10 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- fprintf (stderr, _("Usage: %s [options]\n"
-+ fprintf (status ? stderr : stdout,
-+ _("Usage: %s [options]\n"
- "\n"
- "Options:\n"
- " -c, --crypt-method the crypt method (one of %s)\n"
-@@ -135,7 +136,7 @@
- " crypt algorithms\n")
- #endif
- );
-- exit (E_USAGE);
-+ exit (status);
- }
-
- /*
-@@ -174,7 +175,7 @@
- eflg = true;
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'm':
- md5flg = true;
-@@ -186,12 +187,12 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- #endif
- default:
-- usage ();
-+ usage (E_USAGE);
- break;
- }
- }
-@@ -212,7 +213,7 @@
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-s", "-c");
-- usage ();
-+ usage (E_USAGE);
- }
- #endif
-
-@@ -221,7 +222,7 @@
- fprintf (stderr,
- _("%s: the -c, -e, and -m flags are exclusive\n"),
- Prog);
-- usage ();
-+ usage (E_USAGE);
- }
-
- if (cflg) {
-@@ -236,7 +237,7 @@
- fprintf (stderr,
- _("%s: unsupported crypt method: %s\n"),
- Prog, crypt_method);
-- usage ();
-+ usage (E_USAGE);
- }
- }
- }
-Index: src/vipw.c
-===================================================================
---- src/vipw.c (revision 3054)
-+++ src/vipw.c (revision 3055)
-@@ -1,7 +1,7 @@
- /*
- vipw, vigr edit the password or group file
- with -s will edit shadow or gshadow file
--
-+
- Copyright (c) 1997 , Guy Maor <maor@ece.utexas.edu>
- Copyright (c) 1999 - 2000, Marek Michałkiewicz
- Copyright (c) 2002 - 2006, Tomasz KÅ‚oczko
-@@ -29,8 +29,8 @@
-
- #include <errno.h>
- #include <getopt.h>
--#ifdef WITH_SELINUX
--#include <selinux/selinux.h>
-+#ifdef WITH_SELINUX
-+#include <selinux/selinux.h>
- #endif
- #include <signal.h>
- #include <stdio.h>
-@@ -64,7 +64,7 @@
- static bool quiet = false;
-
- /* local function prototypes */
--static void usage (void);
-+static void usage (int status);
- static int create_backup_file (FILE *, const char *, struct stat *);
- static void vipwexit (const char *msg, int syserr, int ret);
- static void vipwedit (const char *, int (*)(void), int (*)(void));
-@@ -72,9 +72,9 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- (void)
-+ (void)
- fputs (_("Usage: vipw [options]\n"
- "\n"
- "Options:\n"
-@@ -83,8 +83,8 @@
- " -p, --passwd edit passwd database\n"
- " -q, --quiet quiet mode\n"
- " -s, --shadow edit shadow or gshadow database\n"
-- "\n"), stderr);
-- exit (E_USAGE);
-+ "\n"), status ? stderr : stdout);
-+ exit (status);
- }
-
- /*
-@@ -285,8 +285,8 @@
- if (st1.st_mtime == st2.st_mtime) {
- vipwexit (0, 0, 0);
- }
--#ifdef WITH_SELINUX
-- /* unset the fscreatecon */
-+#ifdef WITH_SELINUX
-+ /* unset the fscreatecon */
- if (is_selinux_enabled ()) {
- if (setfscreatecon (NULL)) {
- vipwexit (_("setfscreatecon () failed"), errno, 1);
-@@ -353,7 +353,7 @@
- do_vipw = false;
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'p':
- do_vipw = true;
-@@ -365,7 +365,7 @@
- editshadow = true;
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
- }
-Index: src/useradd.c
-===================================================================
---- src/useradd.c (revision 3054)
-+++ src/useradd.c (revision 3055)
-@@ -179,7 +179,7 @@
- static void show_defaults (void);
- static int set_defaults (void);
- static int get_groups (char *);
--static void usage (void);
-+static void usage (int status);
- static void new_pwent (struct passwd *);
- #ifdef WITH_SELINUX
- static void selinux_update_mapping (void);
-@@ -681,45 +681,46 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- (void) fprintf (stderr,
-+ FILE *usageout = status ? stderr : stdout;
-+ (void) fprintf (usageout,
- _("Usage: %s [options] LOGIN\n"
- "\n"
- "Options:\n"),
- Prog);
- (void) fputs (_(" -b, --base-dir BASE_DIR base directory for the home directory of the\n"
-- " new account\n"), stderr);
-- (void) fputs (_(" -c, --comment COMMENT GECOS field of the new account\n"), stderr);
-- (void) fputs (_(" -d, --home-dir HOME_DIR home directory of the new account\n"), stderr);
-- (void) fputs (_(" -D, --defaults print or change default useradd configuration\n"), stderr);
-- (void) fputs (_(" -e, --expiredate EXPIRE_DATE expiration date of the new account\n"), stderr);
-- (void) fputs (_(" -f, --inactive INACTIVE password inactivity period of the new account\n"), stderr);
-+ " new account\n"), usageout);
-+ (void) fputs (_(" -c, --comment COMMENT GECOS field of the new account\n"), usageout);
-+ (void) fputs (_(" -d, --home-dir HOME_DIR home directory of the new account\n"), usageout);
-+ (void) fputs (_(" -D, --defaults print or change default useradd configuration\n"), usageout);
-+ (void) fputs (_(" -e, --expiredate EXPIRE_DATE expiration date of the new account\n"), usageout);
-+ (void) fputs (_(" -f, --inactive INACTIVE password inactivity period of the new account\n"), usageout);
- (void) fputs (_(" -g, --gid GROUP name or ID of the primary group of the new\n"
-- " account\n"), stderr);
-+ " account\n"), usageout);
- (void) fputs (_(" -G, --groups GROUPS list of supplementary groups of the new\n"
-- " account\n"), stderr);
-- (void) fputs (_(" -h, --help display this help message and exit\n"), stderr);
-- (void) fputs (_(" -k, --skel SKEL_DIR use this alternative skeleton directory\n"), stderr);
-- (void) fputs (_(" -K, --key KEY=VALUE override /etc/login.defs defaults\n"), stderr);
-+ " account\n"), usageout);
-+ (void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
-+ (void) fputs (_(" -k, --skel SKEL_DIR use this alternative skeleton directory\n"), usageout);
-+ (void) fputs (_(" -K, --key KEY=VALUE override /etc/login.defs defaults\n"), usageout);
- (void) fputs (_(" -l, --no-log-init do not add the user to the lastlog and\n"
-- " faillog databases\n"), stderr);
-- (void) fputs (_(" -m, --create-home create the user's home directory\n"), stderr);
-- (void) fputs (_(" -M, --no-create-home do not create the user's home directory\n"), stderr);
-+ " faillog databases\n"), usageout);
-+ (void) fputs (_(" -m, --create-home create the user's home directory\n"), usageout);
-+ (void) fputs (_(" -M, --no-create-home do not create the user's home directory\n"), usageout);
- (void) fputs (_(" -N, --no-user-group do not create a group with the same name as\n"
-- " the user\n"), stderr);
-+ " the user\n"), usageout);
- (void) fputs (_(" -o, --non-unique allow to create users with duplicate\n"
-- " (non-unique) UID\n"), stderr);
-- (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), stderr);
-- (void) fputs (_(" -r, --system create a system account\n"), stderr);
-- (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), stderr);
-- (void) fputs (_(" -u, --uid UID user ID of the new account\n"), stderr);
-- (void) fputs (_(" -U, --user-group create a group with the same name as the user\n"), stderr);
-+ " (non-unique) UID\n"), usageout);
-+ (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), usageout);
-+ (void) fputs (_(" -r, --system create a system account\n"), usageout);
-+ (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), usageout);
-+ (void) fputs (_(" -u, --uid UID user ID of the new account\n"), usageout);
-+ (void) fputs (_(" -U, --user-group create a group with the same name as the user\n"), usageout);
- #ifdef WITH_SELINUX
-- (void) fputs (_(" -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping\n"), stderr);
-+ (void) fputs (_(" -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping\n"), usageout);
- #endif
-- (void) fputs ("\n", stderr);
-- exit (E_USAGE);
-+ (void) fputs ("\n", usageout);
-+ exit (status);
- }
-
- /*
-@@ -989,9 +990,9 @@
- };
- while ((c = getopt_long (argc, argv,
- #ifdef WITH_SELINUX
-- "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:UZ:",
-+ "b:c:d:De:f:g:G:hk:K:lmMNop:rs:u:UZ:",
- #else
-- "b:c:d:De:f:g:G:k:K:lmMNop:rs:u:U",
-+ "b:c:d:De:f:g:G:hk:K:lmMNop:rs:u:U",
- #endif
- long_options, NULL)) != -1) {
- switch (c) {
-@@ -1029,7 +1030,7 @@
- break;
- case 'D':
- if (anyflag) {
-- usage ();
-+ usage (E_USAGE);
- }
- Dflg = true;
- break;
-@@ -1066,7 +1067,7 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- /*
- * -f -1 is allowed
-@@ -1106,7 +1107,7 @@
- Gflg = true;
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'k':
- def_template = optarg;
-@@ -1201,7 +1202,7 @@
- break;
- #endif
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- anyflag = true;
- }
-@@ -1220,31 +1221,31 @@
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-o", "-u");
-- usage ();
-+ usage (E_USAGE);
- }
- if (kflg && !mflg) {
- fprintf (stderr,
- _("%s: %s flag is only allowed with the %s flag\n"),
- Prog, "-k", "-m");
-- usage ();
-+ usage (E_USAGE);
- }
- if (Uflg && gflg) {
- fprintf (stderr,
- _("%s: options %s and %s conflict\n"),
- Prog, "-U", "-g");
-- usage ();
-+ usage (E_USAGE);
- }
- if (Uflg && Nflg) {
- fprintf (stderr,
- _("%s: options %s and %s conflict\n"),
- Prog, "-U", "-N");
-- usage ();
-+ usage (E_USAGE);
- }
- if (mflg && Mflg) {
- fprintf (stderr,
- _("%s: options %s and %s conflict\n"),
- Prog, "-m", "-M");
-- usage ();
-+ usage (E_USAGE);
- }
-
- /*
-@@ -1253,15 +1254,15 @@
- */
- if (Dflg) {
- if (optind != argc) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- if (uflg || oflg || Gflg || dflg || cflg || mflg) {
-- usage ();
-+ usage (E_USAGE);
- }
- } else {
- if (optind != argc - 1) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- user_name = argv[optind];
-Index: src/su.c
-===================================================================
---- src/su.c (revision 3054)
-+++ src/su.c (revision 3055)
-@@ -323,7 +323,7 @@
- /*
- * usage - print command line syntax and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
- fputs (_("Usage: su [options] [LOGIN]\n"
- "\n"
-@@ -335,8 +335,8 @@
- " --preserve-environment do not reset environment variables, and\n"
- " keep the same shell\n"
- " -s, --shell SHELL use SHELL instead of the default in passwd\n"
-- "\n"), stderr);
-- exit (E_USAGE);
-+ "\n"), status ? stderr : stdout);
-+ exit (status);
- }
-
- /*
-@@ -421,7 +421,7 @@
- command = optarg;
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'l':
- fakelogin = true;
-@@ -438,7 +438,7 @@
- shellstr = optarg;
- break;
- default:
-- usage (); /* NOT REACHED */
-+ usage (E_USAGE); /* NOT REACHED */
- }
- }
-
-Index: src/groupmod.c
-===================================================================
---- src/groupmod.c (revision 3054)
-+++ src/groupmod.c (revision 3055)
-@@ -93,7 +93,7 @@
- pflg = false; /* new encrypted password */
-
- /* local function prototypes */
--static void usage (void);
-+static void usage (int status);
- static void new_grent (struct group *);
-
- #ifdef SHADOWGRP
-@@ -113,21 +113,22 @@
- * usage - display usage message and exit
- */
-
--static void usage (void)
-+static void usage (int status)
- {
-- (void) fprintf (stderr,
-+ FILE *usageout = status ? stderr : stdout;
-+ (void) fprintf (usageout,
- _("Usage: %s [options] GROUP\n"
- "\n"
- "Options:\n"),
- Prog);
-- (void) fputs (_(" -g, --gid GID change the group ID to GID\n"), stderr);
-- (void) fputs (_(" -h, --help display this help message and exit\n"), stderr);
-- (void) fputs (_(" -n, --new-name NEW_GROUP change the name to NEW_GROUP\n"), stderr);
-- (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), stderr);
-+ (void) fputs (_(" -g, --gid GID change the group ID to GID\n"), usageout);
-+ (void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
-+ (void) fputs (_(" -n, --new-name NEW_GROUP change the name to NEW_GROUP\n"), usageout);
-+ (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), usageout);
- (void) fputs (_(" -p, --password PASSWORD change the password to this (encrypted)\n"
-- " PASSWORD\n"), stderr);
-- (void) fputs ("\n", stderr);
-- exit (E_USAGE);
-+ " PASSWORD\n"), usageout);
-+ (void) fputs ("\n", usageout);
-+ exit (status);
- }
-
- /*
-@@ -362,6 +363,8 @@
- exit (E_BAD_ARG);
- }
- break;
-+ case 'h':
-+ usage (E_SUCCESS);
- case 'n':
- nflg = true;
- group_newname = optarg;
-@@ -374,16 +377,16 @@
- pflg = true;
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
- if (oflg && !gflg) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- if (optind != (argc - 1)) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- group_name = argv[argc - 1];
-Index: src/passwd.c
-===================================================================
---- src/passwd.c (revision 3054)
-+++ src/passwd.c (revision 3055)
-@@ -180,7 +180,7 @@
- " -w, --warndays WARN_DAYS set expiration warning days to WARN_DAYS\n"
- " -x, --maxdays MAX_DAYS set maximum number of days before password\n"
- " change to MAX_DAYS\n"
-- "\n"), stderr);
-+ "\n"), status ? stderr : stdout);
- exit (status);
- }
-
-@@ -811,7 +811,7 @@
- {NULL, 0, NULL, '\0'}
- };
-
-- while ((c = getopt_long (argc, argv, "adei:kln:qr:Suw:x:",
-+ while ((c = getopt_long (argc, argv, "adehi:kln:qr:Suw:x:",
- long_options, &option_index)) != -1) {
- switch (c) {
- case 'a':
-@@ -897,6 +897,8 @@
- xflg = true;
- anyflag = true;
- break;
-+ case 'h':
-+ usage (E_SUCCESS);
- default:
- usage (E_BAD_ARG);
- }
-Index: src/groupadd.c
-===================================================================
---- src/groupadd.c (revision 3054)
-+++ src/groupadd.c (revision 3055)
-@@ -88,7 +88,7 @@
- #endif
-
- /* local function prototypes */
--static void usage (void);
-+static void usage (int status);
- static void new_grent (struct group *grent);
-
- #ifdef SHADOWGRP
-@@ -105,24 +105,25 @@
- /*
- * usage - display usage message and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
-- (void) fprintf (stderr,
-+ FILE *usageout = status ? stderr : stdout;
-+ (void) fprintf (usageout,
- _("Usage: %s [options] GROUP\n"
- "\n"
- "Options:\n"),
- Prog);
- (void) fputs (_(" -f, --force exit successfully if the group already exists,\n"
-- " and cancel -g if the GID is already used\n"), stderr);
-- (void) fputs (_(" -g, --gid GID use GID for the new group\n"), stderr);
-- (void) fputs (_(" -h, --help display this help message and exit\n"), stderr);
-- (void) fputs (_(" -K, --key KEY=VALUE override /etc/login.defs defaults\n"), stderr);
-+ " and cancel -g if the GID is already used\n"), usageout);
-+ (void) fputs (_(" -g, --gid GID use GID for the new group\n"), usageout);
-+ (void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
-+ (void) fputs (_(" -K, --key KEY=VALUE override /etc/login.defs defaults\n"), usageout);
- (void) fputs (_(" -o, --non-unique allow to create groups with duplicate\n"
-- " (non-unique) GID\n"), stderr);
-- (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), stderr);
-- (void) fputs (_(" -r, --system create a system account\n"), stderr);
-- (void) fputs ("\n", stderr);
-- exit (E_USAGE);
-+ " (non-unique) GID\n"), usageout);
-+ (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), usageout);
-+ (void) fputs (_(" -r, --system create a system account\n"), usageout);
-+ (void) fputs ("\n", usageout);
-+ exit (status);
- }
-
- /*
-@@ -412,7 +413,7 @@
- }
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'K':
- /*
-@@ -444,7 +445,7 @@
- rflg = true;
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-@@ -452,7 +453,7 @@
- * Check the flags consistency
- */
- if (optind != argc - 1) {
-- usage ();
-+ usage (E_USAGE);
- }
- group_name = argv[optind];
-
-@@ -468,7 +469,7 @@
- {
- /* -o does not make sense without -g */
- if (oflg && !gflg) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- check_new_name ();
-Index: src/chage.c
-===================================================================
---- src/chage.c (revision 3054)
-+++ src/chage.c (revision 3055)
-@@ -91,7 +91,7 @@
-
- /* local function prototypes */
- static bool isnum (const char *s);
--static void usage (void);
-+static void usage (int status);
- static void date_to_str (char *buf, size_t maxsize, time_t date);
- static int new_fields (void);
- static void print_date (time_t date);
-@@ -152,7 +152,7 @@
- /*
- * usage - print command line syntax and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
- fputs (_("Usage: chage [options] [LOGIN]\n"
- "\n"
-@@ -168,8 +168,8 @@
- " -M, --maxdays MAX_DAYS set maximim number of days before password\n"
- " change to MAX_DAYS\n"
- " -W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS\n"
-- "\n"), stderr);
-- exit (E_USAGE);
-+ "\n"), status ? stderr : stdout);
-+ exit (status);
- }
-
- static void date_to_str (char *buf, size_t maxsize, time_t date)
-@@ -413,7 +413,7 @@
- fprintf (stderr,
- _("%s: invalid date '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- case 'E':
-@@ -425,11 +425,11 @@
- fprintf (stderr,
- _("%s: invalid date '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'I':
- Iflg = true;
-@@ -438,7 +438,7 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- case 'l':
-@@ -451,7 +451,7 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- case 'M':
-@@ -461,7 +461,7 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- case 'W':
-@@ -471,11 +471,11 @@
- fprintf (stderr,
- _("%s: invalid numeric argument '%s'\n"),
- Prog, optarg);
-- usage ();
-+ usage (E_USAGE);
- }
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-@@ -495,14 +495,14 @@
- */
-
- if (argc != opt_index + 1) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- if (lflg && (mflg || Mflg || dflg || Wflg || Iflg || Eflg)) {
- fprintf (stderr,
- _("%s: do not include \"l\" with other flags\n"),
- Prog);
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-Index: src/faillog.c
-===================================================================
---- src/faillog.c (revision 3054)
-+++ src/faillog.c (revision 3055)
-@@ -47,6 +47,17 @@
- /*@-exitarg@*/
- #include "exitcodes.h"
-
-+/* local function prototypes */
-+static void usage (int status);
-+static void print_one (/*@null@*/const struct passwd *pw, bool force);
-+static void set_locktime (long locktime);
-+static bool set_locktime_one (uid_t uid, long locktime);
-+static void setmax (int max);
-+static bool setmax_one (uid_t uid, int max);
-+static void print (void);
-+static bool reset_one (uid_t uid);
-+static void reset (void);
-+
- /*
- * Global variables
- */
-@@ -69,24 +80,25 @@
-
- #define NOW (time((time_t *) 0))
-
--static void usage (void)
-+static void usage (int status)
- {
-- (void) fprintf (stderr,
-+ FILE *usageout = status ? stderr : stdout;
-+ (void) fprintf (usageout,
- _("Usage: %s [options]\n"
- "\n"
- "Options:\n"),
- "faillog");
-- (void) fputs (_(" -a, --all display faillog records for all users\n"), stderr);
-- (void) fputs (_(" -h, --help display this help message and exit\n"), stderr);
-- (void) fputs (_(" -l, --lock-time SEC after failed login lock account for SEC seconds\n"), stderr);
-- (void) fputs (_(" -m, --maximum MAX set maximum failed login counters to MAX\n"), stderr);
-- (void) fputs (_(" -r, --reset reset the counters of login failures\n"), stderr);
-- (void) fputs (_(" -t, --time DAYS display faillog records more recent than DAYS\n"), stderr);
-+ (void) fputs (_(" -a, --all display faillog records for all users\n"), usageout);
-+ (void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
-+ (void) fputs (_(" -l, --lock-time SEC after failed login lock account for SEC seconds\n"), usageout);
-+ (void) fputs (_(" -m, --maximum MAX set maximum failed login counters to MAX\n"), usageout);
-+ (void) fputs (_(" -r, --reset reset the counters of login failures\n"), usageout);
-+ (void) fputs (_(" -t, --time DAYS display faillog records more recent than DAYS\n"), usageout);
- (void) fputs (_(" -u, --user LOGIN/RANGE display faillog record or maintains failure\n"
- " counters and limits (if used with -r, -m,\n"
-- " or -l) only for the specified LOGIN(s)\n"), stderr);
-- (void) fputs ("\n", stderr);
-- exit (E_USAGE);
-+ " or -l) only for the specified LOGIN(s)\n"), usageout);
-+ (void) fputs ("\n", usageout);
-+ exit (status);
- }
-
- static void print_one (/*@null@*/const struct passwd *pw, bool force)
-@@ -495,7 +507,7 @@
- aflg = true;
- break;
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 'l':
- if (getlong (optarg, &fail_locktime) == 0) {
-@@ -561,16 +573,16 @@
- break;
- }
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
- }
-
- if (aflg && uflg) {
-- usage ();
-+ usage (E_USAGE);
- }
- if (tflg && (lflg || mflg || rflg)) {
-- usage ();
-+ usage (E_USAGE);
- }
-
- /* Open the faillog database */
-Index: src/chsh.c
-===================================================================
---- src/chsh.c (revision 3054)
-+++ src/chsh.c (revision 3055)
-@@ -72,7 +72,7 @@
-
- /* local function prototypes */
- static void fail_exit (int code);
--static void usage (void);
-+static void usage (int status);
- static void new_fields (void);
- static bool shell_is_listed (const char *);
- static bool is_restricted_shell (const char *);
-@@ -101,15 +101,15 @@
- /*
- * usage - print command line syntax and exit
- */
--static void usage (void)
-+static void usage (int status)
- {
- fputs (_("Usage: chsh [options] [LOGIN]\n"
- "\n"
- "Options:\n"
- " -h, --help display this help message and exit\n"
- " -s, --shell SHELL new login shell for the user account\n"
-- "\n"), stderr);
-- exit (E_USAGE);
-+ "\n"), status ? stderr : stdout);
-+ exit (status);
- }
-
- /*
-@@ -217,14 +217,14 @@
- &option_index)) != -1) {
- switch (c) {
- case 'h':
-- usage ();
-+ usage (E_SUCCESS);
- break;
- case 's':
- sflg = true;
- STRFCPY (loginsh, optarg);
- break;
- default:
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-@@ -233,7 +233,7 @@
- * be the user's name.
- */
- if (argc > (optind + 1)) {
-- usage ();
-+ usage (E_USAGE);
- }
- }
-
-Index: man/groupmems.8.xml
-===================================================================
---- man/groupmems.8.xml (revision 3054)
-+++ man/groupmems.8.xml (revision 3055)
-@@ -114,6 +114,12 @@
- </listitem>
- </varlistentry>
- <varlistentry>
-+ <term><option>-h</option>, <option>--help</option></term>
-+ <listitem>
-+ <para>Display help message and exit.</para>
-+ </listitem>
-+ </varlistentry>
-+ <varlistentry>
- <term><option>-l</option>, <option>--list</option></term>
- <listitem>
- <para>List the group membership list.</para>
-Index: man/gpasswd.1.xml
-===================================================================
---- man/gpasswd.1.xml (revision 3054)
-+++ man/gpasswd.1.xml (revision 3055)
-@@ -1,7 +1,7 @@
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Copyright (c) 1996 , Rafal Maszkowski
-- Copyright (c) 2007 - 2008, Nicolas François
-+ Copyright (c) 2007 - 2009, Nicolas François
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
-@@ -148,6 +148,14 @@
- </variablelist>
- <variablelist remap='IP'>
- <varlistentry>
-+ <term><option>-h</option>, <option>--help</option></term>
-+ <listitem>
-+ <para>Display help message and exit.</para>
-+ </listitem>
-+ </varlistentry>
-+ </variablelist>
-+ <variablelist remap='IP'>
-+ <varlistentry>
- <term>
- <option>-r</option>, <option>--remove-password</option>
- </term>
-Index: NEWS
-===================================================================
---- NEWS (revision 3054)
-+++ NEWS (revision 3055)
-@@ -1,5 +1,11 @@
- $Id$
-
-+shadow-4.1.4.1 -> shadow-4.1.4.2 UNRELEASED
-+
-+- general
-+ * report usage error to stderr, but report usage help to stdout (and return
-+ zero) when explicitly requested (e.g. with --help).
-+
- shadow-4.1.4.1 -> shadow-4.1.4.2 2009-07-24
-
- - general
diff --git a/source/a/shadow/patches/r3060.diff b/source/a/shadow/patches/r3060.diff
deleted file mode 100644
index 8ece6430..00000000
--- a/source/a/shadow/patches/r3060.diff
+++ /dev/null
@@ -1,116 +0,0 @@
-* libmisc/copydir.c, lib/shadowmem.c, lib/groupmem.c, lib/pwmem.c:
-Fix some memory leaks.
-
-Index: libmisc/copydir.c
-===================================================================
---- libmisc/copydir.c (revision 3059)
-+++ libmisc/copydir.c (revision 3060)
-@@ -443,6 +443,7 @@
- nchars = readlink (filename, buffer, size);
-
- if (nchars < 0) {
-+ free(buffer);
- return NULL;
- }
-
-
-Index: lib/shadowmem.c
-===================================================================
---- lib/shadowmem.c (revision 3059)
-+++ lib/shadowmem.c (revision 3060)
-@@ -52,10 +52,13 @@
- *sp = *spent;
- sp->sp_namp = strdup (spent->sp_namp);
- if (NULL == sp->sp_namp) {
-+ free(sp);
- return NULL;
- }
- sp->sp_pwdp = strdup (spent->sp_pwdp);
- if (NULL == sp->sp_pwdp) {
-+ free(sp->sp_namp);
-+ free(sp);
- return NULL;
- }
-
-Index: lib/groupmem.c
-===================================================================
---- lib/groupmem.c (revision 3059)
-+++ lib/groupmem.c (revision 3060)
-@@ -51,10 +51,13 @@
- *gr = *grent;
- gr->gr_name = strdup (grent->gr_name);
- if (NULL == gr->gr_name) {
-+ free(gr);
- return NULL;
- }
- gr->gr_passwd = strdup (grent->gr_passwd);
- if (NULL == gr->gr_passwd) {
-+ free(gr->gr_name);
-+ free(gr);
- return NULL;
- }
-
-@@ -62,11 +65,21 @@
-
- gr->gr_mem = (char **) malloc ((i + 1) * sizeof (char *));
- if (NULL == gr->gr_mem) {
-+ free(gr->gr_passwd);
-+ free(gr->gr_name);
-+ free(gr);
- return NULL;
- }
- for (i = 0; grent->gr_mem[i]; i++) {
- gr->gr_mem[i] = strdup (grent->gr_mem[i]);
- if (NULL == gr->gr_mem[i]) {
-+ int j;
-+ for (j=0; j<i; j++)
-+ free(gr->gr_mem[j]);
-+ free(gr->gr_mem);
-+ free(gr->gr_passwd);
-+ free(gr->gr_name);
-+ free(gr);
- return NULL;
- }
- }
-Index: lib/pwmem.c
-===================================================================
---- lib/pwmem.c (revision 3059)
-+++ lib/pwmem.c (revision 3060)
-@@ -51,22 +51,37 @@
- *pw = *pwent;
- pw->pw_name = strdup (pwent->pw_name);
- if (NULL == pw->pw_name) {
-+ free(pw);
- return NULL;
- }
- pw->pw_passwd = strdup (pwent->pw_passwd);
- if (NULL == pw->pw_passwd) {
-+ free(pw->pw_name);
-+ free(pw);
- return NULL;
- }
- pw->pw_gecos = strdup (pwent->pw_gecos);
- if (NULL == pw->pw_gecos) {
-+ free(pw->pw_passwd);
-+ free(pw->pw_name);
-+ free(pw);
- return NULL;
- }
- pw->pw_dir = strdup (pwent->pw_dir);
- if (NULL == pw->pw_dir) {
-+ free(pw->pw_gecos);
-+ free(pw->pw_passwd);
-+ free(pw->pw_name);
-+ free(pw);
- return NULL;
- }
- pw->pw_shell = strdup (pwent->pw_shell);
- if (NULL == pw->pw_shell) {
-+ free(pw->pw_dir);
-+ free(pw->pw_gecos);
-+ free(pw->pw_passwd);
-+ free(pw->pw_name);
-+ free(pw);
- return NULL;
- }
-
diff --git a/source/a/shadow/patches/r3062.diff b/source/a/shadow/patches/r3062.diff
deleted file mode 100644
index 00d9ba3a..00000000
--- a/source/a/shadow/patches/r3062.diff
+++ /dev/null
@@ -1,139 +0,0 @@
-Index: lib/shadowmem.c
-===================================================================
---- lib/shadowmem.c (revision 3061)
-+++ lib/shadowmem.c (revision 3062)
-@@ -49,8 +49,14 @@
- if (NULL == sp) {
- return NULL;
- }
-- *sp = *spent;
-- sp->sp_namp = strdup (spent->sp_namp);
-+ sp->sp_lstchg = spent->sp_lstchg;
-+ sp->sp_min = spent->sp_min;
-+ sp->sp_max = spent->sp_max;
-+ sp->sp_warn = spent->sp_warn;
-+ sp->sp_inact = spent->sp_inact;
-+ sp->sp_expire = spent->sp_expire;
-+ sp->sp_flag = spent->sp_flag;
-+ sp->sp_namp = strdup (spent->sp_namp);
- if (NULL == sp->sp_namp) {
- free(sp);
- return NULL;
-@@ -68,8 +74,10 @@
- void spw_free (/*@out@*/ /*@only@*/struct spwd *spent)
- {
- free (spent->sp_namp);
-- memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
-- free (spent->sp_pwdp);
-+ if (NULL != spent->sp_pwdp) {
-+ memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
-+ free (spent->sp_pwdp);
-+ }
- free (spent);
- }
-
-Index: lib/groupmem.c
-===================================================================
---- lib/groupmem.c (revision 3061)
-+++ lib/groupmem.c (revision 3062)
-@@ -48,7 +48,7 @@
- if (NULL == gr) {
- return NULL;
- }
-- *gr = *grent;
-+ gr->gr_gid = grent->gr_gid;
- gr->gr_name = strdup (grent->gr_name);
- if (NULL == gr->gr_name) {
- free(gr);
-@@ -90,13 +90,18 @@
-
- void gr_free (/*@out@*/ /*@only@*/struct group *grent)
- {
-+ size_t i;
- free (grent->gr_name);
-- memzero (grent->gr_passwd, strlen (grent->gr_passwd));
-- free (grent->gr_passwd);
-- while (*(grent->gr_mem)) {
-- free (*(grent->gr_mem));
-- grent->gr_mem++;
-+ if (NULL != grent->gr_passwd) {
-+ memzero (grent->gr_passwd, strlen (grent->gr_passwd));
-+ free (grent->gr_passwd);
- }
-+ if (NULL != grent->gr_mem) {
-+ for (i = 0; NULL != grent->gr_mem[i]; i++) {
-+ free (grent->gr_mem[i]);
-+ }
-+ free (grent->gr_mem);
-+ }
- free (grent);
- }
-
-Index: lib/sgroupio.c
-===================================================================
---- lib/sgroupio.c (revision 3061)
-+++ lib/sgroupio.c (revision 3062)
-@@ -51,7 +51,6 @@
- if (NULL == sg) {
- return NULL;
- }
-- *sg = *sgent;
- sg->sg_name = strdup (sgent->sg_name);
- if (NULL == sg->sg_name) {
- free (sg);
-@@ -137,17 +136,20 @@
-
- void sgr_free (/*@out@*/ /*@only@*/struct sgrp *sgent)
- {
-+ size_t i;
- free (sgent->sg_name);
-- memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
-- free (sgent->sg_passwd);
-- while (NULL != *(sgent->sg_adm)) {
-- free (*(sgent->sg_adm));
-- sgent->sg_adm++;
-+ if (NULL != sgent->sg_passwd) {
-+ memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
-+ free (sgent->sg_passwd);
- }
-- while (NULL != *(sgent->sg_mem)) {
-- free (*(sgent->sg_mem));
-- sgent->sg_mem++;
-+ for (i = 0; NULL != sgent->sg_adm[i]; i++) {
-+ free (sgent->sg_adm[i]);
- }
-+ free (sgent->sg_adm);
-+ for (i = 0; NULL != sgent->sg_mem[i]; i++) {
-+ free (sgent->sg_mem[i]);
-+ }
-+ free (sgent->sg_mem);
- free (sgent);
- }
-
-Index: lib/pwmem.c
-===================================================================
---- lib/pwmem.c (revision 3061)
-+++ lib/pwmem.c (revision 3062)
-@@ -48,7 +48,8 @@
- if (NULL == pw) {
- return NULL;
- }
-- *pw = *pwent;
-+ pw->pw_uid = pwent->pw_uid;
-+ pw->pw_gid = pwent->pw_gid;
- pw->pw_name = strdup (pwent->pw_name);
- if (NULL == pw->pw_name) {
- free(pw);
-@@ -91,8 +92,10 @@
- void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent)
- {
- free (pwent->pw_name);
-- memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
-- free (pwent->pw_passwd);
-+ if (pwent->pw_passwd) {
-+ memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
-+ free (pwent->pw_passwd);
-+ }
- free (pwent->pw_gecos);
- free (pwent->pw_dir);
- free (pwent->pw_shell);
diff --git a/source/a/shadow/patches/r3090.diff b/source/a/shadow/patches/r3090.diff
deleted file mode 100644
index 46057673..00000000
--- a/source/a/shadow/patches/r3090.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- libmisc/env.c.orig 2011-02-13 11:58:11.000000000 -0600
-+++ libmisc/env.c 2012-08-14 10:38:25.304917619 -0500
-@@ -251,7 +251,7 @@
- if (strncmp (*cur, *bad, strlen (*bad)) != 0) {
- continue;
- }
-- if (strchr (*cur, '/') != NULL) {
-+ if (strchr (*cur, '/') == NULL) {
- continue; /* OK */
- }
- for (move = cur; NULL != *move; move++) {
diff --git a/source/a/shadow/patches/r3096.diff b/source/a/shadow/patches/r3096.diff
deleted file mode 100644
index 0e77ce6f..00000000
--- a/source/a/shadow/patches/r3096.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-
-* lib/gshadow.c: Fix parsing of gshadow entries.
-
-Index: lib/gshadow.c
-===================================================================
---- lib/gshadow.c (revision 3095)
-+++ lib/gshadow.c (revision 3096)
-@@ -222,6 +222,7 @@
- if (NULL == buf) {
- return NULL;
- }
-+ buflen = BUFSIZ;
- }
-
- if (NULL == fp) {
-@@ -229,9 +230,9 @@
- }
-
- #ifdef USE_NIS
-- while (fgetsx (buf, (int) sizeof buf, fp) == buf)
-+ while (fgetsx (buf, (int) buflen, fp) == buf)
- #else
-- if (fgetsx (buf, (int) sizeof buf, fp) == buf)
-+ if (fgetsx (buf, (int) buflen, fp) == buf)
- #endif
- {
- while ( ((cp = strrchr (buf, '\n')) == NULL)
diff --git a/source/a/shadow/patches/r3160.diff b/source/a/shadow/patches/r3160.diff
deleted file mode 100644
index 5aabbaa9..00000000
--- a/source/a/shadow/patches/r3160.diff
+++ /dev/null
@@ -1,239 +0,0 @@
-Index: libmisc/limits.c
-===================================================================
---- libmisc/limits.c (revision 3159)
-+++ libmisc/limits.c (revision 3160)
-@@ -33,6 +33,7 @@
- /*
- * Separated from setup.c. --marekm
- * Resource limits thanks to Cristian Gafton.
-+ * Enhancements of resource limit code by Thomas Orgis <thomas@orgis.org> ("thor").
- */
-
- #include <config.h>
-@@ -44,6 +45,7 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdio.h>
-+#include <ctype.h>
- #include "prototypes.h"
- #include "defines.h"
- #include <pwd.h>
-@@ -69,17 +71,37 @@
- unsigned int multiplier)
- {
- struct rlimit rlim;
-- long limit;
-+ rlim_t limit;
-
-- if (getlong (value, &limit) == 0) {
-- return 0;
-+ /* The "-" is special, not belonging to a strange negative limit.
-+ It is infinity, in a controlled way. --thor */
-+ if(value[0] == '-') {
-+ limit = RLIM_INFINITY;
- }
-- limit *= multiplier;
-- if (limit != (rlim_t) limit) {
-- return 0;
-+ else {
-+ /* We cannot use getlong here because it fails when there
-+ is more to the value than just this number!
-+ Also, we are limited to base 10 here (hex numbers will not
-+ work with the limit string parser as is anyway) --thor */
-+ char *endptr;
-+ long longlimit = strtol(value, &endptr, 10);
-+ if ((0 == longlimit) && (value == endptr)) {
-+ /* No argument at all. No-op.
-+ We could instead throw an error, though. --thor */
-+ return 0;
-+ }
-+ longlimit *= multiplier;
-+ limit = (rlim_t)longlimit;
-+ if(longlimit != limit)
-+ {
-+ /* Again, silent error handling... I left it that way.
-+ Wouldn't screaming make more sense? --thor */
-+ return 0;
-+ }
- }
-- rlim.rlim_cur = (rlim_t) limit;
-- rlim.rlim_max = (rlim_t) limit;
-+
-+ rlim.rlim_cur = limit;
-+ rlim.rlim_max = limit;
- if (setrlimit (resource, &rlim) != 0) {
- return LOGIN_ERROR_RLIMIT;
- }
-@@ -199,6 +221,9 @@
- * [Ii]: i = RLIMIT_NICE max nice value (0..39 translates to 20..-19)
- * [Oo]: o = RLIMIT_RTPRIO max real time priority (linux/sched.h 0..MAX_RT_PRIO)
- *
-+ * Remember to extend the "no-limits" string below when adding a new limit...
-+ * --thor
-+ *
- * Return value:
- * 0 = okay, of course
- * LOGIN_ERROR_RLIMIT = error setting some RLIMIT
-@@ -214,7 +239,20 @@
- bool reported = false;
-
- pp = buf;
-+ /* Skip leading whitespace. --thor */
-+ while(*pp == ' ' || *pp == '\t') ++pp;
-
-+ /* The special limit string "-" results in no limit for all known limits.
-+ We achieve that by parsing a full limit string, parts of it being ignored
-+ if a limit type is not known to the system.
-+ Though, there will be complaining for unknown limit types. --thor */
-+ if(strcmp(pp, "-") == 0) {
-+ /* Remember to extend this, too, when adding new limits!
-+ Oh... but "unlimited" does not make sense for umask, or does it?
-+ --thor */
-+ pp = "A- C- D- F- M- N- R- S- T- P- I- O-";
-+ }
-+
- while ('\0' != *pp) {
- switch (*pp++) {
- #ifdef RLIMIT_AS
-@@ -316,6 +354,10 @@
- break;
- default:
- /* Only report invalid strings once */
-+ /* Note: A string can be invalid just because a specific (theoretically
-+ valid) setting is not supported by this build.
-+ It is just a warning in syslog anyway. The line is still processed
-+ --thor */
- if (!reported) {
- SYSLOG ((LOG_WARN,
- "Invalid limit string: '%s'",
-@@ -324,13 +366,51 @@
- retval |= LOGIN_ERROR_RLIMIT;
- }
- }
-+ /* After parsing one limit setting (or just complaining about it),
-+ one still needs to skip its argument to prevent a bogus warning on
-+ trying to parse that as limit specification.
-+ So, let's skip all digits, "-" and our limited set of whitespace.
-+ --thor */
-+ while(isdigit(*pp) || *pp == '-' || *pp == ' ' || *pp == '\t') {
-+ ++pp;
-+ }
- }
- return retval;
- }
-
-+/* Check if user uname is in the group gname.
-+ * Can I be sure that gr_mem contains no UID as string?
-+ * Returns true when user is in the group, false when not.
-+ * Any error is treated as false. --thor
-+ */
-+static bool user_in_group (const char *uname, const char *gname)
-+{
-+ struct group *groupdata;
-+ char **member;
-+ if(uname == NULL || gname == NULL){
-+ return false;
-+ }
-+ /* We are not claiming to be re-entrant!
-+ * In case of paranoia or a multithreaded login program,
-+ * one needs to add some mess for getgrnam_r. */
-+ groupdata = getgrnam(gname);
-+ if(groupdata == NULL) {
-+ SYSLOG ((LOG_WARN, "Nonexisting group `%s' in limits file.", gname));
-+ return false;
-+ }
-+ /* Now look for our user in the list of members. */
-+ member = groupdata->gr_mem;
-+ while(*member != NULL) {
-+ if(strcmp(*member, uname) == 0) {
-+ return true;
-+ }
-+ ++member;
-+ }
-+ return false;
-+}
-+
- static int setup_user_limits (const char *uname)
- {
-- /* TODO: allow and use @group syntax --cristiang */
- FILE *fil;
- char buf[1024];
- char name[1024];
-@@ -352,7 +432,7 @@
- }
- /* The limits file have the following format:
- * - '#' (comment) chars only as first chars on a line;
-- * - username must start on first column
-+ * - username must start on first column (or *, or @group --thor)
- * A better (smarter) checking should be done --cristiang */
- while (fgets (buf, 1024, fil) != NULL) {
- if (('#' == buf[0]) || ('\n' == buf[0])) {
-@@ -367,6 +447,13 @@
- * Imposing a limit should be done with care, so a wrong
- * entry means no care anyway :-). A '-' as a limits
- * strings means no limits --cristiang */
-+ /* In addition to the handling of * as name which was alrady present,
-+ I added handling of the @group syntax.
-+ To clarify: The first entry with matching user name rules,
-+ everything after it is ignored. If there is no user entry,
-+ the last encountered entry for a matching group rules.
-+ If there is no matching group entry, the default limits rule.
-+ --thor. */
- if (sscanf (buf, "%s%[ACDFMNRSTULPIOacdfmnrstulpio0-9 \t-]",
- name, tempbuf) == 2) {
- if (strcmp (name, uname) == 0) {
-@@ -374,6 +461,12 @@
- break;
- } else if (strcmp (name, "*") == 0) {
- strcpy (deflimits, tempbuf);
-+ } else if (name[0] == '@') {
-+ /* If the user is in the group, the group limits apply unless
-+ later a line for the specific user is found. --thor */
-+ if(user_in_group(uname, name+1)) {
-+ strcpy (limits, tempbuf);
-+ }
- }
- }
- }
-Index: man/limits.5.xml
-===================================================================
---- man/limits.5.xml (revision 3159)
-+++ man/limits.5.xml (revision 3160)
-@@ -64,7 +64,13 @@
- <emphasis remap='I'>user LIMITS_STRING</emphasis>
- </para>
-
-+ <para>or in the form:</para>
-+
- <para>
-+ <emphasis remap='I'>@group LIMITS_STRING</emphasis>
-+ </para>
-+
-+ <para>
- The <emphasis>LIMITS_STRING</emphasis> is a string of a concatenated
- list of resource limits. Each limit consists of a letter identifier
- followed by a numerical limit.
-@@ -125,11 +131,23 @@
- </para>
-
- <para>
-+ The limits specified in the form "<replaceable>@group</replaceable>"
-+ apply to the members of the specified
-+ <replaceable>group</replaceable>.
-+ </para>
-+
-+ <para>
- To completely disable limits for a user, a single dash
- "<emphasis>-</emphasis>" will do.
- </para>
-
- <para>
-+ To disable a limit for a user, a single dash
-+ "<replaceable>-</replaceable>" can be used instead of the numerical
-+ value for this limit.
-+ </para>
-+
-+ <para>
- Also, please note that all limit settings are set PER LOGIN. They are
- not global, nor are they permanent. Perhaps global limits will come,
- but for now this will have to do ;)
diff --git a/source/a/shadow/patches/r3194.diff b/source/a/shadow/patches/r3194.diff
deleted file mode 100644
index 0eff631b..00000000
--- a/source/a/shadow/patches/r3194.diff
+++ /dev/null
@@ -1,15 +0,0 @@
-* src/su.c: shell's name must be -su when a su fakes a login.
-
-===================================================================
---- src/su.c (revision 3193)
-+++ src/su.c (revision 3194)
-@@ -1021,7 +1021,7 @@
- * Use the shell and create an argv
- * with the rest of the command line included.
- */
-- argv[-1] = shellstr;
-+ argv[-1] = cp;
- #ifndef USE_PAM
- execve_shell (shellstr, &argv[-1], environ);
- err = errno;
-
diff --git a/source/a/shadow/shadow.SlackBuild b/source/a/shadow/shadow.SlackBuild
index 41e9353b..8194930d 100755
--- a/source/a/shadow/shadow.SlackBuild
+++ b/source/a/shadow/shadow.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
PKGNAM=shadow
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-7}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -63,8 +63,8 @@ for patch in $CWD/patches/*.diff.gz ; do
zcat $patch | patch -p0 --verbose || exit 1
done
-# Don't duplicate Russian man page installations:
-zcat $CWD/shadow.man.nodups.diff.gz | patch -p1 --verbose || exit 1
+# Patch to handle newer crypt() that may return NULL:
+zcat $CWD/shadow.glibc217-crypt.diff.gz | patch -p1 --verbose || exit 1
# Re-run automake because of r3299 patch to man/ru/Makefile.am:
# (not used because it doesn't work... above patch does the intended fix)
diff --git a/source/a/shadow/shadow.glibc217-crypt.diff b/source/a/shadow/shadow.glibc217-crypt.diff
new file mode 100644
index 00000000..e26ca10b
--- /dev/null
+++ b/source/a/shadow/shadow.glibc217-crypt.diff
@@ -0,0 +1,258 @@
+From a616a72160c17fa193ad6ad95eb2c869633f4fe9 Mon Sep 17 00:00:00 2001
+From: mancha <mancha1@hush.com>
+Date: Fri, 4 Oct 2013 11:25:43
+Subject: [PATCH] Improve handling of NULL returns from crypt().
+
+Signed-off-by: mancha <mancha1@hush.com>
+---
+ ChangeLog | 15 +++++++++++++++
+ lib/encrypt.c | 7 +++----
+ lib/pwauth.c | 7 ++++++-
+ libmisc/valid.c | 1 +
+ src/chgpasswd.c | 4 ++++
+ src/chpasswd.c | 4 ++++
+ src/gpasswd.c | 4 ++++
+ src/newgrp.c | 3 ++-
+ src/newusers.c | 26 +++++++++++++++++++++-----
+ src/passwd.c | 15 +++++++++++++++
+ 10 files changed, 75 insertions(+), 11 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index aab00ae..1416a38 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,18 @@
++2013-05-06 mancha <mancha1@hush.com>
++
++ * lib/encrypt.c: crypt() in glibc/eglibc 2.17 now fails if passed
++ a salt that violates specs. On Linux, crypt() also fails with
++ DES/MD5 salts in FIPS140 mode. Rather than exit() on NULL returns
++ we send them back to the caller for appropriate handling.
++ * lib/pwauth.c: Handle NULL return from crypt().
++ * libmisc/valid.c: Likewise.
++ * src/chgpasswd.c: Likewise.
++ * src/chpasswd.c: Likewise.
++ * src/gpasswd.c: Likewise.
++ * src/newgrp.c: Likewise.
++ * src/newusers.c: Likewise.
++ * src/passwd.c: Likewise.
++
+ 2012-05-25 Nicolas François <nicolas.francois@centraliens.net>
+
+ * NEWS: Set release date.
+diff --git a/lib/encrypt.c b/lib/encrypt.c
+index 7daa8da..49cb691 100644
+--- a/lib/encrypt.c
++++ b/lib/encrypt.c
+@@ -49,11 +49,10 @@
+ if (!cp) {
+ /*
+ * Single Unix Spec: crypt() may return a null pointer,
+- * and set errno to indicate an error. The caller doesn't
+- * expect us to return NULL, so...
++ * and set errno to indicate an error. In this case return
++ * the NULL so the caller can handle appropriately.
+ */
+- perror ("crypt");
+- exit (EXIT_FAILURE);
++ return cp;
+ }
+
+ /* The GNU crypt does not return NULL if the algorithm is not
+diff --git a/lib/pwauth.c b/lib/pwauth.c
+index 4b26daa..086a72e 100644
+--- a/lib/pwauth.c
++++ b/lib/pwauth.c
+@@ -73,6 +73,7 @@ int pw_auth (const char *cipher,
+ char prompt[1024];
+ char *clear = NULL;
+ const char *cp;
++ const char *encrypted;
+ int retval;
+
+ #ifdef SKEY
+@@ -177,7 +178,11 @@ int pw_auth (const char *cipher,
+ * the results there as well.
+ */
+
+- retval = strcmp (pw_encrypt (input, cipher), cipher);
++ encrypted = pw_encrypt (input, cipher);
++ if (encrypted!=NULL)
++ retval = strcmp (encrypted, cipher);
++ else
++ retval = -1;
+
+ #ifdef SKEY
+ /*
+diff --git a/libmisc/valid.c b/libmisc/valid.c
+index aa0390a..4b85d67 100644
+--- a/libmisc/valid.c
++++ b/libmisc/valid.c
+@@ -95,6 +95,7 @@ bool valid (const char *password, const struct passwd *ent)
+ */
+
+ if ( (NULL != ent->pw_name)
++ && (NULL != encrypted)
+ && (strcmp (encrypted, ent->pw_passwd) == 0)) {
+ return true;
+ } else {
+diff --git a/src/chgpasswd.c b/src/chgpasswd.c
+index 0f41d0b..6c42a09 100644
+--- a/src/chgpasswd.c
++++ b/src/chgpasswd.c
+@@ -469,6 +469,10 @@ int main (int argc, char **argv)
+ #endif
+ cp = pw_encrypt (newpwd,
+ crypt_make_salt (crypt_method, arg));
++ if (cp == NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
+ }
+
+ /*
+diff --git a/src/chpasswd.c b/src/chpasswd.c
+index 928e2d7..4968b0d 100644
+--- a/src/chpasswd.c
++++ b/src/chpasswd.c
+@@ -492,6 +492,10 @@ int main (int argc, char **argv)
+ #endif
+ cp = pw_encrypt (newpwd,
+ crypt_make_salt(crypt_method, arg));
++ if (cp == NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
+ }
+
+ /*
+diff --git a/src/gpasswd.c b/src/gpasswd.c
+index df8d714..0043610 100644
+--- a/src/gpasswd.c
++++ b/src/gpasswd.c
+@@ -939,6 +939,10 @@ static void change_passwd (struct group *gr)
+ }
+
+ cp = pw_encrypt (pass, crypt_make_salt (NULL, NULL));
++ if (cp==NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
+ memzero (pass, sizeof pass);
+ #ifdef SHADOWGRP
+ if (is_shadowgrp) {
+diff --git a/src/newgrp.c b/src/newgrp.c
+index 9330c72..6b87761 100644
+--- a/src/newgrp.c
++++ b/src/newgrp.c
+@@ -184,7 +184,8 @@ static void check_perms (const struct group *grp,
+ cpasswd = pw_encrypt (cp, grp->gr_passwd);
+ strzero (cp);
+
+- if (grp->gr_passwd[0] == '\0' ||
++ if (cpasswd == NULL ||
++ grp->gr_passwd[0] == '\0' ||
+ strcmp (cpasswd, grp->gr_passwd) != 0) {
+ #ifdef WITH_AUDIT
+ snprintf (audit_buf, sizeof(audit_buf),
+diff --git a/src/newusers.c b/src/newusers.c
+index 994898e..5f83a6a 100644
+--- a/src/newusers.c
++++ b/src/newusers.c
+@@ -387,6 +387,7 @@ static int add_user (const char *name, uid_t uid, gid_t gid)
+ static void update_passwd (struct passwd *pwd, const char *password)
+ {
+ void *crypt_arg = NULL;
++ char *cp;
+ if (crypt_method != NULL) {
+ #ifdef USE_SHA_CRYPT
+ if (sflg) {
+@@ -398,9 +399,13 @@ static void update_passwd (struct passwd *pwd, const char *password)
+ if ((crypt_method != NULL) && (0 == strcmp(crypt_method, "NONE"))) {
+ pwd->pw_passwd = (char *)password;
+ } else {
+- pwd->pw_passwd = pw_encrypt (password,
+- crypt_make_salt (crypt_method,
+- crypt_arg));
++ cp=pw_encrypt (password, crypt_make_salt (crypt_method,
++ crypt_arg));
++ if (cp == NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
++ pwd->pw_passwd = cp;
+ }
+ }
+ #endif /* !USE_PAM */
+@@ -412,6 +417,7 @@ static int add_passwd (struct passwd *pwd, const char *password)
+ {
+ const struct spwd *sp;
+ struct spwd spent;
++ char *cp;
+
+ #ifndef USE_PAM
+ void *crypt_arg = NULL;
+@@ -448,7 +454,12 @@ static int add_passwd (struct passwd *pwd, const char *password)
+ } else {
+ const char *salt = crypt_make_salt (crypt_method,
+ crypt_arg);
+- spent.sp_pwdp = pw_encrypt (password, salt);
++ cp = pw_encrypt (password, salt);
++ if (cp == NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
++ spent.sp_pwdp = cp;
+ }
+ spent.sp_lstchg = (long) time ((time_t *) 0) / SCALE;
+ if (0 == spent.sp_lstchg) {
+@@ -492,7 +503,12 @@ static int add_passwd (struct passwd *pwd, const char *password)
+ spent.sp_pwdp = (char *)password;
+ } else {
+ const char *salt = crypt_make_salt (crypt_method, crypt_arg);
+- spent.sp_pwdp = pw_encrypt (password, salt);
++ cp = pw_encrypt (password, salt);
++ if (cp == NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
++ spent.sp_pwdp = cp;
+ }
+ #else
+ /*
+diff --git a/src/passwd.c b/src/passwd.c
+index ac90aa3..ae26666 100644
+--- a/src/passwd.c
++++ b/src/passwd.c
+@@ -242,6 +242,17 @@ static int new_password (const struct pa
+ }
+
+ cipher = pw_encrypt (clear, crypt_passwd);
++ if (cipher == NULL) {
++ strzero (clear);
++ (void) fprintf (stderr,
++ _("Failed to crypt password for %s.\n"),
++ pw->pw_name);
++ SYSLOG ((LOG_INFO,
++ "failed to crypt password for %s",
++ pw->pw_name));
++ return -1;
++ }
++
+ if (strcmp (cipher, crypt_passwd) != 0) {
+ strzero (clear);
+ strzero (cipher);
+@@ -349,6 +360,10 @@ static int new_password (const struct pa
+ * Encrypt the password, then wipe the cleartext password.
+ */
+ cp = pw_encrypt (pass, crypt_make_salt (NULL, NULL));
++ if (cp == NULL) {
++ perror ("crypt");
++ exit (EXIT_FAILURE);
++ }
+ memzero (pass, sizeof pass);
+
+ #ifdef HAVE_LIBCRACK_HIST
+--
+1.7.11.4
+
diff --git a/source/a/shadow/shadow.man.nodups.diff b/source/a/shadow/shadow.man.nodups.diff
deleted file mode 100644
index 425321b9..00000000
--- a/source/a/shadow/shadow.man.nodups.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./man/ru/Makefile.in.orig 2011-02-15 16:18:21.000000000 -0600
-+++ ./man/ru/Makefile.in 2012-06-26 23:21:34.866292111 -0500
-@@ -228,7 +228,7 @@
- grpunconv.8 gshadow.5 lastlog.8 login.1 login.defs.5 logoutd.8 \
- newgrp.1 newusers.8 nologin.8 passwd.1 passwd.5 pwck.8 \
- pwconv.8 pwunconv.8 sg.1 shadow.3 shadow.5 su.1 suauth.5 \
-- useradd.8 userdel.8 usermod.8 vigr.8 vipw.8 $(am__append_1)
-+ useradd.8 userdel.8 usermod.8 vigr.8 vipw.8
- man_nopam = \
- limits.5 \
- login.access.5 \
diff --git a/source/a/sharutils/sharutils.SlackBuild b/source/a/sharutils/sharutils.SlackBuild
index 5c1997ca..cc4b5b13 100755
--- a/source/a/sharutils/sharutils.SlackBuild
+++ b/source/a/sharutils/sharutils.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2011, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
PKGNAM=sharutils
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
@@ -55,7 +55,7 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf sharutils-$VERSION
-tar xvf $CWD/sharutils-$VERSION.tar.?z* || exit 1
+tar xvf $CWD/sharutils-$VERSION.tar.?z || exit 1
cd sharutils-$VERSION || exit 1
chown -R root:root .
find . \
diff --git a/source/a/slocate/slocate.SlackBuild b/source/a/slocate/slocate.SlackBuild
index def08b8c..83375a4d 100755
--- a/source/a/slocate/slocate.SlackBuild
+++ b/source/a/slocate/slocate.SlackBuild
@@ -65,7 +65,7 @@ chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 2750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
cd src
diff --git a/source/a/sysklogd/sysklogd.SlackBuild b/source/a/sysklogd/sysklogd.SlackBuild
index a5cd75e2..8ff3de9d 100755
--- a/source/a/sysklogd/sysklogd.SlackBuild
+++ b/source/a/sysklogd/sysklogd.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
VERSION=1.5
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -79,8 +79,9 @@ cat $CWD/config/rc.syslog.new > $PKG/etc/rc.d/rc.syslog.new
chmod 0755 $PKG/etc/rc.d/rc.syslog.new
mkdir -p $PKG/var/log
-for i in cron debug maillog messages secure spooler syslog ;
- do touch $PKG/var/log/$i.new ;
+for i in cron debug maillog messages secure spooler syslog ; do
+ touch $PKG/var/log/$i.new
+ chmod 640 $PKG/var/log/$i.new
done
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
diff --git a/source/a/syslinux/syslinux-4.05.tar.sign b/source/a/syslinux/syslinux-4.05.tar.sign
deleted file mode 100644
index 892883ae..00000000
--- a/source/a/syslinux/syslinux-4.05.tar.sign
+++ /dev/null
@@ -1,17 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.11 (GNU/Linux)
-
-iQIcBAABAgAGBQJO4mUDAAoJEIiuZH1Y96v+Dg8P/1Pn+22CIUHfgPtDse6U1+Wj
-A7/c5AdtezK/UQlhCh/Po7mRdCGzm/Tb6pCnHOWvpEFMeRQARGx5ElqDUmH1Y6SW
-NGrPxwj40eTdVrA6TE9/Jj1QkKnFZGTTzsSm5njt06cJM1s0kABlyS0MEx++YGyX
-hEnO5C6oyfh30KkTsUFLljFev1wz5FdQVHtL4e0//dh5KXgulPCIDEufIdvdIM1o
-4RB2vTwpcxm1Fuqd9Th73pD1u4V9mjCwKEazKpmmCkwebn6KAzyUlcKxXMUG+Q4C
-mbqRDlNCL8ia9LajJKj00wz0428M3eIT9kVxROYWdZnQGC0gDbcD8/6AAvt06bL+
-ZrlUGl02JASMk2lO9QVp74zTdlnTKQef3V9/SIPk2zLcYuVsKni87ZnEEhDke6vn
-DF4S2OySfZjBw7ohou7fkbiw/1uJTYLbh9gXXgEi+GKRkLEmEzrjalRc5I9X+D18
-kEg2rMZS4bpTKTk9IZEsCncyaO8tGrevLiMijoRnqDqzOPGjnYLBDrm+rNNn4cQ9
-biiF19uapF97goGzC315PKHKeMohFWhk3YGIUIwFzzShC0bKAYaZmMWC5Dcj1Udw
-XOo0/CL0uRuneS5z4TfN4mh0nVZTTgUeY3n2SbIEpTPGJdT+GGGGg06uq9PpY5WS
-Jx4uX40HrNIAw2qaR+fY
-=gTaU
------END PGP SIGNATURE-----
diff --git a/source/a/syslinux/syslinux-4.06.tar.sign b/source/a/syslinux/syslinux-4.06.tar.sign
new file mode 100644
index 00000000..64496074
--- /dev/null
+++ b/source/a/syslinux/syslinux-4.06.tar.sign
@@ -0,0 +1,17 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.12 (GNU/Linux)
+
+iQIcBAABAgAGBQJQhnLhAAoJEC84WcCNIz1VmjsP/2hpcAmfvtC3fLqlHXs4z6sa
+2Bk5sQryOEdxAiXPzzrt+vgoXHJC/Vc7nOD6Zroj1CZrCkaW69HzeKpCtUlOWv2s
+bcj0ZUQQabBnTi3Pe2yDZeMdBfqOr1XE/0SLFqJfBfsmF9xfDVTrHJNKz9M/pPHY
+/NKny4jhOV5y6wnBCn+8jE/LZAfORh1C4faVZ1m/kDUJcnLAqvop0hCde4PIIUZc
+i9y8i1ZNXjghxtETxfBO7aqUt2rjndFd3kD9e0aGEfIZ/wMeQFlj5wsOjPEZFyBe
+rnAA7UVZcaNFc/J15FPlyFKIn8Lel8tvC4FjoX0zWA1/kSKY5AkjHnqzIZudWAHv
+ayq9wAAWzJUeBLsCSqruA2OYUdwFkL3kPURGB2rYM0O9LkijIJkqLoxRsnmA+lqd
+G78QTrcszsvkxXSn3xVxejtMv6DdckRVeO0ahx7f3PROavdg3QXCy9uG28HVVyop
+ABdSGMhgjdPXKhKpMHGzOx0XmUtvba+/4krqVTUeor2GnMe2gkXNh0lOjGoCJTTg
+rd56fF0lBauk9wBwBoSx2z8wNzBxVpXeXsMicaB7M2AxhNYSVnDwzoEytsxCX4Ib
+QNOJzxvPEqw8DIoKeR2EP8Tw1H/0DhsdMJyQXCgTPMnJjSVqY1OGrSj/p5Z7SWSF
+iPKkqqj+N2GgNbbli07o
+=5g4G
+-----END PGP SIGNATURE-----
diff --git a/source/a/syslinux/syslinux.SlackBuild b/source/a/syslinux/syslinux.SlackBuild
index e7ec5fbb..e879b991 100755
--- a/source/a/syslinux/syslinux.SlackBuild
+++ b/source/a/syslinux/syslinux.SlackBuild
@@ -22,8 +22,8 @@
PKGNAM=syslinux
-VERSION=${VERSION:-4.05}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-4.06}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -46,8 +46,6 @@ rm -rf ${PKGNAM}-${VERSION}
tar xvf $CWD/${PKGNAM}-$VERSION.tar.xz || exit 1
cd ${PKGNAM}-$VERSION
-zcat $CWD/syslinux.altmbr.diff.gz | patch -p1 --verbose || exit 1
-
# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
diff --git a/source/a/syslinux/syslinux.altmbr.diff b/source/a/syslinux/syslinux.altmbr.diff
deleted file mode 100644
index ee2dfbee..00000000
--- a/source/a/syslinux/syslinux.altmbr.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./mbr/altmbr.S.orig 2011-12-09 12:28:17.000000000 -0600
-+++ ./mbr/altmbr.S 2012-08-17 17:10:33.903688084 -0500
-@@ -204,7 +204,7 @@
- 5:
- decb (partition)
- jz boot
-- addw $16, %bx
-+ addw $16, %si
- loopw 5b
-
- popw %cx /* %cx <- 4 */
diff --git a/source/a/sysvinit-scripts/scripts/rc.6 b/source/a/sysvinit-scripts/scripts/rc.6
index 465a0a4a..8288128c 100644
--- a/source/a/sysvinit-scripts/scripts/rc.6
+++ b/source/a/sysvinit-scripts/scripts/rc.6
@@ -189,9 +189,9 @@ fi
# Carry a random seed between reboots.
echo "Saving random seed from /dev/urandom in /etc/random-seed."
-# Use the pool size from /proc, or 512 bytes:
+# Use the pool size from /proc, or 4096 bits:
if [ -r /proc/sys/kernel/random/poolsize ]; then
- /bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=$(cat /proc/sys/kernel/random/poolsize) 2> /dev/null
+ /bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=$(expr $(cat /proc/sys/kernel/random/poolsize) / 8) 2> /dev/null
else
/bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
fi
diff --git a/source/a/sysvinit-scripts/scripts/rc.M b/source/a/sysvinit-scripts/scripts/rc.M
index 63cb8801..d9b3fed3 100644
--- a/source/a/sysvinit-scripts/scripts/rc.M
+++ b/source/a/sysvinit-scripts/scripts/rc.M
@@ -86,7 +86,7 @@ fi
# Run rc.udev again. This will start udev if it is not already running
# (for example, upon return from runlevel 1), otherwise it will trigger it
# to look for device changes and to generate persistent rules if needed.
-if grep -wq sysfs /proc/mounts && grep -q tmpfs /proc/filesystems ; then
+if grep -wq sysfs /proc/mounts && grep -q devtmpfs /proc/filesystems ; then
if ! grep -wq nohotplug /proc/cmdline ; then
if [ -x /etc/rc.d/rc.udev ]; then
/bin/sh /etc/rc.d/rc.udev start
@@ -124,6 +124,7 @@ fi
# Remove stale locks and junk files (must be done after mount -a!)
/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 2> /dev/null
+/bin/rm -rf /var/spool/cron/cron.?????? 2> /dev/null
# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
@@ -206,6 +207,9 @@ fi
if [ -x /usr/bin/update-pango-querymodules ]; then
/usr/bin/update-pango-querymodules --verbose
fi
+if [ -x /usr/bin/glib-compile-schemas ]; then
+ /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1
+fi
# Start dnsmasq, a simple DHCP/DNS server:
if [ -x /etc/rc.d/rc.dnsmasq ]; then
@@ -239,16 +243,6 @@ fi
# /usr/sbin/smartd
#fi
-# If we're using udev, make /dev/cdrom and any other optical drive symlinks
-# if some udev rule hasn't made them already:
-if grep -wq sysfs /proc/mounts && grep -q tmpfs /proc/filesystems; then
- if ! grep -wq nohotplug /proc/cmdline ; then
- if [ -x /lib/udev/rc.optical-symlinks -a -x /etc/rc.d/rc.udev ]; then
- /bin/sh /lib/udev/rc.optical-symlinks
- fi
- fi
-fi
-
# Monitor the UPS with genpowerd.
# To use this, uncomment this section and edit your settings in
# /etc/genpowerd.conf (serial device, UPS type, etc). For more information,
diff --git a/source/a/sysvinit-scripts/scripts/rc.S b/source/a/sysvinit-scripts/scripts/rc.S
index 97ff7be4..7b152e90 100644
--- a/source/a/sysvinit-scripts/scripts/rc.S
+++ b/source/a/sysvinit-scripts/scripts/rc.S
@@ -40,7 +40,7 @@ fi
# all of them), and make any additional device nodes that you need in the
# /dev directory. Even USB and IEEE1394 devices will need to have the
# modules loaded by hand if udev is not used. So use it. :-)
-if grep -wq sysfs /proc/mounts && grep -q tmpfs /proc/filesystems ; then
+if grep -wq sysfs /proc/mounts && grep -q devtmpfs /proc/filesystems ; then
if ! grep -wq nohotplug /proc/cmdline ; then
if [ -x /etc/rc.d/rc.udev ]; then
/bin/sh /etc/rc.d/rc.udev start
@@ -51,7 +51,22 @@ fi
# Mount Control Groups filesystem interface:
if grep -wq cgroup /proc/filesystems ; then
if [ -d /sys/fs/cgroup ]; then
- mount -t cgroup cgroup /sys/fs/cgroup
+ # See linux-*/Documentation/cgroups/cgroups.txt (section 1.6)
+ # Check if we have some tools to autodetect the available cgroup controllers
+ if [ -x /usr/bin/lssubsys -a -x /usr/bin/tr -a -x /usr/bin/sed ]; then
+ # Mount a tmpfs as the cgroup filesystem root
+ mount -t tmpfs -o mode=0755 cgroup_root /sys/fs/cgroup
+ # Autodetect available controllers and mount them in subfolders
+ controllers="$(lssubsys -a 2>/dev/null | tr '\n' ' ' | sed s/.$//)"
+ for i in $controllers; do
+ mkdir /sys/fs/cgroup/$i
+ mount -t cgroup -o $i $i /sys/fs/cgroup/$i
+ done
+ unset i controllers
+ else
+ # We can't use autodetection so fall back mounting them all together
+ mount -t cgroup cgroup /sys/fs/cgroup
+ fi
else
mkdir -p /dev/cgroup
mount -t cgroup cgroup /dev/cgroup
@@ -63,6 +78,8 @@ fi
# /etc/lvm/backup/ (LVM2). This is created by /sbin/vgscan, so to
# use LVM you must run /sbin/vgscan yourself the first time (and
# create some VGs and LVs).
+# Create LVM lock/run directories:
+mkdir -p -m 0700 /run/lvm /run/lock /run/lock/lvm
if [ -r /etc/lvmtab -o -d /etc/lvm/backup ]; then
echo "Initializing LVM (Logical Volume Manager):"
# Check for device-mapper support.
@@ -385,9 +402,9 @@ if [ -f /etc/random-seed ]; then
echo "Using /etc/random-seed to initialize /dev/urandom."
cat /etc/random-seed > /dev/urandom
fi
-# Use the pool size from /proc, or 512 bytes:
+# Use the pool size from /proc, or 4096 bits:
if [ -r /proc/sys/kernel/random/poolsize ]; then
- dd if=/dev/urandom of=/etc/random-seed count=1 bs=$(cat /proc/sys/kernel/random/poolsize) 2> /dev/null
+ dd if=/dev/urandom of=/etc/random-seed count=1 bs=$(expr $(cat /proc/sys/kernel/random/poolsize) / 8) 2> /dev/null
else
dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
fi
diff --git a/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild b/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild
index cbc12030..d59bbf4a 100755
--- a/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild
+++ b/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
VERSION=${VERSION:-2.0}
ARCH=noarch
-BUILD=${BUILD:-13}
+BUILD=${BUILD:-17}
CWD=$(pwd)
TMP=${TMP:-/tmp}
diff --git a/source/a/sysvinit/sysvinit.SlackBuild b/source/a/sysvinit/sysvinit.SlackBuild
index 2a9459c2..bb1f8ee6 100755
--- a/source/a/sysvinit/sysvinit.SlackBuild
+++ b/source/a/sysvinit/sysvinit.SlackBuild
@@ -22,7 +22,7 @@
VERSION=${VERSION:-2.88dsf}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -70,7 +70,7 @@ for program in bootlogd halt init killall5 shutdown runlevel ; do
chown root:root $PKG/sbin/$program
done
mkdir -p $PKG/usr/bin
-for program in last mountpoint ; do
+for program in last ; do
strip --strip-unneeded $program
cat $program > $PKG/usr/bin/$program
chmod 755 $PKG/usr/bin/$program
@@ -91,7 +91,7 @@ cp initscript.sample $PKG/sbin/initscript.sample
cd ../man
mkdir -p $PKG/usr/man/man{1,5,8}
-for page in last.1 mountpoint.1 ; do
+for page in last.1 ; do
cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz
done
for page in inittab.5 initscript.5 ; do
diff --git a/source/a/tcsh/tcsh-6.18.01-crypt.diff b/source/a/tcsh/tcsh-6.18.01-crypt.diff
new file mode 100644
index 00000000..db7306e2
--- /dev/null
+++ b/source/a/tcsh/tcsh-6.18.01-crypt.diff
@@ -0,0 +1,11 @@
+--- tc.func.c.orig 2013-05-16
++++ tc.func.c 2013-05-16
+@@ -733,7 +733,7 @@ auto_lock(void)
+ pp = xgetpass("Password:");
+
+ crpp = XCRYPT(pw, pp, srpp);
+- if ((strcmp(crpp, srpp) == 0)
++ if ((crpp && (strcmp(crpp, srpp) == 0))
+ #ifdef AFS
+ || (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
+ afsname, /* name */
diff --git a/source/a/tcsh/tcsh.SlackBuild b/source/a/tcsh/tcsh.SlackBuild
index c8134a80..44e398c0 100755
--- a/source/a/tcsh/tcsh.SlackBuild
+++ b/source/a/tcsh/tcsh.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
VERSION=6.18.01
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -53,6 +53,8 @@ rm -rf tcsh-$VERSION
tar xvf $CWD/tcsh-$VERSION.tar.?z* || exit 1
cd tcsh-$VERSION
+zcat $CWD/tcsh-6.18.01-crypt.diff.gz | patch -p0 --verbose || exit 1
+
# The LS_COLORS variable shared by tcsh has new options in recent
# versions of coreutils that cause tcsh to exit, so disable the
# built-in color ls:
diff --git a/source/a/udev/60-cdrom_id.rules.diff b/source/a/udev/60-cdrom_id.rules.diff
new file mode 100644
index 00000000..6ac5e227
--- /dev/null
+++ b/source/a/udev/60-cdrom_id.rules.diff
@@ -0,0 +1,28 @@
+--- ./src/cdrom_id/60-cdrom_id.rules.orig 2012-01-30 12:02:56.526251552 -0600
++++ ./src/cdrom_id/60-cdrom_id.rules 2013-01-17 21:11:20.821006629 -0600
+@@ -15,6 +15,24 @@
+ # enable the receiving of media eject button events
+ IMPORT{program}="cdrom_id --lock-media $devnode"
+
+-KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
++# create default links to the first detected device
++KERNEL=="sr0", ENV{ID_CDROM}=="1", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdr", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdwriter", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_CD_RW}=="1", SYMLINK+="cdrw", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdr", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdwriter", OPTIONS+="link_priority=-100"
++KERNEL=="sr0", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw", OPTIONS+="link_priority=-100"
++
++# create all other device links
++KERNEL=="sr[0-9]*", ENV{ID_CDROM}=="1", SYMLINK+="cdrom%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdr%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_R}=="1", SYMLINK+="cdwriter%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_RW}=="1", SYMLINK+="cdrw%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdr%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_R}=="1", SYMLINK+="dvdwriter%n", OPTIONS+="link_priority=-100"
++KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw%n", OPTIONS+="link_priority=-100"
+
+ LABEL="cdrom_end"
diff --git a/source/a/udev/config/rc.d/rc.udev.new b/source/a/udev/config/rc.d/rc.udev.new
index 2bbd9819..f000e938 100644
--- a/source/a/udev/config/rc.d/rc.udev.new
+++ b/source/a/udev/config/rc.d/rc.udev.new
@@ -112,7 +112,7 @@ case "$1" in
/sbin/udevadm trigger --type=devices --action=add
else # trigger changes for already running udevd
# If the persistent rules files do not exist, trigger an add event:
- if [ ! -r /etc/udev/rules.d/70-persistent-net.rules ]; then
+ if [ ! -r /etc/udev/rules.d/70-persistent-net.rules -o ! -r /etc/udev/rules.d/70-persistent-cd.rules ]; then
# Test that we can actually write to the directory first:
if touch /etc/udev/rules.d/testfile 2> /dev/null ; then
rm -f /etc/udev/rules.d/testfile
@@ -120,6 +120,13 @@ case "$1" in
echo "Triggering udev to write persistent rules to /etc/udev/rules.d/"
/sbin/udevadm trigger --type=devices --action=add
sleep 3
+ # Create the files if they don't exist at this point.
+ # If a machine does not have a network device or an optical
+ # device, we don't want to waste time trying to generate
+ # rules at every boot.
+ # To force another attempt, delete the file(s).
+ touch /etc/udev/rules.d/70-persistent-net.rules
+ touch /etc/udev/rules.d/70-persistent-cd.rules
fi
fi
# Since udevd is running, most of the time we only need change events:
diff --git a/source/a/udev/rule_generator.diff b/source/a/udev/rule_generator.diff
index 25c72b84..ff2acf80 100644
--- a/source/a/udev/rule_generator.diff
+++ b/source/a/udev/rule_generator.diff
@@ -1,17 +1,62 @@
-diff -Nur udev-182.orig/src/rule_generator/write_cd_rules udev-182/src/rule_generator/write_cd_rules
---- udev-182.orig/src/rule_generator/write_cd_rules 2012-03-24 22:47:53.138527732 -0500
-+++ udev-182/src/rule_generator/write_cd_rules 2012-03-24 22:59:42.595889830 -0500
+--- ./src/rule_generator/write_cd_rules.orig 2012-01-28 18:15:46.958827013 -0600
++++ ./src/rule_generator/write_cd_rules 2013-01-17 22:58:27.294859303 -0600
@@ -3,7 +3,8 @@
# This script is run if an optical drive lacks a rule for persistent naming.
#
# It adds symlinks for optical drives based on the device class determined
-# by cdrom_id and used ID_PATH to identify the device.
-+# by cdrom_id and uses ID_PATH or ID_SERIAL or ID_MODEL and ID_REVISION to
++# by cdrom_id and uses ID_SERIAL or ID_MODEL and ID_REVISION to
+# identify the device.
# (C) 2006 Marco d'Itri <md@Linux.IT>
#
-@@ -105,18 +106,57 @@
+@@ -66,37 +67,16 @@
+ exit 1
+ fi
+
+-if [ "$1" ]; then
+- METHOD="$1"
++# ID_PATH is gone from the ata subsystem used in recent kernels, so
++# always use the by-id method:
++if [ "$ID_SERIAL" ]; then
++ RULE="ENV{ID_SERIAL}==\"$ID_SERIAL\""
++elif [ "$ID_MODEL" -a "$ID_REVISION" ]; then
++ RULE="ENV{ID_MODEL}==\"$ID_MODEL\", ENV{ID_REVISION}==\"$ID_REVISION\""
+ else
+- METHOD='by-path'
+-fi
+-
+-case "$METHOD" in
+- by-path)
+- if [ -z "$ID_PATH" ]; then
+- echo "$DEVPATH not supported by path_id. by-id may work." >&2
+- exit 1
+- fi
+- RULE="ENV{ID_PATH}==\"$ID_PATH\""
+- ;;
+-
+- by-id)
+- if [ "$ID_SERIAL" ]; then
+- RULE="ENV{ID_SERIAL}==\"$ID_SERIAL\""
+- elif [ "$ID_MODEL" -a "$ID_REVISION" ]; then
+- RULE="ENV{ID_MODEL}==\"$ID_MODEL\", ENV{ID_REVISION}==\"$ID_REVISION\""
+- else
+- echo "$DEVPATH not supported by ata_id. by-path may work." >&2
+- exit 1
+- fi
+- ;;
+-
+- *)
+- echo "Invalid argument (must be either by-path or by-id)." >&2
++ echo "$DEVPATH not supported by ata_id. Unable to generate persistent rules." >&2
+ exit 1
+- ;;
+-esac
++fi
+
+ # Prevent concurrent processes from modifying the file at the same time.
+ lock_rules_file
+@@ -105,18 +85,62 @@
choose_rules_file
link_num=$(find_next_available 'cdrom[0-9]*')
@@ -19,8 +64,9 @@ diff -Nur udev-182.orig/src/rule_generator/write_cd_rules udev-182/src/rule_gene
match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE"
- comment="$ID_MODEL ($ID_PATH)"
+-comment="$ID_MODEL ($ID_PATH)"
-
++comment="$ID_MODEL ($ID_SERIAL)"
write_rule "$match" "cdrom$link_num" "$comment"
-[ "$ID_CDROM_CD_R" -o "$ID_CDROM_CD_RW" ] && \
- write_rule "$match" "cdrw$link_num"
@@ -28,47 +74,52 @@ diff -Nur udev-182.orig/src/rule_generator/write_cd_rules udev-182/src/rule_gene
- write_rule "$match" "dvd$link_num"
-[ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ] && \
- write_rule "$match" "dvdrw$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' cdrom)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "cdrom"
+ fi
+
+ if [ "$ID_CDROM_CD_R" ]; then
-+ write_rule "$match" "cdr$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' cdr)" = "" ]; then
++ write_rule "$match" "cdr$link_num"
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "cdr"
+ fi
+
+ write_rule "$match" "cdwriter$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' cdwriter)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "cdwriter"
+ fi
+
+ if [ "$ID_CDROM_CD_RW" ]; then
+ write_rule "$match" "cdrw$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' cdrw)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "cdrw"
+ fi
+ fi
+
-+ if [ "$(find_all_rules 'SYMLINK+=' writer)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "writer"
+ fi
+ fi
+
+ if [ "$ID_CDROM_DVD" ]; then
+ write_rule "$match" "dvd$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' dvd)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "dvd"
+ fi
+
+ if [ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ]; then
++ write_rule "$match" "dvdr$link_num"
++ if [ "$link_num" = "0" ]; then
++ write_rule "$match" "dvdr"
++ fi
++
+ write_rule "$match" "dvdrw$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' dvdrw)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "dvdrw"
+ fi
+
+ write_rule "$match" "dvdwriter$link_num"
-+ if [ "$(find_all_rules 'SYMLINK+=' dvdwriter)" = "" ]; then
++ if [ "$link_num" = "0" ]; then
+ write_rule "$match" "dvdwriter"
+ fi
+ fi
diff --git a/source/a/udev/udev.SlackBuild b/source/a/udev/udev.SlackBuild
index 183c6667..d39da262 100755
--- a/source/a/udev/udev.SlackBuild
+++ b/source/a/udev/udev.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2006, 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
VERSION=${VERSION:-$(echo udev-*.tar.* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
-BUILD=${BUILD:-5}
+BUILD=${BUILD:-7}
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -67,10 +67,17 @@ zcat $CWD/fix-42-usb-hid-pm.rules.diff.gz | patch -p1 --verbose || exit 1
# Fixup the rule generator for our use
zcat $CWD/rule_generator.diff.gz | patch -p1 --verbose || exit 1
+# Patch 60-cdrom_id.rules to create a full set of symlinks.
+# This is needed for a hotplugged optical device since the generated
+# rules will not be used until the second time the device is plugged.
+zcat $CWD/60-cdrom_id.rules.diff.gz | patch -p1 --verbose || exit 1
+
# static libudev is needed for lvm2
# --enable-udev_acl was removed (will be part of future CK release)
# --enable-floppy support was also disabled by default in 173
# --enable-rule_generator was disabled by default in 175
+
+LDFLAGS="$LDFLAGS -lrt" \
./configure \
--prefix=/usr \
--with-rootprefix=/ \
diff --git a/source/a/udisks/udisks.SlackBuild b/source/a/udisks/udisks.SlackBuild
index 9d12e783..86a90bdf 100755
--- a/source/a/udisks/udisks.SlackBuild
+++ b/source/a/udisks/udisks.SlackBuild
@@ -27,7 +27,7 @@
PKGNAM=udisks
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:--j7}
diff --git a/source/a/usb_modeswitch/device_reference.txt b/source/a/usb_modeswitch/device_reference.txt
index db7ac8c0..1a21efb3 100644
--- a/source/a/usb_modeswitch/device_reference.txt
+++ b/source/a/usb_modeswitch/device_reference.txt
@@ -1,7 +1,7 @@
#
# Device and Configuration Reference (UTF-8 encoding used)
#
-# Last modified: 2012-01-20
+# Last modified: 2013-10-16
#
# Collection of configurations for usb_modeswitch, a mode switching
# tool for controlling flip flop (multiple mode) USB devices
@@ -115,7 +115,10 @@
# * SequansMode <0/1> -N
# * MobileActionMode <0/1> -A
# * QisdaMode <0/1> -B
-# * CiscoMode <0/1> -B
+# * QuantaMode <0/1> -E
+# * PantechMode <0/1> -F
+# * BlackberryMode <0/1> -Z
+# * CiscoMode <0/1> -L
#
#
# Flags to support devices that need special control messages.
@@ -170,11 +173,17 @@
# Mostly useful for non-modem devices.
#
#
-# * WaitBefore <seconds> (no command line parameter)
+# * WaitBefore <seconds> (no command line parameter)
#
# Waiting time before taking any action. Helps with some sensitive setups.
#
#
+# * NoMBIMCheck <0|1> (no command line parameter)
+#
+# Disable the check for new MBIM standard devices, which is always done
+# by default.
+#
+#
#
# -> All other entries in config files are just ignored <-
@@ -228,7 +237,7 @@ MessageContent="55534243123456780000000000000601000000000000000000000000000000"
########################################################
# Option GlobeTrotter GT MAX 3.6 (aka "T-Mobile Web'n'walk Card Compact II")
#
-# Contributor: Bernd Holzmüller
+# Contributor: Bernd Holzmüller
DefaultVendor= 0x05c6
DefaultProduct= 0x1000
@@ -447,7 +456,7 @@ HuaweiMode=1
#
# Probably works with DetachStorageOnly too
#
-# Contributor: Flávio Moringa and others
+# Contributor: Flávio Moringa and others
DefaultVendor= 0x19d2
DefaultProduct= 0x2000
@@ -945,7 +954,7 @@ Configuration=2
#
# Recommended init command: ATE0V1&D2&C1S0=0
#
-# Contributor: Jérôme Oufella
+# Contributor: Jérôme Oufella
DefaultVendor= 0x1004
DefaultProduct= 0x1000
@@ -1504,7 +1513,7 @@ MessageContent="555342431234567824000000800006bc626563240000000000000000000000"
########################################################
# LG HDM-2100 (EVDO Rev.A USB modem)
#
-# Contributor: Jérôme Oufella
+# Contributor: Jérôme Oufella
DefaultVendor= 0x1004
DefaultProduct=0x607f
@@ -1809,7 +1818,7 @@ ResponseNeeded=1
########################################################
# Huawei U8110 / U8300 / Joy, Vodafone 845 (Android smartphone)
#
-# Contributor: David Erosa García
+# Contributor: David Erosa García
DefaultVendor= 0x12d1
DefaultProduct=0x1031
@@ -1826,7 +1835,7 @@ NoDriverLoading=1
########################################################
# Nokia CS-10
#
-# Contributor: Wacław Sierek
+# Contributor: Wacław Sierek
DefaultVendor= 0x0421
DefaultProduct=0x060c
@@ -1868,7 +1877,7 @@ MessageContent="55534243123456780000000000000606f50402527000000000000000000000"
#######################################################
# Samsung GT-B3730
#
-# Contributor: Per Øyvind Karlsen
+# Contributor: Per Øyvind Karlsen
DefaultVendor= 0x04e8
DefaultProduct=0x689a
@@ -1939,7 +1948,7 @@ NeedResponse=1
#######################################################
# Huawei EC168C (from Zantel)
#
-# Contributor: Ã…smund Hjulstad
+# Contributor: Ã…smund Hjulstad
DefaultVendor= 0x12d1
DefaultProduct=0x1446
@@ -2935,7 +2944,7 @@ NeedResponse=1
########################################################
# ZTE MF652
#
-# Contributor: Björn Andreas Höfer
+# Contributor: Björn Andreas Höfer
DefaultVendor= 0x19d2
DefaultProduct=0x1520
@@ -3260,7 +3269,7 @@ MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
########################################################
# ZTE MF821D
#
-# Contributor: Thomas Schäfer
+# Contributor: Thomas Schäfer
DefaultVendor= 0x19d2
DefaultProduct=0x0325
@@ -3306,7 +3315,7 @@ MessageContent="555342431234567800000000000010ff000000000000000000000000000000"
########################################################
# Vodafone K5006Z (MF821)
#
-# Contributor: Thomas Schäfer
+# Contributor: Thomas Schäfer
DefaultVendor= 0x19d2
DefaultProduct=0x1017
@@ -3419,3 +3428,573 @@ MessageContent="55534243123456780000000000000011062000000100000000000000000000"
#######################################################
+# ZTE MF190J
+#
+# Contributor: moma
+
+DefaultVendor= 0x19d2
+DefaultProduct=0x1542
+
+TargetVendor= 0x19d2
+TargetProduct= 0x1544
+
+MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
+MessageContent2="5553424312345679000000000000061b000000020000000000000000000000"
+
+NeedResponse=1
+
+
+#######################################################
+# Huawei E171
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x155b
+
+TargetVendor= 0x12d1
+TargetProduct= 0x1506
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+#######################################################
+# Vodafone / Huawei K3772
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1526
+
+TargetVendor= 0x12d1
+TargetProduct= 0x14cf
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+#######################################################
+# Vodafone / Huawei K3773
+#
+# Contributor: Allwyn Fernandes
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1f11
+
+TargetVendor= 0x12d1
+TargetProduct= 0x14bc
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+#######################################################
+# Huawei E173u-2, E177
+#
+# Contributor: Rob Spanton
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x14ba
+
+TargetVendor= 0x12d1
+TargetProduct= 0x14d2
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+#######################################################
+# Option Beemo / Pantech P4200 LTE
+#
+# Contributor: Thomas Schäfer
+
+DefaultVendor= 0x106c
+DefaultProduct=0x3b14
+
+TargetVendor= 0x106c
+TargetProduct= 0x3721
+
+MessageContent="555342431234567824000000800008ff024445564348470000000000000000"
+
+# QMI device
+NoDriverLoading=1
+
+
+#######################################################
+# Huawei E355s-1
+#
+# Contributor: Mihail Zenkov
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1f01
+
+TargetVendor= 0x12d1
+TargetProduct= 0x14db
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+#######################################################
+# Nokia CS-7M-01
+#
+# Contributor: Krzysztof Luczak
+
+DefaultVendor= 0x0421
+DefaultProduct=0x0632
+
+TargetVendor= 0x0421
+TargetProduct= 0x0632
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#########################################################
+# LG L-03D LTE/3G
+#
+# Contributor: Kentaro Kazuhama
+
+DefaultVendor= 0x1004
+DefaultProduct=0x6327
+
+TargetVendor= 0x1004
+TargetProduct= 0x6326
+
+MessageContent=555342431234567800000000000005f1010100000000000000000000000000
+
+########################################################
+# Franklin Wireless U600
+
+DefaultVendor= 0x1fac
+DefaultProduct=0x0150
+
+TargetVendor= 0x1fac
+TargetProduct= 0x0151
+
+MessageContent="555342431234567824000000800108df200000000000000000000000000000"
+
+
+#######################################################
+# Huawei E353
+#
+# Contributor: koisoke
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x151a
+
+TargetVendor= 0x12d1
+TargetProduct= 0x14ac
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+#######################################################
+# Changhong CH690
+
+DefaultVendor= 0x2077
+DefaultProduct=0x1000
+
+TargetVendor= 0x2077
+TargetProduct= 0x7001
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Alcatel-Lucent T930S
+#
+# Contributor: areslee
+
+DefaultVendor= 0x04cc
+DefaultProduct=0x225c
+
+Configuration=2
+
+
+#######################################################
+# Axesstel MU130
+#
+# Contributor: Jazb
+
+DefaultVendor= 0x1726
+DefaultProduct=0xf00e
+
+TargetVendor= 0x1726
+TargetProduct= 0xa000
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Explay Slim
+#
+# Contributor: vdsdmitry
+
+DefaultVendor= 0x1c9e
+DefaultProduct=0x9e08
+
+TargetVendor= 0x1c9e
+TargetProduct= 0x9e18
+
+SierraMode=1
+NoDriverLoading=1
+
+
+#######################################################
+# Huawei GP02 (E587 Variant)
+#
+# Contributor: Genmei Mori
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1c1b
+
+TargetVendor= 0x12d1
+TargetProduct= 0x1506
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+NoDriverLoading=1
+
+
+#######################################################
+# Huawei U2800 Phone
+#
+# Contributor: Peter Fedorow
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1805
+
+TargetClass=0xff
+
+MessageContent="55534243123456780600000080000601000000000000000000000000000000"
+
+
+###################################################
+# KDDI (Huawei) HWD12 LTE
+#
+# Contributor: nhe
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1f03
+
+TargetVendor= 0x12d1
+TargetProduct= 0x14db
+
+#MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
+NoDriverLoading=1
+
+
+########################################################
+# D-Link DWM-156 (Variant)
+#
+# Contributor: Bjørn Mork
+
+DefaultVendor= 0x2001
+DefaultProduct=0xa706
+
+TargetVendor= 0x2001
+TargetProduct= 0x7d01
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+########################################################
+# D-Link DWM-156 (Variant)
+#
+# Contributor: Bjørn Mork
+
+DefaultVendor= 0x2001
+DefaultProduct=0xa707
+
+TargetVendor= 0x2001
+TargetProduct= 0x7d02
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+########################################################
+# D-Link DWM-156 (Variant)
+#
+# Contributor: Bjørn Mork
+
+DefaultVendor= 0x2001
+DefaultProduct=0xa708
+
+TargetVendor= 0x2001
+TargetProduct= 0x7d03
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Onda TM201 14.4 (TIM Italy)
+#
+# Contributor: Cristian Astorino
+
+DefaultVendor= 0x1ee8
+DefaultProduct=0x0063
+
+TargetVendor= 0x1ee8
+TargetProduct= 0x0064
+
+MessageContent="555342431234567800000000000008FF000000000000030000000000000000"
+
+
+#######################################################
+# Onda WM301
+#
+# Contributor: Nicolas Carrier
+
+DefaultVendor= 0x1ee8
+DefaultProduct=0x0068
+
+TargetVendor= 0x1ee8
+TargetProduct= 0x0069
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Nokia CS-12
+#
+# Contributor: John Zouck
+
+DefaultVendor= 0x0421
+DefaultProduct=0x0618
+
+TargetVendor= 0x0421
+TargetProduct= 0x0619
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Axesstel Modems (w/ initial idProduct 0x0010)
+#
+# Contributor: LOM
+
+DefaultVendor= 0x05c6
+DefaultProduct=0x0010
+
+TargetVendor= 0x05c6
+TargetProduct= 0x00a0
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Onda MT8205 LTE
+#
+# Contributor: Vincenzo Ingrosso
+
+DefaultVendor= 0x19d2
+DefaultProduct=0x0266
+
+TargetVendor= 0x19d2
+TargetProduct= 0x0265
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Pantech UML290
+#
+# Contributor: Davis Ford
+
+DefaultVendor= 0x106c
+DefaultProduct=0x3b11
+
+TargetVendor= 0x106c
+TargetProduct= 0x3718
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Novatel MC996D
+#
+# Contributor: David Caste
+
+DefaultVendor= 0x1410
+DefaultProduct=0x5023
+
+TargetVendor= 0x1410
+TargetProduct= 0x7030
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# D-Link DWR-510
+#
+# Contributor: Nicolas Carrier
+
+DefaultVendor= 0x2001
+DefaultProduct=0xa805
+
+TargetVendor= 0x2001
+TargetProduct= 0x7e12
+
+MessageContent="5553424308407086000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Mediatek MT6229
+#
+# Contributor: Daniel Dongo
+
+DefaultVendor= 0x2020
+DefaultProduct=0x0002
+
+TargetVendor= 0x2020
+TargetProduct= 0x2000
+
+MessageContent="555342430820298900000000000003f0010100000000000000000000000000"
+
+
+#######################################################
+# ZTE MF196
+#
+# Contributor: David Caste
+
+DefaultVendor= 0x19d2
+DefaultProduct=0x1528
+
+TargetVendor= 0x19d2
+TargetProduct= 0x1527
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+NeedResponse=1
+
+
+#######################################################
+# ZTE MF656A, MF668A, MF669
+#
+# Contributor: David Caste
+
+DefaultVendor= 0x19d2
+DefaultProduct=0x0150
+
+TargetVendor= 0x19d2
+TargetProduct= 0x0124
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+NeedResponse=1
+
+
+#######################################################
+# ZTE MF680
+#
+# Contributor: David Caste
+
+DefaultVendor= 0x19d2
+DefaultProduct=0x1227
+
+TargetVendor= 0x19d2
+TargetProduct= 0x1252
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+NeedResponse=1
+
+
+#######################################################
+# WeTelecom WM-D200
+#
+# Contributor: Kirill Roskoliy
+
+DefaultVendor= 0x22de
+DefaultProduct=0x6801
+
+TargetClass=0xff
+
+MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
+MessageContent2="5553424312345679000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Quanta 1K3 LTE
+#
+# Contributor: Andrey Tikhomirov
+
+DefaultVendor= 0x0408
+DefaultProduct=0xea25
+
+TargetVendor= 0x0408
+TargetProduct= 0xea26
+
+QuantaMode=1
+
+
+#######################################################
+# TP-Link MA260
+#
+# Contributor: Bjørn Mork
+
+DefaultVendor= 0x2357
+DefaultProduct=0xf000
+
+TargetVendor= 0x2357
+TargetProduct= 0x9000
+
+MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
+
+
+#######################################################
+# Teracom LW272
+#
+# Contributor: Dheeraj Khanna
+
+DefaultVendor= 0x230d
+DefaultProduct=0x0103
+
+Configuration=2
+
+
+#######################################################
+# Huawei E3276s-151 and E3251
+#
+# Contributor: Nicholas Carrier
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x156a
+
+TargetVendor= 0x12d1
+TargetProductList="156b,156c"
+
+MessageContent="55534243123456780000000000000011062000000100000000000000000000"
+
+
+########################################################
+# Huawei K4305
+#
+# Contributor: Dario
+
+DefaultVendor= 0x12d1
+DefaultProduct=0x1f15
+
+TargetVendor= 0x12d1
+TargetProduct= 0x1400
+
+MessageContent="55534243123456780000000000000011062000000000000100000000000000"
+
+
+########################################################
+# BlackBerry Q10 and Z10
+#
+# Contributor: Daniel Mende
+
+DefaultVendor= 0x0fca
+DefaultProduct=0x8020
+
+TargetVendor= 0x0fca
+TargetProduct= 0x8012
+
+BlackberryMode=1
+
+
+########################################################
+# Pantech LTE Modem
+#
+# Contributor: Adam Goode
+
+DefaultVendor= 0x10a9
+DefaultProduct=0x6080
+
+TargetVendor= 0x10a9
+TargetProduct= 0x6085
+
+PantechMode=1
+
+########################################################
diff --git a/source/a/usb_modeswitch/usb_modeswitch.SlackBuild b/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
index e71d6876..ac26ff4d 100755
--- a/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
+++ b/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for usb_modeswitch.
-# Copyright 2010, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2010 David Somero, Athens, TN, USA
# All rights reserved.
#
@@ -24,9 +24,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PKGNAM=usb_modeswitch
-VERSION=${VERSION:-1.2.4}
-DATAVER=${DATAVER:-20120812}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-2.0.1}
+DATAVER=${DATAVER:-20130807}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/a/usbutils/usbutils-007.tar.sign b/source/a/usbutils/usbutils-007.tar.sign
new file mode 100644
index 00000000..4c8ea414
--- /dev/null
+++ b/source/a/usbutils/usbutils-007.tar.sign
@@ -0,0 +1,17 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.19 (GNU/Linux)
+
+iQIcBAABAgAGBQJRsR1jAAoJEDjbvchgkmk+jFsQAIHKnkijXjdzij6VEBqfq0RO
+WrqhtR6EWOwo60/oYIzw0dLynZwBeA4OQ+QGAAA5XSfeSOEPcVRE06bN0Cv9omVj
+GYJz5mBguAo6IfRf+rRXd8p9nnC0mS3qTpIA0/T2vSPopImrx2RfbzzpsAeEwTpg
+K7qqcdwoApd3qvBCrmPWzSIvTEGnxZPpiy5cBVoZ9YhAx09PinbUGhz7Z3cc/VJZ
+nFa+YfCie2P5eJtsv9EXudJs6NhUP02bUHtoDvktDPvQnXOtEqUBF3LsECX16kL3
+nwfWvpyDDRNEhu9jj2QspXHzROO435WTWQB81q0x1Qf14tsGa3SFgGj1mQhweAul
+m9t4fo0T+/Kgl1P2kohwa/7ws6WDc1Sy7/sd7cOxDYNQZEH1lH4mja0Qm1ViZ0lR
+ydpjHFtcjT/FHSYUOOIdIAg5NXrWhH1moAKduW9byAgM2q68nTGzs93j3uiundZv
+knfhfO3WGUlXgLYznyUUTR5xAMLq0zQUV0sNiPLci/jU0dyPMmVhnPsfivK1xN4q
+RnpU7cc3/IYYiTdlMz4jOJSMvNF2CU2ebLHEAuelbz9/jte2E+kwc3VAu5bWlSGb
+REdcYVgyV+2nA/DU61+wCJC7QIFxC/zHYtQ6vdGIcTndST0fywmtyObuL7kTkmf7
+gDNrUyjKGdFMawPfSAcm
+=Ku5j
+-----END PGP SIGNATURE-----
diff --git a/source/a/usbutils/usbutils.SlackBuild b/source/a/usbutils/usbutils.SlackBuild
index 15694392..0a938025 100755
--- a/source/a/usbutils/usbutils.SlackBuild
+++ b/source/a/usbutils/usbutils.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2011, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
diff --git a/source/a/util-linux/partx.data.type.diff b/source/a/util-linux/partx.data.type.diff
new file mode 100644
index 00000000..9811c0bd
--- /dev/null
+++ b/source/a/util-linux/partx.data.type.diff
@@ -0,0 +1,11 @@
+--- ./partx/partx.h.orig 2012-05-25 04:44:58.994195443 -0500
++++ ./partx/partx.h 2013-08-07 21:06:30.899997659 -0500
+@@ -23,7 +23,7 @@
+ }
+
+ static inline int partx_add_partition(int fd, int partno,
+- unsigned long start, unsigned long size)
++ long long start, long long size)
+ {
+ struct blkpg_ioctl_arg a;
+ struct blkpg_partition p;
diff --git a/source/a/util-linux/util-linux.SlackBuild b/source/a/util-linux/util-linux.SlackBuild
index 1fa74c83..b348d83e 100755
--- a/source/a/util-linux/util-linux.SlackBuild
+++ b/source/a/util-linux/util-linux.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
# Slackware build script for util-linux
VERSION=${VERSION:-$(echo util-linux*.tar.?z* | cut -d - -f 3 | rev | cut -f 3- -d . | rev)}
-BUILD=${BUILD:-5}
+BUILD=${BUILD:-6}
ADJTIMEXVERS=1.29
SETSERIALVERS=2.17
@@ -95,6 +95,10 @@ zcat $CWD/0002-fdisk-don-t-ignore-1MiB-granularity-on-512-byte-sect.patch.gz | p
# 20120814 bkw: fix "column --separator <anything>" segfault
zcat $CWD/column-fix_long_opts.diff.gz | patch -p1 --verbose || exit 1
+# Fix data type in partx to prevent silently truncating partition sizes and
+# offsets to 4GB on 32-bit platforms:
+zcat $CWD/partx.data.type.diff.gz | patch -p1 --verbose || exit 1
+
# Regenerate, since patch 0001 hits mount/Makefile.am:
./autogen.sh
diff --git a/source/a/xz/xz.SlackBuild b/source/a/xz/xz.SlackBuild
index 7c60ce6c..75b4e5f4 100755
--- a/source/a/xz/xz.SlackBuild
+++ b/source/a/xz/xz.SlackBuild
@@ -22,7 +22,7 @@
# SUCH DAMAGE.
PKGNAM=xz
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
@@ -72,7 +72,7 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
cd $PKGNAM-$VERSION
chown -R root:root .
find . \