Faulty build after moving to a new laptop

i create my own build on my Ubuntu PC. Now I bought a new laptop and copied the openwrt directory to the new laptop and installed all package requirements. After updating the git and the feeds I get the following error message. Are there any packages missing for the build?

stefan.harbich@nsthwme02:~/Downloads/tp-link/openwrt$ make -j $(($(nproc)+1)) V=sc
make[2]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/scripts/config'
make[1]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt'
make[2]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt'
make[2]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt'
rm -rf /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/target-mips_24kc_musl/root-ath79
make[2]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt'
+ mkdir -p /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/target-mips_24kc_musl
+ mkdir -p /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host
+ cd /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/target-mips_24kc_musl
+ mkdir -p bin lib stamp usr/include usr/lib
+ cd /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host
+ mkdir -p bin lib stamp usr/include usr/lib
mkdir -p /home/stefan.harbich/Downloads/tp-link/openwrt/build_dir/target-mips_24kc_musl/stamp
mkdir -p /home/stefan.harbich/Downloads/tp-link/openwrt/build_dir/host/stamp /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/include/sys
touch /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/target-mips_24kc_musl/.prepared
install -m0644 /home/stefan.harbich/Downloads/tp-link/openwrt/tools/include/*.h /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/include/
install -m0644 /home/stefan.harbich/Downloads/tp-link/openwrt/tools/include/sys/*.h /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/include/sys/
ln -snf lib /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/lib64
touch /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/flock'
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/flock'
time: tools/flock/compile#0.02#0.00#0.03
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/xz'
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/xz'
time: tools/xz/compile#0.04#0.01#0.05
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/sed'
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/sed'
time: tools/sed/compile#0.05#0.03#0.07
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/tar'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/patch'
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/patch'
time: tools/patch/compile#0.03#0.00#0.03
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/tar'
time: tools/tar/compile#0.03#0.01#0.04
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/m4'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/autoconf-archive'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/ninja'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/cpio'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/lzma'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/patch-image'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/mtools'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/sstrip'
make[3]: Entering directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/zip'
cd /home/stefan.harbich/Downloads/tp-link/openwrt/build_dir/host/ninja-1.10.2 && CXX="g++" CXXFLAGS=" -I/home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/include " LDFLAGS="-L/home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/lib " /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/bin/python3 configure.py --bootstrap --verbose
bash: line 1: /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/bin/python3: No such file or directory
make[3]: *** [Makefile:40: /home/stefan.harbich/Downloads/tp-link/openwrt/build_dir/host/ninja-1.10.2/.built] Error 127
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/ninja'
time: tools/ninja/compile#0.03#0.01#0.06
    ERROR: tools/ninja failed to build.
make[2]: *** [tools/Makefile:168: tools/ninja/compile] Error 1
make[2]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/patch-image'
time: tools/patch-image/compile#0.03#0.00#0.05
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/lzma'
time: tools/lzma/compile#0.03#0.01#0.06
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/autoconf-archive'
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/sstrip'
time: tools/autoconf-archive/compile#0.04#0.01#0.06
time: tools/sstrip/compile#0.04#0.00#0.06
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/cpio'
time: tools/cpio/compile#0.03#0.01#0.06
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/mtools'
time: tools/mtools/compile#0.03#0.01#0.06
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/zip'
time: tools/zip/compile#0.04#0.00#0.06
make[3]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt/tools/m4'
time: tools/m4/compile#0.04#0.02#0.07
make[2]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt'
make[1]: *** [tools/Makefile:164: /home/stefan.harbich/Downloads/tp-link/openwrt/staging_dir/host/stamp/.tools_compile_yyynyynnyyyynyyyyyynyynnyynyyyyyyyyyyyyyyyyyyynynyyyyyyyy] Error 2
make[1]: Leaving directory '/home/stefan.harbich/Downloads/tp-link/openwrt'
make: *** [/home/stefan.harbich/Downloads/tp-link/openwrt/include/toplevel.mk:230: world] Fehler 2

Is a python3 package missing here?

I installed all the required packages following this guide. That's why I posted the above error message here for support.

python3 is part of the list, so it should have been there.

I had Python3 installed as described.

root@dsme01:~# sudo apt install python3
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
python3 ist schon die neueste Version (3.9.2-3).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 21 nicht aktualisiert.

The python symlink is not pointing to Your current python version.
Remove staging_dir/host/.prereq-build and run make prereq, should fix Your issue.

Actually, the best solution is to wipe it, and start over. It's not a good idea to try and move a previously-used OpenWrt folder from one computer to another. Just clone it again on the new computer, and move the config file over as required.

If you do want to move the config file over, it's also better to distill it down to base essentials on the old machine first:
scripts/diffconfig.sh > ~/openwrt_diffconfig.cfg

Could you help me with which files I have to save in the old Git folder to copy them to the new Git folder? I had also changed something in the "make kernel_menuconfig" in the old Git folder.

Just the two .config's are all you should need - .config from the main openwrt folder, and .config from openwrt/build_dir/target*/linux-*/linux-5.15.111

Distill OpenWrt's config as I described, and then once it's moved into the new openwrt/.config make defcofig to re-expand it. You can copy the kernel .config straight across after a make target/linux/prepare

Just for info, you do realize that any change to the kernel config will make it so you can no longer access downloaded packages, right?

Does that mean if I change something in the kernel that I can no longer make changes using "make menuconfig"?

Or does it have something to do with the following message:

error: Your local changes in the following files would be overwritten by the merge:
Please commit or stash your changes before merging.

So this configuration only includes the changes I made? Do I then have to import / apply these again in the new directory on the new laptop?

No, not at all. It just means that if you change something in the kernel, you will likely not be able to use OpenWrt's opkg to download and install any kernel module from OpenWrt's servers. You will need to set up a repository on your device, or somewhere your device can access, that has all the kernel modules compiled in your custom build if you want to be able to use opkg to install one.

That is caused by you changing a file locally in your build tree (target/linux/x86/config-5.10), and then trying to do a git pull or scripts/update -a that would have updated the same file. That file is the kernel configuration template - did you modify it?

Yes, that will include the changes you made - it distills the .config down to ONLY what is different from default. It is the safest way to move OpenWrt's .config from one build tree to a new one. Once you move the diffconfig file created to the OpenWrt/.config on the new laptop, then yes, at some point you need to perform a make defconfig to expand it, or a make menuconfig and then save.

What version of OpenWrt are you building? From the kernel version it looks like a release version.

That means doing a "git clone..." on the new laptop and then playing the "openwrt_diffconfig.cfg" file back into the .config? That means I have to specify where the file "openwrt_diffconfig.cfg" is with the "make defconfig" command?
I create the "openwrt-22.03" build for my central router "PC Engine APU 1D4" and my access point's "TP-Link Archer C7 v2".


No, just copy it to be the new OpenWrt folder's .config after cloning, then do a make defconfig

git clone https://git.openwrt.org/openwrt/openwrt.git -b v22.03.5
cd openwrt
git branch -a
git tag
git checkout v22.03.5
git pull https://git.openwrt.org/openwrt/openwrt.git v22.03.5
./scripts/feeds update -a
./scripts/feeds install -a
#wget https://downloads.openwrt.org/releases/22.03.5/targets/x86/generic/config.buildinfo -O .config
cp /path/to/openwrt_diffconfig.cfg .config
wget https://downloads.openwrt.org/releases/22.03.5/targets/x86/generic/llvm-bpf-13.0.0.Linux-x86_64.tar.xz
tar -xaf llvm-bpf-13.0.0.Linux-x86_64.tar.xz
make defconfig
make menuconfig
make kernel_menuconfig
make -j $(nproc) toolchain/install
make download
make -j $(nproc) world

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