Karel Zak [Tue, 10 Nov 2009 11:48:34 +0000 (12:48 +0100)]
Revert "libblkid: fix buffer usage in FAT prober"
This patch is unnecessary, the library uses two buffers and the VFAT
superblock is always stored in the probe->sbbuf buffer which is never
overwritten. It seems that FAT fsinfo is also in the superblock
buffer. I was too paranoid :-) Sorry.
Karel Zak [Fri, 6 Nov 2009 22:43:46 +0000 (23:43 +0100)]
build-sys: clean up gtk-doc stuff
* gtk-doc.make does not care about difference between $srcdir and $builddir
and many things are generated into $srcdir. It's pretty difficult to support
out-of-source build...
* gtk-doc expects that many generated files are stored in repository
(we don't use XML templates, all documentation in source code only).
* we don't want to distribute generated html files, the docs is
attractive for very small group of people...
Frankly, it would be nice to found something more robust and better
than gtk-doc.
Karel Zak [Fri, 30 Oct 2009 11:20:51 +0000 (12:20 +0100)]
libblkid: does not return useless binary data
Currently, the binary blkid_probe_get_{topology,partitions}() API
returns empty structs when information has not been gathered. This is
confusing for applications. It's seems better to return NULL.
Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 27 Oct 2009 10:30:37 +0000 (11:30 +0100)]
libblkid: add BLKID_{VERSION,DATE} to blkid.h
The original e2fsprogs has BLKID_{VERSION,DATE} macros in blkid.h.
Although the macros are not updated for many years in e2fsprogs. So I
guess nobody uses it.
Crypto devices may sometimes have multiple additional prober matches,
however just like RAID, there's no danger of activating the wrong one
since special help is needed to activate the block device before it
can be used.
Thus modify blkid_do_safeprobe() to break out of the loop when a
crypto device is detected, as it does already for RAID.
Signed-off-by: Scott James Remnant <scott@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* on systems where DM is fully integrated with udev the /dev/mapper/<name>
files are symlinks to /dev/dm-N. It means we need a special care to hide
private device-mapper names.
Karel Zak [Thu, 22 Oct 2009 12:52:39 +0000 (14:52 +0200)]
libblkid: use BLKSSZGET for GPT sectors
The current implementation uses fixed sector size (512 bytes), that's
wrong. UEFI standard requires real logical sector size -- it means
BLKSSZGET for Linux.
The size of GPT header is not static, but whole sector is allocated
for the header. In theory the HeaderSize field could be greater than
sizeof(struct gpt_header). It means we have to read whole sector with
the header, because the header crc32 checksum is counted according to
HeaderSize.
Karel Zak [Fri, 16 Oct 2009 00:34:28 +0000 (02:34 +0200)]
libblkid: add missing packed attributes
This patch add __attribute__((packed)) to almost all superblock and
disk label definitions. Well, in many cases this is not necessary, but
it's a cheap way how to keep the code robust...
Karel Zak [Thu, 15 Oct 2009 21:37:34 +0000 (23:37 +0200)]
tests: update fsck.ismounted test
The latest version of the lib/test_ismounted binary returns absolute
mountpoint path too. This patch removes the path from test output (the
path is variable).
Karel Zak [Wed, 14 Oct 2009 23:22:42 +0000 (01:22 +0200)]
blockdev: add topology ioctls support
new options:
--getpbsz get physical block (sector) size
--getiomin get minimum I/O size
--getioopt get optimal I/O size
--getalignoff get alignment offset
--getmaxsect get max sectors per request
Karel Zak [Wed, 14 Oct 2009 00:17:27 +0000 (02:17 +0200)]
blkid: add pretty output, document -L incompatibility with e2fsprogs
... sad story, I have temporary disabled pretty-output code
in very early version of blkid.c in u-l-ng. (It was also in
time when pretty-output was very new feature in e2fsprogs.)
Unfortunately, the -L option (shortcut to "-o list") in u-l-ng version
was reused for for any other functionality few months later.... this
stupid thing was released in u-l-ng 2.15 and 2.16 without any negative
feedback from users.
It means the blkid from u-l-ng is not backwardly compatible with
the original version from e2fsprogs. The -L option has a different
meaning there.
I'm sorry about this bug...
This patch:
* enable pretty-output (-o line)
* add a note about incompatibility between u-l-ng and e2fsprogs
to blkid.8 man page
Even though --systz doesn't need to change the system clock when the
hardware clock is in UTC time (--systz --utc), it does need to set
the kernel timezone so that FAT timestamps, etc. will be correct.
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Karel Zak [Tue, 13 Oct 2009 13:37:49 +0000 (15:37 +0200)]
tests: swapon workaround for libtool wrapper
The swapon command behaviour depends on program name (argv[0] = swapon
| swapoff). It means we cannot use the libtool wrapper script in our
regression tests. It seems better to call the binaries directly with
proper LD_LIBRARY_PATH. This is probably less portable, but good
enough for our tests.
Karel Zak [Tue, 13 Oct 2009 12:22:33 +0000 (14:22 +0200)]
swapon: more robust progname probing
Currently, the 'swapoff' is the default behavior. It means that if you
have a libtool wrapper script in your build directory the executed binary
name is 'lt-swapon' and then "swapon -a" is interpreted as "swapoff -a".
Any random argv[0] should not be interpreted as "swapoff".
Mike Frysinger [Tue, 13 Oct 2009 10:05:19 +0000 (06:05 -0400)]
swapon: handle <=linux-2.6.19 bug in /proc/swaps
Linux <=2.6.19 contained a bug in the /proc/swaps code where the header
would not be displayed (the first line). Most people report the issue as
a sequence of swapon/swapoff calls to trigger, but for some lucky people,
it triggers all the time at initial boot. Since this throws up an error,
init systems don't actually activate any swap files.
First, swapon shouldn't whine about unexpected format if the file is empty
(the default at boot). This is easy to do by putting the warning behind a
check to ferror().
Second, we can detect that the first line isn't actually the header but
instead is a valid swap line and so need to be processed. This assumes
that the first line will always be the same format. Looking quickly at
older versions shows that this header has retained its exact format since
at least Linux 2.2.0 and considering the concern that goes along with proc
files and the ABI, it's highly unlikely it will ever change.
hwclock: do not access hardware clock when using --systz
When using --systz we do not read from the hardware clock, so there
is no need to search for a hardware clock. Indeed, we may be running
hwclock --systz before /dev is mounted.
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Karel Zak [Mon, 12 Oct 2009 12:14:56 +0000 (14:14 +0200)]
build-sys: clean up gtk-doc usage
Currently gtk-doc is optional. Unfortunately, the ./configure script
still depends on GTK_DOC_CHECK macro and shlibs/blkid/docs/Makefile.am
depends on gtk-doc.make.
It seems that the best solution is to add gtk-doc.[make,m4] files to
the repository.
Mike Frysinger [Sun, 11 Oct 2009 00:07:16 +0000 (20:07 -0400)]
build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr
The bfs/cramfs/minix rarely (if ever?) are used for root filesystems, so
it doesn't make much sense to keep them in the root partition. Move them
to /usr by default.
Guillem Jover [Thu, 8 Oct 2009 11:40:11 +0000 (13:40 +0200)]
build-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINED
Older versions of glibc used to declare ‘union semun’ in <sys/sem.h>,
but POSIX.1-2001 requires the caller to declare it instead. Later
versions of glibc started defining _SEM_SEMUN_UNDEFINED to note that
the union was not being declared, but conforming systems are not
required to define that macro (e.g. FreeBSD). As a side effect we get
rid of some obsolete __GNU_LIBRARY__ macro usage.
[kzak@redhat.com: - use #ifndef]
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Guillem Jover [Thu, 8 Oct 2009 11:40:06 +0000 (13:40 +0200)]
build-sys: detect if const is available
Some systems define __STDC__ and do not have a working const, some do
not define the macro but do have a working const. Use AC_C_CONST to
check for its presence.