-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild_image.sh
More file actions
32 lines (26 loc) · 1.06 KB
/
build_image.sh
File metadata and controls
32 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
export VOLUME_HOME=$(pwd)
export BUILD_DIR="/builder"
export BUILDER="buildbot"
cd $BUILD_DIR
apt-get update
apt install sudo tree -y
tree packages/mypackages
chown -R $BUILDER:$BUILDER packages
sudo -u $BUILDER sed -i "s/CONFIG_TARGET_ROOTFS_PARTSIZE=[0-9]\+/CONFIG_TARGET_ROOTFS_PARTSIZE=$ROOTFS_SIZE/g;s/CONFIG_TARGET_KERNEL_PARTSIZE=[0-9]\+/CONFIG_TARGET_KERNEL_PARTSIZE=$KERNEL_SIZE/g" .config
echo $PROFILE
# For OpenWRT 25.x (apk), need to allow untrusted packages
if [[ "$VERSION" == 25.* ]]; then
echo "OpenWRT 25.x detected, disabling signature check for custom packages..."
sed -i 's/CONFIG_SIGNATURE_CHECK=y/# CONFIG_SIGNATURE_CHECK is not set/' .config
fi
sudo -u $BUILDER make image PROFILE=$PROFILE PACKAGES="$PACKAGES packages/mypackages/*"
tree bin/targets
if [ "$ARCH" == "x86-64" ]; then
cp bin/targets/x86/64/* /openwrt_output/
elif [ "$ARCH" == "rockchip-armv8" ]; then
cp bin/targets/rockchip/armv8/* /openwrt_output/
elif [ "$ARCH" == "mediatek-filogic" ]; then
cp bin/targets/mediatek/filogic/* /openwrt_output/
fi