0001-libremakepkg-rw-startdir.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From e43ee910408794654dc3c498e4790ab39cbb3466 Mon Sep 17 00:00:00 2001
  2. From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  3. Date: Fri, 17 May 2019 02:41:43 +0200
  4. Subject: [PATCH] libremakepkg: fix building packages requring a rw startdir
  5. Several packages require a read-write startdir:
  6. - Some packages have a pkgver that is computed dynamically
  7. through a pkgver function. This is the case for many packages
  8. using git repositories. At the end of the package build, the
  9. pkgver is automatically updated in the PKGBUILD, however,
  10. without that fix that fails with libremakepkg as the PKGBUILD
  11. was set read-only.
  12. - Some packages like linux-libre are modifying the install=
  13. script. This is done by creating a temporary install script
  14. in the startdir that is then modified with sed. Once this is
  15. done that install script is then dynamically selected.
  16. As this also require to have read-write access to the
  17. startdir to be read-write it fails to build the package if
  18. it's not the case.
  19. In both cases it's possible to modify the PKGBUILDs to
  20. workaround the issue, however the Arch Linux distribution has
  21. a read-write startdir, and modifying each affected packages
  22. would significatively increase the cost (in time and efforts)
  23. of maintaining Parabola.
  24. This was broken by the following commit:
  25. 646ac02 libremakepkg,chcleanup: Be stricter about network access
  26. Thanks to elibrokeit on the #parabola IRC channel on Freenode
  27. for helping me identifying the cause of read-only mounts in
  28. libremakepkg.
  29. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  30. ---
  31. src/chroot-tools/libremakepkg | 3 +--
  32. 1 file changed, 1 insertion(+), 2 deletions(-)
  33. diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
  34. index 00eb2e0..fe7dd3a 100755
  35. --- a/src/chroot-tools/libremakepkg
  36. +++ b/src/chroot-tools/libremakepkg
  37. @@ -124,11 +124,11 @@ build() (
  38. local run_ynet=()
  39. local run_nnet=()
  40. if $INCHROOT; then
  41. - local _run=(sh -c "mount --bind -o ro -- ${startdir@Q} ${startdir@Q} && cd ${startdir@Q} && \$@" --)
  42. + local _run=(sh -c "cd ${startdir@Q} && \$@" --)
  43. run_ynet=(unshare --mount -- "${_run[@]}")
  44. run_nnet=(unshare --mount --net -- "${_run[@]}")
  45. else
  46. - librechroot_flags+=(-r "$startdir:/startdir")
  47. + librechroot_flags+=(-w "$startdir:/startdir")
  48. run_ynet=(librechroot "${librechroot_flags[@]}" run)
  49. run_nnet=(librechroot "${librechroot_flags[@]}" -N run)
  50. fi
  51. 2.21.0