Module Name:    src
Committed By:   martin
Date:           Wed Oct 30 14:16:15 UTC 2019

Modified Files:
        src/distrib/utils/embedded: mkimage

Log Message:
Derive the FAT type from the MBR partition type and pass it on to makefs
when crating a msdos file system.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.70 src/distrib/utils/embedded/mkimage:1.71
--- src/distrib/utils/embedded/mkimage:1.70	Wed Oct  2 11:16:00 2019
+++ src/distrib/utils/embedded/mkimage	Wed Oct 30 14:16:15 2019
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.70 2019/10/02 11:16:00 maya Exp $
+# $NetBSD: mkimage,v 1.71 2019/10/30 14:16:15 martin Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -217,7 +217,14 @@ populate
 
 if [ -n "${msdosid}" ]; then
 	echo ${bar} Populating msdos filesystem ${bar}
-	${MAKEFS} -N ${release}/etc -t msdos -o volume_label=NETBSD \
+	case $(( ${msdosid} )) in
+	1)	fat_opt=",fat_type=12";;
+	4|6|14)	fat_opt=",fat_type=16";;
+	11|12)	fat_opt=",fat_type=32";;
+	*)	fat_opt=;;
+	esac
+	${MAKEFS} -N ${release}/etc -t msdos \
+	    -o "volume_label=NETBSD${fat_opt}" \
 	    -O $((${init} / 2))m -s $((${boot} / 2))m \
 	    ${image} ${mnt}/boot
 fi

Reply via email to