NetBSD-Bugs archive

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

install/54065: sysinst: make newfs_ext2fs -O REVs configurable



>Number:         54065
>Category:       install
>Synopsis:       sysinst: make newfs_ext2fs -O REVs configurable
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    install-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 16 15:40:00 +0000 2019
>Originator:     Izumi Tsutsui
>Release:        NetBSD -current, after 20190307
>Organization:
>Environment:
System: NetBSD 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Recently newfs_ext2fs(8) has been changed to create -O1 (DYNAMIC_REV)
file system by default:
 http://mail-index.netbsd.org/source-changes/2019/03/06/msg104050.html
 ---
 Module Name:	src
 Committed By:	mrg
 Date:		Wed Mar  6 05:11:13 UTC 2019
 
 Modified Files:
 	src/sbin/newfs_ext2fs: newfs_ext2fs.8 newfs_ext2fs.c
 
 Log Message:
 make ext2fs rev1 the default.  this enables LARGEFILES support.
 ---

but current sysinst(8) assumes its default is -O0 and there is
no way to specify options for newfs_ext2fs -O REVs.

The Cobalt firmware requires to have Ext2 REV0 to load a bootloader
from a boot partition so NetBSD/cobalt installation will fail.

(note I wrote newfs_ext2fs(8) for cobalt restorecd :-)

>How-To-Repeat:
Code inspection.

>Fix:
Changes like the following patch is necessary (untested):

Index: usr.sbin/sysinst/defs.h
===================================================================
RCS file: /cvsroot/src/usr.sbin/sysinst/defs.h,v
retrieving revision 1.28
diff -u -p -d -r1.28 defs.h
--- usr.sbin/sysinst/defs.h	27 Nov 2018 17:13:41 -0000	1.28
+++ usr.sbin/sysinst/defs.h	16 Mar 2019 15:25:41 -0000
@@ -218,6 +218,7 @@ typedef struct _partinfo {
 	uint	pi_flags;
 #define PIF_NEWFS	0x0001		/* need to 'newfs' partition */
 #define PIF_FFSv2	0x0002		/* newfs with FFSv2, not FFSv1 */
+#define PIF_EXT2REV1	PIF_FFSv2	/* newfs_ext2fs with REV1, not REV0 */
 #define PIF_MOUNT	0x0004		/* need to mount partition */
 #define PIF_ASYNC	0x0010		/* mount -o async */
 #define PIF_NOATIME	0x0020		/* mount -o noatime */
Index: usr.sbin/sysinst/disks.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/sysinst/disks.c,v
retrieving revision 1.28
diff -u -p -d -r1.28 disks.c
--- usr.sbin/sysinst/disks.c	27 Nov 2018 17:13:41 -0000	1.28
+++ usr.sbin/sysinst/disks.c	16 Mar 2019 15:25:42 -0000
@@ -1093,7 +1093,8 @@ make_filesystems(void)
 #endif
 #ifdef USE_EXT2FS
 		case FS_EX2FS:
-			asprintf(&newfs, "/sbin/newfs_ext2fs");
+			asprintf(&newfs, "/sbin/newfs_ext2fs -O %d"
+			    lbl->pi_flags & PIF_EXT2REV1 ? 1 : 0));
 			lbl->mnt_opts = "-text2fs";
 			lbl->fsname = "ext2fs";
 			break;


---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index