"make download" fails

Hi,

I'm trying to build OpenWrt (main branch, HEAD at 5b1d6d4607e4 ("kernel: crypto: add SHA512 ARM64 ASM optimized module")) for the first time using the steps at https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem.

I cannot proceed past the "make download" step, which fails. I've attached a log where it fails directly after a clean git clone, with V=sc: https://pastebin.com/TWMZ4y0h
My host environment is Ubuntu 22.04.4.

The important part of the failure seems to be this.

make[2]: Entering directory '/opt/openwrt/toolchain/kernel-headers'
WARNING: linux-.tar.xz is missing, please run make download before re-running this check
mkdir -p /opt/openwrt/dl
SHELL= flock /opt/openwrt/tmp/.linux-.tar.xz.flock -c '         /opt/openwrt/scripts/download.pl "/opt/openwrt/dl" "linux-.tar.xz" "x" "" "@KERNEL/linux/kernel/v.x"      '
Cannot find appropriate hash command, ensure the provided hash is either a MD5 or SHA256 checksum.
make[2]: *** [Makefile:117: /opt/openwrt/dl/linux-.tar.xz] Error 255
make[2]: Leaving directory '/opt/openwrt/toolchain/kernel-headers'
time: toolchain/kernel-headers/download#0.02#0.01#0.04
    ERROR: toolchain/kernel-headers failed to build.
make[1]: *** [toolchain/Makefile:93: toolchain/kernel-headers/download] Error 1

"linux-.tar.xz" seems to be generated by include/kernel.mk and put into LINUX_SOURCE. I cannot seem to figure out why LINUX_VERSION is unset (or better said, how is it supposed to reach there from include/kernel-version.mk, which is where it appears to be set).

Does anybody know what I am doing wrong?

nvm edited it

I'm just trying to build the master branch of OpenWrt, without making any changes to it. That should use kernel 6.1 for the target I'm trying to build (armsr).

what happens when you run

sha256sum dl/linux-6.1.80.tar.xz

from the openwrt directory ?

$ sha256sum dl/linux-6.1.80.tar.xz
568ecaaebb8b87c7c8246bba67bc83402972bf34f5811651a2d3cd548ff7b671  dl/linux-6.1.80.tar.xz

ok and
cat include/kernel-6.1

I haven't changed it:

$ cat include/kernel-6.1
LINUX_VERSION-6.1 = .80
LINUX_KERNEL_HASH-6.1.80 = 568ecaaebb8b87c7c8246bba67bc83402972bf34f5811651a2d3cd548ff7b671

weird, maybe you're missing tar or xz commands

Have you seen that it's running download.pl on a non-existing file name called linux-.tar.xz instead of linux-6.1.80.tar.xz?

Definitely not missing tar and xz.

$ xz
xz: Compressed data cannot be written to a terminal
xz: Try `xz --help' for more information.
$ tar
tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try 'tar --help' or 'tar --usage' for more information.

maybe its something introduced lately, maybe try git reset to e8a2fd241d270097b938cae4d11c7d2fd43561d8

its that or maybe your config / tmp has been messed up maybe

rm -rf tmp
make menuconfig

then try again ?

Even release tag v23.05.2 behaves the same (and also the sha1sum you requested).

$ make download                                                                                                                                                       [10/9258]
 make[1] tools/download                                                                                                                                                                                      
 make[2] target/prereq                                                                                                                                                                                       
 make[3] -C target/linux prereq                                                                                                                                                                              
 make[2] -C tools/autoconf download                                                                                                                                                                          
 make[2] -C tools/autoconf-archive download                                                                                                                                                                  
 make[2] -C tools/automake download                                                                                                                                                                          
 make[2] -C tools/bc download                                                                                                                                                                                
 make[2] -C tools/bison download                                                                                                                                                                             
 make[2] -C tools/cmake download                                                                                                                                                                             
 make[2] -C tools/cpio download                                                                                                                                                                              
 make[2] -C tools/dosfstools download
 make[2] -C tools/e2fsprogs download
 make[2] -C tools/expat download
 make[2] -C tools/fakeroot download
 make[2] -C tools/findutils download
 make[2] -C tools/firmware-utils download
 make[2] -C tools/flex download
 make[2] -C tools/gengetopt download
 make[2] -C tools/gnulib download
 make[2] -C tools/libressl download
 make[2] -C tools/libtool download
 make[2] -C tools/lzma download
 make[2] -C tools/m4 download
 make[2] -C tools/make-ext4fs download
 make[2] -C tools/meson download
 make[2] -C tools/missing-macros download
 make[2] -C tools/mkimage download
 make[2] -C tools/mklibs download
 make[2] -C tools/mtd-utils download
 make[2] -C tools/mtools download
 make[2] -C tools/ninja download
 make[2] -C tools/padjffs2 download
 make[2] -C tools/patch-image download
 make[2] -C tools/patchelf download
 make[2] -C tools/pkgconf download
 make[2] -C tools/quilt download
 make[2] -C tools/squashfs4 download
 make[2] -C tools/sstrip download
 make[2] -C tools/zip download
 make[2] -C tools/zlib download
 make[2] -C tools/zstd download
 make[2] -C tools/gmp download
 make[2] -C tools/mpc download
 make[2] -C tools/mpfr download
 make[2] -C tools/elfutils download
 make[2] -C tools/libdeflate download
 make[2] -C tools/patch download
 make[2] -C tools/tar download
 make[2] -C tools/xz download
 make[2] -C tools/flock download
 make[2] -C tools/sed download
 make[1] toolchain/download
 make[2] -C toolchain/gdb download
 make[2] -C toolchain/kernel-headers download
    ERROR: toolchain/kernel-headers failed to build.
make toolchain/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
 make[1] package/download
 make[2] -C package/kernel/linux download
 make[1] target/download
 make[2] -C target/linux download

have you installed all the stuff you need to build for sure ? check here https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem#debianubuntu

also try
make V=s download
to maybe see more info

Everything that is listed there is installed.

$ sudo apt install build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev \
python3-distutils rsync unzip zlib1g-dev file wget
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
clang is already the newest version (1:19.0-58~exp2+0~20240303091736.15~1.gbp3b61b3).
bison is already the newest version (2:3.8.2+dfsg-1build1).
build-essential is already the newest version (12.9ubuntu3).
flex is already the newest version (2.6.4-8build2).
g++ is already the newest version (4:11.2.0-1ubuntu1).
g++-multilib is already the newest version (4:11.2.0-1ubuntu1).
gcc-multilib is already the newest version (4:11.2.0-1ubuntu1).
gettext is already the newest version (0.21-4ubuntu4).
wget is already the newest version (1.21.2-2ubuntu1).
file is already the newest version (1:5.41-3ubuntu0.1).
gawk is already the newest version (1:5.1.0-1ubuntu0.1).
git is already the newest version (1:2.34.1-1ubuntu1.10).
libncurses-dev is already the newest version (6.3-2ubuntu0.1).
libssl-dev is already the newest version (3.0.2-0ubuntu1.15).
python3-distutils is already the newest version (3.10.8-1~22.04).
rsync is already the newest version (3.2.7-0ubuntu0.22.04.2).
unzip is already the newest version (6.0-26ubuntu3.2).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu9.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

There's a pastebin link in the initial post, which shows the verbose "make download" output already.

guess i'm tapping out haha
the only other thing i can think of is target/linux/armsr/Makefile got edited somehow to have no kernel version in it

Actually, trying to build ramips and layerscape, "make download" fails in the same way - for the "kernel-headers" package.

No problem, thanks for the help.

What packages did you select with menuconfig. You can run ./scripts/diffconfig.sh that gives you the diff of the config (which you can expand later with make defconfig. E.g:

~/projects/openwrt # ./scripts/diffconfig.sh
CONFIG_TARGET_armsr=y
CONFIG_TARGET_armsr_armv8=y
CONFIG_TARGET_armsr_armv8_DEVICE_generic=y

And is the linux version set to 6.1.80 in ./tmp/info/.targetinfo-armsr?

1 Like
$ ./scripts/diffconfig.sh
CONFIG_TARGET_armsr=y
CONFIG_TARGET_armsr_armv8=y
CONFIG_TARGET_armsr_armv8_DEVICE_generic=y
$ cat tmp/info/.targetinfo-armsr
Source-Makefile: target/linux/armsr/Makefile
Target: armsr
Target-Board: armsr
Target-Name: Arm SystemReady (EFI) compliant
Target-Arch:
Target-Arch-Packages:
Target-Features: boot-part cpiogz dt ext4 fpu gpio pci pcie ramdisk rootfs-part rtc squashfs targz usb virtio vmdk
Target-Depends:
Target-Optimization: -Os -pipe
CPU-Type:
Linux-Version: 6.1.80
Linux-Release: 1
Linux-Kernel-Arch: arm64
Target-Description:

@@
Default-Packages: base-files ca-bundle dropbear fstools libc libgcc libustream-mbedtls logd mtd netifd opkg uci uclient-fetch urandom-seed urngd busybox procd procd-ujail dnsmasq firewall4 nftables kmod-nf
t-offload odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe mkf2fs e2fsprogs blkid kmod-fs-vfat
Target: armsr/armv7
Target-Board: armsr
Target-Name: 32-bit (armv7) machines
Target-Arch: arm
Target-Arch-Packages: arm_cortex-a15_neon-vfpv4
Target-Features: arm_v7 boot-part cpiogz dt ext4 fpu gpio pci pcie ramdisk rootfs-part rtc squashfs targz usb virtio vmdk
Target-Depends:
Target-Optimization: -Os -pipe
CPU-Type: cortex-a15+neon-vfpv4
Linux-Version: 6.1.80
Linux-Release: 1
Linux-Kernel-Arch: arm
Target-Description:
  Build images for 32-bit (armv7) machines
@@
Default-Packages: base-files ca-bundle dropbear fstools libc libgcc libustream-mbedtls logd mtd netifd opkg uci uclient-fetch urandom-seed urngd busybox procd procd-ujail dnsmasq firewall4 nftables kmod-nf
t-offload odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe mkf2fs e2fsprogs blkid kmod-fs-vfat
Target-Profile: DEVICE_generic
Target-Profile-Name: Generic EFI Boot
Target-Profile-Packages: kmod-amazon-ena kmod-e1000e kmod-vmxnet3 kmod-rtc-rx8025 kmod-i2c-mux-pca954x kmod-gpio-pca953x partx-utils kmod-wdt-sp805 kmod-mvneta kmod-mvpp2 kmod-fsl-dpaa1-net kmod-fsl-dpaa2-
net kmod-fsl-enetc-net kmod-dwmac-imx kmod-fsl-fec kmod-thunderx-net kmod-dwmac-rockchip kmod-dwmac-sun8i kmod-phy-aquantia kmod-phy-broadcom kmod-phy-marvell kmod-phy-marvell-10g kmod-sfp kmod-atlantic km
od-bcmgenet kmod-octeontx2-net
Target-Profile-hasImageMetadata: 1
Target-Profile-SupportedDevices:


Target-Profile-Description:
Build firmware images for Generic EFI Boot






@@

Target: armsr/armv8
Target-Board: armsr
Target-Name: 64-bit (armv8) machines
Target-Arch: aarch64
Target-Arch-Packages: aarch64_generic
Target-Features: boot-part cpiogz display dt ext4 fpu gpio pci pcie ramdisk rootfs-part rtc squashfs targz usb virtio vmdk
Target-Depends:
Target-Optimization: -Os -pipe -mcpu=generic
CPU-Type: generic
Linux-Version: 6.1.80
Linux-Release: 1
Linux-Kernel-Arch: arm64
Target-Description:
  Build multi-platform images for the ARMv8 instruction set architecture
@@
Default-Packages: base-files ca-bundle dropbear fstools libc libgcc libustream-mbedtls logd mtd netifd opkg uci uclient-fetch urandom-seed urngd busybox procd procd-ujail dnsmasq firewall4 nftables kmod-nf
t-offload odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe mkf2fs e2fsprogs blkid kmod-fs-vfat
Target-Profile: DEVICE_generic
Target-Profile-Name: Generic EFI Boot
Target-Profile-Packages: kmod-amazon-ena kmod-e1000e kmod-vmxnet3 kmod-rtc-rx8025 kmod-i2c-mux-pca954x kmod-gpio-pca953x partx-utils kmod-wdt-sp805 kmod-mvneta kmod-mvpp2 kmod-fsl-dpaa1-net kmod-fsl-dpaa2-
net kmod-fsl-enetc-net kmod-dwmac-imx kmod-fsl-fec kmod-thunderx-net kmod-dwmac-rockchip kmod-dwmac-sun8i kmod-phy-aquantia kmod-phy-broadcom kmod-phy-marvell kmod-phy-marvell-10g kmod-sfp kmod-atlantic km
od-bcmgenet kmod-octeontx2-net
Target-Profile-hasImageMetadata: 1
Target-Profile-SupportedDevices:


Target-Profile-Description:
Build firmware images for Generic EFI Boot






@@


$ make download
make[2]: Entering directory '/opt/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/opt/openwrt/scripts/config'
WARNING: linux-6.1.80.tar.xz is missing, please run make download before re-running this check
time: target/linux/prereq#0.06#0.05#0.11
 make[1] tools/flock/compile
 make[2] -C tools/flock compile
 make[1] tools/download
 make[2] -C tools/autoconf download
 make[2] -C tools/autoconf-archive download
 make[2] -C tools/automake download
 make[2] -C tools/bc download
 make[2] -C tools/bison download
 make[2] -C tools/cmake download
 make[2] -C tools/cpio download
 make[2] -C tools/dosfstools download
 make[2] -C tools/e2fsprogs download
 make[2] -C tools/elfutils download
 make[2] -C tools/expat download
 make[2] -C tools/fakeroot download
 make[2] -C tools/findutils download
 make[2] -C tools/firmware-utils download
 make[2] -C tools/flex download
 make[2] -C tools/gengetopt download
 make[2] -C tools/gnulib download
 make[2] -C tools/libressl download
 make[2] -C tools/libtool download
 make[2] -C tools/lzma download
 make[2] -C tools/m4 download
 make[2] -C tools/make-ext4fs download
 make[2] -C tools/meson download
 make[2] -C tools/missing-macros download
 make[2] -C tools/mkimage download
 make[2] -C tools/mklibs download
 make[2] -C tools/mtd-utils download
 make[2] -C tools/mtools download
 make[2] -C tools/ninja download
 make[2] -C tools/padjffs2 download
 make[2] -C tools/patch-image download
 make[2] -C tools/patchelf download
 make[2] -C tools/pkgconf download
 make[2] -C tools/quilt download
 make[2] -C tools/squashfs4 download
 make[2] -C tools/sstrip download
 make[2] -C tools/zip download
 make[2] -C tools/zlib download
 make[2] -C tools/zstd download
 make[2] -C tools/gmp download
 make[2] -C tools/mpc download
 make[2] -C tools/mpfr download
 make[2] -C tools/libdeflate download
 make[2] -C tools/patch download
 make[2] -C tools/tar download
 make[2] -C tools/xz download
 make[2] -C tools/flock download
 make[2] -C tools/sed download
 make[1] toolchain/download
 make[2] -C toolchain/gdb download
 make[2] -C toolchain/kernel-headers download
    ERROR: toolchain/kernel-headers failed to build.
make toolchain/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
 make[1] package/download
 make[2] -C package/kernel/linux download
 make[1] target/download
 make[2] -C target/linux download