Files
SimpleLinux/scripts/busybox.sh
T

49 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
#--- import rolors ---
. ./scripts/colors.sh
#---------------------
#--- import funcs ----
. ./scripts/funcs.sh
#---------------------
. ./scripts/config.sh
#----------- Building busybox for rootfs ----------
busybox_rootfs() {
printf "$UGREEN** Building busybox for rootfs\n$RESET"
rm -r $build/busybox # &>> $fulllogfile
mkdir -p $build/busybox # &>> $fulllogfile
cd $build/busybox
tar -xjf $root/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2 # &>> $fulllogfile
cd busybox-${BUSYBOX_VERSION}
sed -i 's/|| ctx->process_block == sha1_process_block64_shaNI/|| ctx->process_block == sha1_process_block64/' libbb/hash_md5_sha.c
cp $root/board/${BOARD_NAME}/busybox-${BUSYBOX_VERSION}.config .config # &>> $fulllogfile
printf "$UGREEN** Configuring busybox\n$RESET"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig # &>> $fulllogfile
check $? "Configure busybox all logs in .log"
printf "$UGREEN** Building busybox\n$RESET"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
check $? "Build busybox all logs in .log"
}
#--------------------------------------------------
#------------------ Building busybox for initramfs ----------------
busybox_initramfs() {
printf "$UGREEN** Building busybox for initramfs\n$RESET"
rm -r $build/busybox # &>> $fulllogfile
mkdir -p $build/busybox
cd $build/busybox
tar -xjf $root/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2
check $? "Extract busybox"
cd busybox-${BUSYBOX_VERSION}
cp -v $root/board/${BOARD_NAME}/busybox-initrd-${BUSYBOX_VERSION}.config .config
# export PATH=$PATH:/opt/toolchains/x86_64-buildroot-linux-uclibc-gcc/bin
printf "$UGREEN** Configuring busybox\n$RESET"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- oldconfig # &>> $fulllogfile
check $? "Configure busybox all logs in .log"
printf "$UGREEN** Building busybox\n$RESET"
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile
check $? "Build busybox all logs in .log"
}
#------------------------------------------------------------------