Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during make, chown returns "No such file or directory" #108

Open
CTassisF opened this issue Jul 23, 2024 · 1 comment
Open

Error during make, chown returns "No such file or directory" #108

CTassisF opened this issue Jul 23, 2024 · 1 comment

Comments

@CTassisF
Copy link

Description:

I'm building ripe-atlas-software-probe manually and encountering an error during make:

chown: //probe/etc/ripe-atlas/mode: No such file or directory

Steps to reproduce:

$ docker run -it --rm alpine /bin/sh

# apk add --no-cache autoconf automake g++ gcc git libtool linux-headers make openssl-dev patch sed
# adduser -D ripe-atlas
# git clone --recursive https://github.com/RIPE-NCC/ripe-atlas-software-probe.git
# cd ripe-atlas-software-probe/
# autoreconf -iv
# ./configure --prefix=/probe
# make
Making all in bin
make[1]: Entering directory '/ripe-atlas-software-probe/bin'
  GEN      arch/generic/generic-ATLAS.sh
  GEN      arch/generic/generic-common.sh
  GEN      arch/generic/generic-reginit.sh
  GEN      paths.lib.sh
  GEN      common.sh
  GEN      common-pre.sh
  GEN      config.sh
  GEN      reginit.sh
  GEN      resolvconf
  GEN      ripe-atlas
make[1]: Leaving directory '/ripe-atlas-software-probe/bin'
Making all in config
make[1]: Entering directory '/ripe-atlas-software-probe/config'
  GEN      ../probe-busybox/include/atlas_path.h
make  all-am
make[2]: Entering directory '/ripe-atlas-software-probe/config'
  GEN      common/FIRMWARE_APPS_VERSION
chown ripe-atlas:ripe-atlas //probe/etc/ripe-atlas/mode
chown: //probe/etc/ripe-atlas/mode: No such file or directory
make[2]: *** [Makefile:777: common/FIRMWARE_APPS_VERSION] Error 1
make[2]: Leaving directory '/ripe-atlas-software-probe/config'
make[1]: *** [Makefile:401: all] Error 2
make[1]: Leaving directory '/ripe-atlas-software-probe/config'
make: *** [Makefile:456: all-recursive] Error 1
#

Interestingly, the build completes successfully if you run make a second time.

Possible cause:

It seems that this Makefile is trying to chown something inside the --prefix=/probe directory before it is created (before make install).

Running ./configure --prefix=/probe --disable-chown before make fixes the issue, but it also disables the low-privilege user functionality.

@michel-stam
Copy link
Contributor

This is so weird. I thought I had replied with an answer.

Anyway:

Fix bug with chown when systemd is disabled

During compile, if systemd is disabled, the build breaks unless
--disable-chown is given during configure.

Problem is caused when --disable-systemd is passed (or not detected)
which also disables the installation hook where the chown should be
executed. This then folds the chown into the generation of the
FIRMWARE_APPS_VERSION file, which is done at an early point in the
build where installation directories have not been created yet.

Fix is in the development branch. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants