Bug#57873: marked as done (install uses /dev/loop0 without checking if it is free)
Your message dated 18 Feb 2000 07:38:21 +0900
with message-id <y5a1z6bsbdu.fsf@kgh12351.nifty.ne.jp>
and subject line Bug#57873: install uses /dev/loop0 without checking if it is free
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Darren Benham
(administrator, Debian Bugs database)
--------------------------------------
Received: (at maintonly) by bugs.debian.org; 12 Feb 2000 14:32:31 +0000
Received: (qmail 15539 invoked from network); 12 Feb 2000 14:32:30 -0000
Received: from mercure.math.u-bordeaux.fr (147.210.16.143)
by master.debian.org with SMTP; 12 Feb 2000 14:32:30 -0000
Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221])
by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id PAA04851
for <maintonly@bugs.debian.org>; Sat, 12 Feb 2000 15:32:29 +0100 (MET)
Received: (from allomber@localhost)
by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id PAA18924;
Sat, 12 Feb 2000 15:32:28 +0100 (MET)
Date: Sat, 12 Feb 2000 15:32:28 +0100 (MET)
Message-Id: <[🔎] 200002121432.PAA18924@math.u-bordeaux.fr>
From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
To: maintonly@bugs.debian.org
Subject: install uses /dev/loop0 without checking if it is free
Package: boot-floppies
Version: 2.1.12
The wonderful Debian install system permits do to such wonderful
things as installing GNU/Linux on loopback partitions, without access
to another machine, using the shell.
The problem is that if you use /dev/loop0 for the loopback partition,
the install system loops. This is because it trys and fails to use
/dev/loop0.
If you use /dev/loop7 instead, the installation process normally,
and this is great.
This is not a severe problem since the mere fact it can be made
working is almost unbelievable you have some experience with other
install system, but it can easily be fixed either by:
Output when you start the shell "Please do not use /dev/loop0"
or use the first loop device not allocated instead of /dev/loop0 in
the installation process.
I install slink with the official CD-ROM.
Best regards,
Bill Allombert.
---------------------------------------
Received: (at 57873-done) by bugs.debian.org; 18 Feb 2000 00:56:02 +0000
Received: (qmail 14282 invoked from network); 18 Feb 2000 00:56:02 -0000
Received: from smtp2.nifty.ne.jp (202.219.63.54)
by master.debian.org with SMTP; 18 Feb 2000 00:56:02 -0000
Received: from localhost (hmmt0340.ppp.infoweb.ne.jp [202.219.211.104])
by smtp2.nifty.ne.jp (8.9.3+3.2W/3.7W-991025) with ESMTP id JAA15980;
Fri, 18 Feb 2000 09:55:46 +0900 (JST)
To: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
Cc: 57873-done@bugs.debian.org
Subject: Re: Bug#57873: install uses /dev/loop0 without checking if it is free
References: <[🔎] 200002121432.PAA18924@math.u-bordeaux.fr>
X-fingerprint: DA 00 13 8C 49 BB 60 BE A4 54 3D AF 2E CE 28 DD
From: Taketoshi Sano <kgh12351@nifty.ne.jp>
In-Reply-To: <[🔎] 200002121432.PAA18924@math.u-bordeaux.fr>
(Bill Allombert's message of "Sat, 12 Feb 2000 15:32:28 +0100 (MET)")
MIME-Version: 1.0 (generated by EMIKO 1.13.9 - "Euglena tripteris")
Content-Type: text/plain; charset=US-ASCII
Date: 18 Feb 2000 07:38:21 +0900
Message-ID: <y5a1z6bsbdu.fsf@kgh12351.nifty.ne.jp>
Lines: 106
User-Agent: T-gnus/6.13.3 (based on Pterodactyl Gnus v0.98) EMIKO/1.13.9 (Euglena tripteris) FLIM/1.13.2 (Kasanui) APEL/10.0 Emacs/20.5 (i386-debian-linux-gnu) MULE/4.0 (HANANOEN)
Sender: Taketoshi Sano <xlj06203@nifty.ne.jp>
X-Dispatcher: imput version 991025(IM133)
Hi.
In article <[🔎] 200002121432.PAA18924@math.u-bordeaux.fr>,
at Sat, 12 Feb 2000 15:32:28 +0100 (MET),
on Bug#57873: install uses /dev/loop0 without checking if it is free,
Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> writes:
> Package: boot-floppies
> Version: 2.1.12
>
> The wonderful Debian install system permits do to such wonderful
> things as installing GNU/Linux on loopback partitions, without access
> to another machine, using the shell.
>
> The problem is that if you use /dev/loop0 for the loopback partition,
> the install system loops. This is because it trys and fails to use
> /dev/loop0.
The code in boot-floppies for slink did it
in utilities/dinstall/extract_kernel.c:
41 copy_to_local(const char* diskimage,int nfsroot)
42 {
43 char* dev;
44 int status;
45 if (nfsroot) {
46 /* if nfs-root, cannot copy to local. Instead use a ramdisk */
47 sprintf(prtbuf, "dd < %s/%s > /dev/ram 2> /dev/null",Archive_Dir,diskimage);
48 status = system(prtbuf);
49 dev = "/dev/ram";
50 }
51 else {
52 int ro=1;
53 sprintf(prtbuf,"cp %s/%s /target/image.bin",Archive_Dir,diskimage);
54 status = system(prtbuf);
55 dev = "/dev/loop0";
56 status = set_loop("/dev/loop0","/target/image.bin",0,&ro);
57 }
58 if (status)
59 return NULL;
60 return dev;
61 }
But current boot-floppies for potato does differently
in utilities/dbootstrap/extract_kernel.c:
19 static char*
20 copy_to_local(const char* diskimage)
21 {
22 char* dev;
23 int status;
24 if (is_nfs_partition("/target")) {
25 /* if nfs-root, cannot copy to local. Instead use a ramdisk */
26 sprintf(prtbuf, "dd < %s/%s > /dev/ram 2> /dev/null",Archive_Dir,diskimage);
27 status = execlog(prtbuf, LOG_INFO);
28 dev = "/dev/ram";
29 }
30 else {
31 int ro=1;
32 sprintf(prtbuf,"cp %s/%s /target/image.bin",Archive_Dir,diskimage);
33 status = execlog(prtbuf, LOG_INFO);
34 dev = find_unused_loop_device();
35 status = set_loop(dev,"/target/image.bin",0,&ro);
36 }
37 if (status)
38 return NULL;
39 return dev;
40 }
find_unused_loop_device() is in losetup.c, and it checks loop0 to loop7
by
88 for(i = 0; i <= 7; i++) {
89 sprintf(dev, "/dev/loop%d", i);
90 if (stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) {
91 if ((fd = open (dev, O_RDONLY)) >= 0) {
92 if(ioctl (fd, LOOP_GET_STATUS, &loopinfo) == -1) {
93 if (errno == ENXIO) { /* probably free */
94 close (fd);
95 return strdup(dev);
96 }
97 }
98 close (fd);
99 }
100 }
101 }
> If you use /dev/loop7 instead, the installation process normally,
> and this is great.
>
> This is not a severe problem since the mere fact it can be made
> working is almost unbelievable you have some experience with other
> install system, but it can easily be fixed either by:
>
> Output when you start the shell "Please do not use /dev/loop0"
>
> or use the first loop device not allocated instead of /dev/loop0 in
> the installation process.
I think the change above fix your problem, therefor I close this report.
Please check the recent (2.2.7 or later) boot-floppies, if you can.
Thanks.
--
Taketoshi Sano: <sano@debian.org>,<sano@debian.or.jp>,<kgh12351@nifty.ne.jp>
Reply to: