blob: ade3ea943ca2cae93a0cad8fea75428a19c36ba3 [file] [log] [blame] [raw]
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/compat/linprocfs/linprocfs.c freebsd-11.1/usr/src/sys/compat/linprocfs/linprocfs.c
--- /usr/src/sys/compat/linprocfs/linprocfs.c 2017-07-21 07:42:01.000000000 +0800
+++ freebsd-11.1/usr/src/sys/compat/linprocfs/linprocfs.c 2019-03-22 12:44:38.420373000 +0800
@@ -39,6 +39,11 @@
* @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
*/
+#include "linprocfs_version.h"
+#ifndef LINPROCFS_VERSION
+#define LINPROCFS_VERSION LINRPOCFS_VERSION_BUILD_VERSION " " LINPROCFS_VERSION_BUILD_TIME
+#endif
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: releng/11.1/sys/compat/linprocfs/linprocfs.c 320693 2017-07-05 19:24:53Z markj $");
@@ -320,20 +325,17 @@
/* determine fs type */
fstype = sp->f_fstypename;
if (strcmp(fstype, pn->pn_info->pi_name) == 0)
- mntfrom = fstype = "proc";
+ fstype = "proc";
else if (strcmp(fstype, "procfs") == 0)
continue;
-
- if (strcmp(fstype, "linsysfs") == 0) {
- sbuf_printf(sb, "/sys %s sysfs %s", mntto,
- sp->f_flags & MNT_RDONLY ? "ro" : "rw");
- } else {
+ else if(strcmp(fstype, "linsysfs") == 0) {
+ fstype = "sysfs";
+ } else if (strcmp(fstype, "msdosfs") == 0) {
/* For Linux msdosfs is called vfat */
- if (strcmp(fstype, "msdosfs") == 0)
- fstype = "vfat";
- sbuf_printf(sb, "%s %s %s %s", mntfrom, mntto, fstype,
- sp->f_flags & MNT_RDONLY ? "ro" : "rw");
+ fstype = "vfat";
}
+ sbuf_printf(sb, "%s %s %s %s", mntfrom, mntto, fstype,
+ sp->f_flags & MNT_RDONLY ? "ro" : "rw");
#define ADD_OPTION(opt, name) \
if (sp->f_flags & (opt)) sbuf_printf(sb, "," name);
ADD_OPTION(MNT_SYNCHRONOUS, "sync");
@@ -506,7 +508,8 @@
sbuf_printf(sb, "%s%s", cp1, cp2 + 1);
else
#endif
- sbuf_cat(sb, "#4 Sun Dec 18 04:30:00 CET 1977");
+ // sbuf_cat(sb, "#4 Sun Dec 18 04:30:00 CET 1977");
+ sbuf_cat(sb, LINPROCFS_VERSION);
}
/*
@@ -531,7 +534,8 @@
sbuf_cat(sb, builder);
else
#endif
- sbuf_cat(sb, "des@freebsd.org");
+ // sbuf_cat(sb, "des@freebsd.org");
+ sbuf_cat(sb, LINPROCFS_VERSION_BUILD_BY);
}
/*
diff -ru --exclude-from freebsd-src-diff-exclude-names --new-file /usr/src/sys/modules/linprocfs/generate-linprocfs-version.sh freebsd-11.1/usr/src/sys/modules/linprocfs/generate-linprocfs-version.sh
--- /usr/src/sys/modules/linprocfs/generate-linprocfs-version.sh 1970-01-01 08:00:00.000000000 +0800
+++ freebsd-11.1/usr/src/sys/modules/linprocfs/generate-linprocfs-version.sh 2019-03-22 12:38:55.487976000 +0800
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+export LANG=C
+if [ -f .linprocfs_build_version ]; then
+ build_version="`cat .linprocfs_build_version`"
+else
+ build_version=1
+fi
+printf '#define LINRPOCFS_VERSION_BUILD_VERSION "#%s"\n' "$build_version"
+printf '#define LINPROCFS_VERSION_BUILD_TIME "%s"\n' "`date`"
+printf '#define LINPROCFS_VERSION LINRPOCFS_VERSION_BUILD_VERSION " " LINPROCFS_VERSION_BUILD_TIME\n'
+printf '#define LINPROCFS_VERSION_BUILD_BY "%s@%s"\n' "`whoami`" "`hostname`"
+echo $((build_version+1)) > .linprocfs_build_version
diff -ru --exclude-from freebsd-src-diff-exclude-names --new-file /usr/src/sys/modules/linprocfs/Makefile freebsd-11.1/usr/src/sys/modules/linprocfs/Makefile
--- /usr/src/sys/modules/linprocfs/Makefile 2017-07-21 07:41:59.000000000 +0800
+++ freebsd-11.1/usr/src/sys/modules/linprocfs/Makefile 2019-03-22 12:38:55.480968000 +0800
@@ -5,6 +5,12 @@
KMOD= linprocfs
SRCS= vnode_if.h \
device_if.h bus_if.h \
- linprocfs.c
+ linprocfs.c \
+ linprocfs_version.h
+
+CLEANFILES += linprocfs_version.h .linprocfs_build_version
+
+linprocfs_version.h: generate-linprocfs-version.sh linprocfs.c
+ sh ${.CURDIR}/generate-linprocfs-version.sh > $@
.include <bsd.kmod.mk>