#!/bin/sh # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: target/idunn/initramfs/etc_rc.d_rc.trymount.sh # Copyright (C) 2008 - 2009 The OpenSDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- . /etc/conf/idunn if [ "x$1" = "x-v" ]; then verbose=yes else verbose= fi if grep -q "^[^ ]* $rootfs " /proc/mounts; then # alredy mounted error=0 elif [ -n "$root" ]; then . /etc/rc.d/functions.in root_type= root_tag= root_options="$root_mode" case "$root_method" in nfs) root_type="$root_method" root_options="$root_options,nolock,intr,tcp" ;; find) # UUID= or LABEL= root_tag="$root" root=$(blkid -l -o device -t "$root_tag") [ -z "$root" ] || root_type=$(blkid -l -o value -t TYPE "$root") [ -z "$root_type" ] || root_tag="$root_tag, $root_type" ;; device) root_type=$(blkid -l -o value -t TYPE "$root") ;; esac if [ -z "$root" ]; then title "Mounting $root_tag at $rootfs." elif [ -z "$root_tag" ]; then title "Mounting $root ($root_type) at $rootfs." else title "Mounting $root ($root_tag) at $rootfs." fi if [ -n "$root_type" ]; then modprobe -q "$root_type" check mount -t "$root_type" -o "$root_options" "$root" "$rootfs" else check false fi status else [ -z "$verbose" ] || cat <<-EOT >&2 sorry, root device not specified. mount it at $rootfs and try again EOT error=1 fi exit ${error:-0}