Bug#136818: powerpc/new-powermac] will not mount /boot partition
On Mon, 2002-03-04 at 16:19, Matt Kraai wrote:
> No. The file system must be mounted for is_fstype, and hence
> verify_powerpc_mount, to work correctly. Since it isn't
> mounted, is_fstype always returns false, so verify_powerpc_mount
> always decides that the /boot partition file system is not
> supported.
Ah, right. That's rather a bummer. I think I see how to solve this
though; we just pass verify_powerpc_mount the type of the partition we
want to mount it as. Maybe this will work:
Index: partition_config.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/partition_config.c,v
retrieving revision 1.146
diff -u -u -r1.146 partition_config.c
--- partition_config.c 2002/02/17 22:00:23 1.146
+++ partition_config.c 2002/03/04 22:35:09
@@ -118,41 +118,41 @@
#if #cpu(powerpc)
int
-verify_powerpc_mount(char *mount_point) {
- /* yaboot can read ext2,ext3,xfs,reiserfs, but crippleware filesystems
- like hfs will break make-bootable.
- quik can only read ext2. */
- if ((!strcmp(mount_point, "/boot")) || (!strcmp(mount_point, "/boot/"))) {
- if (strstr(Arch2, "PowerMac")) {
- int is_newworld = !strcmp(Arch3, "NewWorld");
- if (!is_fstype("/boot", "ext2")
- ||
- (is_newworld ? !is_fstype("/boot", "ext3")
- || !is_fstype("/boot", "xfs")
- /* Should someone WANT to lose their data...*/
- || !is_fstype("/boot", "reiserfs")
- : 0))
- {
- snprintf(prtbuf, sizeof(prtbuf),
- _("The file system type you have chosen for /boot "
- "is not compatible with the %s bootloader. Please "
- "choose one of: ext2%s%s"),
- is_newworld ? "yaboot" : "quik",
- is_ext3 ? " ext3" : "",
- is_xfs ? " xfs" : "");
- problemBox(prtbuf,
- _("Choose another file system"));
- return 1;
- }
- else if (!(((Arch3 != NULL) && (0 == strcmp(Arch3, "NewWorld"))) || (0 == strcmp(Arch2, "chrp"))))
- if (DLG_NO == yesNoBox(_("Quik may not work correctly if a separate "
- "/boot partition is used. Do you wish to continue "
- "mounting /boot?"),
- _("Quik problems with /boot not on /")))
- return 1;
- }
+verify_powerpc_mount(char *mount_point, char *type) {
+ /* yaboot can read ext2,ext3,xfs,reiserfs, but crippleware filesystems
+ like hfs will break make-bootable.
+ quik can only read ext2. */
+ if (!strncmp(mount_point, "/target/boot", 12)) {
+ if (strstr(Arch2, "PowerMac")) {
+ int is_newworld = !strcmp(Arch3, "NewWorld");
+ if ((!is_newworld
+ && strcmp(type, "ext2"))
+ || (is_newworld
+ && strcmp(type, "ext2")
+ && strcmp(type, "ext3")
+ && strcmp(type, "xfs")
+ && strcmp(type, "reiserfs")))
+ {
+ snprintf(prtbuf, sizeof(prtbuf),
+ _("The file system type you have chosen for /boot "
+ "is not compatible with the %s bootloader. Please "
+ "choose one of: ext2%s%s"),
+ is_newworld ? "yaboot" : "quik",
+ is_ext3 ? " ext3" : "",
+ is_xfs ? " xfs" : "");
+ problemBox(prtbuf, _("Choose another file system"));
+ return 1;
+ }
+ else if (!(((Arch3 != NULL) && (0 == strcmp(Arch3, "NewWorld")))
+ || (0 == strcmp(Arch2, "chrp"))))
+ if (DLG_NO == yesNoBox(_("Quik may not work correctly if a separate "
+ "/boot partition is used. Do you wish to continue "
+ "mounting /boot?"),
+ _("Quik problems with /boot not on /")))
+ return 1;
}
- return 0;
+ }
+ return 0;
}
#endif
@@ -639,10 +639,6 @@
else {
mount_point = strdup(mount_points[status].tag);
}
-#if #cpu(powerpc)
- if (verify_powerpc_mount(mount_point))
- return 1;
-#endif
if (NULL == mount_point) return 1;
real_mount_point = (char *)malloc(9 + strlen(mount_point));
strcpy(real_mount_point, "/target");
@@ -710,7 +706,7 @@
if (!(strcmp(xfsmagic, "XFSB"))) { /* XFS */
#if #cpu(powerpc)
- if (verify_powerpc_mount(mount_point))
+ if (verify_powerpc_mount(mount_point, "xfs"))
return 1;
#endif
INFOMSG("Mounting XFS partition %s on %s", partition->name, mount_point);
@@ -722,7 +718,7 @@
else if (!(strcmp(shfsmagic, "ReIsErFs") && strcmp(shfsmagic, "ReIsEr2Fs"))) /* reiserfs */
{
#if #cpu (powerpc)
- if (verify_powerpc_mount(mount_point))
+ if (verify_powerpc_mount(mount_point, "reiserfs"))
return 1;
#endif
snprintf(prtbuf, sizeof(prtbuf), _("The \"notail\" option is required on the /boot "
Reply to: