mirror of
https://github.com/openbsd/src.git
synced 2026-04-22 21:24:34 +00:00
drop in-line comments repeating munge_fstab() function description
OK afresh1 krw
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/bin/ksh
|
||||
# $OpenBSD: install.sub,v 1.1284 2026/01/17 21:49:39 kn Exp $
|
||||
# $OpenBSD: install.sub,v 1.1285 2026/03/25 21:07:46 kn Exp $
|
||||
#
|
||||
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
|
||||
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
|
||||
@@ -2700,7 +2700,7 @@ start_cgiinfo() {
|
||||
#
|
||||
# In addition,
|
||||
#
|
||||
# 1) mount non-ffs filesystems read only,
|
||||
# 1) mount ffs filesystems read-write and all others read-only,
|
||||
# 2) prepend '/mnt' to all mount points,
|
||||
# 3) delete any trailing '/' from the mount point (e.g. root),
|
||||
#
|
||||
@@ -2709,30 +2709,21 @@ munge_fstab() {
|
||||
local _dev _mp _fstype _opt _rest
|
||||
|
||||
while read _dev _mp _fstype _opt _rest; do
|
||||
# Drop irrelevant lines and filesystems.
|
||||
[[ $_dev == @(/dev/vnd*|\#*) ||
|
||||
$_fstype == nfs ||
|
||||
! -f /sbin/mount_$_fstype ||
|
||||
$_opt == *noauto* ||
|
||||
$_opt == *xx* ]] && continue
|
||||
|
||||
# Change read-only ffs to read-write since we'll potentially
|
||||
# write to these filesystems.
|
||||
# Mount non-ffs filesystems read only.
|
||||
if [[ $_fstype == ffs ]]; then
|
||||
_opt=$(echo $_opt | sed 's/[[:<:]]ro[[:>:]]/rw/')
|
||||
else
|
||||
_opt=$(echo $_opt | sed 's/[[:<:]]rw[[:>:]]/ro/')
|
||||
fi
|
||||
|
||||
# Write fs entry in fstab.
|
||||
# 1) prepend '/mnt' to the mount point.
|
||||
# 2) remove a trailing '/' from the mount point (e.g. root).
|
||||
echo $_dev /mnt${_mp%/} $_fstype $_opt $_rest
|
||||
|
||||
done </tmp/i/fstab >/etc/fstab
|
||||
|
||||
# If no /etc/fstab was created, we have nowhere to $MODE to.
|
||||
if [[ ! -s /etc/fstab ]]; then
|
||||
echo "Unable to create valid /etc/fstab."
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user