Page MenuHomeFreeBSD

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

Authored by trasz on Wed, Jul 8, 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

trasz created this revision.Wed, Jul 8, 7:11 PM
trasz requested review of this revision.Wed, Jul 8, 7:11 PM
trasz edited the summary of this revision. (Show Details)Wed, Jul 8, 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.Wed, Jul 8, 7:59 PM
trasz edited the summary of this revision. (Show Details)
0mp added a subscriber: 0mp.Tue, Jul 14, 8:59 AM
0mp added inline comments.
sysutils/debootstrap/files/patch-debootstrap
5 ↗(On Diff #74212)

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.Tue, Jul 14, 11:53 PM
emaste added inline comments.
sysutils/debootstrap/files/patch-functions
7 ↗(On Diff #74212)

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

trasz added inline comments.Wed, Jul 15, 1:10 PM
sysutils/debootstrap/files/patch-functions
7 ↗(On Diff #74212)

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.Fri, Jul 17, 3:49 PM

Fix from 0mp.

trasz marked an inline comment as done.Fri, Jul 17, 3:50 PM
0mp accepted this revision.Fri, Jul 17, 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.Fri, Jul 17, 4:17 PM
0mp added inline comments.Fri, Jul 17, 4:22 PM
sysutils/debootstrap/files/patch-debootstrap
5 ↗(On Diff #74579)

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.Sun, Jul 19, 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.