@@ -94,7 +94,6 @@ use schemars::JsonSchema;
9494use serde:: { Deserialize , Serialize } ;
9595
9696use crate :: parsers:: bls_config:: { BLSConfig , BLSConfigType } ;
97- use crate :: parsers:: grub_menuconfig:: MenuEntry ;
9897use crate :: task:: Task ;
9998use crate :: {
10099 bootc_composefs:: repo:: get_imgref,
@@ -119,6 +118,7 @@ use crate::{
119118 } ,
120119 spec:: { Bootloader , Host } ,
121120} ;
121+ use crate :: { parsers:: grub_menuconfig:: MenuEntry , store:: BootedComposefs } ;
122122
123123use crate :: install:: { RootSetup , State } ;
124124
@@ -155,7 +155,14 @@ pub(crate) enum BootSetupType<'a> {
155155 ) ,
156156 ) ,
157157 /// For `bootc upgrade`
158- Upgrade ( ( & ' a Storage , & ' a ComposefsFilesystem , & ' a Host ) ) ,
158+ Upgrade (
159+ (
160+ & ' a Storage ,
161+ & ' a BootedComposefs ,
162+ & ' a ComposefsFilesystem ,
163+ & ' a Host ,
164+ ) ,
165+ ) ,
159166}
160167
161168#[ derive(
@@ -532,7 +539,7 @@ pub(crate) fn setup_composefs_bls_boot(
532539 )
533540 }
534541
535- BootSetupType :: Upgrade ( ( storage, fs, host) ) => {
542+ BootSetupType :: Upgrade ( ( storage, booted_cfs , fs, host) ) => {
536543 let sysroot_parent = get_sysroot_parent_dev ( & storage. physical_root ) ?;
537544 let bootloader = host. require_composefs_booted ( ) ?. bootloader . clone ( ) ;
538545
@@ -551,7 +558,12 @@ pub(crate) fn setup_composefs_bls_boot(
551558 } ;
552559
553560 // Copy all cmdline args, replacing only `composefs=`
554- let param = format ! ( "{COMPOSEFS_CMDLINE}={id_hex}" ) ;
561+ let param = if booted_cfs. cmdline . insecure {
562+ format ! ( "{COMPOSEFS_CMDLINE}=?{id_hex}" )
563+ } else {
564+ format ! ( "{COMPOSEFS_CMDLINE}={id_hex}" )
565+ } ;
566+
555567 let param =
556568 Parameter :: parse ( & param) . context ( "Failed to create 'composefs=' parameter" ) ?;
557569 cmdline. add_or_modify ( & param) ;
@@ -1083,7 +1095,7 @@ pub(crate) fn setup_composefs_uki_boot(
10831095 )
10841096 }
10851097
1086- BootSetupType :: Upgrade ( ( storage, _, host) ) => {
1098+ BootSetupType :: Upgrade ( ( storage, booted_cfs , _, host) ) => {
10871099 let sysroot = Utf8PathBuf :: from ( "/sysroot" ) ; // Still needed for root_path
10881100 let sysroot_parent = get_sysroot_parent_dev ( & storage. physical_root ) ?;
10891101 let bootloader = host. require_composefs_booted ( ) ?. bootloader . clone ( ) ;
@@ -1092,7 +1104,7 @@ pub(crate) fn setup_composefs_uki_boot(
10921104 sysroot,
10931105 get_esp_partition ( & sysroot_parent) ?. 0 ,
10941106 bootloader,
1095- false ,
1107+ booted_cfs . cmdline . insecure ,
10961108 None ,
10971109 )
10981110 }
@@ -1224,8 +1236,11 @@ pub(crate) async fn setup_composefs_boot(
12241236 root_setup : & RootSetup ,
12251237 state : & State ,
12261238 image_id : & str ,
1239+ insecure : bool ,
12271240) -> Result < ( ) > {
1228- let repo = open_composefs_repo ( & root_setup. physical_root ) ?;
1241+ let mut repo = open_composefs_repo ( & root_setup. physical_root ) ?;
1242+ repo. set_insecure ( insecure) ;
1243+
12291244 let mut fs = create_composefs_filesystem ( & repo, image_id, None ) ?;
12301245 let entries = fs. transform_for_boot ( & repo) ?;
12311246 let id = fs. commit_image ( & repo, None ) ?;
@@ -1296,6 +1311,7 @@ pub(crate) async fn setup_composefs_boot(
12961311 & state. source . imageref . name ,
12971312 ) )
12981313 . await ?,
1314+ insecure,
12991315 )
13001316 . await ?;
13011317
0 commit comments