`pmbootstrap build --envkernel` fails for out of source builds
Trying to do pmbootstrap build --envkernel
for a kernel which does a make O=$_outdir
(which is what the template suggests) then the build fails with
(250387) [00:25:55] (native) % rm /mnt/linux//$_outdir
(250387) [00:25:55] (native) % ln -s /mnt/linux /home/pmos/build/src
(250387) [00:25:55] (native) % ln -s /mnt/linux/.output /home/pmos/build/src/$_outdir
(250387) [00:25:55] % sudo cp /work/projects/postmarketos/aportgen/APKBUILD /work/projects/postmarketos/chroot_native/home/pmos/build/APKBUILD
(250387) [00:25:55] (native) % cd /home/pmos/build; busybox su pmos -c CARCH=aarch64 CHOST=aarch64 CBUILD=x86_64 SUDO_APK='abuild-apk --no-progress' HOME=/home/pmos abuild rootpkg
]0;abuild-aarch64: linux-samsung-dream>>> linux-samsung-dream: Entering fakeroot...
]0;abuild-aarch64: linux-samsung-dreaminstall: can't stat '/home/pmos/build/src/out/include/config/kernel.release': No such file or directory
/usr/bin/downstreamkernel_package: cd: line 24: can't cd to /home/pmos/build/src/out/arch/arm64/boot: No such file or directory
Could not find zImage in /home/pmos/build/src!
>>> ERROR: linux-samsung-dream*: package failed
]0;>>> ERROR: linux-samsung-dream: rootpkg failed
]0;(250387) [00:25:55] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(250387) [00:25:55] NOTE: The failed command's output is above the ^^^ line in the log file: /work/projects/postmarketos/log.txt
(250387) [00:25:55] ERROR: Command failed: (native) % cd /home/pmos/build; busybox su pmos -c CARCH=aarch64 CHOST=aarch64 CBUILD=x86_64 SUDO_APK='abuild-apk --no-progress' HOME=/home/pmos abuild rootpkg
(250387) [00:25:55] See also: <https://postmarketos.org/troubleshooting>
(250387) [00:25:55] Traceback (most recent call last):
File "/work/projects/pmbootstrap/pmb/__init__.py", line 49, in main
getattr(frontend, args.action)(args)
File "/work/projects/pmbootstrap/pmb/helpers/frontend.py", line 103, in build
pmb.build.envkernel.package_kernel(args)
File "/work/projects/pmbootstrap/pmb/build/envkernel.py", line 194, in package_kernel
run_abuild(args, pkgname, arch, apkbuild_path, kbuild_out)
File "/work/projects/pmbootstrap/pmb/build/envkernel.py", line 153, in run_abuild
pmb.chroot.user(args, cmd, working_dir=build_path, env=env)
File "/work/projects/pmbootstrap/pmb/chroot/user.py", line 26, in user
return pmb.chroot.root(args, cmd, suffix, working_dir, output,
File "/work/projects/pmbootstrap/pmb/chroot/root.py", line 74, in root
return pmb.helpers.run_core.core(args, msg, cmd_sudo, None, output,
File "/work/projects/pmbootstrap/pmb/helpers/run_core.py", line 342, in core
check_return_code(args, code, log_message)
File "/work/projects/pmbootstrap/pmb/helpers/run_core.py", line 218, in check_return_code
raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: (native) % cd /home/pmos/build; busybox su pmos -c CARCH=aarch64 CHOST=aarch64 CBUILD=x86_64 SUDO_APK='abuild-apk --no-progress' HOME=/home/pmos abuild rootpkg
where the root of the problem is (250387) [00:25:55] (native) % ln -s /mnt/linux/.output /home/pmos/build/src/$_outdir
. $_outdir
is not expanded so I end up with
/ # ls -l /home/pmos/build/src/
total 2744
lrwxrwxrwx 1 root root 18 Jan 1 23:40 $_outdir -> /mnt/linux/.output
Instead of
lrwxrwxrwx 1 root root 18 Jan 1 23:40 out -> /mnt/linux/.output
Edited by Administrator