43 echo "${DEBUGCACHE}" >> ${DEBUGFILE}
46 # print_info(debuglevel, print [, newline [, prefixline [, forcefile ] ] ])
55 if [ "$#" -lt '2' ] ; then return 1; fi
57 # IF 3 OR MORE ARGS, CHECK IF WE WANT A NEWLINE AFTER PRINT
68 # IF 4 OR MORE ARGS, CHECK IF WE WANT TO PREFIX WITH A *
79 # IF 5 OR MORE ARGS, CHECK IF WE WANT TO FORCE OUTPUT TO DEBUG
80 # FILE EVEN IF IT DOESN'T MEET THE MINIMUM DEBUG REQS
91 # PRINT TO SCREEN ONLY IF PASSED DEBUGLEVEL IS HIGHER THAN
92 # OR EQUAL TO SET DEBUG LEVEL
93 if [ "$1" -lt "${DEBUGLEVEL}" -o "$1" -eq "${DEBUGLEVEL}" ]
98 # RETURN IF NOT OUTPUTTING ANYWHERE
99 if [ "${SCRPRINT}" != '1' -a "${FORCEFILE}" != '1' ]
104 # STRUCTURE DATA TO BE OUTPUT TO SCREEN, AND OUTPUT IT
105 if [ "${SCRPRINT}" -eq '1' ]
107 if [ "${PREFIXLINE}" = '1' ]
109 STR="${GOOD}*${NORMAL} ${2}"
114 if [ "${NEWLINE}" = '0' ]
122 # STRUCTURE DATA TO BE OUTPUT TO FILE, AND OUTPUT IT
123 if [ "${SCRPRINT}" -eq '1' -o "${FORCEFILE}" -eq '1' ]
126 STRR=${STRR//${BAD}/}
127 STRR=${STRR//${BOLD}/}
128 STRR=${STRR//${NORMAL}/}
130 if [ "${PREFIXLINE}" = '1' ]
137 if [ "${NEWLINE}" = '0' ]
139 if [ "${TODEBUGCACHE}" -eq 1 ]; then
140 DEBUGCACHE="${DEBUGCACHE}${STR}"
142 echo -ne "${STR}" >> ${DEBUGFILE}
145 if [ "${TODEBUGCACHE}" -eq 1 ]; then
146 DEBUGCACHE="${DEBUGCACHE}${STR}"$'\n'
148 echo "${STR}" >> ${DEBUGFILE}
158 GOOD=${BAD} print_info "$@"
163 GOOD=${WARN} print_info "$@"
166 # var_replace(var_name, var_value, string)
168 # $2 = variable value
173 echo "${3}" | sed -e "s/%%${1}%%/${2}/g" -
177 var_replace "ARCH" "${ARCH}" "${1}"
181 [ -f "${DEBUGFILE}" ] && echo > "${DEBUGFILE}"
189 print_error 1 "ERROR: ${1}"
192 print_info 1 "-- Grepping log... --"
195 if isTrue ${USECOLOR}
197 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}
199 grep -B5 -E "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE}
202 print_info 1 "-- End log... --"
204 print_info 1 "Please consult ${DEBUGFILE} for more information and any"
205 print_info 1 "errors that were reported above."
207 print_info 1 "Report any genkernel bugs to bugs.gentoo.org and"
208 print_info 1 "assign your bug to genkernel@gentoo.org. Please include"
209 print_info 1 "as much information as you can in your bug report; attaching"
210 print_info 1 "${DEBUGFILE} so that your issue can be dealt with effectively."
212 print_info 1 'Please do *not* report compilation failures as genkernel bugs!'
218 dmesg | egrep -q '^loop:'
219 if [ -e '/dev/loop0' -o -e '/dev/loop/0' -a $? ]
221 # We found devfs or standard dev loop device, assume
222 # loop is compiled into the kernel or the module is loaded
231 for mo in `grep ' /boot ' /proc/mounts | cut -d ' ' -f 4 | sed -e 's/,/ /'`
233 if [ "x${mo}x" == "xrox" ]