fix kernel and rootfs filesize checking, keep libstdc++ for fpv profile

pull/187/head
cronyx 2022-02-23 18:58:24 +03:00
parent f93e292b11
commit 1227019029
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# OpenIPC.org | v.20220221 # OpenIPC.org | v.20220223
# #
MAX_KERNEL_SIZE=0x200000 # 2MiB, 2097152 MAX_KERNEL_SIZE=0x200000 # 2MiB, 2097152
@ -8,6 +8,8 @@ MAX_KERNEL_SIZE_EXPERIMENTAL=0x3E8480 # ~3.9MiB, 4097152
MAX_ROOTFS_SIZE=0x500000 # 5MiB, 5242880 MAX_ROOTFS_SIZE=0x500000 # 5MiB, 5242880
MAX_KERNEL_SIZE_ULTIMATE=0xC80000 # 12,5MiB, 13107200 MAX_KERNEL_SIZE_ULTIMATE=0xC80000 # 12,5MiB, 13107200
export REQUIRE_LIBSTDC=0
clone() { clone() {
sudo apt-get update -y ; apt-get install -y bc build-essential git unzip rsync autotools-dev automake libtool sudo apt-get update -y ; apt-get install -y bc build-essential git unzip rsync autotools-dev automake libtool
git clone --depth=1 https://github.com/OpenIPC/firmware.git git clone --depth=1 https://github.com/OpenIPC/firmware.git
@ -24,7 +26,7 @@ should_fit() {
filename=$1 filename=$1
maxsize=$2 maxsize=$2
filesize=$(stat --printf="%s" ./output/images/$filename) filesize=$(stat --printf="%s" ./output/images/$filename)
if [[ $filesize -gt $MAX_KERNEL_SIZE ]]; then if [[ $filesize -gt $maxsize ]]; then
export TG_NOTIFY="Warning: $filename is too large: $filesize vs $maxsize" export TG_NOTIFY="Warning: $filename is too large: $filesize vs $maxsize"
exit 1 exit 1
fi fi
@ -133,6 +135,7 @@ gk7205v200() {
} }
gk7205v200_fpv() { gk7205v200_fpv() {
export REQUIRE_LIBSTDC=1
soc="gk7205v200" soc="gk7205v200"
fresh && make PLATFORM=goke BOARD=unknown_unknown_${soc}_fpv all && rename fresh && make PLATFORM=goke BOARD=unknown_unknown_${soc}_fpv all && rename
} }
@ -148,6 +151,7 @@ gk7205v300() {
} }
gk7205v300_fpv() { gk7205v300_fpv() {
export REQUIRE_LIBSTDC=1
soc="gk7205v300" soc="gk7205v300"
fresh && make PLATFORM=goke BOARD=unknown_unknown_${soc}_fpv all && rename fresh && make PLATFORM=goke BOARD=unknown_unknown_${soc}_fpv all && rename
} }

View File

@ -12,6 +12,6 @@ echo 'Note: BR2_TOOLCHAIN_BUILDROOT_LIBC="musl"'
ln -sfv /lib/libc.so ${TARGET_DIR}/lib/ld-uClibc.so.0 ln -sfv /lib/libc.so ${TARGET_DIR}/lib/ld-uClibc.so.0
ln -sfv ../../lib/libc.so ${TARGET_DIR}/usr/bin/ldd ln -sfv ../../lib/libc.so ${TARGET_DIR}/usr/bin/ldd
# #
# Comment out this line if you want to save the libraries if [ $(echo $REQUIRE_LIBSTDC) -eq 0 ]; then
rm -f ${TARGET_DIR}/usr/lib/libstdc++* rm -f ${TARGET_DIR}/usr/lib/libstdc++*
# fi