64
64
enableUefi bool
65
65
enableUefiSecure bool
66
66
isOffline bool
67
+ isISOFromRAM bool
67
68
68
69
// The iso-as-disk tests are only supported in x86_64 because other
69
70
// architectures don't have the required hybrid partition table.
79
80
"iso-live-login.4k.uefi" ,
80
81
"iso-offline-install.bios" ,
81
82
"iso-offline-install.mpath.bios" ,
82
- "iso-offline-install.4k.uefi" ,
83
+ "iso-offline-install-fromram .4k.uefi" ,
83
84
"miniso-install.bios" ,
84
85
"miniso-install.nm.bios" ,
85
86
"miniso-install.4k.uefi" ,
@@ -101,7 +102,7 @@ var (
101
102
}
102
103
tests_ppc64le = []string {
103
104
"iso-live-login.ppcfw" ,
104
- "iso-offline-install.ppcfw" ,
105
+ "iso-offline-install-fromram .ppcfw" ,
105
106
"iso-offline-install.mpath.ppcfw" ,
106
107
"iso-offline-install.4k.ppcfw" ,
107
108
"miniso-install.ppcfw" ,
@@ -114,7 +115,7 @@ var (
114
115
tests_aarch64 = []string {
115
116
"iso-live-login.uefi" ,
116
117
"iso-live-login.4k.uefi" ,
117
- "iso-offline-install.uefi" ,
118
+ "iso-offline-install-fromram .uefi" ,
118
119
"iso-offline-install.mpath.uefi" ,
119
120
"iso-offline-install.4k.uefi" ,
120
121
"miniso-install.uefi" ,
@@ -130,6 +131,8 @@ var (
130
131
131
132
const (
132
133
installTimeout = 10 * time .Minute
134
+ // https://github.com/coreos/fedora-coreos-config/pull/2544
135
+ liveISOFromRAMKarg = "coreos.liveiso.fromram"
133
136
)
134
137
135
138
var liveOKSignal = "live-test-OK"
@@ -236,6 +239,24 @@ RequiredBy=coreos-installer.target
236
239
# for iso-as-disk
237
240
RequiredBy=multi-user.target`
238
241
242
+ // Unit to check that /run/media/iso is not mounted when
243
+ // coreos.liveiso.fromram kernel argument is passed
244
+ var isoNotMountedUnit = `[Unit]
245
+ Description=Verify ISO is not mounted when coreos.liveiso.fromram
246
+ OnFailure=emergency.target
247
+ OnFailureJobMode=isolate
248
+ ConditionKernelCommandLine=coreos.liveiso.fromram
249
+ [Service]
250
+ Type=oneshot
251
+ StandardOutput=kmsg+console
252
+ StandardError=kmsg+console
253
+ RemainAfterExit=yes
254
+ # Would like to use SuccessExitStatus but it doesn't support what
255
+ # we want: https://github.com/systemd/systemd/issues/10297#issuecomment-1672002635
256
+ ExecStart=bash -c "if mountpoint /run/media/iso 2>/dev/null; then exit 1; fi"
257
+ [Install]
258
+ RequiredBy=coreos-installer.target`
259
+
239
260
var nmConnectionId = "CoreOS DHCP"
240
261
var nmConnectionFile = "coreos-dhcp.nmconnection"
241
262
var nmConnection = fmt .Sprintf (`[connection]
@@ -519,6 +540,12 @@ func runTestIso(cmd *cobra.Command, args []string) error {
519
540
if kola .HasString ("offline" , strings .Split (components [0 ], "-" )) {
520
541
isOffline = true
521
542
}
543
+ // For fromram it is a part of the first component. i.e. for
544
+ // iso-offline-install-fromram.uefi we need to search for 'fromram' in
545
+ // iso-offline-install-fromram, which is currently in components[0].
546
+ if kola .HasString ("fromram" , strings .Split (components [0 ], "-" )) {
547
+ isISOFromRAM = true
548
+ }
522
549
523
550
switch components [0 ] {
524
551
case "pxe-offline-install" , "pxe-online-install" :
@@ -527,7 +554,7 @@ func runTestIso(cmd *cobra.Command, args []string) error {
527
554
duration , err = testAsDisk (ctx , filepath .Join (outputDir , test ))
528
555
case "iso-live-login" :
529
556
duration , err = testLiveLogin (ctx , filepath .Join (outputDir , test ))
530
- case "iso-install" , "iso-offline-install" :
557
+ case "iso-install" , "iso-offline-install" , "iso-offline-install-fromram" :
531
558
duration , err = testLiveIso (ctx , inst , filepath .Join (outputDir , test ), false )
532
559
case "miniso-install" :
533
560
duration , err = testLiveIso (ctx , inst , filepath .Join (outputDir , test ), true )
@@ -711,13 +738,15 @@ func testLiveIso(ctx context.Context, inst platform.Install, outdir string, mini
711
738
return 0 , err
712
739
}
713
740
741
+ var isoKernelArgs []string
714
742
var keys []string
715
743
keys = append (keys , strings .TrimSpace (string (sshPubKeyBuf )))
716
744
virtioJournalConfig .AddAuthorizedKeys ("core" , keys )
717
745
718
746
liveConfig := * virtioJournalConfig
719
747
liveConfig .AddSystemdUnit ("live-signal-ok.service" , liveSignalOKUnit , conf .Enable )
720
748
liveConfig .AddSystemdUnit ("verify-no-efi-boot-entry.service" , verifyNoEFIBootEntry , conf .Enable )
749
+ liveConfig .AddSystemdUnit ("iso-not-mounted-when-fromram.service" , isoNotMountedUnit , conf .Enable )
721
750
liveConfig .AddSystemdUnit ("coreos-test-entered-emergency-target.service" , signalFailureUnit , conf .Enable )
722
751
723
752
targetConfig := * virtioJournalConfig
@@ -738,7 +767,11 @@ func testLiveIso(ctx context.Context, inst platform.Install, outdir string, mini
738
767
liveConfig .AddFile (nmstateConfigFile , nmstateConfig , 0644 )
739
768
}
740
769
741
- mach , err := inst .InstallViaISOEmbed (nil , liveConfig , targetConfig , outdir , isOffline , minimal )
770
+ if isISOFromRAM {
771
+ isoKernelArgs = append (isoKernelArgs , liveISOFromRAMKarg )
772
+ }
773
+
774
+ mach , err := inst .InstallViaISOEmbed (isoKernelArgs , liveConfig , targetConfig , outdir , isOffline , minimal )
742
775
if err != nil {
743
776
return 0 , errors .Wrapf (err , "running iso install" )
744
777
}
0 commit comments