feat(installer): add 'Install to disk' in Tools submenu
Copies the live system to a local disk via unsquashfs — no debootstrap, no network required. Supports UEFI (GPT+EFI) and BIOS (MBR) layouts. ISO: - Add squashfs-tools, parted, grub-pc, grub-efi-amd64 to package list - New overlay script bee-install: partitions, formats, unsquashfs, writes fstab, runs grub-install+update-grub in chroot Go TUI: - Settings → Tools submenu (Install to disk, Check tools) - Disk picker screen: lists non-USB, non-boot disks via lsblk - Confirm screen warns about data loss - Runs with live progress tail of /tmp/bee-install.log - platform/install.go: ListInstallDisks, InstallToDisk, findLiveBootDevice Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -123,6 +123,26 @@ func cleanSATStepName(name string) string {
|
||||
return name
|
||||
}
|
||||
|
||||
// pollInstallProgress tails the install log file and returns recent lines as progress.
|
||||
func pollInstallProgress(logFile string) tea.Cmd {
|
||||
return tea.Tick(500*time.Millisecond, func(_ time.Time) tea.Msg {
|
||||
return satProgressMsg{lines: readInstallProgressLines(logFile)}
|
||||
})
|
||||
}
|
||||
|
||||
func readInstallProgressLines(logFile string) []string {
|
||||
raw, err := os.ReadFile(logFile)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
lines := strings.Split(strings.TrimSpace(string(raw)), "\n")
|
||||
// Show last 12 lines
|
||||
if len(lines) > 12 {
|
||||
lines = lines[len(lines)-12:]
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
func fmtDurMs(ms int) string {
|
||||
if ms < 1000 {
|
||||
return fmt.Sprintf("%dms", ms)
|
||||
|
||||
Reference in New Issue
Block a user