Make fails with .git and build_dir on external USB drive in GNU/Linux

I successfully built OpenWrt last week, but now my internal hard drive is full, so I removed the OpenWrt directory and re-cloned and reinstalled on an external USB drive. I'm using Manjaro GNU/Linux. Here's what I ran and the error messages:

[user@system openwrt]$ git status
On branch openwrt-18.06
Your branch is up to date with 'origin/openwrt-18.06'.

nothing to commit, working tree clean

[user@system openwrt]$ ./scripts/feeds update -a
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git;openwrt-18.06' ...
Already up to date.
Create index file './feeds/packages.index' 
Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git;openwrt-18.06' ...
Already up to date.
Create index file './feeds/luci.index' 
Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git;openwrt-18.06' ...
Already up to date.
Create index file './feeds/routing.index' 
Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git;openwrt-18.06' ...
Already up to date.
Create index file './feeds/telephony.index' 

[user@system openwrt]$ ./scripts/feeds install -a
WARNING: Makefile 'package/feeds/packages/gnutls/Makefile' has a dependency on 'kmod-cryptodev', which does not exist
Installing all packages from feed packages.
Installing all packages from feed luci.
Installing all packages from feed routing.
Installing all packages from feed telephony.

[user@system openwrt]$ make menuconfig
WARNING: Makefile 'package/feeds/packages/gnutls/Makefile' has a dependency on 'kmod-cryptodev', which does not exist
tmp/.config-package.in:718:warning: ignoring unsupported character '@'
tmp/.config-package.in:718:warning: ignoring unsupported character '@'
tmp/.config-package.in:803:warning: ignoring unsupported character '@'
tmp/.config-package.in:857:warning: ignoring unsupported character '@'
tmp/.config-package.in:857:warning: ignoring unsupported character '@'
tmp/.config-package.in:857:warning: ignoring unsupported character '@'
tmp/.config-package.in:857:warning: ignoring unsupported character '@'
tmp/.config-package.in:857:warning: ignoring unsupported character '@'
tmp/.config-package.in:13380:warning: ignoring unsupported character '@'
tmp/.config-package.in:14349:warning: ignoring unsupported character '@'
tmp/.config-package.in:14762:warning: ignoring unsupported character '@'
tmp/.config-package.in:16283:warning: ignoring unsupported character '@'
tmp/.config-package.in:17420:warning: ignoring unsupported character '@'
tmp/.config-package.in:17420:warning: ignoring unsupported character '@'
tmp/.config-package.in:17434:warning: ignoring unsupported character '@'
tmp/.config-package.in:17434:warning: ignoring unsupported character '@'
tmp/.config-package.in:17448:warning: ignoring unsupported character '@'
tmp/.config-package.in:17448:warning: ignoring unsupported character '@'
tmp/.config-package.in:17461:warning: ignoring unsupported character '@'
tmp/.config-package.in:17461:warning: ignoring unsupported character '@'
tmp/.config-package.in:31997:warning: ignoring unsupported character '@'
tmp/.config-package.in:32001:warning: ignoring unsupported character '@'
tmp/.config-package.in:32038:warning: ignoring unsupported character '@'
tmp/.config-package.in:32045:warning: ignoring unsupported character '@'
tmp/.config-package.in:32075:warning: ignoring unsupported character '@'
tmp/.config-package.in:99770:warning: ignoring unsupported character '@'
tmp/.config-package.in:99770:warning: ignoring unsupported character '@'
tmp/.config-package.in:99770:warning: ignoring unsupported character '@'
tmp/.config-package.in:99770:warning: ignoring unsupported character '@'
tmp/.config-package.in:99770:warning: ignoring unsupported character '@'
tmp/.config-package.in:99770:warning: ignoring unsupported character '@'
tmp/.config-package.in:99773:warning: ignoring unsupported character '@'
tmp/.config-package.in:99773:warning: ignoring unsupported character '@'
tmp/.config-package.in:99788:warning: ignoring unsupported character '@'
tmp/.config-package.in:99788:warning: ignoring unsupported character '@'
tmp/.config-package.in:99788:warning: ignoring unsupported character '@'
tmp/.config-package.in:99788:warning: ignoring unsupported character '@'
tmp/.config-package.in:99788:warning: ignoring unsupported character '@'
tmp/.config-package.in:99788:warning: ignoring unsupported character '@'
tmp/.config-package.in:99811:warning: ignoring unsupported character '@'
tmp/.config-package.in:99811:warning: ignoring unsupported character '@'
tmp/.config-package.in:99811:warning: ignoring unsupported character '@'
tmp/.config-package.in:99811:warning: ignoring unsupported character '@'
tmp/.config-package.in:99811:warning: ignoring unsupported character '@'
tmp/.config-package.in:99811:warning: ignoring unsupported character '@'
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.



[user@system openwrt]$ make -j1 V=s
WARNING: Makefile 'package/feeds/packages/gnutls/Makefile' has a dependency on 'kmod-cryptodev', which does not exist
time: target/linux/prereq#0.18#0.10#0.37
make[1]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
make[2]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
+ mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl
+ cd /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl
+ mkdir -p bin lib include stamp
mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/target-mips_24kc_musl/stamp
touch /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl/.prepared
+ mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host
+ cd /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host
+ mkdir -p bin lib include stamp
mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/stamp /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/include/sys
install -m0644 /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/include/*.h /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/include/
install -m0644 /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/include/sys/*.h /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/include/sys/
ln -sf lib /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/lib64
touch /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/flock'
make[3]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/flock'
time: tools/flock/compile#0.08#0.04#0.17
make[3]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/sed'
make  -C /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5 SHELL="bash"
make[4]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5'
 cd . && bash /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5/build-aux/missing automake-1.16 --gnu Makefile
autom4te: need GNU m4 1.4 or later: /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/bin/m4
automake-1.16: error: autoconf failed with exit status: 1
make[4]: *** [Makefile:2088: Makefile.in] Error 1
make[4]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5'
make[3]: *** [Makefile:46: /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5/.built] Error 2
make[3]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/sed'
time: tools/sed/compile#0.45#0.30#0.82
make[2]: *** [tools/Makefile:154: tools/sed/compile] Error 2
make[2]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
make[1]: *** [tools/Makefile:150: /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynyyyyyyyyyyyyyyyyyyyyynyynynyyyynnyy] Error 2
make[1]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
make: *** [/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/include/toplevel.mk:218: world] Error 2
[user@system openwrt]$ 

As it sounds like a build-system inconsistency, I'd try

cd path/to/openwrt/
rm -r tmp
make config-clean
make clean
[user@system openwrt]$ rm -r tmp
[user@system openwrt]$ ls
BSDmakefile  Config.in  feeds.conf.default  Makefile  rules.mk     target
build_dir    dl         include             package   scripts      toolchain
config       feeds      LICENSE             README    staging_dir  tools
[user@system openwrt]$ make config-clean
make[1]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/scripts/config'
rm -f *.o lxdialog/*.o zconf.tab.c lex.zconf.c zconf.hash.c qconf.o qconf.moc .tmp_qtcheck qconf conf mconf
make[1]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/scripts/config'
[user@system openwrt]$ make clean
Collecting package info: done
Collecting target info: done
WARNING: Makefile 'package/feeds/packages/gnutls/Makefile' has a dependency on 'kmod-cryptodev', which does not exist
 make[1] clean
[user@system openwrt]$ 

[user@system openwrt]$ make -j1 V=s
WARNING: Makefile 'package/feeds/packages/gnutls/Makefile' has a dependency on 'kmod-cryptodev', which does not exist
time: target/linux/prereq#0.16#0.11#0.35
make[1]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
make[2]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
+ mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl
+ cd /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl
+ mkdir -p bin lib include stamp
mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/target-mips_24kc_musl/stamp
touch /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl/.prepared
+ mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host
+ cd /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host
+ mkdir -p bin lib include stamp
mkdir -p /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/stamp /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/include/sys
install -m0644 /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/include/*.h /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/include/
install -m0644 /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/include/sys/*.h /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/include/sys/
ln -sf lib /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/lib64
touch /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/flock'
make[3]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/flock'
time: tools/flock/compile#0.06#0.06#0.16
make[3]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/sed'
make  -C /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5 SHELL="bash"
make[4]: Entering directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5'
 cd . && bash /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5/build-aux/missing automake-1.16 --gnu Makefile
autom4te: need GNU m4 1.4 or later: /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/host/bin/m4
automake-1.16: error: autoconf failed with exit status: 1
make[4]: *** [Makefile:2088: Makefile.in] Error 1
make[4]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5'
make[3]: *** [Makefile:46: /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/build_dir/host/sed-4.5/.built] Error 2
make[3]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/tools/sed'
time: tools/sed/compile#0.46#0.29#0.81
make[2]: *** [tools/Makefile:154: tools/sed/compile] Error 2
make[2]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
make[1]: *** [tools/Makefile:150: /run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/staging_dir/target-mips_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynyyyyyyyyyyyyyyyyyyyyynyynynyyyynnyy] Error 2
make[1]: Leaving directory '/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt'
make: *** [/run/media/user/USBdrive/GitDev/GitHub-OpenWrt/openwrt/include/toplevel.mk:218: world] Error 2
[user@system openwrt]$ 


I get the sense that some piece of software expects to be on an internal drive, and that's the cause of the failure. I wonder if making a partcular symlink would solve the issue (no idea what to symlink), or mounting the drive on an internal mountpoint.

Linux doesn't have a sense of "internal" vs. "external" for a mounted file system (though auto-mounted file systems may run afoul of the OS trying to be "helpful"). Is it possible that the file system on the stick is FAT/NTFS/exFAT or the like?

autom4te: need GNU m4 1.4 or later

appears to be the key error -- is it in your path?

2 Likes

What filesystem is the stick formatted as?

Most sticks come as FAT or exFAT - if it's formatted with either of these you're very likely to have problems.

I've never had problems with an external USB 3.0 hard drive - but it's formatted ext4.

It's a 2 TB hard disk, USB 3.0 (though not sure if my laptop USB port is 3.0), with the partition in question formatted as NTFS (for compatibility). There is an ext4 partition as well, I could try on that to see if it makes a difference.

Yes, I think this means that m4 is in my path:

[user@system openwrt]$ which m4
/usr/bin/m4
[user@system openwrt]$ m4 --version
m4 (GNU M4) 1.4.18
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Rene' Seindal.
[user@system openwrt]$ 
1 Like

these errors crop up when something borked your user env or related dev nodes....

have you been running fancy chroots/jails/containers on that machine?

a new user or a check of the logs for any /dev errors should point to the resolution...

1 Like

Save yourself the hassle and use a native Linux filesystem. Permissions on your NTFS drive might be wrong (e.g. 777), and there's probably other stuff that could go wonky with NTFS as well.

Pick your battles.

3 Likes

Just a Docker container a few months ago.

Where would I look?

Maybe permissions are the problem:

[user@system user]$ pwd
/run/media/user
[user@system user]$ ls -alh
total 8.0K
drwxr-x---+ 4 root root   80 Jun 28 16:43 .
drwxr-xr-x  3 root root   60 Jun 28 11:00 ..
drwxr-xr-x  4 user user 4.0K Jun 28 14:40 linux-home  ## the ext4 partition
drwxrwxrwx  1 user user 4.0K Jun 28 11:07 USBdrive ## the NTFS partition

I tried on an ext4 partition of the same drive, and.... success!!

2 Likes

To help others, you can mark the solution by expanding the buttons at the bottom of the post that solved it with with the ... icon, then clicking the checkbox

image

I don't know exactly what the problem was with the NTFS partition, but I know that switching to an ext4 partition solved the problem.

I generally assume that any build system (and a lot of applications) are very likely to fail on an NTFS partition.

NTFS is only suitable for transferring files between operating systems, it's not really suitable to "normal" operations on a Linux machine.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.