Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #41 from trueos/kernelupdates
Browse files Browse the repository at this point in the history
Kernelupdates
  • Loading branch information
kmoore134 authored May 21, 2019
2 parents 8ffecfa + 2d4b11b commit 44734a7
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 207 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Only **one** of these arguments may be used at a time.
- **-change-train TRAIN_NAME**
- Reconfigure the package repository files to point to the designated TRAIN_NAME.
- ***WARNING*** This will remove *all* package repository configuration files on the system and create a single "/etc/pkg/Train.conf" file containing the configuration for the desired package train.
- **-stage2**
- Start 2nd stage of update, internal usage only

## Secondary/Optional Arguments
There are a number of secondary/optional flags that can be used for additional functionality:
Expand Down
23 changes: 18 additions & 5 deletions defines/defines.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,35 @@ var WSClient *websocket.Conn
var pkgflags string

// What is this tool called?
var toolname = "sysup"
var ToolName = "sysup"

// Where to log by default
var LogFile = "/var/log/" + toolname + ".log"
var LogFile = "/var/log/" + ToolName + ".log"

// Configuration file location
var ConfigJson = "/usr/local/etc/" + toolname + ".json"
var ConfigJson = "/usr/local/etc/" + ToolName + ".json"

// Global trains URL
var TrainsUrl string

// Default kernel pkg name
var KernelPkg string

// Are we running without WS backend
var DisableWSMsg = false

// Set our default bootstrap options
var Bootstrap = false
var BootstrapFatal = false

// Default pubkey used for trains
var TrainPubKey = "/usr/local/share/" + toolname + "/trains.pub"
var TrainPubKey = "/usr/local/share/" + ToolName + "/trains.pub"

// Package defaults
//----------------------------------------------------
var PKGBIN = "pkg-static"

var SysUpDb = "/var/db/" + toolname
var SysUpDb = "/var/db/" + ToolName
var PkgDb = SysUpDb + "/pkgdb"
var ImgMnt = SysUpDb + "/mnt"
var PkgConf = SysUpDb + "/pkg.conf"
Expand Down Expand Up @@ -76,6 +82,7 @@ var CheckFlag bool
var DisableBsFlag bool
var FullUpdateFlag bool
var ListTrainFlag bool
var Stage2Flag bool
var UpdateFlag bool
var UpdateFileFlag string
var UpdateKeyFlag string
Expand Down Expand Up @@ -143,6 +150,12 @@ func init() {
"Use the specified update pubkey for offline updates"+
" (Defaults to none)",
)
flag.BoolVar(
&Stage2Flag,
"stage2",
false,
"Start 2nd stage of updating, normally only run internally by sysup",
)
flag.StringVar(
&BeNameFlag,
"bename",
Expand Down
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ func main() {
// Update any variable locations
defines.SetLocs()

// Bypass normal startup and go straight to updating
if defines.Stage2Flag {
update.StartStage2()
os.Exit(0)
}

// Capture any sigint
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt)
Expand Down
Loading

0 comments on commit 44734a7

Please sign in to comment.