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

Build fails when replacing /etc/hosts by link since 15.0 #427

Open
mrelyb opened this issue Jan 21, 2025 · 3 comments
Open

Build fails when replacing /etc/hosts by link since 15.0 #427

mrelyb opened this issue Jan 21, 2025 · 3 comments

Comments

@mrelyb
Copy link
Contributor

mrelyb commented Jan 21, 2025

We need to replace /etc/hosts by a link to a writeable storage, since we keep our rootfs readonly. Up to v15.0 this was no problem, builds were successfull.
With commit 2984e60 things changed: now we get a build error, when elbe tries to update /etc/hosts in rfs.py at

self.rfs.append_file('/etc/hosts',
                             '\n127.0.0.1 localhost'
                             f'\n127.0.1.1 {fqdn} {hostname} elbe-daemon\n')

How can I replace /etc/hosts without getting a build error?

log of failing build:

[CMD] /usr/sbin/chroot /var/cache/elbe/019488fe-bb3e-726e-aee2-50b2ae52a07d/chroot chpasswd --encrypted
[ERROR]Build failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/elbepack/asyncworker.py", line 163, in execute
    self.project.build(skip_pkglist=False,
  File "/usr/lib/python3/dist-packages/elbepack/elbeproject.py", line 671, in build
    self.build_cdroms(build_bin, build_sources, cdrom_size, tgt_pkg_lst=tgt_pkgs)
  File "/usr/lib/python3/dist-packages/elbepack/elbeproject.py", line 462, in build_cdroms
    env.seed_etc()
  File "/usr/lib/python3/dist-packages/elbepack/rfs.py", line 333, in seed_etc
    self.rfs.append_file('/etc/hosts',
  File "/usr/lib/python3/dist-packages/elbepack/filesystem.py", line 338, in append_file
    with self.open(path, 'a') as f:
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/filesystem.py", line 85, in open
    return open(self.fname(path), mode, opener=opener)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/cache/elbe/019488fe-bb3e-726e-aee2-50b2ae52a07d/chroot/etc/hosts'
elbe control wait_busy /var/cache/elbe/019488fe-bb3e-726e-aee2-50b2ae52a07d failed!
elbe parselicence failed!
@t-8ch
Copy link
Contributor

t-8ch commented Jan 23, 2025

@mrelyb There were some bugfixes around this in v15.3. Could you test that?

@mrelyb
Copy link
Contributor Author

mrelyb commented Jan 24, 2025

The above test was acutally with 15.3. Sorry for not mention it...

root@e7070abfcbb3:/# elbe --version
elbe v15.3

@t-8ch
Copy link
Contributor

t-8ch commented Jan 24, 2025

Can you provide a minimal reproducer? XML and command.
Did you bisect the issue to this commit or is it an assumption?

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