Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-06-20 00:38:39 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-07-09 15:14:49 -0300
commita038edac590fbb0c96ffc35daf117e122b18e35e (patch)
tree994ba0fdcb4a6563c6b377d65661f9fb5ed4b9ef /archiso
parente59d7931328a0f0f747520d48b254a6ef8378d44 (diff)
[archiso] Create correctly loop devs if loop.max_part > 0
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso')
-rw-r--r--archiso/hooks/archiso16
1 files changed, 10 insertions, 6 deletions
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index b81bbf7..7e2997a 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -1,22 +1,26 @@
# Initialize loopback device logic (we using on-demand mode)
# args: none
_init_loop_dev() {
- loop_dev_cnt=99
+ modprobe loop
+ loop_dev_count=99
+ loop_dev_range=$(cat /sys/block/loop0/range)
+ loop_dev_minor=$((loop_dev_count*loop_dev_range))
}
# Call this function before _make_loop_dev() each time.
# args: none
_next_loop_dev() {
- loop_dev_cnt=$((loop_dev_cnt+1))
+ loop_dev_count=$((loop_dev_count+1))
+ loop_dev_minor=$((loop_dev_count*loop_dev_range))
}
-# Setup a loopback device for image passed as arguemnt and echo the path to loopback device used.
+# Setup a loopback device for image passed as argument and echo the path to loopback device used.
# args: /path/to/image_file
_make_loop_dev() {
local img="${1}"
- mknod /dev/loop${loop_dev_cnt} b 7 ${loop_dev_cnt} &> /dev/null
- losetup /dev/loop${loop_dev_cnt} "${img}" &> /dev/null
- echo /dev/loop${loop_dev_cnt}
+ mknod /dev/loop${loop_dev_count} b 7 ${loop_dev_minor} &> /dev/null
+ losetup /dev/loop${loop_dev_count} "${img}" &> /dev/null
+ echo /dev/loop${loop_dev_count}
}
# args: source, mountpoint