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

bootconfig



Hi All,

Well, apologies first for complaining about poor communication and then
disappearing for a week. :-/  Mother and child doing well, thank you.
Well, I'm back now and trying to pick up the pieces where I left off.

I've just checked in a simple fix for libfdisk/fdisk.c which initialises
the fields in the fdisk_partition struct that were causing the problems
testing Root->disk in bootconfig.c.  Karl, I think, had also traced
this back to add_partition().  This change should be totally benign,
so I've included it in the main trunk.

Joey got dbootstrap working by disabling the affected checks.  Since I
believe the problem is fixed for all devices onto which people might
try to install LILO (with the regrettable exception of /dev/md*), I
have re-activated the checks, but modified them to fail silently (with
segfaulting!) if part->disk or part->disk->name is undefined.  Fearful of
making the same sort of mistake as before, I'm letting you know directly,
Joey (in case you are wondering why I copied you this message).

Karl, I've been perusing your changes on the br_exp_karlheg_markv branch
and think some of them should definitely be merged into the main branch
fairly soon.  In particular, I want to build upon some of your work in
make_bootable() and I think it a problem to have the branch so different
from the main trunk.  Please let me know your thinking and intentions
in this area.

I've included a bit from my old bootconfig.c.  This is too different to
anything recent to make a meaningful patch, and won't work without a lot
of adjustment, so please don't use it!  I include it only to indicate my
previous direction and someone asked to see it (sorry, forget who).

Regards,

Mark.


char *choose_lilo_boot(struct fdisk_partition *root)
{
  char *boot = NULL;

  /* At present, we try to put LILO into the root, and offer a selection */
  /* of extended partitions iff the root is a logical.  It would be nice */
  /* to allow the user to choose the partition for LILO, regardless.     */

  if ((is_first_ide(root) || is_first_scsi(root) ||
       yesNoBox(_("With your current configuration, LILO will try to boot "
                  "from a disk that is not your first IDE or SCSI disk. "
                  "It's possible that your BIOS doesn't support that.\n\n"
                  "Do you want to install LILO anyway?"), _("Problem")))
   && (! is_first_scsi(root) || ! fdisk_find_disk(DEV_HDA) ||
       yesNoBox(_("With your current configuration, LILO will try to boot "
                  "from your first SCSI disk, but your system has also a "
                  "master IDE disk at the primary IDE controller. "
                  "It's possible that your BIOS doesn't support that.\n\n"
                  "Do you want to install LILO anyway?"), _("Problem"))))
  {
    if (is_logical_part(root)) {
      struct fdisk_partition *extd = select_not_mounted(_(
                  "The root filesystem is installed in a logical partition. "
                  "LILO can't install there, so you must install LILO "
                  "in one of the following extended partitions. "
                  "Please select the partition to use."),
                  _("Select Partition"), 1, FSTYPE_EXTPART);
      if (extd)
        boot = extd->name;
    } else
      boot = root->name;
  }
  return boot;  /* will be NULL for a problem not overridden by the user */
}
#endif /* #cpu (i386) */


int make_bootable(void) 
{
  int status;

#if #cpu (i386)
  char *lilo_boot = choose_lilo_boot(Root);

  status = run_lilo(lilo_boot);
  if (status) {
    /* FIXME: does anyone know what the FIXME in the next line means? */
    /* FIXME: write_it_down. */
    problemBox(_("LILO wasn't able to install. You'll still be able to "
                 "boot your system if you create a boot floppy, but it "
                 "won't be able to boot without a floppy.\nThe most "
                 "common reason why LILO fails is an overly-large root "
                 "(\"/\") partition. LILO is unable to load any block of "
                 "the kernel from a disk cylinder numbered higher than "
                 "1023. This is often a problem with disks larger than a "
                 "gigabyte (1024 MB) or so. One way to solve the problem "
                 "is to make a separate \"/\" and \"/usr\" partition, "
                 "so that the entire \"/\" partition will be below the "
                 "1023rd cylinder."), _("Problem"));
  } else {
    if (lilo_boot) {
      char *mbr_boot = choose_mbr_boot(lilo_boot);
      status = install_mbr(mbr_boot);
      if (! status)
        status = set_boot_default(mbr_boot);
      notInstalledLILO=0;
    } else {
      /* problem earlier and user responded "no": lilo.conf will be broken */
      problemBox(_("Please boot the system using the rescue boot method "
                   "and configure LILO manually."), _("Problem"));
    }
  }


Reply to: