summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-04-08rtcwake: does miss the "off" optionKarel Zak1-5/+19
Reported-by: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de> Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=580296 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-07swaplabel: fix typo in man pageKarel Zak1-1/+1
Reported-by: Marcos Felipe Rasia de Mello <marcosfrm@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-07libblkid: add ultrix PT supportKarel Zak4-0/+91
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-07libblkid: fix 'partno' usageKarel Zak6-10/+26
Linux kernel ignores empty partitions, but partition number is always allocated for the partition. (This rule is used for primary partitions only.) For example: part 1. size=12345 part 2. size=0 part 3. size=24567 the final list of partitions: sda1 sda3 'sda2' is not defined and partno=2 is not used for any other partitions. The libblkid library has to be compatible with this rule. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-06libblkid: fix blkid_partlist_devno_to_partition() for extended partitionsKarel Zak1-0/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-02swaplabel: new commandJason Borden6-14/+325
Print or change the label / UUID of a swap area. [kzak@redhat.com: - code refactoring - add long options - clean up Makefile.am] Signed-off-by: Jason Borden <jborden@bluehost.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-02mkswap: zap bootbits on regular filesKarel Zak1-3/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-02swapon: move DELETED_SUFFIX to include/pathnames.hKarel Zak2-6/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-01mkswap: move write_all() to include/writeall.hKarel Zak3-19/+28
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-31libblkid: avoid probing CDs for RAIDM.S.Colclough4-0/+24
RAID probing of CD/DVD can yield errors because of well-known problem in reading the end of the disk with some disk/drive combinations. Borrow CD detection method from udev and skip the RAID tests for these devices. [kzak@redhat.com: - check for linux/cdrom.h in ./configure - add #ifdef around the ioctl call - call the ioctl for block devices only] Signed-off-by: Mark Colclough <m.s.colclough@bham.ac.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-31blockdev: reduce usage text widthFrancesco Cosoleto1-4/+4
Use spaces in usage text instead of tabs and reduce the distance between option names and descriptions. This helps to minimize problems due to limited number of columns and translated texts which take up more space than English. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-03-31fdisk: replace bzero with memsetJon Ringle1-2/+2
Work on this was done in commit c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed, however a couple of bzero call sites were missed Signed-off-by: Jon Ringle <jon@ringle.org>
2010-03-31docs: update tests/READMEKarel Zak1-3/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-31tests: added tests against strtosizeYann Droneaud2-0/+16
- test empty string, white spaces - test hexadecimal Signed-off-by: Yann Droneaud <yann@droneaud.fr>
2010-03-31build-sys: improved check for fallocate()Yann Droneaud1-1/+36
With glibc 2.10 on a 32bits system, fallocate64() function is not exported. This a problem, since _FILE_OFFSET_BITS is set to 64 and fallocate() is redirected to fallocate64(). Sadly, AC_CHECK_FUNC() doesn't catch such problem, since it's overriding the function prototype. See this for references: http://sources.redhat.com/ml/libc-hacker/2009-05/msg00003.html Signed-off-by: Yann Droneaud <yann@droneaud.fr>
2010-03-31tests: use POSIX localeYann Droneaud23-23/+28
Since not everyone have en_US.UTF-8 locale, default to POSIX locale. This changes default sort order, so some expected results were updated. Signed-off-by: Yann Droneaud <yann@droneaud.fr>
2010-03-31partx: fix infinite loopKarel Zak1-0/+2
On Wed, Mar 24, 2010 at 04:39:35PM -0400, Phillip Susi wrote: > I noticed that running partx -d /dev/sda hangs so I looked into it > and it seems that it keeps trying to delete partitions forever. Reported-By: Phillip Susi <psusi@cfl.rr.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-31partx: do not add nonexistent partitionsPhillip Susi1-0/+3
This simple patch fixes partx -a to not add nonexistent zero length partitions for unused primary partition slots to to the kernel. This makes partx conform to the usual kernel behavior. Signed-off-by: Phillip Susi <psusi@cfl.rr.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30mkswap: fixed strtoll() usageYann Droneaud1-2/+3
- catch empty string - check against LLONG_MAX and LLONG_MIN instead of ULLONG_MAX and 0 Signed-off-by: Yann Droneaud <yann@droneaud.fr>
2010-03-30mount: support suffixes for offset= and sizelimit=Karel Zak2-24/+24
Note that the offset= and sizelimit= values in /etc/mtab are always in the final format -- it means without suffix). Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30mount: more robust offset= and sizelimit= parsingKarel Zak1-3/+25
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30losetup: support suffixes and hex numbers for --offset and --sizelimitKarel Zak3-10/+18
Reported-By: Liu Aleaxander <aleaxander@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30fallocate: support suffixes for --offset and --lenghtKarel Zak3-40/+10
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30mkswap: more robust strtoull() usageKarel Zak1-6/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30wipefs: support suffixes for --offsetKarel Zak3-12/+10
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30blkid: support suffixes for -O <offset> and -S <size>Karel Zak3-9/+21
for example: blkid -p -O 17816085KiB /dev/sda Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30lib: add strtosize() functionKarel Zak7-1/+235
This function int strtosize(const char *str, uintmax_t *res) supports {K,M,G,T,E,P}iB and {K,M,G,T,E,P}B suffixes. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-29hwclock: add --predict for predicting RTC reading at a given timeTimo Juhani Lindfors2-11/+37
Implement new option --predict that predicts what the RTC will read at a time given by the --date option. This is useful for example if you need to setup an RTC wakeup time to distant future and want to account for the RTC drift. Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-23blkid: cleanup man pageKarel Zak1-18/+17
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-23docs: update TODO fileKarel Zak1-4/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-23blkid: add -n <list> optionKarel Zak2-6/+88
This option allows to restrict low-level probing to the defined list of superbocks (filesystems or RAIDs). For example: blkid -p -n ext3,ext4,vfat /dev/sda1 or blkid -p -n novfat /dev/sda1 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-22blkid: cleanup -u <list> parsingKarel Zak1-18/+27
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-19fdisk: fix -b <sectorsize>Karel Zak2-7/+15
The old fdisk (<2.17) does not differentiate between logical and physical sector size, it uses the <sectorsize> for everything. Now, we have logical and physical sectors size, but the -b option changes the logical size only. The second bug is that "fdisk -b <sz>" does not read topology information (it means that all I/O limits and physical sector size are 512 (default). The backwardly compatible bug fix is to override both sizes, logical and physical if "-b" is used. In future we can add a special option for physical size only. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-19docs: update TODO fileKarel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-17libblkid: add microsecond resolution for cache entriesKarel Zak6-16/+51
The libblkid library uses stat.st_mtine to detect changes on the device. The last update time of of the device in the cache is stored as TIME= tag in the /etc/blkid.tab file. Linux since 2.5.48 supports nanosecond resolution and more precise time is available in the stat.st_mtim timespec struct. This patch add microsecond precision to TIME= tag in the cache file, old format: TIME="<sec>" the new format: TIME="<sec>.<usec>" This change is backwardly compatible. Now, the blkid_verify() function checks stat.st_mtime and stat.st_mtim.tv_nsec/1000. Test: # e2label /dev/sdb1 AAAA old version: # blkid -s LABEL /dev/sdb1; e2label /dev/sdb1 BBBB; blkid -s LABEL /dev/sdb1 /dev/sdb1: LABEL="AAAA" /dev/sdb1: LABEL="AAAA" new version: # blkid -s LABEL /dev/sdb1; e2label /dev/sdb1 BBBB; blkid -s LABEL /dev/sdb1 /dev/sdb1: LABEL="AAAA" /dev/sdb1: LABEL="BBBB" Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16lib: fix blkdev_find_size()Karel Zak1-4/+16
echo l | fdisk/fdisk /dev/zero FYI that however now spins forever doing: offset=3074457345618258603) at ../lib/blkdev.c:31 at ../lib/blkdev.c:151 at ../lib/blkdev.c:161 Reported-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16fdisk: correctly truncate and align translated partition namesPádraig Brady2-4/+15
* fdisk/Makefile.am: Depend on the mbsalign module. * fdisk/fdisk.c: Align using mbsalign rather than printf. [kzak@redhat.com: - use size_t for width to fix gcc warning] Reported-by: Makoto Kato <m_kato@ga2.so-net.ne.jp> Signed-off-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16lib: add #ifndef around min() max() macrosKarel Zak1-3/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16cal: factor out and update multibyte alignment codePádraig Brady5-79/+306
* include/mbsalign.h: New module interface * lib/mbsalign.c: Updated implementation synced from coreutils * include/Makefile.am: Add mbsalign.h * misc-utils/Makefile.am: Make cal dependent on mbsalign module * misc-utils/cal.c: Call mbsalign() [kzak@redhat.com: - use min() macro from c.h] Signed-off-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16docs: update TODO fileKarel Zak1-2/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16lib: avoid compilation failure on rawhideJim Meyering1-0/+1
* lib/blkdev.c: Include <sys/stat.h>, for use of S_ISREG.
2010-03-15mount: automatically detect and loop-mount regular filesKarel Zak2-11/+41
This patch allows to automatically create a loop device from a regular file if a filesystem type is not specified, for example: mount /path/disk.img /mnt If the filesystem type is specified than "-o loop" is required. Note that there is not a restriction (on kernel side) that prevents regular file as a mount(2) source argument. A filesystem that is able to mount regular files could be implemented. Based on a patch from Adam Jackson <ajax@redhat.com>. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-15mount: more explicitly explain fstab usage in mount.8Karel Zak1-0/+28
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-15mount: report ambivalent FS detection, improve brute force detectionKarel Zak3-14/+34
The ambivalent probing result should be properly reported and user should be informed that the problem is possible to bypass by "-t <type>" or resolved by wipefs(8). The mount(8) command uses a brute force stage (calls mount(2) for all /{proc,etc}/fylesystems) if there is not any other way how to detect the filesystem type. The brute force stage should not be restricted by libblkid. It's possible that libblkid is not able to detect slightly corrupted filesystem, but kernel is able to mount such filesystem. Note that the brute force stage should not be used if libblkid returns ambivalent probing result. In this case user's intervention is required (e.g. mount -t <type>). Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-15wipefs: cleanup usage() and man pageKarel Zak2-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-14tests: fix whitespacesKarel Zak4-15/+15
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-14ionice: fix typoPierre Hauweele1-1/+1
Signed-off-by: Pierre Hauweele <antegallya@gmail.com>
2010-03-14libblkid: fix infinite loop when probe chain bails out earlyColin Watson2-3/+7
The superblocks probe bails out early with no results in some cases. If this happens, blkid_do_probe needs to go to the next chain, rather than entering an infinite loop calling superblocks_probe over and over again. [kzak@redhat.com: - print debug message always when leaving superblocks_probe()] Addresses: https://bugs.launchpad.net/bugs/528073 Signed-off-by: Colin Watson <cjwatson@canonical.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-11libblkid: remove "0x" prefix from DRBD UUIDKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-11libblkid: improve ZFS detection and add LABEL and UUID extractionAndreas Dilger2-37/+183
Improve ZFS uberblock detection to loop over multiple uberblocks, and detect at least 4 magic values, to avoid random collisions. It doesn't yet probe the VDEV LABEL at the end of the device, though it wouldn't be too hard to add it at this point if needed. Add extraction of the pool name (as LABEL), the VDEV (block device) guid as UUID_SUB, and pool_guid (volume) as UUID from the nvlist in the VDEV LABEL. Do simple sanity checking on the nvlist data values to avoid overflowing the buffer if they are corrupt in any way. [kzak@redhat.com: - use %PRIu64 instead %llu] Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Karel Zak <kzak@redhat.com>