forked from dolphinsmalltalk/Dolphin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Boot.st
76 lines (58 loc) · 2.82 KB
/
Boot.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
"Check for update to DBOOT itself"
(SessionManager current argv at: 3 ifAbsent: [nil]) = 'UpdateBoot' ifTrue: [
SourceManager default fileIn: 'Core\Object Arts\Dolphin\Base\Boot\Boot.st'.
]!
"Apply any patches not yet consolidated into the boot image that are required to load the system package"
SourceManager default fileIn: 'PreBoot.st'!
"Reload the base package constituents to reflect any changes since the boot image was created."
SourceManager default fileIn: 'Core\Object Arts\Dolphin\Base\BootSessionManager.cls'!
SessionManager current updateBootImage!
"Install some bare bones packages to get the Installation Management system working"
Package manager install: 'Core\Object Arts\Dolphin\Registry\Dolphin Registry Access.pax'!
"We need this to install any packages containing binaries"
Package manager install: 'Core\Object Arts\Dolphin\System\Base64\Dolphin Base64.pax'!
"Set Dolphin package version and about operation"
Object owningPackage
packageVersion: VMLibrary default versionString!
"Load standard Dolphin products"
Package manager install: 'Core\Object Arts\Dolphin\Installation Manager\Dolphin Products.pax'!
"If required, prompt to boot the desired end product"
| productName product isPrompted |
productName := SessionManager current argv at: 3 ifAbsent: [ | p |
"We'll need MVP bits in order to be able to display the choice prompter for the image version to boot"
Package manager install: 'Core\Object Arts\Dolphin\MVP\Presenters\Prompters\Dolphin Choice Prompter.pax'.
p := (Smalltalk at: #ChoicePrompter)
choices: (DolphinProduct allSubclasses reject: [:each | each isAbstract])
caption: 'Product to boot...'.
p isNil ifTrue: [SessionManager current quit: -1].
isPrompted := true.
p name].
[product := Smalltalk at: productName asSymbol ifAbsent: [ | path |
path := SessionManager current argv at: 4.
Package manager install: path.
Smalltalk at: productName asSymbol].
SessionManager current saveImage: (File fullPathOf: product shortProductName).
Notification signal: 'Booting ', product name.
product boot] on: Error do: [:ex |
"isPrompted==true ifFalse: [SessionManager current quit: -2]."
ex pass ] !
DevelopmentSessionManager installNew!
SessionManager current defaultResourceLibrary loadFlags: 0.
SessionManager current stashBootInfo!
"Ensure all structures have calculated size to avoid recompilation messages later"
ExternalStructure allSubclasses do: [:e | e ensureDefined]!
"Mark all the booted packages as base"
Package manager markAllPackagesAsBase!
"Save the booted image"
| devsesh |
SourceManager default flushChanges.
devsesh := SessionManager current.
devsesh onPreSaveImage.
[devsesh primSnapshot: devsesh imageFileName
backup: false
type: 0
maxObjects: 24576*1024
] ensure: [devsesh onPostSaveImage]!
"Remove unnecessary .chg files"
File delete: 'DBOOT.chg'!
SessionManager current onExit; primQuit: 0!