while read _dev _mp _fs _opts _dump _pass _rest; do
[ -z "${_dev%%#*}" ] && continue # Skip comment lines
if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
- fsck_single "$_dev" "$_fs"
+ fsck_single "$_dev" "$_fs" "$_opts"
fi
_fs=$(det_fs "$_dev" "$_fs")
info "Mounting $_dev"
ran_fsck=0
if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
umount "$NEWROOT"
- fsck_single "${root#block:}" "$rootfs" "$fsckoptions"
+ fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions"
_ret=$?
[ $_ret -ne 255 ] && echo $_ret >/run/initramfs/root-fsck
ran_fsck=1
{
local _dev=$1
local _fs=$2
+ local _fsopts=$3
local _fsckoptions
if [ -f "$NEWROOT"/fsckoptions ]; then
_fsckoptions="$AUTOFSCK_OPT $_fsckoptions"
fi
- fsck_single "$_dev" "$_fs" "$_fsckoptions"
+ fsck_single "$_dev" "$_fs" "$_fsopts" "$_fsckoptions"
}
mount_usr()
if [ "x$_usr_found" != "x" ]; then
# we have to mount /usr
if [ "0" != "${_passno:-0}" ]; then
- fsck_usr "$_dev" "$_fs"
+ fsck_usr "$_dev" "$_fs" "$_opts"
else
:
fi
# printf '%s %s %s %s 1 1 \n' "$esc_root" "$NEWROOT" "$rootfs" "$rflags" >/etc/fstab
if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
- fsck_single "${root#block:}" "$rootfs" "$fsckoptions"
+ fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions"
_ret=$?
[ $_ret -ne 255 ] && echo $_ret >/run/initramfs/root-fsck
fi
mkdir -p /tmp/.xfs
info "trying to mount $_dev"
- if mount -t xfs "$_dev" "/tmp/.xfs" >/dev/null 2>&1; then
+ if mount -t xfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.xfs" >/dev/null 2>&1; then
_ret=0
info "xfs: $_dev is clean"
umount "$_dev" >/dev/null 2>&1
mkdir -p /tmp/.btrfs
info "trying to mount $_dev"
- if mount -t btrfs "$_dev" "/tmp/.btrfs" >/dev/null 2>&1; then
+ if mount -t btrfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.btrfs" >/dev/null 2>&1; then
_ret=0
info "btrfs: $_dev is clean"
umount "$_dev" >/dev/null 2>&1
# checks single filesystem, relying on specific "driver"; we don't rely on
# automatic checking based on fstab, so empty one is passed;
-# takes 3 arguments - device, filesystem, additional fsck options;
+# takes 4 arguments - device, filesystem, filesystem options, additional fsck options;
# first 2 arguments are mandatory (fs may be auto or "")
# returns 255 if filesystem wasn't checked at all (e.g. due to lack of
# necessary tools or insufficient options)
local FSTAB_FILE=/etc/fstab.empty
local _dev="$1"
local _fs="${2:-auto}"
- local _fop="$3"
+ local _fsopts="$3"
+ local _fop="$4"
local _drv
[ $# -lt 2 ] && return 255