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

Contents of /eclass/mount-boot.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Sep 20 18:38:22 2002 UTC (11 years, 10 months ago) by woodchip
Branch: MAIN
#7903 in progress...

1 woodchip 1.1 # Copyright 1999-2000 Gentoo Technologies, Inc.
2     # Distributed under the terms of the GNU General Public License, v2 or later
3     # $Header: $
4    
5     ECLASS=boot
6     INHERITED="$INHERITED $ECLASS"
7    
8     boot_pkg_setup(){
9    
10     [ "${ROOT}" != "/" ] && return 0
11    
12     local fstabstate="$(cat /etc/fstab | awk '!/^#|^[[:blank:]]+#/ {print $2}' | egrep "/boot" )"
13     local procstate="$(cat /proc/mounts | awk '{print $2}' | egrep "/boot" )"
14    
15     if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then
16     if [ -n "`cat /proc/mounts | awk '{ print $2, $4 }' | sed -n '/\/boot/{ /[ ,]ro/p }'`" ]; then
17     einfo "Your boot partition, detected as being mounted as /boot, is read-only"
18     einfo "Remounting it in read-write mode"
19     sleep 1; echo -ne "\a"; sleep 1; echo -ne "\a"
20     mount -o remount,rw /boot &>/dev/null
21     if [ "$?" -ne 0 ]; then
22     eerror; eerror "Unable to remount in rw mode. Please do it manually" ; eerror
23     sleep 1; echo -ne "\a"; sleep 1; echo -ne "\a"
24     die "Can't remount in rw mode. Please do it manually"
25     fi
26     else
27     echo
28     einfo "Your boot partition was detected as being mounted as /boot."
29     einfo "Files will be installed there for ${PN} to function correctly."
30     sleep 1; echo -ne "\a"; sleep 1; echo -ne "\a"
31     fi
32     elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ]; then
33     mount /boot &>/dev/null
34     if [ "$?" -eq 0 ]; then
35     echo
36     einfo "Your boot partition was not mounted as /boot, but portage was able to mount"
37     einfo "it without additional intervention."
38     einfo "Files will be installed there for ${PN} to function correctly."
39     sleep 1; echo -ne "\a"; sleep 1; echo -ne "\a"
40     else
41     echo
42     eerror "Your boot partition has to be mounted on /boot before the installation"
43     eerror "can continue. ${PN} needs to install important files there."
44     sleep 1; echo -ne "\a"; sleep 1; echo -ne "\a"
45     die "Please mount your /boot partition."
46     fi
47     else
48     echo
49     einfo "Assuming you do not have a separate /boot partition."
50     sleep 1; echo -ne "\a"; sleep 1; echo -e "\a";
51     fi
52     }
53    
54     EXPORT_FUNCTIONS pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20