@ -4,17 +4,16 @@ compile_kernel_args()
{
{
local ARGS
local ARGS
ARGS = ""
ARGS = ''
if [ " ${ KERNEL_CC } " != "" ]
if [ " ${ KERNEL_CC } " != '' ]
then
then
ARGS = " CC=\" ${ KERNEL_CC } \" "
ARGS = " CC=\" ${ KERNEL_CC } \" "
fi
fi
if [ " ${ KERNEL_LD } " != "" ]
if [ " ${ KERNEL_LD } " != '' ]
then
then
ARGS = " ${ ARGS } LD=\" ${ KERNEL_LD } \" "
ARGS = " ${ ARGS } LD=\" ${ KERNEL_LD } \" "
fi
fi
if [ " ${ KERNEL_AS } " != '' ]
if [ " ${ KERNEL_AS } " != "" ]
then
then
ARGS = " ${ ARGS } AS=\" ${ KERNEL_AS } \" "
ARGS = " ${ ARGS } AS=\" ${ KERNEL_AS } \" "
fi
fi
@ -26,17 +25,16 @@ compile_utils_args()
{
{
local ARGS
local ARGS
ARGS = ""
ARGS = ''
if [ " ${ UTILS_CC } " != "" ]
if [ " ${ UTILS_CC } " != '' ]
then
then
ARGS = " CC=\" ${ UTILS_CC } \" "
ARGS = " CC=\" ${ UTILS_CC } \" "
fi
fi
if [ " ${ UTILS_LD } " != "" ]
if [ " ${ UTILS_LD } " != '' ]
then
then
ARGS = " ${ ARGS } LD=\" ${ UTILS_LD } \" "
ARGS = " ${ ARGS } LD=\" ${ UTILS_LD } \" "
fi
fi
if [ " ${ UTILS_AS } " != '' ]
if [ " ${ UTILS_AS } " != "" ]
then
then
ARGS = " ${ ARGS } AS=\" ${ UTILS_AS } \" "
ARGS = " ${ ARGS } AS=\" ${ UTILS_AS } \" "
fi
fi
@ -46,15 +44,15 @@ compile_utils_args()
export_utils_args( )
export_utils_args( )
{
{
if [ " ${ UTILS_CC } " != "" ]
if [ " ${ UTILS_CC } " != '' ]
then
then
export CC = " ${ UTILS_CC } "
export CC = " ${ UTILS_CC } "
fi
fi
if [ " ${ UTILS_LD } " != "" ]
if [ " ${ UTILS_LD } " != '' ]
then
then
export LD = " ${ UTILS_LD } "
export LD = " ${ UTILS_LD } "
fi
fi
if [ " ${ UTILS_AS } " != "" ]
if [ " ${ UTILS_AS } " != '' ]
then
then
export AS = " ${ UTILS_AS } "
export AS = " ${ UTILS_AS } "
fi
fi
@ -62,15 +60,15 @@ export_utils_args()
unset_utils_args( )
unset_utils_args( )
{
{
if [ " ${ UTILS_CC } " != "" ]
if [ " ${ UTILS_CC } " != '' ]
then
then
unset CC
unset CC
fi
fi
if [ " ${ UTILS_LD } " != "" ]
if [ " ${ UTILS_LD } " != '' ]
then
then
unset LD
unset LD
fi
fi
if [ " ${ UTILS_AS } " != "" ]
if [ " ${ UTILS_AS } " != '' ]
then
then
unset AS
unset AS
fi
fi
@ -78,15 +76,15 @@ unset_utils_args()
export_kernel_args( )
export_kernel_args( )
{
{
if [ " ${ KERNEL_CC } " != "" ]
if [ " ${ KERNEL_CC } " != '' ]
then
then
export CC = " ${ KERNEL_CC } "
export CC = " ${ KERNEL_CC } "
fi
fi
if [ " ${ KERNEL_LD } " != "" ]
if [ " ${ KERNEL_LD } " != '' ]
then
then
export LD = " ${ KERNEL_LD } "
export LD = " ${ KERNEL_LD } "
fi
fi
if [ " ${ KERNEL_AS } " != "" ]
if [ " ${ KERNEL_AS } " != '' ]
then
then
export AS = " ${ KERNEL_AS } "
export AS = " ${ KERNEL_AS } "
fi
fi
@ -94,15 +92,15 @@ export_kernel_args()
unset_kernel_args( )
unset_kernel_args( )
{
{
if [ " ${ KERNEL_CC } " != "" ]
if [ " ${ KERNEL_CC } " != '' ]
then
then
unset CC
unset CC
fi
fi
if [ " ${ KERNEL_LD } " != "" ]
if [ " ${ KERNEL_LD } " != '' ]
then
then
unset LD
unset LD
fi
fi
if [ " ${ KERNEL_AS } " != "" ]
if [ " ${ KERNEL_AS } " != '' ]
then
then
unset AS
unset AS
fi
fi
@ -110,51 +108,45 @@ unset_kernel_args()
compile_generic( ) {
compile_generic( ) {
local RET
local RET
if [ " $# " -lt "2" ]
[ " $# " -lt '2' ] && gen_die "compile_generic(): improper usage"
then
gen_die "compile_generic(): improper usage"
fi
CMAKEOPTS = ${ MAKEOPTS }
if [ " ${ 2 } " = 'kernel' ] || [ " ${ 2 } " = 'runtask' ]
if [ " ${ 2 } " = "kernel" ] || [ " ${ 2 } " = "runtask" ]
then
then
export_kernel_args
export_kernel_args
MAKE = ${ KERNEL_MAKE }
MAKE = ${ KERNEL_MAKE }
[ " ${ 2 } " = "runtask" ] && CMAKEOPTS = ${ MAKEOPTS /-j?/-j1 }
elif [ " ${ 2 } " = 'utils' ]
elif [ " ${ 2 } " = "utils" ]
then
then
export_utils_args
export_utils_args
MAKE = ${ UTILS_MAKE }
MAKE = ${ UTILS_MAKE }
fi
fi
if [ " ${ 2 } " = = "runtask" ]
if [ " ${ 2 } " = = 'runtask' ]
then
then
print_info 2 " COMMAND: ${ MAKE } ${ MAKEOPTS } ${ 1 } " 1 0 1
print_info 2 " COMMAND: ${ MAKE } ${ MAKEOPTS } ${ 1 } " 1 0 1
${ MAKE } -s ${ C MAKEOPTS} ${ 1 }
${ MAKE } -s ${ MAKEOPTS/-j?/-j1 } ${ 1 }
RET = $?
RET = $?
elif [ " ${ DEBUGLEVEL } " -gt "1" ]
elif [ " ${ DEBUGLEVEL } " -gt "1" ]
then
then
# Output to stdout and debugfile
# Output to stdout and debugfile
print_info 2 " COMMAND: ${ MAKE } ${ MAKEOPTS } ${ 1 } " 1 0 1
print_info 2 " COMMAND: ${ MAKE } ${ MAKEOPTS } ${ 1 } " 1 0 1
${ MAKE } ${ C MAKEOPTS} ${ 1 } 2>& 1 | tee -a ${ DEBUGFILE }
${ MAKE } ${ MAKEOPTS} ${ 1 } 2>& 1 | tee -a ${ DEBUGFILE }
RET = $?
RET = $?
else
else
# Output to debugfile only
# Output to debugfile only
print_info 2 " COMMAND: ${ MAKE } ${ MAKEOPTS } ${ 1 } " 1 0 1
print_info 2 " COMMAND: ${ MAKE } ${ MAKEOPTS } ${ 1 } " 1 0 1
${ MAKE } ${ C MAKEOPTS} ${ 1 } >> ${ DEBUGFILE } 2>& 1
${ MAKE } ${ MAKEOPTS} ${ 1 } >> ${ DEBUGFILE } 2>& 1
RET = $?
RET = $?
fi
fi
[ " ${ RET } " -ne "0" ] && gen_die " Failed to compile the \" ${ 1 } \" target... "
[ " ${ RET } " -ne '0' ] && gen_die " Failed to compile the \" ${ 1 } \" target... "
unset MAKE
unset MAKE
if [ " ${ 2 } " = "kernel" ]
if [ " ${ 2 } " = 'kernel' ]
then
then
unset_kernel_args
unset_kernel_args
elif [ " ${ 2 } " = "utils" ]
elif [ " ${ 2 } " = 'utils' ]
then
then
unset_utils_args
unset_utils_args
fi
fi
}
}
extract_dietlibc_bincache( ) {
extract_dietlibc_bincache( ) {
@ -171,44 +163,49 @@ clean_dietlibc_bincache() {
cd - > /dev/null
cd - > /dev/null
}
}
compile_dep( ) {
compile_dep( ) {
# Only run ``make dep'' for 2.4 kernels
# Only run ``make dep'' for 2.4 kernels
if [ " ${ VER } " -eq "2" ] && [ " ${ PAT } " -le "4" ]
if [ " ${ VER } " -eq '2' -a " ${ PAT } " -le '4' ]
then
then
print_info 1 "kernel: >> Making dependencies..."
print_info 1 "kernel: >> Making dependencies..."
cd ${ KERNEL_DIR }
cd ${ KERNEL_DIR }
compile_generic " dep" kernel
compile_generic dep kernel
fi
fi
}
}
compile_modules( ) {
compile_modules( ) {
print_info 1 " >> Compiling ${ KV } modules... "
print_info 1 " >> Compiling ${ KV } modules... "
cd ${ KERNEL_DIR }
cd ${ KERNEL_DIR }
compile_generic " modules" kernel
compile_generic modules kernel
export UNAME_MACHINE = " ${ ARCH } "
export UNAME_MACHINE = " ${ ARCH } "
# On 2.4 kernels, if MAKEOPTS > -j1 it can cause failures
# On 2.4 kernels, if MAKEOPTS > -j1 it can cause failures
MAKEOPTS_SAVE = " ${ MAKEOPTS } "
if [ " ${ VER } " -eq '2' -a " ${ PAT } " -le '4' ]
MAKEOPTS = "-j1"
then
MAKEOPTS_SAVE = " ${ MAKEOPTS } "
MAKEOPTS = '-j1'
fi
compile_generic "modules_install" kernel
compile_generic "modules_install" kernel
MAKEOPTS = " ${ MAKEOPTS_SAVE } "
if [ " ${ VER } " -eq '2' -a " ${ PAT } " -le '4' ]
then
MAKEOPTS = " ${ MAKEOPTS_SAVE } "
fi
export MAKEOPTS
export MAKEOPTS
unset UNAME_MACHINE
unset UNAME_MACHINE
}
}
compile_kernel( ) {
compile_kernel( ) {
[ " ${ KERNEL_MAKE } " = "" ] && gen_die "KERNEL_MAKE undefined - I don't know how to compile kernel for this arch. "
[ " ${ KERNEL_MAKE } " = '' ] && gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch! "
cd ${ KERNEL_DIR }
cd ${ KERNEL_DIR }
print_info 1 " >> Compiling ${ KV } ${ KERNEL_MAKE_DIRECTIVE /_install/ [ install ]/ } ... "
print_info 1 " >> Compiling ${ KV } ${ KERNEL_MAKE_DIRECTIVE /_install/ [ install ]/ } ... "
compile_generic " ${ KERNEL_MAKE_DIRECTIVE } " kernel
compile_generic " ${ KERNEL_MAKE_DIRECTIVE } " kernel
if [ " ${ KERNEL_MAKE_DIRECTIVE_2 } " != "" ]
if [ " ${ KERNEL_MAKE_DIRECTIVE_2 } " != '' ]
then
then
print_info 1 " >> Starting supplimental compile of ${ KV } : ${ KERNEL_MAKE_DIRECTIVE_2 } ... "
print_info 1 " >> Starting supplimental compile of ${ KV } : ${ KERNEL_MAKE_DIRECTIVE_2 } ... "
compile_generic " ${ KERNEL_MAKE_DIRECTIVE_2 } " kernel
compile_generic " ${ KERNEL_MAKE_DIRECTIVE_2 } " kernel
fi
fi
if ! isTrue " ${ CMD_NOINSTALL } "
if ! isTrue " ${ CMD_NOINSTALL } "
then
then
cp " ${ KERNEL_BINARY } " " /boot/kernel- ${ KV } " || gen_die "Could not copy the kernel binary to /boot!"
cp " ${ KERNEL_BINARY } " " /boot/kernel- ${ KV } " || gen_die 'Could not copy the kernel binary to /boot!'
else
else
cp " ${ KERNEL_BINARY } " " ${ TEMP } /kernel- ${ KV } " || gen_die " Could not copy the kernel binary to ${ TEMP } ! "
cp " ${ KERNEL_BINARY } " " ${ TEMP } /kernel- ${ KV } " || gen_die " Could not copy the kernel binary to ${ TEMP } ! "
fi
fi
@ -217,12 +214,12 @@ compile_kernel() {
compile_busybox( ) {
compile_busybox( ) {
if [ ! -f " ${ BUSYBOX_BINCACHE } " ]
if [ ! -f " ${ BUSYBOX_BINCACHE } " ]
then
then
[ ! -f " ${ BUSYBOX_SRCTAR } " ] && gen_die " Could not find busybox source tarball: ${ BUSYBOX_SRCTAR } ! "
[ -f " ${ BUSYBOX_SRCTAR } " ] || gen_die " Could not find busybox source tarball: ${ BUSYBOX_SRCTAR } ! "
[ ! -f " ${ BUSYBOX_CONFIG } " ] && gen_die " Cound not find busybox config file: ${ BUSYBOX_CONFIG } ! "
[ -f " ${ BUSYBOX_CONFIG } " ] || gen_die " Cound not find busybox config file: ${ BUSYBOX_CONFIG } ! "
cd " ${ TEMP } "
cd " ${ TEMP } "
rm -rf ${ BUSYBOX_DIR } > /dev/null
rm -rf ${ BUSYBOX_DIR } > /dev/null
tar -jxpf ${ BUSYBOX_SRCTAR } || gen_die "Could not extract busybox source tarball!"
tar -jxpf ${ BUSYBOX_SRCTAR } || gen_die 'Could not extract busybox source tarball!'
[ ! -d " ${ BUSYBOX_DIR } " ] && gen_die " Busybox directory ${ BUSYBOX_DIR } is invalid! "
[ -d " ${ BUSYBOX_DIR } " ] || gen_die 'Busybox directory ${BUSYBOX_DIR} is invalid!'
cp " ${ BUSYBOX_CONFIG } " " ${ BUSYBOX_DIR } /.config "
cp " ${ BUSYBOX_CONFIG } " " ${ BUSYBOX_DIR } /.config "
cd " ${ BUSYBOX_DIR } "
cd " ${ BUSYBOX_DIR } "
# Busybox and dietlibc don't play nice right now
# Busybox and dietlibc don't play nice right now
@ -232,22 +229,21 @@ compile_busybox() {
# OLD_CC="${UTILS_CC}"
# OLD_CC="${UTILS_CC}"
# UTILS_CC="${TEMP}/diet/bin/diet ${UTILS_CC}"
# UTILS_CC="${TEMP}/diet/bin/diet ${UTILS_CC}"
# fi
# fi
print_info 1 "busybox: >> Configuring..."
print_info 1 'busybox: >> Configuring...'
yes "" | compile_generic "oldconfig" utils
yes '' | compile_generic oldconfig utils
print_info 1 "busybox: >> Compiling..."
print_info 1 'busybox: >> Compiling...'
compile_generic " all" utils
compile_generic all utils
# Busybox and dietlibc don't play nice right now
# Busybox and dietlibc don't play nice right now
# if [ "${USE_DIETLIBC}" -eq "1" ]
# if [ "${USE_DIETLIBC}" -eq "1" ]
# then
# then
# clean_dietlibc_bincache
# clean_dietlibc_bincache
# UTILS_CC="${OLD_CC}"
# UTILS_CC="${OLD_CC}"
# fi
# fi
print_info 1 "busybox: >> Copying to cache..."
print_info 1 'busybox: >> Copying to cache...'
[ ! -f " ${ TEMP } / ${ BUSYBOX_DIR } /busybox " ] && gen_die "busybox executable does not exist after compile, error"
[ -f " ${ TEMP } / ${ BUSYBOX_DIR } /busybox " ] || gen_die 'Busybox executable does not exist!'
strip " ${ TEMP } / ${ BUSYBOX_DIR } /busybox " || gen_die "could not strip busybox"
strip " ${ TEMP } / ${ BUSYBOX_DIR } /busybox " || gen_die 'Could not strip busybox binary!'
bzip2 " ${ TEMP } / ${ BUSYBOX_DIR } /busybox " || gen_die "bzip2 compression of busybox failed"
bzip2 " ${ TEMP } / ${ BUSYBOX_DIR } /busybox " || gen_die 'bzip2 compression of busybox failed!'
[ ! -f " ${ TEMP } / ${ BUSYBOX_DIR } /busybox.bz2 " ] && gen_die "could not find compressed busybox binary"
mv " ${ TEMP } / ${ BUSYBOX_DIR } /busybox.bz2 " " ${ BUSYBOX_BINCACHE } " || gen_die 'Could not copy the busybox binary to package directory, does the directory exist?'
mv " ${ TEMP } / ${ BUSYBOX_DIR } /busybox.bz2 " " ${ BUSYBOX_BINCACHE } " || gen_die "could not copy busybox binary to arch package directory, does the directory exist?"
cd " ${ TEMP } "
cd " ${ TEMP } "
rm -rf " ${ BUSYBOX_DIR } " > /dev/null
rm -rf " ${ BUSYBOX_DIR } " > /dev/null
@ -266,7 +262,7 @@ compile_modutils() {
cd " ${ MODUTILS_DIR } "
cd " ${ MODUTILS_DIR } "
print_info 1 "modutils: >> Configuring..."
print_info 1 "modutils: >> Configuring..."
if [ " ${ USE_DIETLIBC } " -eq "1" ]
if [ " ${ USE_DIETLIBC } " -eq '1' ]
then
then
extract_dietlibc_bincache
extract_dietlibc_bincache
OLD_CC = " ${ UTILS_CC } "
OLD_CC = " ${ UTILS_CC } "
@ -275,24 +271,23 @@ compile_modutils() {
export_utils_args
export_utils_args
export ARCH = ${ ARCH }
export ARCH = ${ ARCH }
./configure --disable-combined --enable-insmod-static >> ${ DEBUGFILE } 2>& 1 || gen_die "Configuring modutils failed!"
./configure --disable-combined --enable-insmod-static >> ${ DEBUGFILE } 2>& 1 || gen_die 'Configuring modutils failed!'
unset_utils_args
unset_utils_args
print_info 1 "modutils: >> Compiling..."
print_info 1 'modutils: >> Compiling...'
compile_generic " all" utils
compile_generic all utils
if [ " ${ USE_DIETLIBC } " -eq "1" ]
if [ " ${ USE_DIETLIBC } " -eq '1' ]
then
then
clean_dietlibc_bincache
clean_dietlibc_bincache
UTILS_CC = " ${ OLD_CC } "
UTILS_CC = " ${ OLD_CC } "
fi
fi
print_info 1 "modutils: >> Copying to cache..."
print_info 1 'modutils: >> Copying to cache...'
[ ! -f " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static " ] && gen_die "insmod.static does not exist after compilation of modutils"
[ -f " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static " ] || gen_die "insmod.static does not exist after the compilation of modutils!"
strip " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static " || gen_die "could not strip insmod.static"
strip " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static " || gen_die 'Could not strip insmod.static!'
bzip2 " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static " || gen_die "compression of insmod.static failed"
bzip2 " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static " || gen_die 'Compression of insmod.static failed!'
[ ! -f " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static.bz2 " ] && gen_die "could not find compressed insmod.static.bz2 binary"
mv " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static.bz2 " " ${ MODUTILS_BINCACHE } " || gen_die 'Could not move the compressed insmod binary to the package cache!'
mv " ${ TEMP } / ${ MODUTILS_DIR } /insmod/insmod.static.bz2 " " ${ MODUTILS_BINCACHE } " || gen_die "could not move compress binary to bincache"
cd " ${ TEMP } "
cd " ${ TEMP } "
rm -rf " ${ MODULE_INIT_TOOLS_DIR } " > /dev/null
rm -rf " ${ MODULE_INIT_TOOLS_DIR } " > /dev/null
@ -309,9 +304,9 @@ compile_module_init_tools() {
tar -jxpf " ${ MODULE_INIT_TOOLS_SRCTAR } "
tar -jxpf " ${ MODULE_INIT_TOOLS_SRCTAR } "
[ ! -d " ${ MODULE_INIT_TOOLS_DIR } " ] && gen_die " Module-init-tools directory ${ MODULE_INIT_TOOLS_DIR } invalid "
[ ! -d " ${ MODULE_INIT_TOOLS_DIR } " ] && gen_die " Module-init-tools directory ${ MODULE_INIT_TOOLS_DIR } invalid "
cd " ${ MODULE_INIT_TOOLS_DIR } "
cd " ${ MODULE_INIT_TOOLS_DIR } "
print_info 1 "module-init-tools: >> Configuring"
print_info 1 'module-init-tools: >> Configuring'
if [ " ${ USE_DIETLIBC } " -eq "1" ]
if [ " ${ USE_DIETLIBC } " -eq '1' ]
then
then
extract_dietlibc_bincache
extract_dietlibc_bincache
OLD_CC = " ${ UTILS_CC } "
OLD_CC = " ${ UTILS_CC } "
@ -319,23 +314,23 @@ compile_module_init_tools() {
fi
fi
export_utils_args
export_utils_args
./configure >> ${ DEBUGFILE } 2>& 1 || gen_die "Configure of module-init-tools failed"
./configure >> ${ DEBUGFILE } 2>& 1 || gen_die 'Configure of module-init-tools failed!'
unset_utils_args
unset_utils_args
print_info 1 " >> Compiling..."
print_info 1 ' >> Compiling...'
compile_generic "all" utils
compile_generic "all" utils
if [ " ${ USE_DIETLIBC } " -eq "1" ]
if [ " ${ USE_DIETLIBC } " -eq '1' ]
then
then
clean_dietlibc_bincache
clean_dietlibc_bincache
UTILS_CC = " ${ OLD_CC } "
UTILS_CC = " ${ OLD_CC } "
fi
fi
print_info 1 " >> Copying to cache..."
print_info 1 ' >> Copying to cache...'
[ ! -f " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static " ] && gen_die "insmod.static does not exist after compilation of module-init-tools"
[ -f " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static " ] || gen_die 'insmod.static does not exist after the compilation of module-init-tools!'
strip " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static " || gen_die "could not strip insmod.static"
strip " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static " || gen_die 'Could not strip insmod.static!'
bzip2 " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static " || gen_die "compression of insmod.static failed"
bzip2 " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static " || gen_die 'Compression of insmod.static failed!'
[ ! -f " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static.bz2 " ] && gen_die "could not find compressed insmod.static.bz2 binary"
[ -f " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static.bz2 " ] || gen_die 'Could not find compressed insmod.static.bz2 binary!'
mv " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static.bz2 " " ${ MODULE_INIT_TOOLS_BINCACHE } " || gen_die "could not move compressed binary to bincache"
mv " ${ TEMP } / ${ MODULE_INIT_TOOLS_DIR } /insmod.static.bz2 " " ${ MODULE_INIT_TOOLS_BINCACHE } " || gen_die 'Could not move the compressed insmod binary to the package cache!'
cd " ${ TEMP } "
cd " ${ TEMP } "
rm -rf " ${ MODULE_INIT_TOOLS_DIR } " > /dev/null
rm -rf " ${ MODULE_INIT_TOOLS_DIR } " > /dev/null
@ -353,42 +348,40 @@ compile_devfsd() {
[ ! -d " ${ DEVFSD_DIR } " ] && gen_die " Devfsd directory ${ DEVFSD_DIR } invalid "
[ ! -d " ${ DEVFSD_DIR } " ] && gen_die " Devfsd directory ${ DEVFSD_DIR } invalid "
cd " ${ DEVFSD_DIR } "
cd " ${ DEVFSD_DIR } "
if [ " ${ USE_DIETLIBC } " -eq "1" ]
if [ " ${ USE_DIETLIBC } " -eq '1' ]
then
then
extract_dietlibc_bincache
extract_dietlibc_bincache
OLD_CC = " ${ UTILS_CC } "
OLD_CC = " ${ UTILS_CC } "
UTILS_CC = " ${ TEMP } /diet/bin/diet ${ UTILS_CC } "
UTILS_CC = " ${ TEMP } /diet/bin/diet ${ UTILS_CC } "
fi
fi
print_info 1 "devfsd: >> Compiling..."
print_info 1 'devfsd: >> Compiling...'
if [ " ${ USE_DIETLIBC } " -eq '1' ]
if [ " ${ USE_DIETLIBC } " -eq "1" ]
then
then
compile_generic "has_dlopen=0 has_rpcsvc=0" utils
compile_generic 'has_dlopen=0 has_rpcsvc=0' utils
else
else
compile_generic "LDFLAGS=-static" utils
compile_generic 'LDFLAGS=-static' utils
fi
fi
if [ " ${ USE_DIETLIBC } " -eq "1" ]
if [ " ${ USE_DIETLIBC } " -eq '1' ]
then
then
clean_dietlibc_bincache
clean_dietlibc_bincache
UTILS_CC = " ${ OLD_CC } "
UTILS_CC = " ${ OLD_CC } "
fi
fi
print_info 1 " >> Copying to cache..."
print_info 1 ' >> Copying to cache...'
[ ! -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd " ] && gen_die "devfsd executable does not exist after compilation of devfsd"
[ -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd " ] || gen_die 'The devfsd executable does not exist after the compilation of devfsd!'
strip " ${ TEMP } / ${ DEVFSD_DIR } /devfsd " || gen_die "could not strip devfsd"
strip " ${ TEMP } / ${ DEVFSD_DIR } /devfsd " || gen_die 'Could not strip devfsd!'
bzip2 " ${ TEMP } / ${ DEVFSD_DIR } /devfsd " || gen_die "compression of devfsd failed"
bzip2 " ${ TEMP } / ${ DEVFSD_DIR } /devfsd " || gen_die 'Compression of devfsd failed!'
[ ! -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.bz2 " ] && gen_die "could not find compressed devfsd.bz2 binary"
[ -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.bz2 " ] || gen_die 'Could not find compressed devfsd.bz2 binary!'
mv " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.bz2 " " ${ DEVFSD_BINCACHE } " || gen_die "could not move compressed binary to bincache"
mv " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.bz2 " " ${ DEVFSD_BINCACHE } " || gen_die 'Could not move compressed binary to the package cache!'
[ ! -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf " ] && gen_die "devfsd.conf does not exist after compilation of devfsd"
[ -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf " ] || gen_die 'devfsd.conf does not exist after the compilation of devfsd!'
bzip2 " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf " || gen_die "compression of devfsd.conf failed"
bzip2 " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf " || gen_die 'Compression of devfsd.conf failed!'
[ ! -f " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf.bz2 " ] && gen_die "could not find compressed devfsd.conf.bz2 binary"
mv " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf.bz2 " " ${ DEVFSD_CONF_BINCACHE } " || gen_die 'Could not move the compressed configuration to the package cache!'
mv " ${ TEMP } / ${ DEVFSD_DIR } /devfsd.conf.bz2 " " ${ DEVFSD_CONF_BINCACHE } " || gen_die "could not move compressed binary to bincache"
cd " ${ TEMP } "
cd " ${ TEMP } "
# rm -rf "${DEVFSD_DIR}" > /dev/null
rm -rf " ${ DEVFSD_DIR } " > /dev/null
fi
fi
}
}
@ -399,24 +392,24 @@ compile_dietlibc() {
BUILD_DIETLIBC = 0
BUILD_DIETLIBC = 0
[ ! -f " ${ DIETLIBC_BINCACHE } " ] && BUILD_DIETLIBC = 1
[ ! -f " ${ DIETLIBC_BINCACHE } " ] && BUILD_DIETLIBC = 1
[ ! -f " ${ DIETLIBC_BINCACHE_TEMP } " ] && BUILD_DIETLIBC = 1
[ ! -f " ${ DIETLIBC_BINCACHE_TEMP } " ] && BUILD_DIETLIBC = 1
if [ " ${ BUILD_DIETLIBC } " -eq "0" ]
if [ " ${ BUILD_DIETLIBC } " ]
then
then
ORIGTEMP = ` cat " ${ DIETLIBC_BINCACHE_TEMP } " `
ORIGTEMP = ` cat " ${ DIETLIBC_BINCACHE_TEMP } " `
if [ " ${ TEMP } " != " ${ ORIGTEMP } " ]
if [ " ${ TEMP } " != " ${ ORIGTEMP } " ]
then
then
print_warning 1 "dietlibc: Bincache exists, but current temp directory"
print_warning 1 'dietlibc: Bincache exists, but the current temporary directory'
print_warning 1 " is different than original. Rebuilding."
print_warning 1 ' is different to the original. Rebuilding.'
BUILD_DIETLIBC = 1
BUILD_DIETLIBC = 1
fi
fi
fi
fi
if [ " ${ BUILD_DIETLIBC } " -eq "1" ]
if [ " ${ BUILD_DIETLIBC } " -eq '1' ]
then
then
[ ! -f " ${ DIETLIBC_SRCTAR } " ] && gen_die " Could not find dietlibc source tarball: ${ DIETLIBC_SRCTAR } "
[ -f " ${ DIETLIBC_SRCTAR } " ] || gen_die " Could not find dietlibc source tarball: ${ DIETLIBC_SRCTAR } "
cd " ${ TEMP } "
cd " ${ TEMP } "
rm -rf " ${ DIETLIBC_DIR } " > /dev/null
rm -rf " ${ DIETLIBC_DIR } " > /dev/null
tar -jxpf ${ DIETLIBC_SRCTAR } || gen_die "Could not extract dietlibc source tarball"
tar -jxpf ${ DIETLIBC_SRCTAR } || gen_die "Could not extract dietlibc source tarball"
[ ! -d " ${ DIETLIBC_DIR } " ] && gen_die " Dietlibc directory ${ DIETLIBC_DIR } i nvalid"
[ -d " ${ DIETLIBC_DIR } " ] || gen_die " Dietlibc directory ${ DIETLIBC_DIR } i s i nvalid! "
cd " ${ DIETLIBC_DIR } "
cd " ${ DIETLIBC_DIR } "
print_info 1 "dietlibc: >> Compiling..."
print_info 1 "dietlibc: >> Compiling..."
compile_generic " prefix= ${ TEMP } /diet " utils
compile_generic " prefix= ${ TEMP } /diet " utils
@ -425,7 +418,7 @@ compile_dietlibc() {
print_info 1 " >> Copying to bincache..."
print_info 1 " >> Copying to bincache..."
cd ${ TEMP }
cd ${ TEMP }
tar -jcpf " ${ DIETLIBC_BINCACHE } " diet || gen_die "Could not tar up the dietlibc binary!"
tar -jcpf " ${ DIETLIBC_BINCACHE } " diet || gen_die "Could not tar up the dietlibc binary!"
[ ! -f " ${ DIETLIBC_BINCACHE } " ] && gen_die "Dietlibc cache not created!"
[ -f " ${ DIETLIBC_BINCACHE } " ] || gen_die 'Dietlibc cache not created!'
echo " ${ TEMP } " > " ${ DIETLIBC_BINCACHE_TEMP } "
echo " ${ TEMP } " > " ${ DIETLIBC_BINCACHE_TEMP } "
cd " ${ TEMP } "
cd " ${ TEMP } "