summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libmount: fix support of comma-separated fs types listsGleb Fotengauer-Malinovskiy2012-11-162-7/+13
| | | | | | | | | | | | | | | | # grep cdrom /etc/fstab /dev/sr0 /media/cdrom udf,iso9660 ro,noauto,user,utf8 0 0 # mount /media/cdrom mount: unknown filesystem type 'udf,iso9660' # mount -t udf,iso9660 /dev/sr0 /media/cdrom mount: /dev/sr0 is write-protected, mounting read-only [kzak@redhat.com: - add some comments - don't try to found external helpers for the types] Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: (recursive) don't call umount(2) for already unmounted targetsKarel Zak2012-11-152-12/+40
| | | | | | | | | In the umount --recursive we follow entries from mountinfo, but the entries maybe already obsolete. Especially if the hierarchy of the mountpoints contains shared subtrees and umount(2) for one entry may generate umount for some other entry too. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add shared subtrees to umount --recursive testKarel Zak2012-11-152-1/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't reset NOSWAPMATCH context flagKarel Zak2012-11-151-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't try to play with loopdevs if umount argument is really ↵Karel Zak2012-11-151-3/+6
| | | | | | mountpoint Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: more robust tab filter usageKarel Zak2012-11-152-2/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add umount --recursive testKarel Zak2012-11-152-0/+102
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: clean --recursiveKarel Zak2012-11-151-0/+17
| | | | | | | - mark some options combinations mutually exclusive - reset libmount context before next umount (this is important!) Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove obsolete tags from cacheKarel Zak2012-11-142-1/+21
| | | | | | | | | | | | | | | | | The libblkid cache tags are not removed if a new version of the tags is empty (e.g. label 'foo' -> ''). # mkfs.ext4 -L test_label /dev/sda15 # blkid /dev/sda15 /dev/sda15: LABEL="test_label" # tune2fs -L '' /dev/sda15 # blkid /dev/sda15 /dev/sda15: LABEL="test_label" ^^^^^^^^^^ Reported-by: Mike Fleetwood <mike.fleetwood@googlemail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: gpt: check header sizeDavidlohr Bueso2012-11-141-1/+8
| | | | | | | UEFI states that the size of the GPT header must be between 92 and the sector size. Add the check when verifying a valid header. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* fdisk: don't offer GPT stuff in BSD menuKarel Zak2012-11-131-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: allways return MOUNT_EX_*Karel Zak2012-11-131-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: add -R, --recursive optionDave Reisner2012-11-132-4/+85
| | | | | | | | | | | This allows unmounting of an entire tree of filesystems, which might be of particular interest for a shutdown initramfs. [kzak@redhat.com: - always return MOUNT_EX_* codes - cosmetic changes on coding style] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: make read_topology() more robust to avoid SIGFPEKarel Zak2012-11-131-6/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add armv7 lscpu dumpKarel Zak2012-11-122-0/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add ppc64-POWER7-64cpu lscpu dumpKarel Zak2012-11-122-0/+80
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove lscpu /sys dumps without 'possible' CPU maskKarel Zak2012-11-1215-0/+0
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: Fix issue found on CPU hot-removeToshi Kani2012-11-121-22/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read_basicinfo() relies on sysfs cpu directories "/sys/devices/system/cpu/cpu%d" with assumption that cpu logical number %d is always sequentially assigned for all CPUs. However, this assumption is not correct with CPU hot-remove operation since it removes a target sysfs cpu directory after it is ejected. As a result, lscpu may not recognize all CPUs. The issue can be easily reproduced on KVM or VirtualBox, which supports CPU eject operation, as follows. 1) The system has 4 CPUs $ lscpu -a -e CPU NODE SOCKET CORE L1d:L1i:L2 ONLINE 0 0 0 0 0:0:0 yes 1 0 1 1 1:1:1 yes 2 0 2 2 2:2:2 yes 3 0 3 3 3:3:3 yes 2) Eject cpu2 # echo 1 > /sys/bus/acpi/devices/LNXCPU:02/eject 3) lscpu no longer recognizes cpu3 after cpu2 is ejected $ lscpu -a -e CPU NODE SOCKET CORE L1d:L1i:L2 ONLINE 0 0 0 0 0:0:0 yes 1 0 1 1 1:1:1 yes The following changes are made to address this issue. - Use maxcpus to allocate and parse bitmaps. - Set desc->ncpu from cpu/present, which includes both on-line and off-line CPUs. - Add is_cpu_present() to check if a CPU is present. Ejected CPUs are not present. [kzak@redhat.com: - read also /sys/devices/system/cpu/possible mask to determine maximal number of CPUs, - err() if possible mask is not found in /sys] Signed-off-by: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: allow to use -O without --listKarel Zak2012-11-121-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: rename SIZE->SIZELIMITKarel Zak2012-11-121-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: mark old losetup output format as DEPRECATEDKarel Zak2012-11-123-7/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: add --list and --output optionOndrej Oprala2012-11-122-11/+261
| | | | | | | | | | | | | | | | The --list --all is the default output: # losetup NAME SIZE OFFSET AUTOCLEAR RO BACK-FILE /dev/loop0 0 0 0 0 /home/fs-images/swap.img /dev/loop1 0 100 0 0 /home/fs-images/disk.img [kzak@redhat.com: - default to --all if no device specified, - cleanup column names (add BACK- prefix) - add MAJ:MIN to of the loopdev device] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: make loopcxt_get_device() more robustKarel Zak2012-11-121-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/console: fix possible fd leakKarel Zak2012-11-091-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: try another methods before go to fallbackKarel Zak2012-11-091-10/+4Star
| | | | | | | | The current code goes immediately to the fallback section if any detection method fails. It seems better to try another methods before the fallback solution. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: add debug messagesKarel Zak2012-11-091-8/+59
| | | | | | - may be enabled by CONSOLES_DEBUG env. variable Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: TIOCGDEV code refactoringKarel Zak2012-11-091-42/+67
| | | | | | | - add missing scandev() otherwise TIOCGDEV make no sense - use this method independent on /proc/cmdline code Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: cmdline code refactoringKarel Zak2012-11-091-72/+91
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: sysfs code refactoringKarel Zak2012-11-091-37/+64
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: /proc/consoles code refactoringKarel Zak2012-11-091-27/+55
| | | | | | | | - move to separate function - cleanup code - fix fscanf() usage to avoid buffer overflow Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: small cleanupKarel Zak2012-11-091-9/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: don't call perror()Karel Zak2012-11-091-11/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: add test programKarel Zak2012-11-092-0/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: remove global variable consolesKarel Zak2012-11-092-21/+20Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consolas: remove global variable concount, fix linked listKarel Zak2012-11-091-7/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: remove global variable initcpKarel Zak2012-11-081-7/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: remove global variable comparedevKarel Zak2012-11-081-8/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: minor clean upsKarel Zak2012-11-081-45/+41Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/consoles: add code to detect all system consolesWerner Fink2012-11-084-0/+558
| | | | Signed-off-by: Werner Fink <werner@suse.de>
* script: do not try to close stderr twiceSami Kerola2012-11-081-3/+5
| | | | | | | | | | | | | | | The commit cdd2a8c360c70d16804ace7cc923a6c6bb7c9ca9 broke script(1) return value. $ script -e -c "echo"; echo $? 1 The reason, as Daniel it reported, was that the script will close stderr twice, once as timing file and atexit() in function close_stdout(). This commit fixes the problem. Reported-by: Daniel Narvaez <dwnarvaez@gmail.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: convert /dev/root from mountinfo to the device nameKarel Zak2012-11-081-5/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add private mnt_get_kernel_cmdline_option()Karel Zak2012-11-086-0/+111
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update TODO fileKarel Zak2012-11-071-5/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: fix "COMMAND not specified" errorKarel Zak2012-11-071-10/+19
| | | | | | | | | | # su su: COMMAND not specified This error message make sense for "runuser -u <user> <command>" only. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=872787 Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: fix and update man page about --scsiKarel Zak2012-11-071-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add TRANsport to --scsi outputKarel Zak2012-11-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: don't ignore disk deviceKarel Zak2012-11-071-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: Add --scsi switchMilan Broz2012-11-072-3/+22
| | | | | | The --scsi switch prints similar information to lsscsi command. Signed-off-by: Milan Broz <mbroz@redhat.com>
* lsblk: Add vendor columnMilan Broz2012-11-071-0/+9
| | | | Signed-off-by: Milan Broz <mbroz@redhat.com>
* lsblk: Add revision columnMilan Broz2012-11-071-0/+9
| | | | Signed-off-by: Milan Broz <mbroz@redhat.com>