41 # print_info(debuglevel, print [, newline [, prefixline [, forcefile ] ] ])
50 if [ "$#" -lt '2' ] ; then return 1; fi
52 # IF 3 OR MORE ARGS, CHECK IF WE WANT A NEWLINE AFTER PRINT
63 # IF 4 OR MORE ARGS, CHECK IF WE WANT TO PREFIX WITH A *
74 # IF 5 OR MORE ARGS, CHECK IF WE WANT TO FORCE OUTPUT TO DEBUG
75 # FILE EVEN IF IT DOESN'T MEET THE MINIMUM DEBUG REQS
86 # PRINT TO SCREEN ONLY IF PASSED DEBUGLEVEL IS HIGHER THAN
87 # OR EQUAL TO SET DEBUG LEVEL
88 if [ "$1" -lt "${DEBUGLEVEL}" -o "$1" -eq "${DEBUGLEVEL}" ]
93 # RETURN IF NOT OUTPUTTING ANYWHERE
94 if [ "${SCRPRINT}" != '1' -a "${FORCEFILE}" != '1' ]
99 # STRUCTURE DATA TO BE OUTPUT TO SCREEN, AND OUTPUT IT
100 if [ "${SCRPRINT}" -eq '1' ]
102 if [ "${PREFIXLINE}" = '1' ]
104 STR="${GOOD}*${NORMAL} ${2}"
109 if [ "${NEWLINE}" = '0' ]
117 # STRUCTURE DATA TO BE OUTPUT TO FILE, AND OUTPUT IT
118 if [ "${SCRPRINT}" -eq '1' -o "${FORCEFILE}" -eq '1' ]
121 STRR=${STRR//${BAD}/}
122 STRR=${STRR//${BOLD}/}
123 STRR=${STRR//${NORMAL}/}
125 if [ "${PREFIXLINE}" = '1' ]
132 if [ "${NEWLINE}" = '0' ]
134 echo -ne "${STR}" >> ${DEBUGFILE}
136 echo "${STR}" >> ${DEBUGFILE}
145 GOOD=${BAD} print_info "$@"
150 GOOD=${WARN} print_info "$@"
153 # var_replace(var_name, var_value, string)
155 # $2 = variable value
160 echo "${3}" | sed -e "s/%%${1}%%/${2}/g" -
164 var_replace "ARCH" "${ARCH}" "${1}"
175 print_error 1 "ERROR: ${1}"
178 print_info 1 "-- Grepping log... --"
181 if isTrue ${USECOLOR}
183 GREP_COLOR='1' grep -B5 -E --colour=always "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE}
185 grep -B5 -E "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE}
188 print_info 1 "-- End log... --"
190 print_info 1 "Please consult ${DEBUGFILE} for more information and any"
191 print_info 1 "errors that were reported above."
193 print_info 1 "Report any genkernel bugs to bugs.gentoo.org and"
194 print_info 1 "assign your bug to genkernel@gentoo.org. Please include"
195 print_info 1 "as much information as you can in your bug report; attaching"
196 print_info 1 "${DEBUGFILE} so that your issue can be dealt with effectively."
198 print_info 1 'Please do *not* report compilation failures as genkernel bugs!'
204 dmesg | egrep -q '^loop:'
205 if [ -e '/dev/loop0' -o -e '/dev/loop/0' -a $? ]
207 # We found devfs or standard dev loop device, assume
208 # loop is compiled into the kernel or the module is loaded
217 for mo in `grep ' /boot ' /proc/mounts | cut -d ' ' -f 4 | sed -e 's/,/ /'`
219 if [ "x${mo}x" == "xrox" ]