Bug 266987

Summary: bsdinstall: following multiple 'restart's, distributions are installed several times
Product: Base System Reporter: Eirik Oeverby <ltning-freebsd>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Some People CC: asiciliano, emaste, grahamperrin, pierre, yom
Priority: --- Keywords: install
Version: CURRENT   
Hardware: Any   
OS: Any   
URL: https://anduin.net/~ltning/bsdinstall-oops.jpg
Attachments:
Description Flags
0001-bsdinstall-reset-the-environment-when-restarting.patch
none
distribution archives extraction FreeBSD 14.0-RC2 none

Description Eirik Oeverby 2022-10-12 09:59:01 UTC
When bsdinstall-ing a new system I ran into partitioning confusion, so I had to restart the installer several times. This was done by selecting "restart" when the installer offered the "restart" or "exit" prompt.

For each restart, I had to re-select the distributions I wanted (the choices were not persisted, which may be relevant here). Once I finally had the partitioning in place, and proceeded to install, all chosen distribution files were installed multiple times - once for each restart (presumably).

See screenshot (also linked to in this ticket): https://anduin.net/~ltning/bsdinstall-oops.jpg

/Eirik
Comment 1 Alfonso S. Siciliano freebsd_committer freebsd_triage 2022-10-13 14:47:55 UTC
Thank you for the screenshot,

I am quite sure the "guilty" variable (not restarted) is 'DISTRIBUTIONS':
https://cgit.freebsd.org/src/tree/usr.sbin/bsdinstall/distextract/distextract.c#n76

Actually, "not persisted restart" is a known problem.
Other PRs describe similar situations. I fixed some problem in the past.

However, we should implement a real "restart" feature to solve properly the problem.
Comment 2 Pierre Pronchery 2023-10-18 20:35:27 UTC
Created attachment 245717 [details]
0001-bsdinstall-reset-the-environment-when-restarting.patch

The patch attached is also in review D42281.
Comment 3 Guillaume Bibaut 2023-10-21 07:53:32 UTC
It seems this bug is also available since the alpha testing of FreeBSD 14.0, it is still visible on RC2.
Comment 4 Guillaume Bibaut 2023-10-21 07:55:38 UTC
Created attachment 245769 [details]
distribution archives extraction FreeBSD 14.0-RC2

distribution archives extraction duplication in FreeBSD 14.0-RC2
Comment 5 Pierre Pronchery 2023-10-25 22:15:32 UTC
(In reply to Guillaume Bibaut from comment #3)

That is correct, the patch is still pending review and not merged to main yet; I am working on the necessary improvements before it can get there.