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

parted - base support

> The patches are ready. I am going to split them into 3 series:
> - generic parted patches (parted stuff will be used if /sbin/parted is here)

Done. This code will stay inactive unless /sbin/parted is found.
--- boot-floppies-cvs.orig/utilities/dbootstrap/partition_config.c
+++ boot-floppies-cvs/utilities/dbootstrap/partition_config.c
@@ -59,7 +61,7 @@
 int partition_disk (void) {
   struct fdisk_disk *d;
   struct fdisk_partition *p;
-  char *mounts, *swaps, *tmpbuf; 
+  char *mounts, *swaps, *tmpbuf, *myfdisk; 
   int root_on_disk=0, status=0;
   struct stat statbuf;
@@ -135,6 +137,21 @@
     free (swaps);
+  if(fopen("/sbin/parted", "r")) { /* check whether we have parted */
+     if(twoButtonBox( _("This set of boot floppies has varios programs for partitioning of the harddisk. However, to partition with other programs then cfdisk (default) is dangerous, you should not try them if you are not an expert or if you don't exactly know what you are doing. Which way do you want to go?"), _("CFDISK or Expert mode?"), _("default"), _("expert only"), 1) == DLG_YES)
+        myfdisk="/sbin/cfdisk";
+     else {
+        if(twoButtonBox( _("Now you have the choice between: fdisk and parted. Fdisk is the old program, but allows to do some tricks with the partition table. GNU parted is new, not complete and not 100\% stable, but has features like fs resizing and moving of the partitions. Which one should be invoked now?"), _("fdisk or parted?"), _("fdisk"), _("parted"), 2) == DLG_YES)
+           myfdisk="/sbin/fdisk";
+        else
+           myfdisk="/sbin/parted";
+     }
+  }
+  else { /* no parted present, use default cfdisk */
+     myfdisk="/sbin/cfdisk";
+  }
 #if #cpu(i386)
   if (! bootargs.isquiet)
@@ -215,7 +232,7 @@
     INFOMSG("running cfdisk to partition %s", d->name);
-    sprintf(prtbuf, "cfdisk %s", d->name);
+    sprintf(prtbuf, "%s %s", myfdisk, d->name);
     status = fullscreen_execlog(prtbuf);
 #ifdef pc_use_cfdisk_err_ret_switch
     switch (status) {

Attachment: pgpApMdDPf2gX.pgp
Description: PGP signature

Reply to: