File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11%global debug_package %{nil }
2- %define release_num 3
2+ %define release_num 4
33
44Name: cryptpilot
55Version: 0.2.5
139139
140140
141141%changelog
142+ *
Wed Jul 2 2025 Kun Lai <[email protected] > -
0.2.5-4 143+ - Fix "Failed to load kernel module 'nbd'" when used in docker container.
144+
142145*
Mon Jun 30 2025 Kun Lai <[email protected] > -
0.2.5-3 143146- cryptpilot-convert: fix occasional "device or resource busy" error when rootfs encryption is enabled
144147
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ pub struct NbdDevice {
2727}
2828
2929impl NbdDevice {
30+ pub fn is_module_loaded ( ) -> bool {
31+ Path :: new ( "/dev/nbd0" ) . exists ( )
32+ }
33+
3034 pub async fn modprobe ( ) -> Result < ( ) > {
3135 tokio:: task:: spawn_blocking ( || {
3236 liblmod:: modprobe (
@@ -48,7 +52,9 @@ impl NbdDevice {
4852 }
4953
5054 pub async fn get_avaliable ( ) -> Result < NbdDeviceNumber > {
51- Self :: modprobe ( ) . await ?;
55+ if !Self :: is_module_loaded ( ) {
56+ Self :: modprobe ( ) . await ?;
57+ }
5258
5359 for i in 0 ..=99 {
5460 let dev = PathBuf :: from ( format ! ( "/dev/nbd{i}" ) ) ;
You can’t perform that action at this time.
0 commit comments