|
Harald Hoyer |
12f6cc |
From 1f4aaaeb5ea6f083a0130a463bfd60ff91b24ac9 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
12f6cc |
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
|
|
Harald Hoyer |
12f6cc |
Date: Thu, 26 Jul 2012 15:05:27 +0200
|
|
Harald Hoyer |
12f6cc |
Subject: [PATCH] modules.d/99base/mount-hook.sh is not used - removed
|
|
Harald Hoyer |
12f6cc |
|
|
Harald Hoyer |
12f6cc |
---
|
|
Harald Hoyer |
12f6cc |
modules.d/99base/mount-hook.sh | 171 -----------------------------------------
|
|
Harald Hoyer |
12f6cc |
1 file changed, 171 deletions(-)
|
|
Harald Hoyer |
12f6cc |
delete mode 100755 modules.d/99base/mount-hook.sh
|
|
Harald Hoyer |
12f6cc |
|
|
Harald Hoyer |
12f6cc |
diff --git a/modules.d/99base/mount-hook.sh b/modules.d/99base/mount-hook.sh
|
|
Harald Hoyer |
12f6cc |
deleted file mode 100755
|
|
Harald Hoyer |
12f6cc |
index e32ecae..0000000
|
|
Harald Hoyer |
12f6cc |
--- a/modules.d/99base/mount-hook.sh
|
|
Harald Hoyer |
12f6cc |
+++ /dev/null
|
|
Harald Hoyer |
12f6cc |
@@ -1,171 +0,0 @@
|
|
Harald Hoyer |
12f6cc |
-#!/bin/sh
|
|
Harald Hoyer |
12f6cc |
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
Harald Hoyer |
12f6cc |
-# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
|
Harald Hoyer |
12f6cc |
-type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
|
Harald Hoyer |
12f6cc |
-type det_fs >/dev/null 2>&1 || [ -f /lib/fs-lib.sh ] && . /lib/fs-lib.sh
|
|
Harald Hoyer |
12f6cc |
-# If fs-lib is not included use following det_fs replacement.
|
|
Harald Hoyer |
12f6cc |
-type det_fs >/dev/null 2>&1 || det_fs() { echo "${2:-auto}"; }
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-mountpoint="$1"
|
|
Harald Hoyer |
12f6cc |
-ismounted "$mountpoint" && exit 0
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-if [ -f "$NEWROOT"/fastboot ] || getargbool 0 fastboot ; then
|
|
Harald Hoyer |
12f6cc |
- fastboot=yes
|
|
Harald Hoyer |
12f6cc |
-fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-filter_rootopts() {
|
|
Harald Hoyer |
12f6cc |
- rootopts=$1
|
|
Harald Hoyer |
12f6cc |
- # strip ro and rw options
|
|
Harald Hoyer |
12f6cc |
- local OLDIFS="$IFS"
|
|
Harald Hoyer |
12f6cc |
- IFS=,
|
|
Harald Hoyer |
12f6cc |
- set -- $rootopts
|
|
Harald Hoyer |
12f6cc |
- IFS="$OLDIFS"
|
|
Harald Hoyer |
12f6cc |
- local v
|
|
Harald Hoyer |
12f6cc |
- while [ $# -gt 0 ]; do
|
|
Harald Hoyer |
12f6cc |
- case $1 in
|
|
Harald Hoyer |
12f6cc |
- rw|ro);;
|
|
Harald Hoyer |
12f6cc |
- defaults);;
|
|
Harald Hoyer |
12f6cc |
- *)
|
|
Harald Hoyer |
12f6cc |
- v="$v,${1}";;
|
|
Harald Hoyer |
12f6cc |
- esac
|
|
Harald Hoyer |
12f6cc |
- shift
|
|
Harald Hoyer |
12f6cc |
- done
|
|
Harald Hoyer |
12f6cc |
- rootopts=${v#,}
|
|
Harald Hoyer |
12f6cc |
- echo $rootopts
|
|
Harald Hoyer |
12f6cc |
-}
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-mount_root() {
|
|
Harald Hoyer |
12f6cc |
- local _ret
|
|
Harald Hoyer |
12f6cc |
- # sanity - determine/fix fstype
|
|
Harald Hoyer |
12f6cc |
- rootfs=$(det_fs "${root#block:}" "$fstype")
|
|
Harald Hoyer |
12f6cc |
- mount -t ${rootfs} -o "$rflags",ro "${root#block:}" "$NEWROOT"
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- READONLY=
|
|
Harald Hoyer |
12f6cc |
- fsckoptions=
|
|
Harald Hoyer |
12f6cc |
- if [ -f "$NEWROOT"/etc/sysconfig/readonly-root ]; then
|
|
Harald Hoyer |
12f6cc |
- . "$NEWROOT"/etc/sysconfig/readonly-root
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if getargbool 0 "readonlyroot=" -y readonlyroot; then
|
|
Harald Hoyer |
12f6cc |
- READONLY=yes
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if getarg noreadonlyroot ; then
|
|
Harald Hoyer |
12f6cc |
- READONLY=no
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if [ -f "$NEWROOT"/fastboot ] || getargbool 0 fastboot ; then
|
|
Harald Hoyer |
12f6cc |
- fastboot=yes
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if [ -f "$NEWROOT"/fsckoptions ]; then
|
|
Harald Hoyer |
12f6cc |
- fsckoptions=$(cat "$NEWROOT"/fsckoptions)
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck ; then
|
|
Harald Hoyer |
12f6cc |
- fsckoptions="-f $fsckoptions"
|
|
Harald Hoyer |
12f6cc |
- elif [ -f "$NEWROOT"/.autofsck ]; then
|
|
Harald Hoyer |
12f6cc |
- [ -f "$NEWROOT"/etc/sysconfig/autofsck ] && . "$NEWROOT"/etc/sysconfig/autofsck
|
|
Harald Hoyer |
12f6cc |
- if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then
|
|
Harald Hoyer |
12f6cc |
- AUTOFSCK_OPT="$AUTOFSCK_OPT -f"
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
- if [ -n "$AUTOFSCK_SINGLEUSER" ]; then
|
|
Harald Hoyer |
12f6cc |
- warn "*** Warning -- the system did not shut down cleanly. "
|
|
Harald Hoyer |
12f6cc |
- warn "*** Dropping you to a shell; the system will continue"
|
|
Harald Hoyer |
12f6cc |
- warn "*** when you leave the shell."
|
|
Harald Hoyer |
12f6cc |
- emergency_shell
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
- fsckoptions="$AUTOFSCK_OPT $fsckoptions"
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- rootopts=
|
|
Harald Hoyer |
12f6cc |
- if getargbool 1 rd.fstab -d -n rd_NO_FSTAB \
|
|
Harald Hoyer |
12f6cc |
- && ! getarg rootflags \
|
|
Harald Hoyer |
12f6cc |
- && [ -f "$NEWROOT/etc/fstab" ] \
|
|
Harald Hoyer |
12f6cc |
- && ! [ -L "$NEWROOT/etc/fstab" ]; then
|
|
Harald Hoyer |
12f6cc |
- # if $NEWROOT/etc/fstab contains special mount options for
|
|
Harald Hoyer |
12f6cc |
- # the root filesystem,
|
|
Harald Hoyer |
12f6cc |
- # remount it with the proper options
|
|
Harald Hoyer |
12f6cc |
- rootopts="defaults"
|
|
Harald Hoyer |
12f6cc |
- while read dev mp fs opts rest; do
|
|
Harald Hoyer |
12f6cc |
- # skip comments
|
|
Harald Hoyer |
12f6cc |
- [ "${dev%%#*}" != "$dev" ] && continue
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if [ "$mp" = "/" ]; then
|
|
Harald Hoyer |
12f6cc |
- # sanity - determine/fix fstype
|
|
Harald Hoyer |
12f6cc |
- rootfs=$(det_fs "${root#block:}" "$fs")
|
|
Harald Hoyer |
12f6cc |
- rootopts=$opts
|
|
Harald Hoyer |
12f6cc |
- break
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
- done < "$NEWROOT/etc/fstab"
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- rootopts=$(filter_rootopts $rootopts)
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- # we want rootflags (rflags) to take precedence so prepend rootopts to
|
|
Harald Hoyer |
12f6cc |
- # them; rflags is guaranteed to not be empty
|
|
Harald Hoyer |
12f6cc |
- rflags="${rootopts:+"${rootopts},"}${rflags}"
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- umount "$NEWROOT"
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- # backslashes are treated as escape character in fstab
|
|
Harald Hoyer |
12f6cc |
- # esc_root=$(echo ${root#block:} | sed 's,\\,\\\\,g')
|
|
Harald Hoyer |
12f6cc |
- # printf '%s %s %s %s 1 1 \n' "$esc_root" "$NEWROOT" "$rootfs" "$rflags" >/etc/fstab
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
|
|
Harald Hoyer |
12f6cc |
- fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions"
|
|
Harald Hoyer |
12f6cc |
- _ret=$?
|
|
Harald Hoyer |
12f6cc |
- [ $_ret -ne 255 ] && echo $_ret >/run/initramfs/root-fsck
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- info "Remounting ${root#block:} with -o ${rflags}"
|
|
Harald Hoyer |
12f6cc |
- mount -t "$rootfs" -o "$rflags" "${root#block:}" "$NEWROOT" 2>&1 | vinfo
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- [ -f "$NEWROOT"/forcefsck ] && rm -f "$NEWROOT"/forcefsck 2>/dev/null
|
|
Harald Hoyer |
12f6cc |
- [ -f "$NEWROOT"/.autofsck ] && rm -f "$NEWROOT"/.autofsck 2>/dev/null
|
|
Harald Hoyer |
12f6cc |
-}
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-sub_mount_ready() {
|
|
Harald Hoyer |
12f6cc |
- local _dev _mp _rest
|
|
Harald Hoyer |
12f6cc |
- while read _dev _mp _rest; do
|
|
Harald Hoyer |
12f6cc |
- [ "$1" = "$_mp" ] && continue
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
- if [ "${1##$_mp}" != "$1" ]; then
|
|
Harald Hoyer |
12f6cc |
- ismounted "$_mp" || return 1
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
- done < "/etc/fstab"
|
|
Harald Hoyer |
12f6cc |
- return 0
|
|
Harald Hoyer |
12f6cc |
-}
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-if [ "$mountpoint" = "$NEWROOT" ]; then
|
|
Harald Hoyer |
12f6cc |
- mount_root
|
|
Harald Hoyer |
12f6cc |
- exit $?
|
|
Harald Hoyer |
12f6cc |
-fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-while read _dev _mp _fs _opts _rest; do
|
|
Harald Hoyer |
12f6cc |
- if [ "$_mp" = "$mountpoint" ]; then
|
|
Harald Hoyer |
12f6cc |
- _found="1"
|
|
Harald Hoyer |
12f6cc |
- break
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-done < "/etc/fstab"
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-[ "$_found" = "1" ] || exit 1
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-sub_mount_ready "$mountpoint" || exit 1
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-if [ -z "$fastboot" ] && ! strstr "${_opts}" _netdev; then
|
|
Harald Hoyer |
12f6cc |
- # fsck?
|
|
Harald Hoyer |
12f6cc |
- fsck_single "$_dev" "$_fs" "$_opts"
|
|
Harald Hoyer |
12f6cc |
- _ret=$?
|
|
Harald Hoyer |
12f6cc |
- if [ "${mountpoint##$NEWROOT}" != "$mountpoint" ]; then
|
|
Harald Hoyer |
12f6cc |
- echo $_ret >/run/initramfs/${mountpoint##$NEWROOT}-fsck
|
|
Harald Hoyer |
12f6cc |
- fi
|
|
Harald Hoyer |
12f6cc |
-fi
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-info "Mounting $_dev on $mountpoint"
|
|
Harald Hoyer |
12f6cc |
-mount "$mountpoint" 2>&1 | vinfo
|
|
Harald Hoyer |
12f6cc |
-
|
|
Harald Hoyer |
12f6cc |
-ismounted "$mountpoint" || exit 1
|
|
Harald Hoyer |
12f6cc |
-
|