Commit Graph

41 Commits

Author SHA1 Message Date
Dave Reisner
4b929ea03a genfstab: add support for prefix matching
this allows genfstab to used on running systems to generate entries for
newly added mount points.
2018-05-18 17:18:03 -04:00
Dave Reisner
4b781af21f prune relatime option for psuedofs 2017-06-29 08:23:30 -04:00
Dave Reisner
daa2fac5b2 genfstab: canonicalize root dir
Avoids problems with users passing weird inputs (such as including a
trailing slash).

ref: https://bugs.archlinux.org/task/45753
2016-06-12 10:48:26 -04:00
Dave Reisner
ae6a0a00ec genfstab: strip seclabel from optstring
People seem to suffer from this, so let's just fix it.

https://www.marshut.net/krqsrn/genfstab-fstab-seclabel-uuid-vs-partuuid-and-arch-wiki.html
https://bbs.archlinux.org/viewtopic.php?pid=1360580
2014-12-26 12:04:05 -05:00
Dave Reisner
67dcb08f4b genfstab: make -p default behavior, add -P as inverse
This should be the default, as you generally don't want to include
pseudofs mounts in your /etc/fstab.
2014-12-26 11:54:24 -05:00
Dave Reisner
f726f8c22c genfstab: add vfat quirk 2014-04-06 10:48:15 -04:00
Dave Reisner
03121cb504 genfstab: add option quirks for f2fs
FS#38019.
2014-04-06 10:48:15 -04:00
Dave Reisner
756e831bd5 genfstab: mangle tag values when needed 2013-12-08 22:42:49 -05:00
Dave Reisner
a93aab3f43 genfstab: fix deleted file parsing
backslashes in single quotes don't need escaping. We need to match the
literal string \040deleted.
2013-12-08 22:42:49 -05:00
Dave Reisner
1f2a6b9b71 genfstab: check sooner for pseudofs types 2013-07-14 12:24:34 -04:00
Dave Reisner
026f54428d genfstab: remove obsolete check for overlapping modes
1f03775f4f introduced arbitrary tag identification which removed the
variables this conditional checks.
2013-07-14 12:21:41 -04:00
Dave Reisner
c6af176666 genfstab: be more careful about assigning passno 2013-05-26 11:41:53 -04:00
Dave Reisner
56e438869c genfstab: prefer lsblk over blkid
lsblk has a far nicer interface and is capable of doing its work
without the need for extra privileges to read superblocks (assuming
udev is behaving properly).
2013-05-23 13:23:48 -04:00
Dave Reisner
99e6b07ab3 genfstab: derive the real type of fuseblk filesystems 2013-05-02 14:09:52 -04:00
Dave Reisner
e4b4e30213 genfstab: correctly specify bind as option
'bind' is an option, not an fstype. In the case of a bind mount, the
fstype is ignored.
2012-12-09 14:05:41 -05:00
Dave Reisner
2179b43b0f genfstab: skip deleted swap files 2012-12-09 13:59:27 -05:00
Dave Reisner
d7624977d3 genfstab: fix typo in comment 2012-11-24 12:38:18 -05:00
Dave Reisner
326e62284c genfstab: trim leading slash from btrfs subvol 2012-11-14 19:38:27 -05:00
Dave Reisner
04c137cfae genfstab: fix root passno assignment
leverage findmnt to match the source device to the root partition. I
wonder how long until btrfs invalidates this approach.
2012-11-14 19:36:13 -05:00
Dave Reisner
cf84170321 add the -h option to the usage 2012-11-12 21:00:09 -05:00
Dave Reisner
5897694194 genfstab: always upcase the requested tag
lowercase tags do not exist, so case shouldn't be a user-facing concern.
2012-11-11 23:45:49 -05:00
Dave Reisner
73016da72f genfstab: avoid re-printing kernel name
Without a specified tag, the devnode should not be printed.
2012-11-11 23:43:51 -05:00
Dave Reisner
e62b6bb560 genfstab: remove dead code
This shouldn't have been added with the previous patch.
2012-11-11 17:31:26 -05:00
Dave Reisner
1f03775f4f genfstab: allow identification by arbitrary tag
Add a -t option which accepts an arbitrary tag to lookup for source
device identification. If the lookup fails, fallback on the kernel
naming. With this change, -L and -U become synonyms for -t LABEL and
-t UUID, respectively.
2012-11-11 17:27:41 -05:00
Dave Reisner
3a7eb157d1 genfstab: provide DM names for swap
We're kind enough to provide DM names for non-swap devices, but simply
use the /dev/dm-X nodes for swap, since that's what /proc/swaps provides
us with. Resolve the DM name out of sysfs and use this instead.

Fixes FS#32609.
2012-11-11 17:04:14 -05:00
Dave Reisner
65b689bda9 genfstab: specify proper grammar in usage
bash getopts stops parsing options at the first non-option argument.
Rather than import some overblown option parser such as the one used in
makepkg or mkinitcpio, just correct the usage.

FS#31862.
2012-10-09 12:06:48 -04:00
Dave Reisner
4f3ef5bfa7 genfstab: ignore suspected bind mounts from the host 2012-10-03 22:46:39 -04:00
Dave Reisner
108735a148 genfstab: use findmnt FSROOT column
I added this for util-linux 2.22 so I could avoid parsing out the
subvolume from the target. Might as well make use of it.
2012-10-02 22:17:16 -04:00
Dave Reisner
e5790dd5e9 genfstab: fix invalid paths when run against / 2012-10-02 22:17:16 -04:00
Dave Reisner
09772d0f38 genfstab: use a more innocuous name than 'source' 2012-08-08 23:15:57 -04:00
Dave Reisner
c8b3d5e8d8 genfstab: handle btrfs subvolumes correctly 2012-08-08 23:12:27 -04:00
Dave Reisner
2dda000a86 genfstab: avoid mangling root parameter 2012-07-22 20:16:09 -04:00
Dave Reisner
b7c75786b0 genfstab: avoid reference to uninitialized var
Rename this, too, so it doesn't share a name with a reserved word.

Fixes FS#30808
2012-07-22 20:11:54 -04:00
Dave Reisner
1d9c98c5ee enforce user-specified root directory
Remove the -r option, forcing the user to explicitly pass a root
directory. This removes some confusion wherein we set defaults, but
wouldn't allow all the defaults to be accepted.

This also adds some mild documentation to the help output for genfstab
and pacstrap.
2012-07-15 10:07:11 -04:00
Dave Reisner
0537563148 use blkid for uuid/label instead of lsblk
This works around something that seems might be a bug in lsblk where-in
detection of UUIDs fails for certain devices when invoked as non-root.
2012-06-22 20:28:37 -04:00
Dave Reisner
60f20d8fc4 avoid fsck'ing bind mounts 2012-06-18 14:25:01 -04:00
Dave Reisner
a50ee5ee9d genfstab: treat swap devices the same as block devices
avoid using %b to unescape swap devices, the same as block devices, and
pass non-file swap devices through the write_source function.
2012-06-18 14:07:51 -04:00
Dave Reisner
120d233639 properly error on options missing an optarg 2012-06-18 11:02:40 -04:00
Dave Reisner
808f744802 genfstab: add flag to skip pseudofs mounts 2012-06-18 11:02:40 -04:00
Dave Reisner
b61c8cb366 move mangle to common, add unmangle, use in genfstab
The %b formatter is too generic for us to use, as a sequence such as
'\b' is invalid for hex escaping, but valid for %b. Port over the logic
from util-linux's mangle mini-lib and use this instead. This supports
both 3 digits hex as well as 3 digit octal escapes, and will ignore the
more generic ascii based single character escapes. Output is always in
octal format to comply with fstab(5).
2012-06-18 10:50:52 -04:00
Pierre Schmitz
6fcfe3b268 Create a project Makefile
* the Makefile uses m4 to build the common lib into the scripts
* it includes install, uninstall and clean targets
* the dist target creates a source tar from a tag

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-18 11:17:42 +02:00