Page MenuHomeFreeBSD

sysutils/deboostrap: make it use bash, mount fdescfs, ignore --configure errors
ClosedPublic

Authored by trasz on Jul 8 2020, 7:11 PM.

Details

Summary

sysutils/deboostrap: make it use bash, mount fdescfs, ignore --configure errors

For some reason, when run with stock sh(1) the script aborts just
after 'Unpacking the base system'.

The fdescfs mount fixes 'dpkg --configure' for rsyslog. Note that
there are also some kernel patches required to make it work completely.

The fdescfs is not enough to fix everything, though, so just ignore
'dpkg --configure' errors for Bionic; they don't break anything important.

PR: ports/247698

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 32383
Build 29864: arc lint + arc unit

Event Timeline

trasz created this revision.Jul 8 2020, 7:11 PM
trasz requested review of this revision.Jul 8 2020, 7:11 PM
trasz edited the summary of this revision. (Show Details)Jul 8 2020, 7:11 PM
trasz added a reviewer: lifanov.
trasz retitled this revision from sysutils/deboostrap: make it use bash, mount fdescfs to sysutils/deboostrap: make it use bash, mount fdescfs, ignore --configure errors.Jul 8 2020, 7:59 PM
trasz edited the summary of this revision. (Show Details)
0mp added a subscriber: 0mp.Jul 14 2020, 8:59 AM
0mp added inline comments.
sysutils/debootstrap/files/patch-debootstrap
5

This should be %%LOCALBASE%%/bin/bash. Maybe add %%BASH%% here and then use REINPLACE_CMD to replace %%BASH%% with ${LOCALBASE}/bin/bash during post-patch.

emaste added a subscriber: emaste.Jul 14 2020, 11:53 PM
emaste added inline comments.
sysutils/debootstrap/files/patch-functions
8

is it smart enough to do these in a reasonable order?

trasz added inline comments.Jul 15 2020, 1:10 PM
sysutils/debootstrap/files/patch-functions
8

It's not. And it processes those umounts in _reverse_ order, thus the above.

We should coordinate with the Debian folks, at least the /dev/fd is probably something that should be upstream?

In any case this seems fine to me

trasz updated this revision to Diff 74579.Jul 17 2020, 3:49 PM

Fix from 0mp.

trasz marked an inline comment as done.Jul 17 2020, 3:50 PM
0mp accepted this revision.Jul 17 2020, 4:17 PM

The changes seem fine. You may want to consider running portfmt from https://www.freshports.org/ports-mgmt/portfmt to get little things fixed like the order of RUN_DEPENDS items. But then you'll end up with a lot of unrelated style changes, which might no be desired.

This revision is now accepted and ready to land.Jul 17 2020, 4:17 PM
0mp added inline comments.Jul 17 2020, 4:22 PM
sysutils/debootstrap/files/patch-debootstrap
5

Actually, you may consider using a more standardized mechanism for it like USES=shebangfix.

Perhaps something along the lines of the following would work:

USES= shebangfix
SHEBANG_LANG=   bash
bash_OLD_CMD=    /bin/sh
SHEBANG_FILES= debootstrap
This revision was automatically updated to reflect the committed changes.

I think I prefer the non-shebangfix version. To me, shebangfix is mostly for adjusting paths, and here we do something semantically different: we're changing the interpreter.

trasz added a comment.Jul 19 2020, 1:34 PM

We should coordinate with the Debian folks, at least the /dev/fd is probably something that should be upstream?

Done, https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/46.