Bug 250928 - [PATCH] bsdinstall: fix distfetch while calling bsdinstall as script target
Summary: [PATCH] bsdinstall: fix distfetch while calling bsdinstall as script target
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-sysinstall (Nobody)
URL: https://reviews.freebsd.org/D27121
Keywords: install, patch
Depends on:
Blocks:
 
Reported: 2020-11-07 16:04 UTC by Vinícius Zavam
Modified: 2021-04-17 20:23 UTC (History)
2 users (show)

See Also:


Attachments
[PATCH] bsdinstall: fix distfetch while calling bsdinstall as script target (683 bytes, patch)
2020-11-07 16:04 UTC, Vinícius Zavam
no flags Details | Diff
[PATCH] bsdinstall: fix distfetch while calling bsdinstall as script target (795 bytes, patch)
2021-04-17 20:12 UTC, Vinícius Zavam
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vinícius Zavam freebsd_committer 2020-11-07 16:04:17 UTC
Created attachment 219428 [details]
[PATCH] bsdinstall: fix distfetch while calling bsdinstall as script target

while an unattended installation of FreeBSD, it came to our attention that a missing task was preventing bsdinstall to fully install FreeBSD if one wants to use the "script" target.

    script script    Runs the installation script at script.    See SCRIPTING
                     for more information on this target.

    --- Source: https://www.freebsd.org/cgi/man.cgi?query=bsdinstall

for quite a time ago, I used to always made distfiles available under a DISTDIR in order to avoid getting into any ftp mirror (as I built my own base and kernel and hosted them in a private repository).

this patch fixes are based on the following use case:

  " as someone wanting to install FreeBSD in an unattended way, I would like to be able to perform unattended installation of FreeBSD using the script target even if there's no distfile available under BSDINSTALL_DISTDIR beforehand "

Differential Review: https://reviews.freebsd.org/D27121
Comment 1 Vinícius Zavam freebsd_committer 2021-01-25 15:13:48 UTC
ping?
Comment 2 Vinícius Zavam freebsd_committer 2021-04-04 11:47:48 UTC
hello there! ping timeout?

this patch fixes and makes way easier to autoinstall and deploy FreeBSD using bsdinstall either on a iPXE-powered env, or a custom ISO installer.

would appreciate any feedback. this has being used by myself for "quite a while".

here is a video recording done using a VirtualBox setup as PoC:

  - https://share.riseup.net/#dVxxsPOPzenSgz9hVOdXNQ
Comment 3 Nathan Whitehorn freebsd_committer 2021-04-05 13:10:56 UTC
Apologies this got missed. The patch here will fetch all of the distributions multiple times, since distfetch fetches all of them and runs in a loop, no?

Maybe the best thing to do is to move lines 350-421 of "auto" into its own install stage ("fetchmissingdists"?) then call it from both "script" and "auto"? Would you be able to do that? Otherwise, I can try to get to it soon.
Comment 4 Vinícius Zavam freebsd_committer 2021-04-17 20:12:12 UTC
Created attachment 224198 [details]
[PATCH] bsdinstall: fix distfetch while calling bsdinstall as script target

updating patch file using `git`, and implementing a fix to avoid calling `bsdinstall distfetch` inside the for loop.
Comment 5 Vinícius Zavam freebsd_committer 2021-04-17 20:23:42 UTC
almost forgot to mention other motivation behind the idea of fixing the `script` target: https://cgit.freebsd.org/src/tree/release/rc.local#n51