Offline installers (roadmap M1.3): - internal/installer drives `reims-util --json offline-installer` and parses its JSON event stream (upstream reims-vgpu 3731afd, reims_util.rs:423-509) - downloads hold installers/.lock like reims-ctl, so the two never write the same file; checked against the real reims-ctl (TestLockExcludesReimsCtl) - pause = stop the process, rerun resumes; deletes go through `reims-ctl downloads delete`, which refuses files in use or downloading - CLI: reims-go installer list | download | cached | delete - Wails bindings: ListOfflineReleases, DownloadInstaller, ListInstallers, DeleteInstaller Task events (ui-redesign B1): - tasks.go tracks long-running work and emits "reims:task" (throttled to 200 ms per task); VM creation turns reims-ctl's progress lines into task progress and logs each step once - the status bar shows the current task with a progress bar, details in a tooltip and a pause button; the frontend regex merging is removed Win10 cold reboot workaround: - host probes whether WinHvPlatform.dll lacks WHvResetPartition (Win10 19045) - internal/qmp watches a dedicated QMP channel for guest resets; with -no-reboot the app restarts the VM in a fresh partition - architecture.md documents download routing and the workaround Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
509 B
Go
29 lines
509 B
Go
//go:build !windows
|
|
|
|
package installer
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
func configureCmd(*exec.Cmd) {}
|
|
|
|
// tryLock is flock(LOCK_EX | LOCK_NB), as Rust's File::try_lock on Unix.
|
|
func tryLock(f *os.File) (bool, error) {
|
|
err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB)
|
|
if err == nil {
|
|
return true, nil
|
|
}
|
|
if errors.Is(err, syscall.EWOULDBLOCK) {
|
|
return false, nil
|
|
}
|
|
return false, err
|
|
}
|
|
|
|
func unlock(f *os.File) {
|
|
_ = syscall.Flock(int(f.Fd()), syscall.LOCK_UN)
|
|
}
|