CVS commit: src/usr.sbin/fstyp

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 18:21:25 UTC 2024

Modified Files:
src/usr.sbin/fstyp: Makefile

Log Message:
PR/58202: Malte Dehling: Don't link libzfs


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/fstyp/Makefile

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/fstyp/Makefile
diff -u src/usr.sbin/fstyp/Makefile:1.14 src/usr.sbin/fstyp/Makefile:1.15
--- src/usr.sbin/fstyp/Makefile:1.14	Sat Jun  3 17:26:29 2023
+++ src/usr.sbin/fstyp/Makefile	Fri Apr 26 14:21:25 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2023/06/03 21:26:29 lukem Exp $
+#	$NetBSD: Makefile,v 1.15 2024/04/26 18:21:25 christos Exp $
 
 .include 
 
@@ -17,7 +17,8 @@ WARNS?=	6
 COPTS.zfs.c+=	-Wno-unknown-pragmas
 COPTS.zfs.c+=	-Wno-sign-conversion
 COPTS.zfs.c+=	-Wno-strict-prototypes
-LDADD+=	-lnvpair -lzfs
+LDADD+=	-lnvpair
+DPADD+= ${LIBNVPAIR}
 
 OSNET=${NETBSDSRCDIR}/external/cddl/osnet
 CPPFLAGS+=	-DHAVE_ZFS



CVS commit: src/usr.sbin/fstyp

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 18:21:25 UTC 2024

Modified Files:
src/usr.sbin/fstyp: Makefile

Log Message:
PR/58202: Malte Dehling: Don't link libzfs


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/fstyp/Makefile

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



CVS commit: src/usr.sbin/fstyp

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 07:25:11 UTC 2021

Modified Files:
src/usr.sbin/fstyp: hammer_disk.h

Log Message:
s/rather then/rather than/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/hammer_disk.h

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/fstyp/hammer_disk.h
diff -u src/usr.sbin/fstyp/hammer_disk.h:1.2 src/usr.sbin/fstyp/hammer_disk.h:1.3
--- src/usr.sbin/fstyp/hammer_disk.h:1.2	Sun Dec  5 04:47:17 2021
+++ src/usr.sbin/fstyp/hammer_disk.h	Sun Dec  5 07:25:11 2021
@@ -1,4 +1,4 @@
-/*$NetBSD: hammer_disk.h,v 1.2 2021/12/05 04:47:17 msaitoh Exp $  */
+/*$NetBSD: hammer_disk.h,v 1.3 2021/12/05 07:25:11 msaitoh Exp $  */
 
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -36,7 +36,7 @@
  * $DragonFly: src/sys/vfs/hammer/hammer_disk.h,v 1.55 2008/11/13 02:18:43 dillon Exp $
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hammer_disk.h,v 1.2 2021/12/05 04:47:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hammer_disk.h,v 1.3 2021/12/05 07:25:11 msaitoh Exp $");
 
 #ifndef VFS_HAMMER_DISK_H_
 #define VFS_HAMMER_DISK_H_
@@ -948,7 +948,7 @@ typedef struct hammer_inode_data {
  * localization field.  The low 16 bits must be 0 and are reserved for
  * future use.
  *
- * Directory entries are indexed with a 128 bit namekey rather then an
+ * Directory entries are indexed with a 128 bit namekey rather than an
  * offset.  A portion of the namekey is an iterator/randomizer to deal
  * with collisions.
  *



CVS commit: src/usr.sbin/fstyp

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 07:25:11 UTC 2021

Modified Files:
src/usr.sbin/fstyp: hammer_disk.h

Log Message:
s/rather then/rather than/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/hammer_disk.h

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



CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:42 UTC 2021

Modified Files:
src/usr.sbin/fstyp: hammer2.c

Log Message:
PR/56530: RVP: use ioctl to get the partition size if possible (avoids SEGV)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fstyp/hammer2.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/fstyp/hammer2.c
diff -u src/usr.sbin/fstyp/hammer2.c:1.8 src/usr.sbin/fstyp/hammer2.c:1.9
--- src/usr.sbin/fstyp/hammer2.c:1.8	Sun Jan 10 08:44:57 2021
+++ src/usr.sbin/fstyp/hammer2.c	Thu Dec  2 09:26:42 2021
@@ -1,4 +1,4 @@
-/*$NetBSD: hammer2.c,v 1.8 2021/01/10 13:44:57 martin Exp $  */
+/*$NetBSD: hammer2.c,v 1.9 2021/12/02 14:26:42 christos Exp $  */
 
 /*-
  * Copyright (c) 2017-2019 The DragonFly Project
@@ -27,7 +27,11 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hammer2.c,v 1.8 2021/01/10 13:44:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hammer2.c,v 1.9 2021/12/02 14:26:42 christos Exp $");
+
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -44,32 +48,37 @@ static ssize_t
 get_file_size(FILE *fp)
 {
 	ssize_t siz;
+	struct dkwedge_info dkw;
+
+	if (ioctl(fileno(fp), DIOCGWEDGEINFO, ) != -1) {
+		return (ssize_t)dkw.dkw_size * DEV_BSIZE;
+	}
 
 	if (fseek(fp, 0, SEEK_END) == -1) {
 		warnx("hammer2: failed to seek media end");
-		return (-1);
+		return -1;
 	}
 
 	siz = ftell(fp);
 	if (siz == -1) {
 		warnx("hammer2: failed to tell media end");
-		return (-1);
+		return -1;
 	}
 
-	return (siz);
+	return siz;
 }
 
 static hammer2_volume_data_t *
 read_voldata(FILE *fp, int i)
 {
 	if (i < 0 || i >= HAMMER2_NUM_VOLHDRS)
-		return (NULL);
+		return NULL;
 
 	if ((hammer2_off_t)i * (hammer2_off_t)HAMMER2_ZONE_BYTES64 >= (hammer2_off_t)get_file_size(fp))
-		return (NULL);
+		return NULL;
 
-	return (read_buf(fp, (off_t)i * (off_t)HAMMER2_ZONE_BYTES64,
-	sizeof(hammer2_volume_data_t)));
+	return read_buf(fp, (off_t)i * (off_t)HAMMER2_ZONE_BYTES64,
+	sizeof(hammer2_volume_data_t));
 }
 
 static int
@@ -86,20 +95,20 @@ test_voldata(FILE *fp)
 		voldata = read_voldata(fp, i);
 		if (voldata == NULL) {
 			warnx("hammer2: failed to read volume data");
-			return (1);
+			return 1;
 		}
 		if (voldata->magic != HAMMER2_VOLUME_ID_HBO &&
 		voldata->magic != HAMMER2_VOLUME_ID_ABO) {
 			free(voldata);
-			return (1);
+			return 1;
 		}
 		if (voldata->volu_id > HAMMER2_MAX_VOLUMES - 1) {
 			free(voldata);
-			return (1);
+			return 1;
 		}
 		if (voldata->nvolumes > HAMMER2_MAX_VOLUMES) {
 			free(voldata);
-			return (1);
+			return 1;
 		}
 
 		if (count == 0) {
@@ -109,21 +118,21 @@ test_voldata(FILE *fp)
 		} else {
 			if (voldata->nvolumes != count) {
 free(voldata);
-return (1);
+return 1;
 			}
 			if (!uuid_equal(, >fsid, NULL)) {
 free(voldata);
-return (1);
+return 1;
 			}
 			if (!uuid_equal(, >fstype, NULL)) {
 free(voldata);
-return (1);
+return 1;
 			}
 		}
 		free(voldata);
 	}
 
-	return (0);
+	return 0;
 }
 
 static hammer2_media_data_t*
@@ -140,7 +149,7 @@ read_media(FILE *fp, const hammer2_block
 
 	if (!bytes) {
 		warnx("hammer2: blockref has no data");
-		return (NULL);
+		return NULL;
 	}
 
 	io_off = bref->data_off & ~HAMMER2_OFF_MASK_RADIX;
@@ -153,7 +162,7 @@ read_media(FILE *fp, const hammer2_block
 
 	if (io_bytes > sizeof(hammer2_media_data_t)) {
 		warnx("hammer2: invalid I/O bytes");
-		return (NULL);
+		return NULL;
 	}
 
 	/*
@@ -163,26 +172,26 @@ read_media(FILE *fp, const hammer2_block
 	fbytes = (size_t)get_file_size(fp);
 	if ((ssize_t)fbytes == -1) {
 		warnx("hammer2: failed to get media size");
-		return (NULL);
+		return NULL;
 	}
 	if (io_base >= fbytes) {
 		warnx("hammer2: XXX read beyond HAMMER2 root volume limit unsupported");
-		return (NULL);
+		return NULL;
 	}
 
 	if (fseeko(fp, (off_t)io_base, SEEK_SET) == -1) {
 		warnx("hammer2: failed to seek media");
-		return (NULL);
+		return NULL;
 	}
 	media = read_buf(fp, (off_t)io_base, io_bytes);
 	if (media == NULL) {
 		warnx("hammer2: failed to read media");
-		return (NULL);
+		return NULL;
 	}
 	if (boff)
 		memcpy(media, (char *)media + boff, bytes);
 
-	return (media);
+	return media;
 }
 
 static int
@@ -196,7 +205,7 @@ find_pfs(FILE *fp, const hammer2_blockre
 
 	media = read_media(fp, bref, );
 	if (media == NULL)
-		return (-1);
+		return -1;
 
 	switch (bref->type) {
 	case HAMMER2_BREF_TYPE_INODE:
@@ -221,7 +230,7 @@ find_pfs(FILE *fp, const hammer2_blockre
 }
 			} else {
 free(media);
-return (-1);
+return -1;
 			}
 		}
 		break;
@@ -239,13 +248,13 @@ find_pfs(FILE *fp, const hammer2_blockre
 		if (bscan[i].type != HAMMER2_BREF_TYPE_EMPTY) {
 			if (find_pfs(fp, [i], pfs, res) == -1) {
 free(media);
-return (-1);
+return -1;
 			}
 		}
 	}
 	free(media);
 
-	return (0);
+	return 0;
 }
 
 static 

CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:42 UTC 2021

Modified Files:
src/usr.sbin/fstyp: hammer2.c

Log Message:
PR/56530: RVP: use ioctl to get the partition size if possible (avoids SEGV)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fstyp/hammer2.c

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



CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:12 UTC 2021

Modified Files:
src/usr.sbin/fstyp: ntfs.c

Log Message:
PR/56530: RVP: fix iconv open error.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/ntfs.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/fstyp/ntfs.c
diff -u src/usr.sbin/fstyp/ntfs.c:1.2 src/usr.sbin/fstyp/ntfs.c:1.3
--- src/usr.sbin/fstyp/ntfs.c:1.2	Sat Dec 28 03:22:30 2019
+++ src/usr.sbin/fstyp/ntfs.c	Thu Dec  2 09:26:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntfs.c,v 1.2 2019/12/28 08:22:30 tkusumi Exp $	*/
+/*	$NetBSD: ntfs.c,v 1.3 2021/12/02 14:26:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,10 +35,11 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: ntfs.c,v 1.2 2019/12/28 08:22:30 tkusumi Exp $");
+__RCSID("$NetBSD: ntfs.c,v 1.3 2021/12/02 14:26:12 christos Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -108,8 +109,7 @@ convert_label(const void *label /* LE */
 	iconv_t cd;
 	size_t rc;
 
-	/* dstname="" means convert to the current locale. */
-	cd = iconv_open("", NTFS_ENC);
+	cd = iconv_open(nl_langinfo(CODESET), NTFS_ENC);
 	if (cd == (iconv_t)-1) {
 		warn("ntfs: Could not open iconv");
 		return;



CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:12 UTC 2021

Modified Files:
src/usr.sbin/fstyp: ntfs.c

Log Message:
PR/56530: RVP: fix iconv open error.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/ntfs.c

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



CVS commit: src/usr.sbin/fstyp

2021-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 17 21:06:35 UTC 2021

Modified Files:
src/usr.sbin/fstyp: exfat.c hfsplus.c

Log Message:
remove lint hacks now that lint supports _Static_assert


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/hfsplus.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/fstyp/exfat.c
diff -u src/usr.sbin/fstyp/exfat.c:1.5 src/usr.sbin/fstyp/exfat.c:1.6
--- src/usr.sbin/fstyp/exfat.c:1.5	Fri Sep 17 10:49:03 2021
+++ src/usr.sbin/fstyp/exfat.c	Fri Sep 17 17:06:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: exfat.c,v 1.5 2021/09/17 14:49:03 christos Exp $	*/
+/*	$NetBSD: exfat.c,v 1.6 2021/09/17 21:06:35 christos Exp $	*/
 
 /*
  * Copyright (c) 2017 Conrad Meyer 
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: exfat.c,v 1.5 2021/09/17 14:49:03 christos Exp $");
+__RCSID("$NetBSD: exfat.c,v 1.6 2021/09/17 21:06:35 christos Exp $");
 
 #include 
 #include 
@@ -116,9 +116,7 @@ struct exfat_dirent {
 #define	xde_set_chksum		u.xde_primary_.xde_set_chksum_
 #define	xde_prim_flags		u.xde_primary_.xde_prim_flags_
 #define	xde_sec_flags		u.xde_secondary_.xde_sec_flags_
-#ifndef __lint__
 _Static_assert(sizeof(struct exfat_dirent) == 32, "spec");
-#endif
 
 struct exfat_de_label {
 	uint8_t		xdel_type;	/* XDE_TYPE_VOL_LABEL */
@@ -126,9 +124,7 @@ struct exfat_de_label {
 	uint16_t	xdel_vol_lbl[11];
 	uint8_t		xdel_reserved[8];
 } __packed;
-#ifndef __lint__
 _Static_assert(sizeof(struct exfat_de_label) == 32, "spec");
-#endif
 
 #define	MAIN_BOOT_REGION_SECT	0
 #define	BACKUP_BOOT_REGION_SECT	12

Index: src/usr.sbin/fstyp/hfsplus.c
diff -u src/usr.sbin/fstyp/hfsplus.c:1.2 src/usr.sbin/fstyp/hfsplus.c:1.3
--- src/usr.sbin/fstyp/hfsplus.c:1.2	Fri Sep 17 10:49:03 2021
+++ src/usr.sbin/fstyp/hfsplus.c	Fri Sep 17 17:06:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hfsplus.c,v 1.2 2021/09/17 14:49:03 christos Exp $	*/
+/*	$NetBSD: hfsplus.c,v 1.3 2021/09/17 21:06:35 christos Exp $	*/
 /*
  * Copyright (c) 2019 Conrad Meyer .  All rights reserved.
  *
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: hfsplus.c,v 1.2 2021/09/17 14:49:03 christos Exp $");
+__RCSID("$NetBSD: hfsplus.c,v 1.3 2021/09/17 21:06:35 christos Exp $");
 
 #include 
 #include 
@@ -96,9 +96,7 @@ struct hfsp_vol_hdr {
 	hfsp_fork_data	hp_attributesFile;
 	hfsp_fork_data	hp_startupFile;
 };
-#ifndef __lint__
 _Static_assert(sizeof(struct hfsp_vol_hdr) == 512, "");
-#endif
 
 int
 fstyp_hfsp(FILE *fp, char *label, size_t size)



CVS commit: src/usr.sbin/fstyp

2021-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 17 21:06:35 UTC 2021

Modified Files:
src/usr.sbin/fstyp: exfat.c hfsplus.c

Log Message:
remove lint hacks now that lint supports _Static_assert


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/hfsplus.c

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



CVS commit: src/usr.sbin/fstyp

2021-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 17 14:49:03 UTC 2021

Modified Files:
src/usr.sbin/fstyp: exfat.c hfsplus.c

Log Message:
XXX: Teach lint about _Static_assert...


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/hfsplus.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/fstyp/exfat.c
diff -u src/usr.sbin/fstyp/exfat.c:1.4 src/usr.sbin/fstyp/exfat.c:1.5
--- src/usr.sbin/fstyp/exfat.c:1.4	Sun Jan 24 09:37:32 2021
+++ src/usr.sbin/fstyp/exfat.c	Fri Sep 17 10:49:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: exfat.c,v 1.4 2021/01/24 14:37:32 tkusumi Exp $	*/
+/*	$NetBSD: exfat.c,v 1.5 2021/09/17 14:49:03 christos Exp $	*/
 
 /*
  * Copyright (c) 2017 Conrad Meyer 
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: exfat.c,v 1.4 2021/01/24 14:37:32 tkusumi Exp $");
+__RCSID("$NetBSD: exfat.c,v 1.5 2021/09/17 14:49:03 christos Exp $");
 
 #include 
 #include 
@@ -116,7 +116,9 @@ struct exfat_dirent {
 #define	xde_set_chksum		u.xde_primary_.xde_set_chksum_
 #define	xde_prim_flags		u.xde_primary_.xde_prim_flags_
 #define	xde_sec_flags		u.xde_secondary_.xde_sec_flags_
+#ifndef __lint__
 _Static_assert(sizeof(struct exfat_dirent) == 32, "spec");
+#endif
 
 struct exfat_de_label {
 	uint8_t		xdel_type;	/* XDE_TYPE_VOL_LABEL */
@@ -124,7 +126,9 @@ struct exfat_de_label {
 	uint16_t	xdel_vol_lbl[11];
 	uint8_t		xdel_reserved[8];
 } __packed;
+#ifndef __lint__
 _Static_assert(sizeof(struct exfat_de_label) == 32, "spec");
+#endif
 
 #define	MAIN_BOOT_REGION_SECT	0
 #define	BACKUP_BOOT_REGION_SECT	12

Index: src/usr.sbin/fstyp/hfsplus.c
diff -u src/usr.sbin/fstyp/hfsplus.c:1.1 src/usr.sbin/fstyp/hfsplus.c:1.2
--- src/usr.sbin/fstyp/hfsplus.c:1.1	Fri Dec 27 06:06:23 2019
+++ src/usr.sbin/fstyp/hfsplus.c	Fri Sep 17 10:49:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hfsplus.c,v 1.1 2019/12/27 11:06:23 tkusumi Exp $	*/
+/*	$NetBSD: hfsplus.c,v 1.2 2021/09/17 14:49:03 christos Exp $	*/
 /*
  * Copyright (c) 2019 Conrad Meyer .  All rights reserved.
  *
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: hfsplus.c,v 1.1 2019/12/27 11:06:23 tkusumi Exp $");
+__RCSID("$NetBSD: hfsplus.c,v 1.2 2021/09/17 14:49:03 christos Exp $");
 
 #include 
 #include 
@@ -96,7 +96,9 @@ struct hfsp_vol_hdr {
 	hfsp_fork_data	hp_attributesFile;
 	hfsp_fork_data	hp_startupFile;
 };
+#ifndef __lint__
 _Static_assert(sizeof(struct hfsp_vol_hdr) == 512, "");
+#endif
 
 int
 fstyp_hfsp(FILE *fp, char *label, size_t size)



CVS commit: src/usr.sbin/fstyp

2021-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 17 14:49:03 UTC 2021

Modified Files:
src/usr.sbin/fstyp: exfat.c hfsplus.c

Log Message:
XXX: Teach lint about _Static_assert...


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/hfsplus.c

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



CVS commit: src/usr.sbin/fstyp

2021-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 17 14:48:32 UTC 2021

Modified Files:
src/usr.sbin/fstyp: Makefile

Log Message:
Use CPPFLAGS for -D and -I so that lint works.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/fstyp/Makefile

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/fstyp/Makefile
diff -u src/usr.sbin/fstyp/Makefile:1.11 src/usr.sbin/fstyp/Makefile:1.12
--- src/usr.sbin/fstyp/Makefile:1.11	Tue Feb  2 16:31:11 2021
+++ src/usr.sbin/fstyp/Makefile	Fri Sep 17 10:48:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2021/02/02 21:31:11 joerg Exp $
+#	$NetBSD: Makefile,v 1.12 2021/09/17 14:48:31 christos Exp $
 
 .include 
 
@@ -14,19 +14,21 @@ MAN=	fstyp.8
 WARNS?=	6
 
 .if (${MKZFS} != "no")
-CFLAGS+=	-DHAVE_ZFS
 COPTS.zfs.c+=	-Wno-unknown-pragmas
 COPTS.zfs.c+=	-Wno-sign-conversion
 COPTS.zfs.c+=	-Wno-strict-prototypes
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/include
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/head
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/lib/libzpool/common
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common/fs/zfs
-COPTS.zfs.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/dist/lib/libnvpair
 LDADD+=	-lnvpair -lzfs
+
+OSNET=${NETBSDSRCDIR}/external/cddl/osnet
+CPPFLAGS+=	-DHAVE_ZFS
+CPPFLAGS.zfs.c+=	-I${NETBSDSRCDIR}/external
+CPPFLAGS.zfs.c+=	-I${OSNET}/include
+CPPFLAGS.zfs.c+=	-I${OSNET}/sys
+CPPFLAGS.zfs.c+=	-I${OSNET}/dist/head
+CPPFLAGS.zfs.c+=	-I${OSNET}/dist/lib/libzpool/common
+CPPFLAGS.zfs.c+=	-I${OSNET}/dist/uts/common
+CPPFLAGS.zfs.c+=	-I${OSNET}/dist/uts/common/fs/zfs
+CPPFLAGS.zfs.c+=	-I${OSNET}/dist/lib/libnvpair
 .endif
 
 CWARNFLAGS.clang+=	-Wno-unknown-pragmas -Wno-error=address-of-packed-member



CVS commit: src/usr.sbin/fstyp

2021-09-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 17 14:48:32 UTC 2021

Modified Files:
src/usr.sbin/fstyp: Makefile

Log Message:
Use CPPFLAGS for -D and -I so that lint works.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/fstyp/Makefile

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



Re: CVS commit: src/usr.sbin/fstyp

2020-01-01 Thread Kamil Rytarowski
On 28.12.2019 09:00, Tomohiro Kusumi wrote:
> Module Name:  src
> Committed By: tkusumi
> Date: Sat Dec 28 08:00:08 UTC 2019
> 
> Modified Files:
>   src/usr.sbin/fstyp: exfat.c fstyp.c fstyp.h
> 
> Log Message:
> fstyp: Show exFAT volume labels with -l flag
> 
> taken-from: FreeBSD (freebsd/freebsd@73773fcda9f69ce7ee0c73292f273bab940223bf)
> 
> 

fstyp -l is now broken:

$ fstyp -l /dev/rwd0a
fstyp: exfat: iconv_open UCS-2LE: Invalid argument



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/usr.sbin/fstyp

2019-12-28 Thread Warner Losh
On Sat, Dec 28, 2019, 1:31 AM Tomohiro Kusumi 
wrote:

> 2019年12月28日(土) 5:24 Warner Losh :
> >
> >
> >
> > On Fri, Dec 27, 2019 at 12:45 PM Sevan Janiyan 
> wrote:
> >>
> >> Hi tkusumi,
> >> Thanks for the work you are doing.
> >>
> >> On 27/12/2019 11:06, Tomohiro Kusumi wrote:
> >> > taken-from: FreeBSD
> (freebsd/freebsd@b4d7ad9f787e74e712423def67de8bd76f71943a)
> >>
> >> One minor nit, could you please cite the revision in the svn repo which
> >> is the source of truth and not the readonly git mirror, this is in case
> >> something happens to the mirror and hashes end up changing in the
> future.
> >
> >
> > FreeBSD is planning a conversion to git.
>
> Yes, that's the reason I'm using Git hash here.
> Nowadays I don't use their svn repo at all, so if recording Git hash
> is not appropriate, I'll just note "taken-from: FreeBSD" without any
> specific revision#.
>

It's a silly reason. Svn revision numbers will be preserved in the
conversion process. Git hashes likely won't so this hash may be
unconvertable to anything at all in the future...

Warner

> It's an open question at the moment what happens to the 'beta' readonly
> export we're doing to github. There's a number of technical issues with it
> which make using it for our source of truth difficult on an ongoing basis,
> so there's a real chance the hashes will change for people just grabbing a
> FreeBSD tree...
> >
> > Warner
>


Re: CVS commit: src/usr.sbin/fstyp

2019-12-28 Thread Warner Losh
On Fri, Dec 27, 2019 at 12:45 PM Sevan Janiyan 
wrote:

> Hi tkusumi,
> Thanks for the work you are doing.
>
> On 27/12/2019 11:06, Tomohiro Kusumi wrote:
> > taken-from: FreeBSD
> (freebsd/freebsd@b4d7ad9f787e74e712423def67de8bd76f71943a)
>
> One minor nit, could you please cite the revision in the svn repo which
> is the source of truth and not the readonly git mirror, this is in case
> something happens to the mirror and hashes end up changing in the future.


FreeBSD is planning a conversion to git. It's an open question at the
moment what happens to the 'beta' readonly export we're doing to github.
There's a number of technical issues with it which make using it for our
source of truth difficult on an ongoing basis, so there's a real chance the
hashes will change for people just grabbing a FreeBSD tree...

Warner


Re: CVS commit: src/usr.sbin/fstyp

2019-12-28 Thread Tomohiro Kusumi
2019年12月28日(土) 5:24 Warner Losh :
>
>
>
> On Fri, Dec 27, 2019 at 12:45 PM Sevan Janiyan  
> wrote:
>>
>> Hi tkusumi,
>> Thanks for the work you are doing.
>>
>> On 27/12/2019 11:06, Tomohiro Kusumi wrote:
>> > taken-from: FreeBSD 
>> > (freebsd/freebsd@b4d7ad9f787e74e712423def67de8bd76f71943a)
>>
>> One minor nit, could you please cite the revision in the svn repo which
>> is the source of truth and not the readonly git mirror, this is in case
>> something happens to the mirror and hashes end up changing in the future.
>
>
> FreeBSD is planning a conversion to git.

Yes, that's the reason I'm using Git hash here.
Nowadays I don't use their svn repo at all, so if recording Git hash
is not appropriate, I'll just note "taken-from: FreeBSD" without any
specific revision#.

> It's an open question at the moment what happens to the 'beta' readonly 
> export we're doing to github. There's a number of technical issues with it 
> which make using it for our source of truth difficult on an ongoing basis, so 
> there's a real chance the hashes will change for people just grabbing a 
> FreeBSD tree...
>
> Warner


Re: CVS commit: src/usr.sbin/fstyp

2019-12-27 Thread Sevan Janiyan

Hi tkusumi,
Thanks for the work you are doing.

On 27/12/2019 11:06, Tomohiro Kusumi wrote:

taken-from: FreeBSD (freebsd/freebsd@b4d7ad9f787e74e712423def67de8bd76f71943a)


One minor nit, could you please cite the revision in the svn repo which 
is the source of truth and not the readonly git mirror, this is in case 
something happens to the mirror and hashes end up changing in the future.



Sevan


CVS commit: src/usr.sbin/fstyp

2019-11-18 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Mon Nov 18 14:53:34 UTC 2019

Modified Files:
src/usr.sbin/fstyp: Makefile fstyp.8 fstyp.c fstyp.h
Added Files:
src/usr.sbin/fstyp: exfat.c

Log Message:
fstyp: Add exFAT support

Taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/fstyp/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/fstyp.8 \
src/usr.sbin/fstyp/fstyp.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/fstyp.h

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/fstyp/Makefile
diff -u src/usr.sbin/fstyp/Makefile:1.5 src/usr.sbin/fstyp/Makefile:1.6
--- src/usr.sbin/fstyp/Makefile:1.5	Mon Jun 24 08:27:21 2019
+++ src/usr.sbin/fstyp/Makefile	Mon Nov 18 14:53:34 2019
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.5 2019/06/24 08:27:21 hannken Exp $
+#	$NetBSD: Makefile,v 1.6 2019/11/18 14:53:34 tkusumi Exp $
 
 .include 
 
 PROG=	fstyp
-SRCS=	cd9660.c ext2fs.c fstyp.c msdosfs.c ntfs.c ufs.c
+SRCS=	cd9660.c exfat.c ext2fs.c fstyp.c msdosfs.c ntfs.c ufs.c
 
 .if (${MKZFS} != "no")
 SRCS+=	zfs.c

Index: src/usr.sbin/fstyp/fstyp.8
diff -u src/usr.sbin/fstyp/fstyp.8:1.2 src/usr.sbin/fstyp/fstyp.8:1.3
--- src/usr.sbin/fstyp/fstyp.8:1.2	Tue Jan  9 09:41:29 2018
+++ src/usr.sbin/fstyp/fstyp.8	Mon Nov 18 14:53:34 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: fstyp.8,v 1.2 2018/01/09 09:41:29 wiz Exp $
+.\" $NetBSD: fstyp.8,v 1.3 2019/11/18 14:53:34 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 25, 2017
+.Dd November 19, 2019
 .Dt FSTYP 8
 .Os
 .Sh NAME
@@ -48,7 +48,7 @@
 The
 .Nm
 utility is used to determine the file system type on a given device.
-It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS file systems.
+It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS file systems.
 When the
 .Fl u
 flag is specified,
@@ -64,6 +64,8 @@ as, respectively:
 .It
 cd9660
 .It
+exfat
+.It
 ext2fs
 .It
 msdosfs
Index: src/usr.sbin/fstyp/fstyp.c
diff -u src/usr.sbin/fstyp/fstyp.c:1.2 src/usr.sbin/fstyp/fstyp.c:1.3
--- src/usr.sbin/fstyp/fstyp.c:1.2	Tue Jan  9 10:47:57 2018
+++ src/usr.sbin/fstyp/fstyp.c	Mon Nov 18 14:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstyp.c,v 1.2 2018/01/09 10:47:57 martin Exp $	*/
+/*	$NetBSD: fstyp.c,v 1.3 2019/11/18 14:53:34 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  *
  */
 #include 
-__RCSID("$NetBSD: fstyp.c,v 1.2 2018/01/09 10:47:57 martin Exp $");
+__RCSID("$NetBSD: fstyp.c,v 1.3 2019/11/18 14:53:34 tkusumi Exp $");
 
 #include 
 #include 
@@ -64,6 +64,7 @@ static struct {
 	bool		unmountable;
 } fstypes[] = {
 	{ "cd9660", _cd9660, false },
+	{ "exfat", _exfat, false },
 	{ "ext2fs", _ext2fs, false },
 	{ "msdosfs", _msdosfs, false },
 	{ "ntfs", _ntfs, false },

Index: src/usr.sbin/fstyp/fstyp.h
diff -u src/usr.sbin/fstyp/fstyp.h:1.1 src/usr.sbin/fstyp/fstyp.h:1.2
--- src/usr.sbin/fstyp/fstyp.h:1.1	Tue Jan  9 03:31:15 2018
+++ src/usr.sbin/fstyp/fstyp.h	Mon Nov 18 14:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstyp.h,v 1.1 2018/01/09 03:31:15 christos Exp $	*/
+/*	$NetBSD: fstyp.h,v 1.2 2019/11/18 14:53:34 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ char	*checked_strdup(const char *);
 void	rtrim(char *, size_t);
 
 int	fstyp_cd9660(FILE *, char *, size_t);
+int	fstyp_exfat(FILE *fp, char *label, size_t size);
 int	fstyp_ext2fs(FILE *, char *, size_t);
 int	fstyp_msdosfs(FILE *, char *, size_t);
 int	fstyp_ntfs(FILE *, char *, size_t);

Added files:

Index: src/usr.sbin/fstyp/exfat.c
diff -u /dev/null src/usr.sbin/fstyp/exfat.c:1.1
--- /dev/null	Mon Nov 18 14:53:34 2019
+++ src/usr.sbin/fstyp/exfat.c	Mon Nov 18 14:53:34 2019
@@ -0,0 +1,78 @@
+/*	$NetBSD: exfat.c,v 1.1 2019/11/18 14:53:34 tkusumi Exp $	*/
+
+/*
+ * Copyright (c) 2017 Conrad Meyer 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 

CVS commit: src/usr.sbin/fstyp

2019-11-18 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Mon Nov 18 14:53:34 UTC 2019

Modified Files:
src/usr.sbin/fstyp: Makefile fstyp.8 fstyp.c fstyp.h
Added Files:
src/usr.sbin/fstyp: exfat.c

Log Message:
fstyp: Add exFAT support

Taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/fstyp/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/fstyp.8 \
src/usr.sbin/fstyp/fstyp.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/fstyp.h

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