Page MenuHomeFreeBSD

libexec/rc/rc.initdiskless: make tar's path flexible
ClosedPublic

Authored by cc on Nov 24 2023, 8:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 9:23 AM
Unknown Object (File)
Wed, May 8, 9:21 AM
Unknown Object (File)
Wed, May 8, 9:21 AM
Unknown Object (File)
Wed, May 8, 9:21 AM
Unknown Object (File)
Wed, May 8, 6:50 AM
Unknown Object (File)
Thu, May 2, 8:49 AM
Unknown Object (File)
Fri, Apr 26, 2:24 AM
Unknown Object (File)
Tue, Apr 23, 4:19 AM
Subscribers

Details

Reviewers
rgrimes
imp
Summary

PR: 274977
MFC after: 1 month

Test Plan

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 54916
Build 51805: arc lint + arc unit

Event Timeline

cc requested review of this revision.Nov 24 2023, 8:56 PM
rgrimes requested changes to this revision.Dec 2 2023, 9:59 PM
rgrimes added a subscriber: rgrimes.

See the PR where I go into details on why the OP had the failure. This "works as inteneded" without this change. Note to say that I wouldnt accept a carefully coded if [ -x block that would do the right things in most instances, including adding an error handling if neither tar exists.

This revision now requires changes to proceed.Dec 2 2023, 9:59 PM

code update based on review comment

Warner, does the protection added by my enhancements to this change meet your criteria of keeping it such that /usr does not become a requirement, thus reducing your concerns on that manner.

/rescue/tar is a requirement. What's wrong with that? the whole bug is because someone tried to grab the wrong image to start with and there's going to be way more than just this one detail wrong with the running system.

I don't like the code repetition. It over engineers a solution to a non-problem.

I think it's a bad change, done for bad reasons and will have unintended consequences down stream.

Honestly, a better solution is just to put /rescue in the path. That way we don't have to special case it and anything not available will use it. If something doesn't exist, you'll get an error message, just like anything else that fails (and maybe the failure mode is too harsh and we should do something about that, but that's a different bug).

libexec/rc/rc.initdiskless
364–366
+PATH=${PATH}:/rescue
381
-	    (cd / ; /rescue/tar -xpf $j)
+	    (cd / ; tar -xpf $j)
In D42765#979657, @imp wrote:

/rescue/tar is a requirement. What's wrong with that? the whole bug is because someone tried to grab the wrong image to start with and there's going to be way more than just this one detail wrong with the running system.

The use-case here is different and not exactly the same as in the "network-diskless" in the handbook. The ISO is not used as a diskless boot image, but literally an installation image.

Please refer to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274977#c12

code update with successful test

cc retitled this revision from libexec/rc/rc.initdiskless: use tar from a working location to libexec/rc/rc.initdiskless: make tar's path flexible.Dec 13 2023, 3:43 PM
This revision is now accepted and ready to land.Dec 13 2023, 8:50 PM