summaryrefslogtreecommitdiffstats
path: root/src/inspect_fs_unix.c
Commit message (Collapse)AuthorAgeFilesLines
* inspection: Don't fail if /etc/HOSTNAME or /etc/hostname are empty files ↵Richard W.M. Jones2012-06-011-2/+18
| | | | | | | | | | | | | | | | | | | (RHBZ#823821). Change guestfs___first_line_of_file so that if the file is empty this returns an empty string instead of an error. This is consistent with the behaviour of this function in the case where the file starts with a \n character, where it would previously have returned an empty string. Change all callers so that they handle this case. Then change the hostname parsing code so that it doesn't give up when /etc/HOSTNAME is empty, but falls through to the next alternative, and similarly for /etc/hostname. Thanks Todd Mummert for finding and diagnosing this bug. (cherry picked from commit f00066d22b11bf40d0272f68565a2a27fea15627)
* inspection: Use parse_release_file to parse ttylinux release file.Richard W.M. Jones2012-06-011-2/+1
| | | | | | | | | | parse_release_file should be used to set fs->product_name, instead of calling guestfs___first_line_of_file directory, although currently the two are equivalent. This is code motion and fixes commit b648b1813fc8e55db790435b5414d9be3ec765d2. (cherry picked from commit cffb7fefc88a317f957785f6448fb24183c8c629)
* Don't abort inspection if mdadm.conf ARRAY doesn't have a uuidMatthew Booth2012-04-241-1/+1
| | | | (cherry picked from commit 4542401fee7a141204baea98dcdc9fa557878f85)
* inspection: Remove spurious warning for Ubuntu 10.04 with encrypted swap ↵Richard W.M. Jones2012-04-131-1/+1
| | | | | | (RHBZ#811872). (cherry picked from commit 96b6504b09461aeb6850bb2e7b870a0a4c2f5edf)
* Don't provoke -Wstrict-overflow warning from map_app_md_devices function.Richard Jones2012-03-301-2/+2
| | | | | Unclear if this is a real bug or not. (cherry picked from commit 3d174b39bff6118bca3068c20ff874924cbfa1fd)
* Work around -Wstrict-overflow warning on gcc 4.5.1.Richard Jones2012-03-301-1/+5
| | | | (cherry picked from commit f2fae5151f33e933f4d574dc4324b7a8a2ee393c)
* Fix strict-overflow bugs and reenable this warning.Richard W.M. Jones2012-03-131-3/+3
| | | | | | | | | In two places, we were counting things in an array using an 'int'. In theory, the int could overflow, so gcc determines this to be undefined behaviour. The fix is to use size_t or ssize_t instead. (cherry picked from commit d66dd2260c724bdfe57a8595aac37c8e9173cee5)
* inspect: Move variable decl to top of function.Richard W.M. Jones2012-03-131-1/+3
| | | | (cherry picked from commit 46d1280100b025de2a448331306e794d688748bd)
* lib: Remove some unused variables.Richard W.M. Jones2012-03-131-4/+0
| | | | (cherry picked from commit cd3f2986eee8dbadc8253d4c3462f7e214f1236d)
* Tempus fugit.Richard W.M. Jones2012-01-181-1/+1
| | | | Update all copyright dates to 2012.
* inspection: Handle MD devices in fstabMatthew Booth2011-12-021-7/+323
| | | | | | | | | This patch fixes inspection when fstab contains devices md devices specified as /dev/mdN. The appliance creates these devices without reference to the guest's mdadm.conf so, for e.g. /dev/md0 in the guest will often be created as /dev/md127 in the appliance. With this patch, we match the uuids of detected md devices against uuids specified in mdadm.conf, and map them appropriately when we encounter them in fstab.
* inspection: Cleanup iteration over fstab entries in inspect_fs_unix.cMatthew Booth2011-11-291-28/+24
| | | | | | | | | | | | | | Select non-comment labels using an augeas path to return the correct nodes in the first instance, rather than applying a regular expression to all results. There is no functional change to the code. RWMJ: - Rebased to current HEAD. - Move variable decls to top of function. - Some whitespace changes. - Remove check for errors from snprintf since it can never happen.
* inspection: Add outline support for GNU/Hurd.Richard W.M. Jones2011-11-281-0/+36
|
* NFC: Allow multiple config files in inspect_with_augeas in inspect_fs_unix.cMatthew Booth2011-11-241-19/+59
| | | | This change is in support of the addition of MD support to fstab inspection.
* NFC: Consolidate the error path in check_fstab in inspect_fs_unix.cMatthew Booth2011-11-241-14/+9
|
* inspect: Handle cciss devices in /etc/fstabMatthew Booth2011-10-191-0/+32
|
* inspect: Add drive naming hintsMatthew Booth2011-10-191-19/+36
| | | | | | | | | | | We currently use a heuristic to guess how drive names we find referenced in the guest map to drive names in the appliance. If this heuristic fails it can cause inspection to fail. This change adds a new 'name' option to add_drive_opts, which allows the user to explicitly pass the name of a drive to libguestfs if it is known. This change also updates the fstab-parsing inspection code to use this information if it is available.
* NFC: Remove unnecessary gotoMatthew Booth2011-10-191-7/+5
|
* inspect: Fix fstab device mapping for >26 disksMatthew Booth2011-10-191-20/+31
| | | | | The regular expression matching disk name assumed that there was only a single letter suffix. This change handles a naming scheme for any number of disks.
* Add basic support for netbsd detection.Michael Scherer2011-10-141-0/+46
|
* Add Opensuse and zypper detection supportMichael Scherer2011-10-141-0/+10
| | | | This would also erronously detect SLES as Opensuse.
* Detect Mageia distributionMichael Scherer2011-10-141-0/+5
|
* inspection: Handle /dev/root in /etc/fstab.Richard W.M. Jones2011-09-161-0/+3
| | | | | | | This means "the device that holds /etc/fstab", so map it correctly. This fixes support for ttylinux and also some other guests that use /dev/root instead of a real device name.
* inspection: Add support for ttylinux (a minimal Linux).Richard W.M. Jones2011-09-161-0/+10
|
* Don't fail if HOSTNAME field is missing on Red Hat guests (RHBZ#726739).Richard W.M. Jones2011-07-291-3/+10
|
* Require PCRE library.Richard W.M. Jones2011-07-251-4/+2
| | | | This library is widely available in distros.
* inspect: "centos" and "scientificlinux" are now separate distros.Richard W.M. Jones2011-04-211-3/+71
| | | | Previously we returned "rhel" for these, which was not accurate.
* inspect: Split code into separate files.Richard W.M. Jones2011-04-141-0/+785
The src/inspect.c file had grown rather large -- 3,500 lines. Split it across several files according to function. This is just moving code. After the split the files are more evenly divided: 536 src/inspect_apps.c 766 src/inspect.c 537 src/inspect_fs.c 404 src/inspect_fs_cd.c 785 src/inspect_fs_unix.c 535 src/inspect_fs_windows.c 3563 total