Lines 187-194
compile_generic() {
Link Here
|
187 |
local RET |
187 |
local RET |
188 |
[ "$#" -lt '2' ] && |
188 |
[ "$#" -lt '2' ] && |
189 |
gen_die 'compile_generic(): improper usage!' |
189 |
gen_die 'compile_generic(): improper usage!' |
|
|
190 |
local target=${1} |
191 |
local argstype=${2} |
190 |
|
192 |
|
191 |
if [ "${2}" = 'kernel' ] || [ "${2}" = 'runtask' ] |
193 |
if [ "${argstype}" = 'kernel' ] || [ "${argstype}" = 'runtask' ] |
192 |
then |
194 |
then |
193 |
export_kernel_args |
195 |
export_kernel_args |
194 |
MAKE=${KERNEL_MAKE} |
196 |
MAKE=${KERNEL_MAKE} |
Lines 197-238
compile_generic() {
Link Here
|
197 |
export_utils_args |
199 |
export_utils_args |
198 |
MAKE=${UTILS_MAKE} |
200 |
MAKE=${UTILS_MAKE} |
199 |
fi |
201 |
fi |
200 |
case "$2" in |
202 |
case "${argstype}" in |
201 |
kernel) ARGS="`compile_kernel_args`" ;; |
203 |
kernel) ARGS="`compile_kernel_args`" ;; |
202 |
utils) ARGS="`compile_utils_args`" ;; |
204 |
utils) ARGS="`compile_utils_args`" ;; |
203 |
*) ARGS="" ;; # includes runtask |
205 |
*) ARGS="" ;; # includes runtask |
204 |
esac |
206 |
esac |
205 |
|
207 |
shift 2 |
|
|
208 |
|
206 |
|
209 |
|
207 |
# the eval usage is needed in the next set of code |
210 |
# the eval usage is needed in the next set of code |
208 |
# as ARGS can contain spaces and quotes, eg: |
211 |
# as ARGS can contain spaces and quotes, eg: |
209 |
# ARGS='CC="ccache gcc"' |
212 |
# ARGS='CC="ccache gcc"' |
210 |
if [ "${2}" == 'runtask' ] |
213 |
if [ "${argstype}" == 'runtask' ] |
211 |
then |
214 |
then |
212 |
print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS/-j?/j1} ${ARGS} ${1}" 1 0 1 |
215 |
print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS/-j?/j1} ${ARGS} ${target} $*" 1 0 1 |
213 |
eval ${MAKE} -s ${MAKEOPTS/-j?/-j1} "${ARGS}" ${1} |
216 |
eval ${MAKE} -s ${MAKEOPTS/-j?/-j1} "${ARGS}" ${target} $* |
214 |
RET=$? |
217 |
RET=$? |
215 |
elif [ "${DEBUGLEVEL}" -gt "1" ] |
218 |
elif [ "${DEBUGLEVEL}" -gt "1" ] |
216 |
then |
219 |
then |
217 |
# Output to stdout and debugfile |
220 |
# Output to stdout and debugfile |
218 |
print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1}" 1 0 1 |
221 |
print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1 |
219 |
eval ${MAKE} ${MAKEOPTS} ${ARGS} ${1} 2>&1 | tee -a ${DEBUGFILE} |
222 |
eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${DEBUGFILE} |
220 |
RET=${PIPESTATUS[0]} |
223 |
RET=${PIPESTATUS[0]} |
221 |
else |
224 |
else |
222 |
# Output to debugfile only |
225 |
# Output to debugfile only |
223 |
print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1}" 1 0 1 |
226 |
print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1} $*" 1 0 1 |
224 |
eval ${MAKE} ${MAKEOPTS} ${ARGS} ${1} >> ${DEBUGFILE} 2>&1 |
227 |
eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${DEBUGFILE} 2>&1 |
225 |
RET=$? |
228 |
RET=$? |
226 |
fi |
229 |
fi |
227 |
[ "${RET}" -ne '0' ] && |
230 |
[ "${RET}" -ne '0' ] && |
228 |
gen_die "Failed to compile the \"${1}\" target..." |
231 |
gen_die "Failed to compile the \"${target}\" target..." |
229 |
|
232 |
|
230 |
unset MAKE |
233 |
unset MAKE |
231 |
unset ARGS |
234 |
unset ARGS |
232 |
if [ "${2}" = 'kernel' ] |
235 |
if [ "${argstype}" = 'kernel' ] |
233 |
then |
236 |
then |
234 |
unset_kernel_args |
237 |
unset_kernel_args |
235 |
elif [ "${2}" = 'utils' ] |
238 |
elif [ "${argstype}" = 'utils' ] |
236 |
then |
239 |
then |
237 |
unset_utils_args |
240 |
unset_utils_args |
238 |
fi |
241 |
fi |
Lines 529-534
compile_dmraid() {
Link Here
|
529 |
fi |
532 |
fi |
530 |
} |
533 |
} |
531 |
|
534 |
|
|
|
535 |
compile_suspend() { |
536 |
[ -f "${SUSPEND_BINCACHE}" ] && return |
537 |
[ -f "${SUSPEND_SRCTAR}" ] || |
538 |
gen_die "Could not find SUSPEND source tarball: ${SUSPEND_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
539 |
cd ${TEMP} |
540 |
rm -rf ${SUSPEND_DIR} > /dev/null |
541 |
/bin/tar -zxpf ${SUSPEND_SRCTAR} || |
542 |
gen_die 'Could not extract SUSPEND source tarball!' |
543 |
[ -d "${SUSPEND_DIR}" ] || |
544 |
gen_die "SUSPEND directory ${DMRAID_DIR} is invalid!" |
545 |
|
546 |
cd "${SUSPEND_DIR}" |
547 |
if [ -f "${GK_SHARE}/pkg/suspend-0.5-Makefile.patch" ] |
548 |
then |
549 |
patch -p1 -i \ |
550 |
${GK_SHARE}/pkg/suspend-0.5-Makefile.patch \ |
551 |
|| gen_die "Failed patching suspend" |
552 |
fi |
553 |
|
554 |
print_info 1 'suspend: >> Compiling...' |
555 |
compile_generic '' utils CC_FLAGS= LD_FLAGS= |
556 |
|
557 |
print_info 1 ' >> Copying to bincache...' |
558 |
mkdir -p "${TEMP}/bincache/etc" |
559 |
mkdir -p "${TEMP}/bincache/sbin" |
560 |
cp -f /etc/suspend.conf "${TEMP}/bincache/etc" || |
561 |
gen_die 'Could not copy suspend.conf' |
562 |
cp -f resume "${TEMP}/bincache/sbin" || |
563 |
gen_die 'Could not copy resume binary' |
564 |
cd "${TEMP}/bincache" |
565 |
/bin/tar -cjf "${SUSPEND_BINCACHE}" * || |
566 |
gen_die 'Could not create suspend binary cache' |
567 |
cd "${TEMP}" |
568 |
rm -rf bincache suspend-0.5 |
569 |
} |
570 |
|
532 |
compile_modutils() { |
571 |
compile_modutils() { |
533 |
# I've disabled dietlibc support for the time being since the |
572 |
# I've disabled dietlibc support for the time being since the |
534 |
# version we use misses a few needed system calls. |
573 |
# version we use misses a few needed system calls. |