Bug 266987 - bsdinstall: following multiple 'restart's, distributions are installed several times
Summary: bsdinstall: following multiple 'restart's, distributions are installed severa...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL: https://anduin.net/~ltning/bsdinstall...
Keywords: install
Depends on:
Blocks:
 
Reported: 2022-10-12 09:59 UTC by Eirik Oeverby
Modified: 2023-10-25 22:15 UTC (History)
5 users (show)

See Also:


Attachments
0001-bsdinstall-reset-the-environment-when-restarting.patch (21.42 KB, patch)
2023-10-18 20:35 UTC, Pierre Pronchery
no flags Details | Diff
distribution archives extraction FreeBSD 14.0-RC2 (17.48 KB, image/png)
2023-10-21 07:55 UTC, Guillaume Bibaut
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.