/[gentoo-x86]/eclass/mount-boot.eclass
Gentoo

Diff of /eclass/mount-boot.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.16
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v 1.15 2008/11/27 18:36:29 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v 1.16 2009/02/27 01:53:34 vapier Exp $
4# 4#
5# This eclass is really only useful for bootloaders. 5# This eclass is really only useful for bootloaders.
6# 6#
7# If the live system has a separate /boot partition configured, then this 7# If the live system has a separate /boot partition configured, then this
8# function tries to ensure that it's mounted in rw mode, exiting with an 8# function tries to ensure that it's mounted in rw mode, exiting with an
23 fi 23 fi
24 24
25 # note that /dev/BOOT is in the Gentoo default /etc/fstab file 25 # note that /dev/BOOT is in the Gentoo default /etc/fstab file
26 local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) 26 local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" )
27 local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) 27 local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts)
28 local proc_ro=$(awk '{ print $2, $4 }' /proc/mounts | sed -n '/\/boot/{ /[ ,]\?ro[ ,]\?/p }' ) 28 local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/\/boot .*,ro,/p')
29 29
30 if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then 30 if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then
31 if [ -n "${proc_ro}" ]; then 31 if [ -n "${proc_ro}" ]; then
32 einfo 32 einfo
33 einfo "Your boot partition, detected as being mounted as /boot, is read-only." 33 einfo "Your boot partition, detected as being mounted as /boot, is read-only."

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20