Converted to using the make build system, updated scripts

This commit is contained in:
SolidHal 2018-09-07 11:56:22 -05:00
parent d9f4251eeb
commit 5965d0e6cc
4 changed files with 63 additions and 64 deletions

View File

@ -1,57 +1,54 @@
.PHONY: clean
.PHONY kernel
kernel:
scripts/buildKernel.sh
.PHONY filesystem
filesystem:
clean_img
scripts/buildDebianFs.sh
.PHONY kernel_inject
kernel_inject: #Targets an already build .img and swaps the old kernel with the newly compiled kernel
scripts/buildNewKernelIntoFS.sh
.PHONY image
image:
clean_img
scripts/buildKernel.sh
scripts/buildDebianFs.sh
.PHONY live_image
live_image:
echo "TODO"
.PHONY kernel_config
kernel_config:
scripts/crossmenuconfig.sh
.PHONY clean
clean: clean:
echo "Enter one of:" @echo "Enter one of:"
echo " clean_kernel - which deletes the untar'd kernel folder from build" @echo " clean_kernel - which deletes the untar'd kernel folder from build"
echo " clean_ath - which deletes the untar'd ath9k driver folder from build" @echo " clean_ath - which deletes the untar'd ath9k driver folder from build"
echo " clean_img - which deletes the built PrawnOS images, this is ran when make image is ran" @echo " clean_img - which deletes the built PrawnOS images, this is ran when make image is ran"
echo " clean_all - which does all of the above" @echo " clean_all - which does all of the above"
echo " in most cases none of these need ot be used manually as most cleanup steaps are handled automatically" @echo " in most cases none of these need to be used manually as most cleanup steps are handled automatically"
.PHONY clean_kernel .PHONY: clean_kernel
clean_kernel: clean_kernel:
rm -rf build/linux-4.* rm -rf build/linux-4.*
.PHONY clean_ath .PHONY: clean_ath
clean_ath: clean_ath:
rm -rf build/open-ath9k-htc-firmware rm -rf build/open-ath9k-htc-firmware
.PHONY clean_img .PHONY: clean_img
clean_img: clean_img:
rm PrawnOS-*-c201-libre-*GB.img rm PrawnOS-*-c201-libre-*GB.img
.PHONY clean_all .PHONY: clean_all
clean_all: clean_all:
clean_kernel make clean_kernel
clean_ath make clean_ath
clean_img make clean_img
.PHONY: kernel
kernel:
scripts/buildKernel.sh
.PHONY: filesystem
filesystem:
make clean_img
scripts/buildDebianFs.sh
.PHONY: kernel_inject
kernel_inject: #Targets an already built .img and swaps the old kernel with the newly compiled kernel
scripts/buildNewKernelIntoFS.sh
.PHONY: image
image:
make clean_img
scripts/buildKernel.sh
scripts/buildDebianFs.sh
.PHONY: live_image
live_image:
echo "TODO"
.PHONY: kernel_config
kernel_config:
scripts/crossmenuconfig.sh

Binary file not shown.

View File

@ -6,40 +6,38 @@ KVER=4.17.2
outmnt=$(mktemp -d -p `pwd`) outmnt=$(mktemp -d -p `pwd`)
outdev=/dev/loop7 outdev=/dev/loop7
build_resources=resources/BuildResources
#A hacky way to ensure the loops are properly unmounted and the temp files are properly deleted. #A hacky way to ensure the loops are properly unmounted and the temp files are properly deleted.
#Without this, a reboot is required to properly clean the loop devices and ensure a clean build #Without this, a reboot is sometimes required to properly clean the loop devices and ensure a clean build
cleanuptwice() {
cleanup
cleanup
}
cleanup() { cleanup() {
set +e set +e
#umount -l $inmnt > /dev/null 2>&1 umount -l $outmnt > /dev/null 2>&1
#rmdir $inmnt > /dev/null 2>&1 rmdir $outmnt > /dev/null 2>&1
#losetup -d $indev > /dev/null 2>&1 losetup -d $outdev > /dev/null 2>&1
set +e
umount -l $outmnt > /dev/null 2>&1 umount -l $outmnt > /dev/null 2>&1
rmdir $outmnt > /dev/null 2>&1 rmdir $outmnt > /dev/null 2>&1
losetup -d $outdev > /dev/null 2>&1 losetup -d $outdev > /dev/null 2>&1
} }
trap cleanuptwice INT TERM EXIT trap cleanup INT TERM EXIT
#Mount the build filesystem image #Mount the build filesystem image
losetup -P $outdev librean-stretch-c201-libre-2GB* losetup -P $outdev PrawnOS-*-c201-libre-2GB*
mount -o noatime ${outdev}p2 $outmnt mount -o noatime ${outdev}p2 $outmnt
# put the kernel in the kernel partition, modules in /lib/modules and AR9271 # put the kernel in the kernel partition, modules in /lib/modules and AR9271
# firmware in /lib/firmware # firmware in /lib/firmware
dd if=blank_kernel of=${outdev}p1 conv=notrunc dd if=$resources/blank_kernel of=${outdev}p1 conv=notrunc
dd if=linux-$KVER/vmlinux.kpart of=${outdev}p1 conv=notrunc dd if=build/linux-$KVER/vmlinux.kpart of=${outdev}p1 conv=notrunc
make -C linux-$KVER ARCH=arm INSTALL_MOD_PATH=$outmnt modules_install make -C build/linux-$KVER ARCH=arm INSTALL_MOD_PATH=$outmnt modules_install
rm -f $outmnt/lib/modules/3.14.0/{build,source} rm -f $outmnt/lib/modules/3.14.0/{build,source}
install -D -m 644 open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
echo "DONE!" echo "DONE!"
cleanup cleanup

View File

@ -1,13 +1,17 @@
#!/bin/sh -xe #!/bin/sh -xe
#Runs Make menuconfig with the proper enviroment vars for cross compiling arm #Runs Make menuconfig with the proper enviroment vars for cross compiling arm
#Grabs the file named config in the same directory as this script, and updates it #Grabs the file named config in resources/BuildResources directory, and updates it
KVER=4.17.2 KVER=4.17.2
ROOT_DIR=`pwd`
RESOURCES=$ROOT_DIR/resources/BuildResources
[ ! -d build ] && mkdir build
cd build
[ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz [ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz
[ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz [ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz
cd linux-$KVER cd linux-$KVER
cp ../config .config cp $RESOURCES/config .config
make menuconfig ARCH=arm CROSS_COMPILE=arm-none-eabi- .config make menuconfig ARCH=arm CROSS_COMPILE=arm-none-eabi- .config
cp .config ../config cp .config $RESOURCES/config