Re: Fix problem report, in progress on hard disk install problems

2002-01-26 Thread Chris Tillman

On Sat, Jan 26, 2002 at 01:56:36PM -0500, Colin Walters wrote:
> On Fri, 2002-01-25 at 22:03, Chris Tillman wrote:
> > I started in on getting the hard disk installation to work again. 
> 
> I wonder when it broke?

Looks like there were some nasty surprises in the changes jaqque had
so carefully prepared. There's been so little activity lately, no
one's noticed. 

> Anyways, would you mind postponing these changes from being applied to
> CVS until after 3.0.19 is released?  There are a lot of show-stoppers in
> 3.0.18, such as the debootstrap problems, lilo on i386, the fact that
> mac-fdisk is b0rked on the powerpc disks.
> 
> Any changes to choose_medium.c will require a lot of testing; that code
> is a nasty, quivering logical mess.  (Your changes do look sane though
> at first glance).

Sure, just warn people they can't install from instant harddisk or
mounted partitions.

I do see what you mean about the code; I've just about got these
things fixed though. The tentacles do reach around a bit, so if the
rest of the release is stable, it's probably best to hold off as you
say.

-- 
*--v- Installing Debian GNU/Linux 3.0 v--*
|    |
|   debian-imac (potato):    |
|Chris Tillman[EMAIL PROTECTED]  |
|   May the Source be with you   |
**


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Fix problem report, in progress on hard disk install problems

2002-01-26 Thread Colin Walters

On Fri, 2002-01-25 at 22:03, Chris Tillman wrote:
> I started in on getting the hard disk installation to work again. 

I wonder when it broke?

Anyways, would you mind postponing these changes from being applied to
CVS until after 3.0.19 is released?  There are a lot of show-stoppers in
3.0.18, such as the debootstrap problems, lilo on i386, the fact that
mac-fdisk is b0rked on the powerpc disks.

Any changes to choose_medium.c will require a lot of testing; that code
is a nasty, quivering logical mess.  (Your changes do look sane though
at first glance).




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Fix problem report, in progress on hard disk install problems

2002-01-25 Thread Chris Tillman

I started in on getting the hard disk installation to work again. For
the first effort, I logically encapsulated the problem report
directory entry into its own function (getting a directory is really a
little different from getting a mountpoint). I also prevented the
partition from getting umounted immediately after being chosen, before
it had a chance for the problem report to be written. It still needs
to be umounted somewhere.

I also restated the get-a-mountpoint logic and added some comments to
make it clearer what is going on.

So far, it's an improvement; at least the problem report works
again. I'll continue work this weekend.

Index: choose_medium.c
===
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/choose_medium.c,v
retrieving revision 1.125
diff -u -r1.125 choose_medium.c
--- choose_medium.c 2002/01/13 00:15:23 1.125
+++ choose_medium.c 2002/01/26 02:49:14
@@ -207,6 +207,36 @@
 return 0;
 }
 
+/* Problem Report wants a directory, not a mountpoint */
+int choose_problem_dir(char *text, char *prefix)
+{
+char buffer[PATH_MAX+1];
+   char buffer2[PATH_MAX+1];
+   int status;
+   struct stat statbuf;
+   char *preventry_prob = strdup(""); /* Previous entry doesn't matter here */
+   for(;;) {
+ status = enterDirBox(_("Select the target directory"),
+   text, prefix, preventry_prob, buffer2, PATH_MAX);
+ if (status == DLG_CANCEL)
+ return DLG_CANCEL;
+ else if (status != DLG_OKAY)
+ return 1;
+ snprintf(buffer, sizeof(buffer), "%s%s%s", prefix, 
+ buffer2[0]=='/'?"":"/", buffer2);
+ if (NAME_ISDIR(buffer, &statbuf))
+ break;
+ else {
+ snprintf (prtbuf, sizeof (prtbuf),
+   _("The supplied directory %s does not exist. Please enter a 
+new one."),
+   buffer2);
+ problemBox(prtbuf, _("Directory Error"));
+ }
+   }
+   Archive_Dir = strdup(buffer);
+   return 0;
+}
+
 /*
text - the message displayed that tells the user what the directory will 
be used for
@@ -218,7 +248,7 @@
 {
 char buffer[PATH_MAX+1];
 char buffer2[PATH_MAX+1];
-int i, found;
+int i, found, ask;
 char *mountpoint, *descr = "", *def;
 static char *preventry = NULL;
 /*  glob_t globbuf; */
@@ -245,18 +275,18 @@
preventry = strdup("");
 }
 
-buffer2[0] = '\0';
+buffer2[0] = '\0'; /* default directory guess */
+if (is_cdrom_image() == 2) {
+   /* we've booted off a CD-ROM, live style */
+   strcpy(buffer2, "");
+}
 
 for(i=0 ;; i++) {
-   if (i == 0 && bootargs.isquiet && disqtype != problem_report) {
-   /* Try to guess a good directory. */
-   if (is_cdrom_image() == 2)
-   /* we've boot off a CD-ROM, live style */
-   strcpy(buffer2, "");
-   } else {
-   i++; /* if we have to manually choose a dir, give us a warning 
-   when we are wrong, even if it is our first time through */
-   status = enterDirBox(_("Choose Directory"),
+   /* Should we ask for user input on the mountpoint? */
+   ask = i; /* if we are looping (i>0) we MUST ask */
+   ask = (ask || bootargs.isverbose); /* if verbose we MUST ask */
+   if (ask) {
+   status = enterDirBox(_("Choose the Mount Point"),
text, prefix, preventry, buffer2, PATH_MAX);
if (status == DLG_CANCEL)
return DLG_CANCEL;
@@ -271,7 +301,7 @@
if (NAME_ISDIR(buffer, &statbuf))
break;
else {
-   if (i==0 && ! bootargs.isverbose) {
+   if (! ask) {
/* We guessed wrong.  Don't let the user see the directory
   that didn't work out. */
free(preventry);
@@ -284,6 +314,7 @@
}
}
 }
+/* We have a valid directory path */
 mountpoint = strdup(buffer);
 
 switch (disqtype) {
@@ -308,11 +339,8 @@
break;
 #endif
 case problem_report:
-   /* We are looking for a directory to write to, not searching 
-  for a file. We are done now. */
-   Archive_Dir = strdup(mountpoint);
-   return 0;
-break;
+   /* handled in choose_problem_dir */
+   DEBUGMSG("problem_report case reached in error");
 }
 
 def = NULL;
@@ -408,11 +436,13 @@
 _("Please select the directory containing a file %s that you 
will use to install %s."),
 pattern, descr);
}
-   status = menuBox(prtbuf, disqtype==problem_report ? _("Select Target path") : 
_("Select Debian Archive path"), 
+   status = menuBox(prtbuf, _("Select Debian Archive path"), 
 choices, items, 1);
 }
 
-