util-linux: update to 2.24.

this is needed for newer udev versions but need some initskript
changes. The updater and arm rootfile is not finished yet.
This commit is contained in:
Arne Fitzenreiter
2013-11-17 18:51:04 +01:00
parent 6ee9053548
commit 1ee33ddadf
10 changed files with 205 additions and 443 deletions

View File

@@ -5,10 +5,6 @@ DEVICE1 /boot ext2 defaults 1 2
DEVICE2 swap swap pri=1 0 0
DEVICE3 / FSTYPE defaults 1 1
DEVICE4 /var FSTYPE defaults 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
#none /tmp tmpfs defaults 0 0
none /var/log/rrd tmpfs defaults,size=64M 0 0
none /var/lock tmpfs defaults,size=8M 0 0
none /var/run tmpfs defaults,size=2M 0 0

View File

@@ -19,7 +19,7 @@ ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
su:S016:once:/sbin/sulogin
1:2345:respawn:/sbin/agetty tty1 9600
1:2345:respawn:/sbin/agetty tty1 9600 --noclear
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600

View File

@@ -1,17 +1,25 @@
#bin/arch
bin/dmesg
bin/findmnt
bin/lsblk
bin/more
bin/mount
bin/umount
etc/fdprm
bin/wdctl
lib/libblkid.so.1.1.0
lib/libmount.so.1
lib/libmount.so.1.1.0
lib/libuuid.so.1.3.0
sbin/agetty
sbin/blkdiscard
sbin/blockdev
sbin/cfdisk
sbin/chcpu
sbin/ctrlaltdel
#sbin/elvtune
sbin/fdisk
#sbin/fsck.cramfs
sbin/fsck.minix
sbin/fsfreeze
sbin/fstrim
sbin/hwclock
sbin/losetup
sbin/mkfs
@@ -19,50 +27,161 @@ sbin/mkfs
#sbin/mkfs.cramfs
sbin/mkfs.minix
sbin/mkswap
sbin/nologin
#sbin/pivot_root
sbin/raw
sbin/sfdisk
sbin/swaplabel
sbin/swapoff
sbin/swapon
sbin/switch_root
sbin/wipefs
#usr/bin/cal
#usr/bin/chkdupexe
#usr/bin/chrt
#usr/bin/col
#usr/bin/colcrt
#usr/bin/colrm
#usr/bin/column
#usr/bin/cytune
#usr/bin/ddate
usr/bin/fdformat
usr/bin/eject
usr/bin/fallocate
usr/bin/flock
usr/bin/getopt
#usr/bin/hexdump
#usr/bin/i386
usr/bin/ionice
#usr/bin/ipcmk
#usr/bin/ipcrm
#usr/bin/ipcs
#usr/bin/isosize
#usr/bin/line
#usr/bin/linux32
#usr/bin/linux64
usr/bin/logger
#usr/bin/look
usr/bin/lscpu
usr/bin/lslocks
#usr/bin/mcookie
#usr/bin/namei
#usr/bin/nsenter
usr/bin/pg
#usr/bin/raw
usr/bin/prlimit
usr/bin/rename
usr/bin/renice
#usr/bin/rev
#usr/bin/script
#usr/bin/setfdprm
#usr/bin/scriptreplay
#usr/bin/setarch
#usr/bin/setsid
#usr/bin/setterm
#usr/bin/tailf
#usr/bin/taskset
#usr/bin/ul
#usr/bin/unshare
#usr/bin/whereis
#usr/bin/write
#usr/sbin/ramsize
usr/sbin/rdev
#usr/include/libmount
#usr/include/libmount/libmount.h
#usr/lib/libblkid.la
#usr/lib/libmount.a
#usr/lib/libmount.la
#usr/lib/libmount.so
#usr/lib/libuuid.la
#usr/lib/pkgconfig/mount.pc
usr/sbin/addpart
usr/sbin/delpart
usr/sbin/fdformat
usr/sbin/ldattach
usr/sbin/partx
#usr/sbin/readprofile
#usr/sbin/rootflags
#usr/sbin/tunelp
#usr/sbin/vidmode
#usr/share/info/ipc.info
usr/sbin/resizepart
usr/sbin/rtcwake
usr/share/bash-completion
#usr/share/bash-completion/completions
#usr/share/bash-completion/completions/addpart
#usr/share/bash-completion/completions/blkdiscard
#usr/share/bash-completion/completions/blkid
#usr/share/bash-completion/completions/blockdev
#usr/share/bash-completion/completions/cal
#usr/share/bash-completion/completions/cfdisk
#usr/share/bash-completion/completions/chcpu
#usr/share/bash-completion/completions/chrt
#usr/share/bash-completion/completions/col
#usr/share/bash-completion/completions/colcrt
#usr/share/bash-completion/completions/colrm
#usr/share/bash-completion/completions/column
#usr/share/bash-completion/completions/ctrlaltdel
#usr/share/bash-completion/completions/cytune
#usr/share/bash-completion/completions/delpart
#usr/share/bash-completion/completions/dmesg
#usr/share/bash-completion/completions/eject
#usr/share/bash-completion/completions/fallocate
#usr/share/bash-completion/completions/fdformat
#usr/share/bash-completion/completions/fdisk
#usr/share/bash-completion/completions/findmnt
#usr/share/bash-completion/completions/flock
#usr/share/bash-completion/completions/fsck
#usr/share/bash-completion/completions/fsck.cramfs
#usr/share/bash-completion/completions/fsck.minix
#usr/share/bash-completion/completions/fsfreeze
#usr/share/bash-completion/completions/fstrim
#usr/share/bash-completion/completions/getopt
#usr/share/bash-completion/completions/hexdump
#usr/share/bash-completion/completions/hwclock
#usr/share/bash-completion/completions/ionice
#usr/share/bash-completion/completions/ipcrm
#usr/share/bash-completion/completions/ipcs
#usr/share/bash-completion/completions/isosize
#usr/share/bash-completion/completions/ldattach
#usr/share/bash-completion/completions/logger
#usr/share/bash-completion/completions/look
#usr/share/bash-completion/completions/losetup
#usr/share/bash-completion/completions/lsblk
#usr/share/bash-completion/completions/lscpu
#usr/share/bash-completion/completions/lslocks
#usr/share/bash-completion/completions/mcookie
#usr/share/bash-completion/completions/mesg
#usr/share/bash-completion/completions/mkfs
#usr/share/bash-completion/completions/mkfs.bfs
#usr/share/bash-completion/completions/mkfs.cramfs
#usr/share/bash-completion/completions/mkfs.minix
#usr/share/bash-completion/completions/mkswap
#usr/share/bash-completion/completions/more
#usr/share/bash-completion/completions/mountpoint
#usr/share/bash-completion/completions/namei
#usr/share/bash-completion/completions/nsenter
#usr/share/bash-completion/completions/partx
#usr/share/bash-completion/completions/pg
#usr/share/bash-completion/completions/pivot_root
#usr/share/bash-completion/completions/prlimit
#usr/share/bash-completion/completions/raw
#usr/share/bash-completion/completions/readprofile
#usr/share/bash-completion/completions/rename
#usr/share/bash-completion/completions/renice
#usr/share/bash-completion/completions/resizepart
#usr/share/bash-completion/completions/rev
#usr/share/bash-completion/completions/rtcwake
#usr/share/bash-completion/completions/script
#usr/share/bash-completion/completions/scriptreplay
#usr/share/bash-completion/completions/setarch
#usr/share/bash-completion/completions/setsid
#usr/share/bash-completion/completions/setterm
#usr/share/bash-completion/completions/sfdisk
#usr/share/bash-completion/completions/swaplabel
#usr/share/bash-completion/completions/swapon
#usr/share/bash-completion/completions/tailf
#usr/share/bash-completion/completions/taskset
#usr/share/bash-completion/completions/ul
#usr/share/bash-completion/completions/unshare
#usr/share/bash-completion/completions/utmpdump
#usr/share/bash-completion/completions/uuidd
#usr/share/bash-completion/completions/uuidgen
#usr/share/bash-completion/completions/wall
#usr/share/bash-completion/completions/wdctl
#usr/share/bash-completion/completions/whereis
#usr/share/bash-completion/completions/wipefs
#usr/share/doc/util-linux
#usr/share/doc/util-linux/getopt
#usr/share/doc/util-linux/getopt/getopt-parse.bash
#usr/share/doc/util-linux/getopt/getopt-parse.tcsh
#usr/share/locale/ca/LC_MESSAGES/util-linux.mo
#usr/share/locale/cs/LC_MESSAGES/util-linux.mo
#usr/share/locale/da/LC_MESSAGES/util-linux.mo
@@ -71,12 +190,21 @@ usr/sbin/rdev
#usr/share/locale/et
#usr/share/locale/et/LC_MESSAGES
#usr/share/locale/et/LC_MESSAGES/util-linux.mo
#usr/share/locale/eu
#usr/share/locale/eu/LC_MESSAGES
#usr/share/locale/eu/LC_MESSAGES/util-linux.mo
#usr/share/locale/fi/LC_MESSAGES/util-linux.mo
#usr/share/locale/fr/LC_MESSAGES/util-linux.mo
#usr/share/locale/gl/LC_MESSAGES/util-linux.mo
#usr/share/locale/hr/LC_MESSAGES/util-linux.mo
#usr/share/locale/hu/LC_MESSAGES/util-linux.mo
#usr/share/locale/id/LC_MESSAGES/util-linux.mo
#usr/share/locale/it/LC_MESSAGES/util-linux.mo
#usr/share/locale/ja/LC_MESSAGES/util-linux.mo
#usr/share/locale/nl/LC_MESSAGES/util-linux.mo
#usr/share/locale/pl/LC_MESSAGES/util-linux.mo
#usr/share/locale/pt_BR/LC_MESSAGES/util-linux.mo
#usr/share/locale/ru/LC_MESSAGES/util-linux.mo
#usr/share/locale/sl
#usr/share/locale/sl/LC_MESSAGES
#usr/share/locale/sl/LC_MESSAGES/util-linux.mo
@@ -85,72 +213,92 @@ usr/sbin/rdev
#usr/share/locale/uk
#usr/share/locale/uk/LC_MESSAGES
#usr/share/locale/uk/LC_MESSAGES/util-linux.mo
#usr/share/man/man1/arch.1
#usr/share/locale/vi/LC_MESSAGES/util-linux.mo
#usr/share/locale/zh_CN/LC_MESSAGES/util-linux.mo
#usr/share/locale/zh_TW/LC_MESSAGES/util-linux.mo
#usr/share/man/man1/cal.1
#usr/share/man/man1/chkdupexe.1
#usr/share/man/man1/chrt.1
#usr/share/man/man1/col.1
#usr/share/man/man1/colcrt.1
#usr/share/man/man1/colrm.1
#usr/share/man/man1/column.1
#usr/share/man/man1/ddate.1
#usr/share/man/man1/dmesg.1
#usr/share/man/man1/eject.1
#usr/share/man/man1/fallocate.1
#usr/share/man/man1/flock.1
#usr/share/man/man1/getopt.1
#usr/share/man/man1/hexdump.1
#usr/share/man/man1/line.1
#usr/share/man/man1/ionice.1
#usr/share/man/man1/ipcmk.1
#usr/share/man/man1/ipcrm.1
#usr/share/man/man1/ipcs.1
#usr/share/man/man1/look.1
#usr/share/man/man1/lscpu.1
#usr/share/man/man1/mcookie.1
#usr/share/man/man1/more.1
#usr/share/man/man1/namei.1
#usr/share/man/man1/nsenter.1
#usr/share/man/man1/pg.1
#usr/share/man/man1/readprofile.1
#usr/share/man/man1/prlimit.1
#usr/share/man/man1/rename.1
#usr/share/man/man1/renice.1
#usr/share/man/man1/rev.1
#usr/share/man/man1/script.1
#usr/share/man/man1/scriptreplay.1
#usr/share/man/man1/setsid.1
#usr/share/man/man1/setterm.1
#usr/share/man/man1/tailf.1
#usr/share/man/man1/taskset.1
#usr/share/man/man1/ul.1
#usr/share/man/man1/unshare.1
#usr/share/man/man1/whereis.1
#usr/share/man/man1/write.1
#usr/share/man/man3/uuid_generate_time_safe.3
#usr/share/man/man5/fstab.5
#usr/share/man/man5/nfs.5
#usr/share/man/man8/addpart.8
#usr/share/man/man8/agetty.8
#usr/share/man/man8/blkdiscard.8
#usr/share/man/man8/blockdev.8
#usr/share/man/man8/cfdisk.8
#usr/share/man/man8/chcpu.8
#usr/share/man/man8/ctrlaltdel.8
#usr/share/man/man8/cytune.8
#usr/share/man/man8/dmesg.8
#usr/share/man/man8/elvtune.8
#usr/share/man/man8/delpart.8
#usr/share/man/man8/fdformat.8
#usr/share/man/man8/fdisk.8
#usr/share/man/man8/findmnt.8
#usr/share/man/man8/fsck.cramfs.8
#usr/share/man/man8/fsck.minix.8
#usr/share/man/man8/fsfreeze.8
#usr/share/man/man8/fstrim.8
#usr/share/man/man8/hwclock.8
#usr/share/man/man8/ipcrm.8
#usr/share/man/man8/ipcs.8
#usr/share/man/man8/i386.8
#usr/share/man/man8/isosize.8
#usr/share/man/man8/ldattach.8
#usr/share/man/man8/linux32.8
#usr/share/man/man8/linux64.8
#usr/share/man/man8/losetup.8
#usr/share/man/man8/lsblk.8
#usr/share/man/man8/lslocks.8
#usr/share/man/man8/mkfs.8
#usr/share/man/man8/mkfs.bfs.8
#usr/share/man/man8/mkfs.cramfs.8
#usr/share/man/man8/mkfs.minix.8
#usr/share/man/man8/mkswap.8
#usr/share/man/man8/mount.8
#usr/share/man/man8/nologin.8
#usr/share/man/man8/partx.8
#usr/share/man/man8/pivot_root.8
#usr/share/man/man8/ramsize.8
#usr/share/man/man8/raw.8
#usr/share/man/man8/rdev.8
#usr/share/man/man8/renice.8
#usr/share/man/man8/rootflags.8
#usr/share/man/man8/setfdprm.8
#usr/share/man/man8/setsid.8
#usr/share/man/man8/readprofile.8
#usr/share/man/man8/resizepart.8
#usr/share/man/man8/rtcwake.8
#usr/share/man/man8/setarch.8
#usr/share/man/man8/sfdisk.8
#usr/share/man/man8/sln.8
#usr/share/man/man8/swaplabel.8
#usr/share/man/man8/swapoff.8
#usr/share/man/man8/swapon.8
#usr/share/man/man8/tunelp.8
#usr/share/man/man8/switch_root.8
#usr/share/man/man8/umount.8
#usr/share/man/man8/vidmode.8
#usr/share/misc/getopt
#usr/share/misc/getopt/getopt-parse.bash
#usr/share/misc/getopt/getopt-parse.tcsh
#usr/share/misc/getopt/getopt-test.bash
#usr/share/misc/getopt/getopt-test.tcsh
var/lib/hwclock
#usr/share/man/man8/wdctl.8
#usr/share/man/man8/wipefs.8

View File

@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
# Copyright (C) 2007-2013 IPFire Team <info@ipfire.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 #
@@ -24,10 +24,10 @@
include Config
VER = 2.12r
VER = 2.24
THISAPP = util-linux-$(VER)
DL_FILE = $(THISAPP).tar.bz2
DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = af9d9e03038481fbf79ea3ac33f116f9
$(DL_FILE)_MD5 = 4fac6443427f575fc5f3531a4ad2ca01
install : $(TARGET)
@@ -69,13 +69,7 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/util-linux-2.12r-umount-no-special.patch
cd $(DIR_APP) && sed -i 's@etc/adjtime@var/lib/hwclock/adjtime@g' \
hwclock/hwclock.c
-mkdir -p /var/lib/hwclock
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-cramfs-1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/util-linux-buildfix.patch
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && ./configure
cd $(DIR_APP) && make $(MAKETUNING) HAVE_KILL=yes HAVE_SLN=yes
cd $(DIR_APP) && make HAVE_KILL=yes HAVE_SLN=yes install

View File

@@ -369,8 +369,8 @@ buildbase() {
lfsmake2 sysvinit
lfsmake2 tar
lfsmake2 texinfo
lfsmake2 udev
lfsmake2 util-linux
lfsmake2 udev
lfsmake2 vim
lfsmake2 xz
lfsmake2 paxctl

View File

@@ -24,11 +24,9 @@ case "${1}" in
# Remove fsck-related file system watermarks.
rm -f /fastboot /forcefsck
boot_mesg "Recording existing mounts in /etc/mtab..."
boot_mesg "Create /etc/mtab..."
> /etc/mtab
mount -f / || failed=1
mount -f /proc || failed=1
mount -f /sys || failed=1
(exit ${failed})
evaluate_retval
@@ -49,9 +47,6 @@ case "${1}" in
boot_mesg "Unmounting all other currently mounted file systems..."
umount -a -d -r &>/dev/null
evaluate_retval
# mount /sys again for led control at halt
mount /sys 2>&1 >/dev/null
;;
*)
echo "Usage: ${0} {start|stop}"

View File

@@ -6,7 +6,7 @@
#
# Authors : Arne Fitzenreiter - arne_f@ipfire.org
#
# Version : 1.01
# Version : 1.02
#
# Notes :
#
@@ -22,6 +22,12 @@ case "${1}" in
mount -o remount,rw / > /dev/null
evaluate_retval
boot_mesg "Create /etc/mtab..."
> /etc/mtab
mount -f / || failed=1
(exit ${failed})
evaluate_retval
# Detect device
ROOT=`mount | grep -m1 " / " | cut -d" " -f1`;
if [ "${ROOT:`expr length $ROOT`-2:1}" == "p" ]; then
@@ -49,4 +55,3 @@ case "${1}" in
esac
# End $rc_base/init.d/partresize

View File

@@ -1,93 +0,0 @@
Submitted by: Jeremy Utley <jeremy@linuxfromscratch.org>
Date: 2004-12-25
Initial Package Version: 2.12p (should apply to versions back to at least k)
Upstream Status: Not Submitted - Test Version
Origin: Alexander Patrakov, adapted from debian build of cramfs utilities
Description: Util-Linux fails in cramfs compilation due to changes in the
linux-libc-headers package 2.6.9 and after. This patch is a proper fix to the
problem, but may in fact not be accepted upstream.
diff -Naur util-linux-2.12p/disk-utils/fsck.cramfs.c util-linux-2.12p-new/disk-utils/fsck.cramfs.c
--- util-linux-2.12p/disk-utils/fsck.cramfs.c 2004-12-11 14:53:16.000000000 +0000
+++ util-linux-2.12p-new/disk-utils/fsck.cramfs.c 2004-12-26 00:53:10.665199086 +0000
@@ -76,16 +76,7 @@
#define PAD_SIZE 512
-#include <asm/page.h>
-#ifdef PAGE_SIZE
-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
-#elif defined __ia64__
-#define PAGE_CACHE_SIZE (16384)
-#elif defined __alpha__
-#define PAGE_CACHE_SIZE (8192)
-#else
-#define PAGE_CACHE_SIZE (4096)
-#endif
+#define PAGE_CACHE_SIZE page_size
/* Guarantee access to at least 8kB at a time */
#define ROMBUFFER_BITS 13
@@ -95,11 +86,13 @@
static unsigned long read_buffer_block = ~0UL;
/* Uncompressing data structures... */
-static char outbuffer[PAGE_CACHE_SIZE*2];
+static char *outbuffer;
z_stream stream;
#endif /* INCLUDE_FS_TESTS */
+static size_t page_size;
+
/* Input status of 0 to print help and exit without an error. */
static void usage(int status)
{
@@ -464,9 +457,17 @@
int c; /* for getopt */
int start = 0;
+ page_size = sysconf(_SC_PAGESIZE);
+
if (argc)
progname = argv[0];
+ outbuffer = malloc(page_size * 2);
+ if (!outbuffer) {
+ fprintf(stderr, _("failed to allocate outbuffer\n"));
+ exit(8);
+ }
+
/* command line options */
while ((c = getopt(argc, argv, "hx:v")) != EOF) {
switch (c) {
diff -Naur util-linux-2.12p/disk-utils/mkfs.cramfs.c util-linux-2.12p-new/disk-utils/mkfs.cramfs.c
--- util-linux-2.12p/disk-utils/mkfs.cramfs.c 2004-12-11 14:56:01.000000000 +0000
+++ util-linux-2.12p-new/disk-utils/mkfs.cramfs.c 2004-12-26 00:53:10.666198928 +0000
@@ -46,16 +46,8 @@
static const char *progname = "mkcramfs";
static int verbose = 0;
-#ifdef __ia64__
-#define PAGE_CACHE_SIZE (16384)
-#elif defined __alpha__
-#define PAGE_CACHE_SIZE (8192)
-#else
-#define PAGE_CACHE_SIZE (4096)
-#endif
-
/* The kernel assumes PAGE_CACHE_SIZE as block size. */
-static unsigned int blksize = PAGE_CACHE_SIZE; /* settable via -b option */
+static unsigned int blksize; /* settable via -b option */
static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
static int image_length = 0;
@@ -730,6 +722,7 @@
u32 crc = crc32(0L, Z_NULL, 0);
int c;
+ blksize = sysconf(_SC_PAGESIZE);
total_blocks = 0;
if (argc) {

View File

@@ -1,11 +0,0 @@
--- util-linux-2.12r.old/mount/umount.c
+++ util-linux-2.12r/mount/umount.c
@@ -31,7 +31,7 @@
#include <arpa/inet.h>
#endif
-#if defined(MNT_FORCE) && !defined(__sparc__) && !defined(__arm__)
+#if defined(MNT_FORCE)
/* Interesting ... it seems libc knows about MNT_FORCE and presumably
about umount2 as well -- need not do anything */
#else /* MNT_FORCE */

View File

@@ -1,272 +0,0 @@
Submitted By: Dan Nicholson <dbn_dot_lists_at_gmail_dot_com>
Date: 2006-07-08
Initial Package Version: 2.12r
Origin: Upstream
Upstream Status: Applied in util-linux-2.13-pre6.tar.bz2
Description: Replaces uses of *llseek with lseek. Fixes an issue
compiling util-linux with kernel headers from linux-2.6.18-rc1
headers_install.
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/Makefile util-linux-2.12r/fdisk/Makefile
--- util-linux-2.12r.orig/fdisk/Makefile 2004-09-06 20:28:58.000000000 +0000
+++ util-linux-2.12r/fdisk/Makefile 2006-07-08 15:40:57.140375072 +0000
@@ -39,7 +39,7 @@ else
endif
endif
-cfdisk: cfdisk.o llseek.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
+cfdisk: cfdisk.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
ifeq "$(HAVE_SLANG)" "yes"
$(CC) $(LDFLAGS) $^ -o $@ $(LIBSLANG)
else
@@ -55,7 +55,7 @@ activate: sfdisk
rm -f activate
ln -s sfdisk activate
-fdisk: fdisk.o llseek.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
+fdisk: fdisk.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
fdisksunlabel.o fdiskaixlabel.o i386_sys_types.o partname.o
fdisk.o: fdisk.c fdisk.h
fdiskbsdlabel.o: fdiskbsdlabel.c fdisk.h fdiskbsdlabel.h
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/cfdisk.c util-linux-2.12r/fdisk/cfdisk.c
--- util-linux-2.12r.orig/fdisk/cfdisk.c 2005-09-09 21:44:57.000000000 +0000
+++ util-linux-2.12r/fdisk/cfdisk.c 2006-07-08 15:40:23.458901045 +0000
@@ -84,9 +84,6 @@
#include "xstrncpy.h"
#include "common.h"
-extern long long ext2_llseek(unsigned int fd, long long offset,
- unsigned int origin);
-
#define VERSION UTIL_LINUX_VERSION
#define DEFAULT_DEVICE "/dev/hda"
@@ -552,7 +549,7 @@ die_x(int ret) {
static void
read_sector(char *buffer, long long sect_num) {
- if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
+ if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
fatal(_("Cannot seek on disk drive"), 2);
if (read(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
fatal(_("Cannot read disk drive"), 2);
@@ -560,7 +557,7 @@ read_sector(char *buffer, long long sect
static void
write_sector(char *buffer, long long sect_num) {
- if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
+ if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
fatal(_("Cannot seek on disk drive"), 2);
if (write(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
fatal(_("Cannot write disk drive"), 2);
@@ -587,7 +584,7 @@ get_dos_label(int i) {
long long offset;
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE;
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
+ if (lseek(fd, offset, SEEK_SET) == offset
&& read(fd, &sector, sizeof(sector)) == sizeof(sector)) {
dos_copy_to_info(p_info[i].ostype, OSTYPESZ,
sector+DOS_OSTYPE_OFFSET, DOS_OSTYPE_SZ);
@@ -672,7 +669,7 @@ get_linux_label(int i) {
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+ 1024;
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
+ if (lseek(fd, offset, SEEK_SET) == offset
&& read(fd, &e2fsb, sizeof(e2fsb)) == sizeof(e2fsb)
&& e2fsb.s_magic[0] + (e2fsb.s_magic[1]<<8) == EXT2_SUPER_MAGIC) {
label = e2fsb.s_volume_name;
@@ -688,7 +685,7 @@ get_linux_label(int i) {
}
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0;
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
+ if (lseek(fd, offset, SEEK_SET) == offset
&& read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb)
&& !strncmp(xfsb.s_magic, XFS_SUPER_MAGIC, 4)) {
label = xfsb.s_fname;
@@ -702,7 +699,7 @@ get_linux_label(int i) {
/* jfs? */
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+ JFS_SUPER1_OFF;
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
+ if (lseek(fd, offset, SEEK_SET) == offset
&& read(fd, &jfsb, sizeof(jfsb)) == sizeof(jfsb)
&& !strncmp(jfsb.s_magic, JFS_MAGIC, strlen(JFS_MAGIC))) {
label = jfsb.s_label;
@@ -716,7 +713,7 @@ get_linux_label(int i) {
/* reiserfs? */
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+ REISERFS_DISK_OFFSET_IN_BYTES;
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
+ if (lseek(fd, offset, SEEK_SET) == offset
&& read(fd, &reiserfsb, sizeof(reiserfsb)) == sizeof(reiserfsb)
&& has_reiserfs_magic_string(&reiserfsb, &reiserfs_is_3_6)) {
if (reiserfs_is_3_6) {
@@ -1860,7 +1857,7 @@ write_part_table(void) {
while (!done) {
mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
- _("Are you sure you want write the partition table "
+ _("Are you sure you want to write the partition table "
"to disk? (yes or no): "));
len = get_string(response, LINE_LENGTH, NULL);
clear_warning();
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/fdisk.c util-linux-2.12r/fdisk/fdisk.c
--- util-linux-2.12r.orig/fdisk/fdisk.c 2004-12-18 02:00:31.000000000 +0000
+++ util-linux-2.12r/fdisk/fdisk.c 2006-07-08 15:40:23.461899841 +0000
@@ -239,8 +239,8 @@ void fatal(enum failure why) {
static void
seek_sector(int fd, unsigned int secno) {
- long long offset = (long long) secno * sector_size;
- if (ext2_llseek(fd, offset, SEEK_SET) == (long long) -1)
+ off_t offset = (off_t) secno * sector_size;
+ if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
fatal(unable_to_seek);
}
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/fdisk.h util-linux-2.12r/fdisk/fdisk.h
--- util-linux-2.12r.orig/fdisk/fdisk.h 2004-12-15 18:19:06.000000000 +0000
+++ util-linux-2.12r/fdisk/fdisk.h 2006-07-08 15:40:23.462899439 +0000
@@ -26,9 +26,6 @@
#define cround(n) (display_in_cyl_units ? ((n)/units_per_sector)+1 : (n))
#define scround(x) (((x)+units_per_sector-1)/units_per_sector)
-extern long long ext2_llseek(unsigned int fd, long long offset,
- unsigned int origin);
-
#if defined(__GNUC__) && (defined(__arm__) || defined(__alpha__))
# define PACKED __attribute__ ((packed))
#else
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/fdiskbsdlabel.c util-linux-2.12r/fdisk/fdiskbsdlabel.c
--- util-linux-2.12r.orig/fdisk/fdiskbsdlabel.c 2003-07-13 21:12:47.000000000 +0000
+++ util-linux-2.12r/fdisk/fdiskbsdlabel.c 2006-07-08 15:40:23.463899038 +0000
@@ -566,7 +566,7 @@ xbsd_write_bootstrap (void)
sector = get_start_sect(xbsd_part);
#endif
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
+ if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
fatal (unable_to_seek);
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
fatal (unable_to_write);
@@ -735,7 +735,7 @@ xbsd_readlabel (struct partition *p, str
sector = 0;
#endif
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
+ if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
fatal (unable_to_seek);
if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
fatal (unable_to_read);
@@ -781,12 +781,12 @@ xbsd_writelabel (struct partition *p, st
#if defined (__alpha__) && BSD_LABELSECTOR == 0
alpha_bootblock_checksum (disklabelbuffer);
- if (ext2_llseek (fd, (long long) 0, SEEK_SET) == -1)
+ if (lseek (fd, (off_t) 0, SEEK_SET) == -1)
fatal (unable_to_seek);
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
fatal (unable_to_write);
#else
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE + BSD_LABELOFFSET,
+ if (lseek (fd, (off_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
SEEK_SET) == -1)
fatal (unable_to_seek);
if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/fdisksgilabel.c util-linux-2.12r/fdisk/fdisksgilabel.c
--- util-linux-2.12r.orig/fdisk/fdisksgilabel.c 2004-12-18 01:53:45.000000000 +0000
+++ util-linux-2.12r/fdisk/fdisksgilabel.c 2006-07-08 15:40:23.464898637 +0000
@@ -379,7 +379,7 @@ sgi_write_table(void) {
*/
sgiinfo *info = fill_sgiinfo();
int infostartblock = SSWAP32(sgilabel->directory[0].vol_file_start);
- if (ext2_llseek(fd, (long long)infostartblock*
+ if (lseek(fd, (off_t) infostartblock*
SECTOR_SIZE, SEEK_SET) < 0)
fatal(unable_to_seek);
if (write(fd, info, SECTOR_SIZE) != SECTOR_SIZE)
diff -pur -x '*.rej' util-linux-2.12r.orig/fdisk/sfdisk.c util-linux-2.12r/fdisk/sfdisk.c
--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 22:31:57.000000000 +0000
+++ util-linux-2.12r/fdisk/sfdisk.c 2006-07-08 15:40:23.467897432 +0000
@@ -164,36 +164,17 @@ fatal(char *s, ...) {
/*
* sseek: seek to specified sector - return 0 on failure
*
- * For >4GB disks lseek needs a > 32bit arg, and we have to use llseek.
- * On the other hand, a 32 bit sector number is OK until 2TB.
- * The routines _llseek and sseek below are the only ones that
- * know about the loff_t type.
- *
* Note: we use 512-byte sectors here, irrespective of the hardware ss.
*/
-#undef use_lseek
-#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__)
-#define use_lseek
-#endif
-
-#ifndef use_lseek
-static __attribute__used
-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
- loff_t *, res, unsigned int, wh);
-#endif
static int
sseek(char *dev, unsigned int fd, unsigned long s) {
- loff_t in, out;
- in = ((loff_t) s << 9);
+ off_t in, out;
+ in = ((off_t) s << 9);
out = 1;
-#ifndef use_lseek
- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) {
-#else
if ((out = lseek(fd, in, SEEK_SET)) != in) {
-#endif
- perror("llseek");
+ perror("lseek");
error(_("seek error on %s - cannot seek to %lu\n"), dev, s);
return 0;
}
diff -pur -x '*.rej' util-linux-2.12r.orig/partx/partx.c util-linux-2.12r/partx/partx.c
--- util-linux-2.12r.orig/partx/partx.c 2004-08-23 20:13:27.000000000 +0000
+++ util-linux-2.12r/partx/partx.c 2006-07-08 15:40:23.469896630 +0000
@@ -330,34 +330,15 @@ xmalloc (size_t size) {
return t;
}
-/*
- * sseek: seek to specified sector
- */
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
-#define NEED__llseek
-#endif
-
-#ifdef NEED__llseek
-#include <linux/unistd.h> /* _syscall */
-static
-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
- long long *, res, uint, wh);
-#endif
-
static int
sseek(int fd, unsigned int secnr) {
long long in, out;
in = ((long long) secnr << 9);
out = 1;
-#ifdef NEED__llseek
- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0
- || out != in)
-#else
if ((out = lseek(fd, in, SEEK_SET)) != in)
-#endif
{
- fprintf(stderr, "llseek error\n");
+ fprintf(stderr, "lseek error\n");
return -1;
}
return 0;