mirror of
https://github.com/Gator96100/ProxSpace.git
synced 2025-08-19 12:59:48 -07:00
Autobuild improvements & fixes
This commit is contained in:
parent
e5abd7ab51
commit
52366b4cb5
13 changed files with 164 additions and 61 deletions
|
@ -3,51 +3,131 @@ pm3Dir=/pm3
|
||||||
copyDir=/builds
|
copyDir=/builds
|
||||||
buildDir=/tmp
|
buildDir=/tmp
|
||||||
mingwDir=/mingw64
|
mingwDir=/mingw64
|
||||||
arch=64
|
|
||||||
jobs=$(nproc)
|
|
||||||
|
|
||||||
|
function check_requirements {
|
||||||
pacman -Q p7zip 1> /dev/null
|
pacman -Q p7zip 1> /dev/null
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
pacman --noconfirm -S p7zip
|
pacman --noconfirm -S p7zip
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
cd $pm3Dir
|
function copy_shell {
|
||||||
for i in $( ls -d */ ); do
|
DEPLIST=(
|
||||||
echo Processing: ${i%%/}-$arch
|
"/usr/bin/bash.exe"
|
||||||
cd $pm3Dir/${i%%/}
|
"/usr/bin/dirname.exe"
|
||||||
|
"/usr/bin/basename.exe"
|
||||||
|
"/usr/bin/uname.exe"
|
||||||
|
"/usr/bin/awk.exe"
|
||||||
|
"/usr/bin/grep.exe"
|
||||||
|
)
|
||||||
|
mkdir -p "$dstDir/client/libs/shell"
|
||||||
|
for dep in ${DEPLIST[*]}; do
|
||||||
|
ldd $dep | grep "=> /usr" | awk '{print $3}' | xargs -I '{}' cp -v '{}' "$dstDir/client/libs/shell"
|
||||||
|
cp $dep "$dstDir/client/libs/shell"
|
||||||
|
done
|
||||||
|
|
||||||
|
#tmp dir required for bash
|
||||||
|
mkdir -p "$dstDir/client/tmp"
|
||||||
|
}
|
||||||
|
|
||||||
|
function copy_common {
|
||||||
|
rm -rf "$dstDir"
|
||||||
|
mkdir -p "$copyDir/$buildName/"
|
||||||
|
mkdir -p "$dstDir/client"
|
||||||
|
mkdir -p "$dstDir/client/libs"
|
||||||
|
mkdir -p "$dstDir/recovery"
|
||||||
|
mkdir -p "$dstDir/Windows Driver (not required for Windows 10)"
|
||||||
|
|
||||||
|
#Copy required libraries to client/libs
|
||||||
|
ldd "$srcDir/client/proxmark3.exe" | grep "=> /mingw" | awk '{print $3}' | xargs -I '{}' cp -v '{}' "$dstDir/client/libs"
|
||||||
|
#Copy qt5 platform dll
|
||||||
|
cp "$mingwDir/share/qt5/plugins/platforms/qwindows.dll" "$dstDir/client/libs"
|
||||||
|
#Copy firmware
|
||||||
|
cp "$srcDir/armsrc/obj/fullimage.elf" "$dstDir/client"
|
||||||
|
cp "$srcDir/bootrom/obj/bootrom.elf" "$dstDir/client"
|
||||||
|
#Copy recovery
|
||||||
|
cp $srcDir/recovery/{bootrom.bin,fullimage.bin,proxmark3_recovery.bin} "$dstDir/recovery"
|
||||||
|
#Copy driver
|
||||||
|
cp "$srcDir/driver/proxmark3.inf" "$dstDir/Windows Driver (not required for Windows 10)"
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_for_updates {
|
||||||
git fetch
|
git fetch
|
||||||
git pull
|
git pull --ff-only
|
||||||
hash=$(git rev-parse HEAD)
|
hash=$(git rev-parse HEAD)
|
||||||
date=$(date +%Y%m%d)
|
|
||||||
if ! ls $copyDir/${i%%/}-$arch/*-$hash.7z 1> /dev/null 2>&1; then
|
|
||||||
|
|
||||||
if [ ! -f "rdv40.txt" ]; then
|
if ls $copyDir/$buildName/*-$hash.7z 1> /dev/null 2>&1; then
|
||||||
jobs=1
|
return 1 #build exist
|
||||||
|
else
|
||||||
|
return 0 #build doesn't exist
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function zip_folder {
|
||||||
|
date=$(date +%Y%m%d)
|
||||||
|
7z a -r -mx9 $copyDir/$buildName/$buildName-$date-$hash.7z $dstDir/*
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_rrg {
|
||||||
make clean
|
make clean
|
||||||
make all -j$jobs
|
#Running python scripts outside ProxSpace is a bad idea
|
||||||
|
make SKIPPYTHON=1 -j
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
rm -rf $buildDir/${i%%/}/*
|
copy_common
|
||||||
mkdir -p $copyDir/${i%%/}-$arch/
|
copy_shell
|
||||||
mkdir -p $buildDir/${i%%/}/win$arch/platforms
|
|
||||||
mkdir -p $buildDir/${i%%/}/firmware_win/bootrom
|
|
||||||
mkdir -p "$buildDir/${i%%/}/firmware_win/JTAG Only"
|
|
||||||
mkdir -p "$buildDir/${i%%/}/Windows Driver"
|
|
||||||
|
|
||||||
ldd $pm3Dir/${i%%/}/client/proxmark3.exe | grep "=> /mingw" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $buildDir/${i%%/}/win$arch
|
#Copy contents of the autobuild folder
|
||||||
cp -r /ps/autobuild/* $buildDir/${i%%/}/win$arch
|
cp -r /ps/autobuild/rrg/* "$dstDir"
|
||||||
cp -r $pm3Dir/${i%%/}/client/{proxmark3.exe,flasher.exe,*.dic,lualibs,scripts,pyscripts,luascripts,lualibs,hardnested,dictionaries,resources} $buildDir/${i%%/}/win$arch
|
|
||||||
cp $mingwDir/share/qt5/plugins/platforms/qwindows.dll $buildDir/${i%%/}/win$arch/platforms
|
#Copy the client and additional files
|
||||||
cp $pm3Dir/${i%%/}/armsrc/obj/{fullimage.elf,fullimage.s19} $buildDir/${i%%/}/firmware_win
|
cp -r $srcDir/client/{proxmark3.exe,lualibs,luascripts,dictionaries,resources} "$dstDir/client"
|
||||||
cp $pm3Dir/${i%%/}/bootrom/obj/{bootrom.elf,bootrom.s19} $buildDir/${i%%/}/firmware_win/bootrom
|
|
||||||
cp $pm3Dir/${i%%/}/recovery/{bootrom.bin,fullimage.bin,proxmark3_recovery.bin} "$buildDir/${i%%/}/firmware_win/JTAG Only"
|
#Copy the pm3 scripts
|
||||||
cp $pm3Dir/${i%%/}/driver/proxmark3.inf "$buildDir/${i%%/}/Windows Driver"
|
cp -r $srcDir/{pm3,pm3-flash,pm3-flash-all,pm3-flash-bootrom,pm3-flash-fullimage} "$dstDir/client"
|
||||||
rm $buildDir/${i%%/}/win$arch/hardnested/{*.h,*.c}
|
|
||||||
cd $buildDir/${i%%/}
|
zip_folder
|
||||||
7z a -r -mx9 $copyDir/${i%%/}-$arch/${i%%/}-$arch-$date-$hash.7z ./*
|
fi
|
||||||
echo done
|
}
|
||||||
|
|
||||||
|
function build_official {
|
||||||
|
make clean
|
||||||
|
make
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
copy_common
|
||||||
|
|
||||||
|
#Copy contents of the autobuild folder
|
||||||
|
cp -r /ps/autobuild/official/* "$dstDir"
|
||||||
|
|
||||||
|
#Copy the client and additional files
|
||||||
|
cp -r $srcDir/client/{proxmark3.exe,flasher.exe,*.dic,lualibs,scripts,hardnested} "$dstDir/client"
|
||||||
|
|
||||||
|
#Remove accidentally copied .h/.c files from hardnested folder
|
||||||
|
rm $dstDir/client/hardnested/{*.h,*.c}
|
||||||
|
|
||||||
|
zip_folder
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function loop_folders {
|
||||||
|
for i in $( ls -d */ ); do
|
||||||
|
buildName=${i%%/}
|
||||||
|
srcDir=$pm3Dir/$buildName
|
||||||
|
dstDir=$buildDir/$buildName
|
||||||
|
echo Processing: $srcDir
|
||||||
|
cd $srcDir
|
||||||
|
|
||||||
|
if check_for_updates; then
|
||||||
|
#Build rrg
|
||||||
|
if [ -f "rdv40.txt" ]; then
|
||||||
|
build_rrg
|
||||||
|
else
|
||||||
|
build_official
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
check_requirements
|
||||||
|
cd $pm3Dir
|
||||||
|
loop_folders
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
proxmark3 COM5
|
|
|
@ -28,11 +28,8 @@ echo FLASHING bootrom.elf + fullimage.elf, please wait...
|
||||||
echo ====================================================
|
echo ====================================================
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
if exist flasher.exe (
|
call client\setup.bat
|
||||||
flasher.exe com5 -b ..\firmware_win\bootrom\bootrom.elf ..\firmware_win\fullimage.elf
|
client\flasher.exe com5 -b client\bootrom.elf client\fullimage.elf
|
||||||
) else (
|
|
||||||
proxmark3.exe com5 --flash --unlock-bootloader --image ..\firmware_win\bootrom\bootrom.elf --image ..\firmware_win\fullimage.elf
|
|
||||||
)
|
|
||||||
|
|
||||||
pause.
|
pause.
|
||||||
|
|
|
@ -41,11 +41,8 @@ echo FLASHING bootrom.elf, please wait...
|
||||||
echo ====================================
|
echo ====================================
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
if exist flasher.exe (
|
call client\setup.bat
|
||||||
flasher.exe com5 -b ..\firmware_win\bootrom\bootrom.elf
|
client\flasher.exe com5 -b client\bootrom.elf
|
||||||
) else (
|
|
||||||
proxmark3.exe com5 --flash --unlock-bootloader --image ..\firmware_win\bootrom\bootrom.elf
|
|
||||||
)
|
|
||||||
|
|
||||||
pause.
|
pause.
|
||||||
|
|
|
@ -27,11 +27,8 @@ echo FLASHING fullimage.elf, please wait...
|
||||||
echo ======================================
|
echo ======================================
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
if exist flasher.exe (
|
call client\setup.bat
|
||||||
flasher.exe com5 -b ..\firmware_win\fullimage.elf
|
client\flasher.exe com5 -b client\fullimage.elf
|
||||||
) else (
|
|
||||||
proxmark3.exe com5 --flash --unlock-bootloader --image ..\firmware_win\fullimage.elf
|
|
||||||
)
|
|
||||||
|
|
||||||
pause.
|
pause.
|
||||||
|
|
3
msys2/ps/autobuild/official/Go.bat
Normal file
3
msys2/ps/autobuild/official/Go.bat
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
@echo off
|
||||||
|
call client\setup.bat
|
||||||
|
client\proxmark3 COM5
|
6
msys2/ps/autobuild/official/client/setup.bat
Normal file
6
msys2/ps/autobuild/official/client/setup.bat
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
@echo off
|
||||||
|
set HOME=%~dp0
|
||||||
|
set QT_PLUGIN_PATH=%HOME%\libs\
|
||||||
|
set QT_QPA_PLATFORM_PLUGIN_PATH=%QT_PLUGIN_PATH%
|
||||||
|
set PATH=%QT_PLUGIN_PATH%;%PATH%
|
||||||
|
set MSYSTEM=MINGW64
|
|
@ -1,2 +0,0 @@
|
||||||
[Paths]
|
|
||||||
Plugins=.
|
|
6
msys2/ps/autobuild/rrg/client/setup.bat
Normal file
6
msys2/ps/autobuild/rrg/client/setup.bat
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
@echo off
|
||||||
|
set HOME=%~dp0
|
||||||
|
set QT_PLUGIN_PATH=%HOME%\libs\
|
||||||
|
set QT_QPA_PLATFORM_PLUGIN_PATH=%QT_PLUGIN_PATH%
|
||||||
|
set PATH=%QT_PLUGIN_PATH%;%QT_PLUGIN_PATH%shell\;%PATH%
|
||||||
|
set MSYSTEM=MINGW64
|
5
msys2/ps/autobuild/rrg/pm3-flash-all.bat
Normal file
5
msys2/ps/autobuild/rrg/pm3-flash-all.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
cd client
|
||||||
|
call setup.bat
|
||||||
|
bash pm3-flash-all
|
||||||
|
pause
|
5
msys2/ps/autobuild/rrg/pm3-flash-bootrom.bat
Normal file
5
msys2/ps/autobuild/rrg/pm3-flash-bootrom.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
cd client
|
||||||
|
call setup.bat
|
||||||
|
bash pm3-flash-bootrom
|
||||||
|
pause
|
5
msys2/ps/autobuild/rrg/pm3-flash-fullimage.bat
Normal file
5
msys2/ps/autobuild/rrg/pm3-flash-fullimage.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
cd client
|
||||||
|
call setup.bat
|
||||||
|
bash pm3-flash-fullimage
|
||||||
|
pause
|
5
msys2/ps/autobuild/rrg/pm3.bat
Normal file
5
msys2/ps/autobuild/rrg/pm3.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
cd client
|
||||||
|
call setup.bat
|
||||||
|
bash pm3
|
||||||
|
pause
|
Loading…
Add table
Add a link
Reference in a new issue