File tree 7 files changed +15
-17
lines changed
7 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ impl InstallationState {
253
253
fn setup_system ( & self , output : RepartOutput , passphrase : Option < & str > ) -> Result < ( ) > {
254
254
// XXX: This is a bit hacky, but this function should be called before output.generate_fstab() for
255
255
// the fstab generator to be correct, IF we're using encryption
256
- //
256
+ //
257
257
// todo: Unfuck this
258
258
let mut container = output. to_container ( passphrase) ?;
259
259
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pub struct CryptSetup;
10
10
impl PostInstallModule for CryptSetup {
11
11
fn run ( & self , context : & Context ) -> Result < ( ) > {
12
12
let mut f = std:: fs:: File :: create ( "/etc/crypttab" ) ?;
13
-
13
+
14
14
f. write_all ( b"# This file is generated by Readymade.\n " ) ?;
15
15
// need to get partition list???
16
16
Original file line number Diff line number Diff line change @@ -127,20 +127,20 @@ impl PostInstallModule for GRUB2 {
127
127
fn run ( & self , context : & Context ) -> Result < ( ) > {
128
128
stage ! ( "Generating system grub defaults" {
129
129
let mut defaults = Grub2Defaults :: default ( ) ;
130
-
130
+
131
131
// Now, let's add extra boot opts if they exist
132
132
if let Some ( crypt_data) = & context. crypt_data {
133
133
// prepend
134
134
let current_value = defaults. cmdline_linux. clone( ) ;
135
-
135
+
136
136
// this is a mess.
137
137
// todo: In the event someone thinks this code stinks, please please PLEASE refactor it for us.
138
-
138
+
139
139
let joined_cmdline = crypt_data. cmdline_opts. join( " " ) ;
140
140
tracing:: info!( "Adding cryptsetup cmdline options: {}" , joined_cmdline) ;
141
141
defaults. cmdline_linux = format!( "{} {}" , joined_cmdline, current_value) ;
142
142
}
143
-
143
+
144
144
let defaults_str = defaults. generate( ) ;
145
145
std:: fs:: write( "/etc/default/grub" , defaults_str) ?;
146
146
} ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ use std::path::PathBuf;
16
16
use super :: repart_output:: CryptData ;
17
17
18
18
pub mod cleanup_boot;
19
+ pub mod cryptsetup;
19
20
pub mod dracut;
20
21
pub mod efi_stub;
21
22
pub mod grub2;
@@ -24,7 +25,6 @@ pub mod language;
24
25
pub mod prepare_fedora;
25
26
pub mod reinstall_kernel;
26
27
pub mod selinux;
27
- pub mod cryptsetup;
28
28
29
29
pub struct Context {
30
30
pub destination_disk : PathBuf ,
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl MapperCache {
55
55
fn insert ( & mut self , node : String , path : PathBuf ) {
56
56
self . cache . insert ( node, path) ;
57
57
}
58
-
58
+
59
59
fn clear ( & mut self ) {
60
60
for ( node, path) in self . cache . drain ( ) {
61
61
if let Err ( e) = cryptsetup_close ( & path. to_string_lossy ( ) ) {
@@ -431,19 +431,19 @@ impl RepartPartition {
431
431
// - Finding the UUID of the mapper device by doing some symlink magic (thanks udev!)
432
432
// - Using that UUID for the fstab entry
433
433
434
-
435
434
// We're gonna be abusing the mapper cache, which should be populated by the time we get here
436
-
435
+
437
436
let mapper_cache = MAPPER_CACHE . read ( ) . unwrap ( ) ;
438
437
let mapper_path = mapper_cache. get ( & self . node ) . unwrap ( ) ;
439
-
440
438
441
439
tracing:: trace!( ?mapper_path, "Guessed mapper path as this" ) ;
442
440
443
441
// Thankfully, since we made lsblk-rs we can do this easily.
444
442
let device = lsblk:: BlockDevice :: from_path ( & mapper_path) ?;
445
443
tracing:: trace!( ?device, "Found device from mapper path" ) ;
446
- let uuid = device. uuid . ok_or_eyre ( "Could not find UUID of decrypted device" ) ?;
444
+ let uuid = device
445
+ . uuid
446
+ . ok_or_eyre ( "Could not find UUID of decrypted device" ) ?;
447
447
448
448
// The mapper path should be a symlink to the /dev/dm-XX device
449
449
Original file line number Diff line number Diff line change @@ -411,4 +411,4 @@ impl EncryptOption {
411
411
pub const fn is_on ( self ) -> bool {
412
412
!matches ! ( self , EncryptOption :: Off )
413
413
}
414
- }
414
+ }
Original file line number Diff line number Diff line change @@ -213,8 +213,6 @@ fn main() -> Result<()> {
213
213
214
214
IPC_CHANNEL . set ( Mutex :: new ( channel) ) . unwrap ( ) ;
215
215
let install_state: InstallationState = serde_json:: from_reader ( std:: io:: stdin ( ) ) ?;
216
-
217
-
218
216
219
217
return install_state. install ( ) ;
220
218
}
@@ -268,9 +266,9 @@ fn setup_hooks() -> impl std::any::Any {
268
266
std:: env:: set_var ( key, value) ;
269
267
}
270
268
}
271
-
269
+
272
270
let is_non_interactive = std:: env:: args ( ) . any ( |arg| arg == "--non-interactive" ) ;
273
-
271
+
274
272
let readymade_log_file = if !is_non_interactive {
275
273
"readymade.log"
276
274
} else {
You can’t perform that action at this time.
0 commit comments