/[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.12 Revision 1.13
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2007 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.12 2006/06/15 14:45:59 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v 1.13 2007/05/25 05:04:08 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
10# 10#
11# MAINTAINER: base-system@gentoo.org 11# MAINTAINER: base-system@gentoo.org
12 12
13EXPORT_FUNCTIONS pkg_preinst 13EXPORT_FUNCTIONS pkg_preinst
14 14
15mount-boot_mount_boot_partition(){ 15mount-boot_mount_boot_partition() {
16 if [[ -n ${DONT_MOUNT_BOOT} ]] ; then
17 return
18 else
19 einfo
20 einfo "To avoid automounting and autoinstalling with /boot,"
21 einfo "just export the DONT_MOUNT_BOOT variable."
22 einfo
23 fi
24
16 # 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
17 local fstabstate="$(cat /etc/fstab | awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' | egrep "^/boot$" )" 26 local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" )
18 local procstate="$(cat /proc/mounts | awk '{print $2}' | egrep "^/boot$" )" 27 local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts)
19 local proc_ro="$(cat /proc/mounts | awk '{ print $2, $4 }' | sed -n '/\/boot/{ /[ ,]\?ro[ ,]\?/p }' )" 28 local proc_ro=$(awk '{ print $2, $4 }' /proc/mounts | sed -n '/\/boot/{ /[ ,]\?ro[ ,]\?/p }' )
20 29
21 if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then 30 if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then
22 if [ -n "${proc_ro}" ]; then 31 if [ -n "${proc_ro}" ]; then
23 einfo 32 einfo
24 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."
58 einfo "Assuming you do not have a separate /boot partition." 67 einfo "Assuming you do not have a separate /boot partition."
59 einfo 68 einfo
60 fi 69 fi
61} 70}
62 71
63mount-boot_pkg_preinst(){ 72mount-boot_pkg_preinst() {
64 mount-boot_mount_boot_partition 73 mount-boot_mount_boot_partition
65} 74}

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20