Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 22, 2024
2 parents ae34ff1 + 12e3eb2 commit fca3ed4
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 131 deletions.
228 changes: 101 additions & 127 deletions openwrt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -448,30 +448,37 @@ start_seconds=$(date --date="$starttime" +%s);
end_seconds=$(date --date="$endtime" +%s);
SEC=$((end_seconds-start_seconds));

if [ -f bin/targets/*/*/sha256sums ]; then
echo -e "${GREEN_COLOR} Build success! ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
else
echo -e "\n${RED_COLOR} Build error... ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
echo
exit 1
fi

if [ "$platform" = "x86_64" ]; then
if [ -f bin/targets/x86/64*/*-ext4-combined-efi.img.gz ]; then
echo -e "${GREEN_COLOR} Build success! ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/x86/*/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/x86_64/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf x86_64-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/x86/*/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/x86_64/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf x86_64-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
if [ "$MINIMAL_BUILD" = "y" ]; then
BUILD_TYPE=minimal
else
BUILD_TYPE=releases
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
if [ "$MINIMAL_BUILD" = "y" ]; then
BUILD_TYPE=minimal
else
BUILD_TYPE=releases
fi
VERSION=$(sed 's/v//g' version.txt)
SHA256=$(sha256sum bin/targets/x86/64*/*-generic-squashfs-combined-efi.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
VERSION=$(sed 's/v//g' version.txt)
SHA256=$(sha256sum bin/targets/x86/64*/*-generic-squashfs-combined-efi.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
{
"x86_64": [
{
Expand All @@ -482,38 +489,29 @@ if [ "$platform" = "x86_64" ]; then
]
}
EOF
fi
# Backup download cache
if [ "$isCN" = "CN" ] && [ "$1" = "rc2" ]; then
rm -rf dl/geo* dl/go-mod-cache
tar cf ../dl.gz dl
fi
exit 0
else
echo -e "\n${RED_COLOR} Build error... ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
echo
exit 1
fi
# Backup download cache
if [ "$isCN" = "CN" ] && [ "$1" = "rc2" ]; then
rm -rf dl/geo* dl/go-mod-cache
tar cf ../dl.gz dl
fi
exit 0
elif [ "$platform" = "armv8" ]; then
if [ -f bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz ]; then
echo -e "${GREEN_COLOR} Build success! ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/armsr/armv8*/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/aarch64_generic/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf armv8-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
VERSION=$(sed 's/v//g' version.txt)
SHA256=$(sha256sum bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/armsr/armv8*/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/aarch64_generic/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf armv8-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
VERSION=$(sed 's/v//g' version.txt)
SHA256=$(sha256sum bin/targets/armsr/armv8*/*-generic-squashfs-combined-efi.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
{
"armsr,armv8": [
{
Expand All @@ -524,38 +522,29 @@ elif [ "$platform" = "armv8" ]; then
]
}
EOF
fi
exit 0
else
echo -e "\n${RED_COLOR} Build error... ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
echo
exit 1
fi
exit 0
elif [ "$platform" = "bcm53xx" ]; then
if [ -f bin/targets/bcm53xx/generic/*netgear_r8500-squashfs.chk ]; then
echo -e "${GREEN_COLOR} Build success! ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/bcm53xx/generic/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/arm_cortex-a9/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf bcm53xx-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/bcm53xx/generic/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/arm_cortex-a9/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf bcm53xx-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
if [ "$MINIMAL_BUILD" = "y" ]; then
BUILD_TYPE=minimal
else
BUILD_TYPE=releases
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
if [ "$MINIMAL_BUILD" = "y" ]; then
BUILD_TYPE=minimal
else
BUILD_TYPE=releases
fi
VERSION=$(sed 's/v//g' version.txt)
SHA256=$(sha256sum bin/targets/bcm53xx/generic/*-bcm53xx-generic-netgear_r8500-squashfs.chk | awk '{print $1}')
cat > ota/fw.json <<EOF
VERSION=$(sed 's/v//g' version.txt)
SHA256=$(sha256sum bin/targets/bcm53xx/generic/*-bcm53xx-generic-netgear_r8500-squashfs.chk | awk '{print $1}')
cat > ota/fw.json <<EOF
{
"netgear,r8500": [
{
Expand All @@ -566,39 +555,30 @@ elif [ "$platform" = "bcm53xx" ]; then
]
}
EOF
fi
exit 0
else
echo -e "\n${RED_COLOR} Build error... ${RES}"
echo -e " Build time: $(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s"
echo
exit 1
fi
exit 0
else
if [ -f bin/targets/rockchip/armv8*/*-r5s-ext4-sysupgrade.img.gz ] || [ -f bin/targets/rockchip/armv8*/*-r5c-ext4-sysupgrade.img.gz ] || [ -f bin/targets/rockchip/armv8*/*-r4s-ext4-sysupgrade.img.gz ]; then
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/rockchip/armv8*/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/aarch64_generic/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf aarch64-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
if [ "$ALL_KMODS" = y ]; then
cp -a bin/targets/rockchip/armv8*/packages $kmodpkg_name
rm -f $kmodpkg_name/Packages*
# driver firmware
cp -a bin/packages/aarch64_generic/base/*firmware*.ipk $kmodpkg_name/
bash kmod-sign $kmodpkg_name
tar zcf aarch64-$kmodpkg_name.tar.gz $kmodpkg_name
rm -rf $kmodpkg_name
fi
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
if [ "$MINIMAL_BUILD" = "y" ]; then
BUILD_TYPE=minimal
else
BUILD_TYPE=releases
fi
echo -e "${GREEN_COLOR} Build success! ${RES}"
echo -e " Build time: ${GREEN_COLOR}$(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s${RES}"
# OTA json
if [ "$1" = "rc2" ]; then
mkdir -p ota
if [ "$MINIMAL_BUILD" = "y" ]; then
BUILD_TYPE=minimal
else
BUILD_TYPE=releases
fi
VERSION=$(sed 's/v//g' version.txt)
if [ "$model" = "nanopi-r4s" ]; then
SHA256=$(sha256sum bin/targets/rockchip/armv8*/*-squashfs-sysupgrade.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
VERSION=$(sed 's/v//g' version.txt)
if [ "$model" = "nanopi-r4s" ]; then
SHA256=$(sha256sum bin/targets/rockchip/armv8*/*-squashfs-sysupgrade.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
{
"friendlyarm,nanopi-r4s": [
{
Expand All @@ -609,10 +589,10 @@ else
]
}
EOF
elif [ "$model" = "nanopi-r5s" ]; then
SHA256_R5C=$(sha256sum bin/targets/rockchip/armv8*/*-r5c-squashfs-sysupgrade.img.gz | awk '{print $1}')
SHA256_R5S=$(sha256sum bin/targets/rockchip/armv8*/*-r5s-squashfs-sysupgrade.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
elif [ "$model" = "nanopi-r5s" ]; then
SHA256_R5C=$(sha256sum bin/targets/rockchip/armv8*/*-r5c-squashfs-sysupgrade.img.gz | awk '{print $1}')
SHA256_R5S=$(sha256sum bin/targets/rockchip/armv8*/*-r5s-squashfs-sysupgrade.img.gz | awk '{print $1}')
cat > ota/fw.json <<EOF
{
"friendlyarm,nanopi-r5c": [
{
Expand All @@ -630,20 +610,14 @@ EOF
]
}
EOF
fi
fi
# Backup download cache
if [ "$isCN" = "CN" ] && [ "$version" = "rc2" ]; then
rm -rf dl/geo* dl/go-mod-cache
tar -cf ../dl.gz dl
fi
exit 0
else
echo -e "\n${RED_COLOR} Build error... ${RES}"
echo -e " Build time: ${RED_COLOR}$(( SEC / 3600 ))h,$(( (SEC % 3600) / 60 ))m,$(( (SEC % 3600) % 60 ))s${RES}"
echo
exit 1
fi
# Backup download cache
if [ "$isCN" = "CN" ] && [ "$version" = "rc2" ]; then
rm -rf dl/geo* dl/go-mod-cache
tar -cf ../dl.gz dl
fi
exit 0
fi

# 很少有人会告诉你为什么要这样做,而是会要求你必须要这样做。
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ index f5db99f..24c6535 100644

-PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
+ifeq ($(PKG_VERSION),15.0.0)
+ PKG_SOURCE_URL:=https://github.com/sbwml/gcc/releases/download/gcc-$(PKG_VERSION)
+ PKG_SOURCE_URL:=https://us.cooluc.com/gcc
+else
+ PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
+endif
Expand All @@ -55,7 +55,7 @@ index f5db99f..24c6535 100644
endif

+ifeq ($(PKG_VERSION),15.0.0)
+ PKG_HASH:=fc150b3d089a0d944096f4ec3e059811f6922e5888e5bac7d516de9fc5cf402b
+ PKG_HASH:=29281a902c3011a7ab3899f1102bb9aff9ad7a0e8f92262472f00f2fcfe72d3b
+endif
+
PATCH_DIR=../patches-$(GCC_MAJOR_VERSION).x
Expand Down
2 changes: 1 addition & 1 deletion openwrt/patch/openwrt-6.x/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PKG_NAME:=perf
PKG_VERSION:=$(LINUX_VERSION)
PKG_RELEASE:=6

PKG_BUILD_FLAGS:=no-mips16 no-lto
PKG_BUILD_FLAGS:=no-mips16 no-lto no-mold
PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_FLAGS:=nonshared
Expand Down
2 changes: 1 addition & 1 deletion openwrt/patch/openwrt-6.x/perf/Makefile.2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PKG_NAME:=perf
PKG_VERSION:=$(LINUX_VERSION)
PKG_RELEASE:=6

PKG_BUILD_FLAGS:=no-mips16 no-lto
PKG_BUILD_FLAGS:=no-mips16 no-lto no-mold
PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_FLAGS:=nonshared
Expand Down

0 comments on commit fca3ed4

Please sign in to comment.