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

Contents of /eclass/mount-boot.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Sep 30 00:56:44 2002 UTC (12 years ago) by woodchip
Branch: MAIN
Changes since 1.2: +14 -11 lines
fixes from #7903

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

  ViewVC Help
Powered by ViewVC 1.1.20