[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LOOP_CLR_FD: Device not configured ?



Hi.

In article <[🔎] oan1q1uwgd.fsf@arroz.fake>,
  at 20 Jan 2000 00:46:26 -0500,
    on LOOP_CLR_FD: Device not configured ?,
 Adam Di Carlo <adam@onshore.com> writes:

> Really wierd problem in dbootstrap.  when trying to install OS and
> modules from disk, I get "unable to mount Rescue Disk" and a strange
> error:
> 
>   ioctl: LOOP_CLR_FD: Device not configured

This message comes from losetup.c in dbootstrap

int del_loop(const char *device)
{
        int fd;

        if ((fd = open(device, O_RDONLY)) < 0) {
                perror(device);
                exit(1);
        }
        if (ioctl(fd, LOOP_CLR_FD, 0) < 0) {
                perror("ioctl: LOOP_CLR_FD");
                exit(1);
        }
        close(fd);
        return(0);
}

This "del_loop()" is called from "release_device()" in extract_kernel.c

void
release_device(const char* device)
{
  if (is_nfs_partition("/target")) {
    /* free ramdisk */
    int f=open(device,O_RDWR);
    if (f >= 0) {
      ioctl(f,BLKFLSBUF);
      close(f);
    }
  }
  else {
    del_loop(device);
    unlink("/target/image.bin");
  }
}

and release_device() is called from "extract_kernel_and_modules()"
in extract_kernel.c (line 304)

    diskimage=kernel_image_filename;
    device=get_device(diskimage);
    if (device) {
      status=install_floppy(device,"rescue",_("Rescue Floppy"));
      release_device(device);
    }

and "install_floppy()" (line 96 in extract_kernel.c) calls
 "mount_and_check_floppy(device,type,text)" (line 38 in choose_medium.c).
but it does not use loop device to mount the rescue floppy at all.

So I wonder why this relase_device() calls del_loop() when
device is not the loop device (/dev/loop?).

> The dbootstrap seems to die rather rudely.

This is caused by exit(-1) in del_loop() (in losetup.c)

I think these calls exit(-1) from other place than main.c
(such as in losetup.c) make the trouble-shooting more difficult.
Can we change them to return(-1) ?

-- 
  Taketoshi Sano: <sano@debian.org>,<sano@debian.or.jp>,<kgh12351@nifty.ne.jp>


Reply to: