Verified Commit 19d1fec1 authored by Michal Hrusecky's avatar Michal Hrusecky 🦎

compile_fw: Try to unify build methods

Now both Turris and Omnia should build in more similar way.
parent bfde97fe
#!/bin/bash -xe
# Cleaning
[ -d ./tmp ] && rm -rf ./tmp
[ -d ./bin ] && rm -rf ./bin
[ -d ./logs ] && rm -rf ./logs
[ -d ./logs-nand ] && rm -rf ./logs-nand
[ -d ./logs-nor ] && rm -rf ./logs-nor
[ -d ./logs-initram ] && rm -rf ./logs-initram
[ -z "$BUILD_ALL" ] || make dirclean
if [ "$1" = turris ] || [ "$1" = omnia ]; then
export TARGET_BOARD="$1"
shift
fi
if [ -z "$TARGET_BOARD" ]; then
echo "You have to specify target board - options are 'turris' or 'omnia'"
exit 1
fi
# Clean feeds
./scripts/feeds clean
# Install luci feed
./scripts/feeds update -a
./scripts/feeds install -a
# Uninstall broken pkgs
[ \! -f ./disabled_packages.common ] || ./scripts/feeds uninstall $(echo $(cut -d '#' -f1 ./disabled_packages.common))
[ \! -f ./disabled_packages.$TARGET_BOARD ] || ./scripts/feeds uninstall $(echo $(cut -d '#' -f1 ./disabled_packages.$TARGET_BOARD))
# Build NAND FW
[ -z "$OPENWRT_BRANCH" ] || PKG_BRANCH="-$OPENWRT_BRANCH"
cat configs/common configs/$TARGET_BOARD | sed -e "s|@BOARD@|$TARGET_BOARD|" -e "s|@BRANCH@|$PKG_BRANCH|" > .config
[ -n "$BUILD_ALL" ] && echo "CONFIG_ALL=y" >> .config && echo "CONFIG_SDK=y" >> .config
[ -n "$USE_CCACHE" ] && echo "CONFIG_CCACHE=y" >> .config
make defconfig
if [ -d .git ] ; then
git log -n1 --format='%H' >files/etc/git-version
fi
make clean
make "$@"
mv ./logs ./logs-nand
#Build initramfs
echo -e "CONFIG_TARGET_ROOTFS_INITRAMFS=y\nCONFIG_TARGET_INITRAMFS_COMPRESSION_XZ=y" >> .config
make defconfig
make target/linux/compile "$@"
mv ./logs ./logs-initram
if [ "$TARGET_BOARD" = turris ]; then
cp build_dir/target-powerpc_*/linux-mpc85xx_p2020-nand/zImage-initramfs bin/mpc85xx/turris-initramfs-zimage
# Preserve the uncompressed image too
mv build_dir/target-powerpc_*/root-mpc85xx bin/mpc85xx/root
cd bin/mpc85xx/root
elif [ "$TARGET_BOARD" = omnia ]; then
cp build_dir/target-arm_*/linux-mvebu/zImage-initramfs bin/mvebu-musl/omnia-initramfs-zimage
# Preserve the uncompressed image too
mv build_dir/target-arm_*/root-mvebu bin/mvebu-musl/root
cd bin/mvebu-musl/root
fi
rm var
find -type l ! -exec test -r {} \; -delete
cd ../../..
# Clean
[ -d ./bin-nand ] && rm -rf ./bin-nand
mv ./bin ./bin-nand
[ -d ./tmp ] && rm -rf ./tmp
if [ "$TARGET_BOARD" = turris ]; then
# Build NOR FW
cp configs/config-turris-nor .config
[ -n "$USE_CCACHE" ] && echo "CONFIG_CCACHE=y" >> .config
make defconfig
make clean
make "$@"
mv ./logs ./logs-nor
[ -d ./bin/mpc85xx/packages ] && rm -rf ./bin/mpc85xx/packages
[ -d ./bin-nor ] && rm -rf ./bin-nor
mv ./bin ./bin-nor
fi
#!/bin/bash -xe
# Cleaning
rm -rf ./tmp ./bin ./logs*
[ -z "$BUILD_ALL" ] || make dirclean
# Clean feeds
./scripts/feeds clean
# Install feeds
./scripts/feeds update -a
./scripts/feeds install -a
# Uninstall eudev - conflicts with udev
./scripts/feeds uninstall eudev
# Build FW
cp configs/config-omnia .config
[ -n "$BUILD_ALL" ] && echo "CONFIG_ALL=y" >> .config && echo "CONFIG_SDK=y" >> .config
[ -n "$USE_CCACHE" ] && echo "CONFIG_CCACHE=y" >> .config
make defconfig
export TARGET_BOARD=omnia
if [ -d .git ] ; then
git log -n1 --format='%H' >files/etc/git-version
fi
make clean
make "$@"
mv ./logs ./logs-nand
# Build initramfs
echo -e "CONFIG_TARGET_ROOTFS_INITRAMFS=y\nCONFIG_TARGET_INITRAMFS_COMPRESSION_XZ=y" >> .config
make defconfig
make target/linux/compile "$@"
mv ./logs ./logs-initram
cp build_dir/target-arm_*/linux-mvebu/zImage-initramfs bin/mvebu-musl/omnia-initramfs-zimage
# Preserve the uncompressed image too
mv build_dir/target-arm_*/root-mvebu bin/mvebu-musl/root
cd bin/mvebu-musl/root
rm var
find -type l ! -exec test -r {} \; -delete
cd ../../..
# Clean
rm -rf ./bin-nand
mv ./bin ./bin-nand
rm -rf ./tmp
#!/bin/sh -x
`dirname "$0"`/compile_fw omnia "$@"
#!/bin/bash -xe
# Cleaning
[ -d ./tmp ] && rm -rf ./tmp
[ -d ./bin ] && rm -rf ./bin
[ -d ./logs ] && rm -rf ./logs
[ -d ./logs-nand ] && rm -rf ./logs-nand
[ -d ./logs-nor ] && rm -rf ./logs-nor
[ -d ./logs-initram ] && rm -rf ./logs-initram
[ -z "$BUILD_ALL" ] || make dirclean
# Clean feeds
./scripts/feeds clean
# Install luci feed
./scripts/feeds update -a
./scripts/feeds install -a
# Uninstall broken pkgs
./scripts/feeds uninstall $(echo $(cut -d '#' -f1 ./disabled_packages))
# Build NAND FW
cp configs/config-turris-nand .config
[ -n "$BUILD_ALL" ] && echo "CONFIG_ALL=y" >> .config && echo "CONFIG_SDK=y" >> .config
[ -n "$USE_CCACHE" ] && echo "CONFIG_CCACHE=y" >> .config
make defconfig
export TARGET_BOARD=turris
if [ -d .git ] ; then
git log -n1 --format='%H' >files/etc/git-version
fi
make clean
make "$@"
mv ./logs ./logs-nand
#Build initramfs
echo -e "CONFIG_TARGET_ROOTFS_INITRAMFS=y\nCONFIG_TARGET_INITRAMFS_COMPRESSION_XZ=y" >> .config
make defconfig
make target/linux/compile "$@"
mv ./logs ./logs-initram
cp build_dir/target-powerpc_*/linux-mpc85xx_p2020-nand/zImage-initramfs bin/mpc85xx/turris-initramfs-zimage
# Preserve the uncompressed image too
mv build_dir/target-powerpc_*/root-mpc85xx bin/mpc85xx/root
cd bin/mpc85xx/root
rm var
find -type l ! -exec test -r {} \; -delete
cd ../../..
# Clean
[ -d ./bin-nand ] && rm -rf ./bin-nand
mv ./bin ./bin-nand
[ -d ./tmp ] && rm -rf ./tmp
# Build NOR FW
cp configs/config-turris-nor .config
[ -n "$USE_CCACHE" ] && echo "CONFIG_CCACHE=y" >> .config
make defconfig
make clean
make "$@"
mv ./logs ./logs-nor
[ -d ./bin/mpc85xx/packages ] && rm -rf ./bin/mpc85xx/packages
[ -d ./bin-nor ] && rm -rf ./bin-nor
mv ./bin ./bin-nor
#!/bin/sh -x
`dirname "$0"`/compile_fw turris "$@"
CONFIG_ATH_USER_REGD=y
CONFIG_VERSION_FILENAMES=n
CONFIG_TARGET_mvebu=y
CONFIG_TARGET_mvebu_Turris-Omnia=y
# CONFIG_TARGET_BOARD="mvebu"
# CONFIG_TARGET_ARCH_PACKAGES="mvebu"
CONFIG_TARGET_ROOTFS_EXT4FS=y
CONFIG_TARGET_ROOTFS_BTRFS=y
CONFIG_TARGET_ROOTFS_TARGZ=y
CONFIG_TARGET_ROOTFS_SQUASHFS=n
# CONFIG_TARGET_ROOTFS_TARGZ=y
CONFIG_TARGET_ROOTFS_PARTSIZE=64
CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL=y
CONFIG_TARGET_ROOTFS_INCLUDE_DTB=y
CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE=y
CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE=n
CONFIG_TARGET_ROOTFS_INCLUDE_FIT=n
CONFIG_DEVEL=y
CONFIG_TARGET_OPTIONS=y
CONFIG_TARGET_OPTIMIZATION="-O2 -pipe -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16"
CONFIG_SOFT_FLOAT=n
CONFIG_IMAGEOPT=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_REPO="https://api.turris.cz/openwrt-repo/omnia/packages"
CONFIG_VERSION_NICK="omnia"
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_CROND=n
CONFIG_BUSYBOX_CONFIG_CRONTAB=n
CONFIG_BUSYBOX_CONFIG_SYSLOGD=n
CONFIG_BUSYBOX_CONFIG_STTY=y
CONFIG_VERSION_REPO="https://api.turris.cz/openwrt-repo/@BOARD@@BRANCH@/packages/"
CONFIG_VERSION_NICK="@BOARD@"
# Disable package signing for now (we don't preserve signing key)
CONFIG_SIGNED_PACKAGES=n
# Use musl for Omnia
CONFIG_TOOLCHAINOPTS=y
CONFIG_LIBC_USE_MUSL=y
CONFIG_USE_MUSL=y
CONFIG_MUSL_VERSION="1.1.11"
# LXC related stuff
CONFIG_KERNEL_NAMESPACES=y
CONFIG_KERNEL_UTS_NS=y
......@@ -60,11 +42,18 @@ CONFIG_LXC_KERNEL_OPTIONS=y
# Make sure we use real strip, that one leaves the debug link in
CONFIG_USE_STRIP=y
# Built-in packages
CONFIG_PACKAGE_kmod-fs-ext4=y
# Packages built as modules all the time
CONFIG_PACKAGE_updater-testkey=m
CONFIG_PACKAGE_updater-consolidator=m
CONFIG_PACKAGE_updater-deps=m
CONFIG_PACKAGE_updater-hash-check=m
CONFIG_PACKAGE_openssh-server=m
CONFIG_PACKAGE_openssh_server_nuci_support=y
CONFIG_PACKAGE_rssh=m
CONFIG_PACKAGE_nuci-nethist=m
CONFIG_PACKAGE_nuci-securris=m
CONFIG_PACKAGE_nuci-tls=m
CONFIG_PACKAGE_oneshot=y
# Modular packages compiled every time
CONFIG_PACKAGE_ca-certificates=m
CONFIG_PACKAGE_kmod-fs-vfat=m
CONFIG_PACKAGE_kmod-ebtables=m
......@@ -79,7 +68,6 @@ CONFIG_PACKAGE_kmod-bridge=m
CONFIG_PACKAGE_kmod-llc=m
CONFIG_PACKAGE_kmod-stp=m
CONFIG_PACKAGE_kmod-tun=m
CONFIG_PACKAGE_kmod-usb-storage-extras=m
CONFIG_PACKAGE_conntrack-tools=m
CONFIG_PACKAGE_ebtables=m
CONFIG_PACKAGE_iptables-mod-tproxy=m
......@@ -92,8 +80,24 @@ CONFIG_PACKAGE_bash=m
CONFIG_PACKAGE_vim-full=m
CONFIG_PACKAGE_psmisc=m
CONFIG_PACKAGE_htop=m
# CONFIG_PACKAGE_mtd-utils-nandtest=m
# CONFIG_PACKAGE_mtd-utils-nanddump=m
CONFIG_PACKAGE_kmod-usb-storage-extras=m
# Little hardening
CONFIG_NEED_TOOLCHAIN=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_PKG_CHECK_FORMAT_SECURITY=y
CONFIG_PKG_FORTIFY_SOURCE_2=y
CONFIG_PKG_RELRO_FULL=y
# Opkg configuration
CONFIG_OPKG_SUPPORT_MD5=y
# Few useful kernel options
CONFIG_KERNEL_AIO=y
CONFIG_KERNEL_DIRECT_IO=y
CONFIG_KERNEL_FHANDLE=y
CONFIG_KERNEL_FANOTIFY=y
CONFIG_KERNEL_BLK_DEV_BSG=y
# Few handy customizations
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
CONFIG_TARGET_mvebu=y
CONFIG_TARGET_mvebu_Turris-Omnia=y
# CONFIG_TARGET_BOARD="mvebu"
# CONFIG_TARGET_ARCH_PACKAGES="mvebu"
CONFIG_TARGET_ROOTFS_EXT4FS=y
CONFIG_TARGET_ROOTFS_TARGZ=y
CONFIG_TARGET_ROOTFS_PARTSIZE=64
CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL=y
CONFIG_TARGET_ROOTFS_INCLUDE_DTB=y
CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE=y
CONFIG_TARGET_OPTIMIZATION="-O2 -pipe -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16"
CONFIG_SOFT_FLOAT=n
# Disable package signing for now (we don't preserve signing key)
# Use musl for Omnia
CONFIG_LIBC_USE_MUSL=y
CONFIG_USE_MUSL=y
CONFIG_MUSL_VERSION="1.1.11"
# Other needed packages
CONFIG_PACKAGE_cert-backup=y
CONFIG_PACKAGE_unbound-anchor=y
CONFIG_PACKAGE_wireless-tools=y
CONFIG_PACKAGE_openssh-server=y
CONFIG_ATH_USER_REGD=y
CONFIG_VERSION_FILENAMES=n
CONFIG_TARGET_mpc85xx=y
CONFIG_TARGET_mpc85xx_p2020_nand=y
CONFIG_TARGET_mpc85xx_p2020_nand_TURRISNAND=y
CONFIG_HAS_SUBTARGETS=y
CONFIG_TARGET_BOARD="mpc85xx"
CONFIG_TARGET_ARCH_PACKAGES="mpc85xx"
CONFIG_TARGET_ROOTFS_TARGZ=y
CONFIG_TARGET_ROOTFS_JFFS2_NAND=n
CONFIG_TARGET_ROOTFS_SQUASHFS=n
CONFIG_TARGET_ROOTFS_UBIFS=y
CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL=n
CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE=n
CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE=n
CONFIG_TARGET_ROOTFS_INCLUDE_FIT=n
CONFIG_TARGET_ROOTFS_INCLUDE_DTB=n
CONFIG_DEVEL=y
CONFIG_TARGET_OPTIONS=y
CONFIG_TARGET_OPTIMIZATION="-O2 -pipe -mcpu=8540"
CONFIG_IMAGEOPT=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_REPO="https://api.turris.cz/openwrt-repo/turris/packages/"
CONFIG_VERSION_NICK="turris"
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_CROND=n
CONFIG_BUSYBOX_CONFIG_CRONTAB=n
CONFIG_BUSYBOX_CONFIG_SYSLOGD=n
CONFIG_BUSYBOX_CONFIG_STTY=y
# Disable package signing for now (we don't preserve signing key)
CONFIG_SIGNED_PACKAGES=n
# LXC related stuff
CONFIG_KERNEL_NAMESPACES=y
CONFIG_KERNEL_UTS_NS=y
CONFIG_KERNEL_IPC_NS=y
CONFIG_KERNEL_PID_NS=y
CONFIG_KERNEL_USER_NS=y
CONFIG_KERNEL_NET_NS=y
CONFIG_KERNEL_LXC_MISC=y
CONFIG_KERNEL_CGROUPS=y
CONFIG_KERNEL_CGROUP_DEVICE=y
CONFIG_KERNEL_CGROUP_SCHED=y
CONFIG_KERNEL_CGROUP_CPUACCT=y
CONFIG_KERNEL_CGROUP_FREEZER=y
CONFIG_KERNEL_CPUSETS=y
CONFIG_KERNEL_RESOURCE_COUNTERS=y
CONFIG_KERNEL_MEMCG=y
CONFIG_KERNEL_MEMCG_SWAP=y
CONFIG_LXC_BUSYBOX_OPTIONS=y
CONFIG_LXC_KERNEL_OPTIONS=y
# Make sure we use real strip, that one leaves the debug link in
CONFIG_USE_STRIP=y
# These are needed as packages for updater
# Packages built as modules all the time
CONFIG_PACKAGE_ucollect-badconf=m
CONFIG_PACKAGE_ucollect-buckets=m
CONFIG_PACKAGE_ucollect-prog=m
......@@ -68,18 +26,8 @@ CONFIG_PACKAGE_lcollect-majordomo=m
CONFIG_PACKAGE_luci-app-majordomo=m
CONFIG_PACKAGE_luci-app-rainbow=m
CONFIG_PACKAGE_daemon-watchdog=m
CONFIG_PACKAGE_updater-testkey=m
CONFIG_PACKAGE_updater-consolidator=m
CONFIG_PACKAGE_updater-deps=m
CONFIG_PACKAGE_updater-hash-check=m
CONFIG_PACKAGE_openssh-server=m
CONFIG_PACKAGE_openssh_server_nuci_support=y
CONFIG_PACKAGE_rssh=m
CONFIG_PACKAGE_sshtunnel=m
CONFIG_PACKAGE_nikola=m
CONFIG_PACKAGE_nuci-nethist=m
CONFIG_PACKAGE_nuci-securris=m
CONFIG_PACKAGE_nuci-tls=m
CONFIG_PACKAGE_nuci-smrt=m
CONFIG_PACKAGE_getbranch-test=m
CONFIG_PACKAGE_turris-firewall-rules=m
......@@ -91,63 +39,16 @@ CONFIG_PACKAGE_knot-host=m
CONFIG_PACKAGE_knot-nsupdate=m
CONFIG_PACKAGE_knot-nsec3hash=m
CONFIG_PACKAGE_knot-tests=m
CONFIG_PACKAGE_oneshot=y
CONFIG_PACKAGE_foris-oldconfig=m
CONFIG_PACKAGE_foris-tls-plugin=m
CONFIG_PACKAGE_squid=m
CONFIG_PACKAGE_ca-certificates=m
CONFIG_PACKAGE_kmod-fs-vfat=m
CONFIG_PACKAGE_kmod-fs-ext4=m
CONFIG_PACKAGE_ouidb=m
CONFIG_PACKAGE_kmod-ebtables=m
CONFIG_PACKAGE_kmod-ebtables-ipv4=m
CONFIG_PACKAGE_kmod-ebtables-ipv6=m
CONFIG_PACKAGE_kmod-ebtables-watchers=m
CONFIG_PACKAGE_kmod-ipt-compat-xtables=m
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=m
CONFIG_PACKAGE_kmod-ipt-ipmark=m
CONFIG_PACKAGE_kmod-ipt-tproxy=m
CONFIG_PACKAGE_kmod-bridge=m
CONFIG_PACKAGE_kmod-llc=m
CONFIG_PACKAGE_kmod-stp=m
CONFIG_PACKAGE_kmod-tun=m
CONFIG_PACKAGE_conntrack-tools=m
CONFIG_PACKAGE_ebtables=m
CONFIG_PACKAGE_iptables-mod-tproxy=m
CONFIG_PACKAGE_ip6tables-mod-nat=m
CONFIG_PACKAGE_openssh-client-utils=m
CONFIG_PACKAGE_openssh-client=m
CONFIG_PACKAGE_openssh-sftp-server=m
CONFIG_PACKAGE_openssh-sftp-client=m
CONFIG_PACKAGE_bash=m
CONFIG_PACKAGE_vim-full=m
CONFIG_PACKAGE_psmisc=m
CONFIG_PACKAGE_htop=m
CONFIG_PACKAGE_logsend=m
CONFIG_PACKAGE_mtd-utils-nandtest=m
CONFIG_PACKAGE_mtd-utils-nanddump=m
CONFIG_PACKAGE_kmod-usb-storage-extras=m
CONFIG_PACKAGE_kmod-mmc=m
CONFIG_PACKAGE_kmod-mmc-fsl-p2020=m
CONFIG_PACKAGE_smrt=m
CONFIG_PACKAGE_smrt-image=m
# Little hardening
CONFIG_NEED_TOOLCHAIN=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_PKG_CHECK_FORMAT_SECURITY=y
CONFIG_PKG_FORTIFY_SOURCE_2=y
CONFIG_PKG_RELRO_FULL=y
# Opkg configuration
CONFIG_OPKG_SUPPORT_MD5=y
# Few useful kernel options
CONFIG_KERNEL_AIO=y
CONFIG_KERNEL_DIRECT_IO=y
CONFIG_KERNEL_FHANDLE=y
CONFIG_KERNEL_FANOTIFY=y
CONFIG_KERNEL_BLK_DEV_BSG=y
# Few handy customizations
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
node # cant't be built on PPC
node-arduino-firmata # depends on node
node-cylon # depends on node
node-hid # depends on node
node-serialport # depends on node
libseccomp # PPC not supported in v2.2.1 yet
micropython # incompatible with PPC
gcc # broken in upstream
gpsd # broken in upstream
grilo-plugins # broken in upstream
......
node # cant't be built on PPC
node-arduino-firmata # depends on node
node-cylon # depends on node
node-hid # depends on node
node-serialport # depends on node
libseccomp # PPC not supported in v2.2.1 yet
micropython # incompatible with PPC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment