Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: mount-boot.eclass
Date: Thu, 30 Jul 2015 07:00:48
Message-Id: 20150730070040.6C580115@oystercatcher.gentoo.org
1 vapier 15/07/30 07:00:40
2
3 Modified: mount-boot.eclass
4 Log:
5 improve the output a bit: do a bit of word smithing, try to make it less spammy with empty lines, and make the mount cases consistent (output message before mounting)
6
7 Revision Changes Path
8 1.20 eclass/mount-boot.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mount-boot.eclass?rev=1.20&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mount-boot.eclass?rev=1.20&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mount-boot.eclass?r1=1.19&r2=1.20
13
14 Index: mount-boot.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v
17 retrieving revision 1.19
18 retrieving revision 1.20
19 diff -u -r1.19 -r1.20
20 --- mount-boot.eclass 30 Jul 2015 06:53:02 -0000 1.19
21 +++ mount-boot.eclass 30 Jul 2015 07:00:40 -0000 1.20
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2015 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v 1.19 2015/07/30 06:53:02 vapier Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v 1.20 2015/07/30 07:00:40 vapier Exp $
27
28 # @ECLASS: mount-boot.eclass
29 # @MAINTAINER:
30 @@ -19,10 +19,8 @@
31 if [[ -n ${DONT_MOUNT_BOOT} ]] ; then
32 return
33 else
34 - elog
35 elog "To avoid automounting and auto(un)installing with /boot,"
36 elog "just export the DONT_MOUNT_BOOT variable."
37 - elog
38 fi
39
40 # note that /dev/BOOT is in the Gentoo default /etc/fstab file
41 @@ -32,45 +30,37 @@
42
43 if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then
44 if [ -n "${proc_ro}" ]; then
45 - einfo
46 - einfo "Your boot partition, detected as being mounted as /boot, is read-only."
47 - einfo "Remounting it in read-write mode ..."
48 - einfo
49 + echo
50 + einfo "Your boot partition, detected as being mounted at /boot, is read-only."
51 + einfo "It will be remounted in read-write mode temporarily."
52 mount -o remount,rw /boot
53 if [ "$?" -ne 0 ]; then
54 - eerror
55 + echo
56 eerror "Unable to remount in rw mode. Please do it manually!"
57 - eerror
58 die "Can't remount in rw mode. Please do it manually!"
59 fi
60 touch /boot/.e.remount
61 else
62 - einfo
63 - einfo "Your boot partition was detected as being mounted as /boot."
64 + echo
65 + einfo "Your boot partition was detected as being mounted at /boot."
66 einfo "Files will be installed there for ${PN} to function correctly."
67 - einfo
68 fi
69 elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ]; then
70 + echo
71 + einfo "Your boot partition was not mounted at /boot, so it will be automounted for you."
72 + einfo "Files will be installed there for ${PN} to function correctly."
73 mount /boot -o rw
74 - if [ "$?" -eq 0 ]; then
75 - einfo
76 - einfo "Your boot partition was not mounted as /boot, but portage"
77 - einfo "was able to mount it without additional intervention."
78 - einfo "Files will be installed there for ${PN} to function correctly."
79 - einfo
80 - else
81 - eerror
82 + if [ "$?" -ne 0 ]; then
83 + echo
84 eerror "Cannot automatically mount your /boot partition."
85 eerror "Your boot partition has to be mounted rw before the installation"
86 eerror "can continue. ${PN} needs to install important files there."
87 - eerror
88 die "Please mount your /boot partition manually!"
89 fi
90 touch /boot/.e.mount
91 else
92 - einfo
93 + echo
94 einfo "Assuming you do not have a separate /boot partition."
95 - einfo
96 fi
97 }
98
99 @@ -90,15 +80,11 @@
100 fi
101
102 if [ -e /boot/.e.remount ] ; then
103 - einfo
104 - einfo "Automatically remounting /boot as ro"
105 - einfo
106 + einfo "Automatically remounting /boot as ro as it was previously."
107 rm -f /boot/.e.remount
108 mount -o remount,ro /boot
109 elif [ -e /boot/.e.mount ] ; then
110 - einfo
111 - einfo "Automatically unmounting /boot"
112 - einfo
113 + einfo "Automatically unmounting /boot as it was previously."
114 rm -f /boot/.e.mount
115 umount /boot
116 fi