summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/lomount.c8
-rw-r--r--perl-install/devices.pm2
2 files changed, 5 insertions, 5 deletions
diff --git a/mdk-stage1/lomount.c b/mdk-stage1/lomount.c
index 6b465758a..37b1373d3 100644
--- a/mdk-stage1/lomount.c
+++ b/mdk-stage1/lomount.c
@@ -119,12 +119,12 @@ set_loop (const char *device, const char *file, int gz)
char* find_free_loop()
{
- char ldev[] = "/dev/loop0";
struct loop_info loopinfo;
int i;
- for (i=0; i<8; i++) {
+ for (i=0; i<256; i++) {
int fd;
- ldev[strlen(ldev)-1] = '0' + i;
+ char ldev[100];
+ sprintf(ldev, "/dev/loop%d", i);
ensure_dev_exists(ldev);
fd = open(ldev, O_RDONLY);
if (!ioctl(fd, LOOP_GET_STATUS, &loopinfo)) {
@@ -171,7 +171,7 @@ lomount(char *loopfile, char *where, char **dev, int gz)
flag = MS_MGC_VAL;
flag |= MS_RDONLY;
- my_insmod("loop", ANY_DRIVER_TYPE, NULL, 1);
+ my_insmod("loop", ANY_DRIVER_TYPE, "max_loop=256", 1);
if (!(loopdev = find_free_loop())) {
log_message("could not find a free loop");
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 434397a61..8a3654566 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -38,7 +38,7 @@ sub del_loop {
run_program::run("losetup", "-d", $dev);
}
sub find_free_loop() {
- foreach (0..7) {
+ foreach (0..255) {
my $dev = make("loop$_");
sysopen(my $F, $dev, 2) or next;
!ioctl($F, c::LOOP_GET_STATUS(), my $_tmp) && $! == 6 or next; #- 6 == ENXIO