Opened 5 years ago
Closed 5 years ago
#58 closed defect (fixed)
symlinks in debirf root point to absolute path on host when built non-privileged
| Reported by: | jrollins | Owned by: | dkg |
|---|---|---|---|
| Priority: | critical | Component: | debirf |
| Keywords: | Cc: | ||
| Sensitive: |
Description
For some reason, when building make-debirf non-privileged, it creates symlinks in the root that point to absolute paths on the host system. This is clearly something going on in the debootstrap phase:
servo:/srv/debirf/minimal 0$ ls -al root/etc/nologin lrwxrwxrwx 1 jrollins jrollins 52 2007-12-19 14:46 root/etc/nologin -> /srv/debirf/minimal/root/var/lib/initscripts/nologin servo:/srv/debirf/minimal 0$
and on the booted debirf:
0 debirf-minimal:~# ls -al /etc/nologin lrwxrwxrwx 1 root root 52 Dec 19 20:04 /etc/nologin -> /srv/debirf/minimal/root/var/lib/initscripts/nologin 0 debirf-minimal:~#
If you look at the root from the outside, the links point to the absolute path on the host, as indicated in the examples above. However, if you "fakeroot fakechroot chroot root" into the debirf root, then the links look correct. the problem is therefore related to the fact that we pack the root from outside the chroot, where the symlinks point to absolute paths on the host.
Change History (1)
comment:1 Changed 5 years ago by jrollins
- Resolution set to fixed
- Status changed from new to closed


This problem was fixed by packaging the root from within a fakechroot chroot:
pack_rootfs() { # need to pack archive in fakechroot/chroot so that symlinks correctly # point within debirf root, instead of to host path fakeroot_if_needed fakechroot chroot "$DEBIRF_ROOT" sh -c "find * | cpio --create -H newc" | gzip > "$1" }