dgiese / dustcloud

Xiaomi Smart Home Device Reverse Engineering and Hacking
GNU General Public License v3.0
2.2k stars 254 forks source link

imagebuilder.sh: loop is a module #215

Open ivan98 opened 5 years ago

ivan98 commented 5 years ago

My CONFIG_BLK_DEV_LOOP is compiled as a module, so I can't mount -o loop without first modprobing the module.

Suggest "modprobe --quiet loop" be inserted before the mount, as follows:

$ diff -Naur imagebuilder.sh.orig imagebuilder.sh
--- imagebuilder.sh.orig        2019-04-23 10:37:26.809665307 +0800
+++ imagebuilder.sh     2019-04-23 10:37:42.660092263 +0800
@@ -340,6 +340,7 @@
     #ext4fuse disk.img image -o force
     fuse-ext2 "$FW_DIR/disk.img" "$IMG_DIR" -o rw+
 else
+    modprobe --quiet loop
     mount -o loop "$FW_DIR/disk.img" "$IMG_DIR"
 fi
dgiese commented 5 years ago

is this a potential thing which might break something for someone?

ivan98 commented 5 years ago

Not that I know of. If loop is built into the kernel, modprobe loop will yield loop module not found, which is harmless (though you may want to pipe the warning message to null, to not frighten people). For kernels with loop module but loop module is already loaded, it does nothing.

So either way, it is harmless.