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

Patches for AmigaOne/MAI Teron CX|PX (new PowerPC flavour) support in dbootstrap (boot floppies)



Hi,

Here is my final patches for utilities/dbootstrap/main.c and utilities/dbootstrap/bootconfig.c for the dbootstrap program, so that the program recognises and can install Debian on the AmigaOne/MAI Teron CX|PX PowerPC ATX boards (a new flavour).

I will later create patches for the Makefiles etc, and create the appropriate kernel packages, so that "amigaone" install disks get built when the PowerPC disk set is built. At the moment, the use of the PowerPC/PReP install disks with a replacement kernel (and my patches on dbootstrap) does the trick, and has been thoroughly tested by me on the AmigaOne board.

The patches have been looked over by Stephen Marenka.

The only issue with the patches is that they increase the size of dbootstrap by a small amount on PowerPC, and since the PowerPC/PReP install disks are very full when they get built, the disk image occasionally ends up being larger than 1.44MB which fails the build. Sometimes this doesn't happen.

We don't know why the compression/optimisation of the PowerPC/PReP disks varies like this, but Stephen is able to build PowerPC/PReP disks usually after a few retries. All other PowerPC flavours are fine.

Regards,

Ross..
--- boot-floppies-cvs-original/utilities/dbootstrap/bootconfig.c	Thu Jan  2 10:54:48 2003
+++ boot-floppies-cvs/utilities/dbootstrap/bootconfig.c	Mon Jan 27 13:54:54 2003
@@ -352,6 +352,11 @@
 #endif
 
 #if #cpu (powerpc)
+  if (strcmp(Arch2, "AmigaOne") == 0) {
+    problemBox(_("Creating a boot floppy is still not possible for PowerPC/AmigaOne."),
+               _("Problem"));
+    return 0;
+  }
   if (strcmp(Arch2, "apus") == 0) {
     problemBox(_("Creating a boot floppy is still not possible for PowerPC/apus."),
                _("Problem"));
@@ -2657,6 +2662,36 @@
       return 1;
     }
   }
+  else if (strcmp(Arch2, "AmigaOne") == 0) {
+    if ((boot_part = fdisk_find_partition_by_type(PTYPE_PREP_BOOT)) != NULL) {
+      /* We need to handle the situation of multiple partitions existing */
+      
+      /* Make sure that the size of the partition is sufficient to hold the kernel image */
+      if (boot_part->size < 10240) {
+        problemBox(_("The boot partition is too small. It must be at least 10 Megabytes."),
+                   _("Problem"));
+        return 1;
+      }
+      
+      /* 'dd' the kernel to the boot partition */
+      snprintf(prtbuf, sizeof(prtbuf), "About to install the kernel to boot partition %s.\n\nIf this is not the correct boot partition select <No>, change the partition type of %s to something other than 0x41, and re-select this option to try again. The partition type of %s can then be changed back again.\n\nAre you sure that you want to do this?",
+               boot_part->name, boot_part->name, boot_part->name);
+      if (DLG_NO == yesNoBox(prtbuf, _("Are You Sure?")))
+        return 1;
+      pleaseWaitBox(_("Copying the operating system kernel..."));
+      snprintf(prtbuf, sizeof(prtbuf), BC_RUN_PREPDD, "/target/vmlinuz", boot_part->name);
+      status=execlog(prtbuf, LOG_INFO);
+      /* Handle errors? */
+      boxPopWindow();
+      notInstalledLILO=0;
+      return 0;
+    }
+    else {
+      problemBox(_("No boot partition (type 0x41) was found."),
+                 _("Problem"));
+      return 1;
+    }
+  } /**/
   else {
     status = run_plilo();
     if(status != 0) {
--- boot-floppies-cvs-original/utilities/dbootstrap/main.c	Wed Dec 25 02:24:44 2002
+++ boot-floppies-cvs/utilities/dbootstrap/main.c	Fri Jan  3 23:16:02 2003
@@ -268,6 +268,9 @@
   }
   if (strcmp(model,"Amiga") == 0)
     model = "apus";
+  
+  if (strcmp(model,"AmigaOne") == 0)
+    model = "AmigaOne";
 
   return model;
 }
@@ -594,6 +597,8 @@
 #if #cpu(powerpc)
       if (!strcmp(Arch2, "Amiga"))
 	 arch_path = "apus";
+      else if (!strcmp(Arch2, "AmigaOne"))
+	 arch_path = "amigaone";
       else if (!strcmp(Arch2, "CHRP"))
 	 arch_path = "chrp";
       else if (!strcmp(Arch2, "PowerMac"))
@@ -900,7 +905,7 @@
 #elif #cpu (powerpc)
     if ( !strstr(Arch2,"PowerMac") &&
 	 strcmp(Arch2,"CHRP") && strcmp(Arch2,"PReP")
-	 && strcasecmp(Arch2,"apus")) {
+	 && strcmp(Arch2,"AmigaOne") && strcasecmp(Arch2,"apus")) {
       problemBox(_("Your PowerPC architecture is not supported yet."), _("Problem"));
       reboot(RB_AUTOBOOT);
     }

Reply to: