Module Name:    src
Committed By:   martin
Date:           Sun May  9 10:39:01 UTC 2021

Modified Files:
        src/usr.sbin/sysinst/arch/evbarm: md.c

Log Message:
Keep MSDOS partition size and subtype consistent - some u-boot are picky.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/arch/evbarm/md.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/arch/evbarm/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm/md.c:1.20 src/usr.sbin/sysinst/arch/evbarm/md.c:1.21
--- src/usr.sbin/sysinst/arch/evbarm/md.c:1.20	Sat Nov 28 13:05:58 2020
+++ src/usr.sbin/sysinst/arch/evbarm/md.c	Sun May  9 10:39:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.20 2020/11/28 13:05:58 jmcneill Exp $ */
+/*	$NetBSD: md.c,v 1.21 2021/05/09 10:39:00 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -333,10 +333,12 @@ bool
 md_parts_use_wholedisk(struct disk_partitions *parts)
 {
 	struct disk_part_info boot_part = {
-		.size = boardtype == BOARD_TYPE_NORMAL ? 
+		.size = boardtype == BOARD_TYPE_NORMAL ?
 		    PART_BOOT_LARGE/parts->bytes_per_sector :
 		    PART_BOOT/parts->bytes_per_sector,
-		.fs_type = PART_BOOT_TYPE, .fs_sub_type = MBR_PTYPE_FAT16L,
+		.fs_type = PART_BOOT_TYPE,
+		.fs_sub_type = boardtype == BOARD_TYPE_NORMAL ?
+		    MBR_PTYPE_FAT32L : MBR_PTYPE_FAT16L,
 	};
 
 	return parts_use_wholedisk(parts, 1, &boot_part);
@@ -368,15 +370,15 @@ evbarm_part_defaults(struct pm_devs *my_
 {
 	size_t i;
 
-	if (boardtype != BOARD_TYPE_NORMAL)
-		return;
-
 	for (i = 0; i < num_usage_infos; i++) {
 		if (infos[i].fs_type == PART_BOOT_TYPE &&
 		    infos[i].mount[0] != 0 &&
 		    strcmp(infos[i].mount, PART_BOOT_MOUNT) == 0) {
-			infos[i].size = PART_BOOT_LARGE /
-			    my_pm->parts->bytes_per_sector;
+			infos[i].size = boardtype == BOARD_TYPE_NORMAL ?
+			    PART_BOOT_LARGE/my_pm->parts->bytes_per_sector :
+			    PART_BOOT/my_pm->parts->bytes_per_sector;
+			infos[i].fs_version = boardtype == BOARD_TYPE_NORMAL ?
+			    MBR_PTYPE_FAT32L : MBR_PTYPE_FAT16L; 
 			return;
 		}
 	}

Reply via email to