blob: 11e707fa699467ef532f1cb47b7a2202ec5596e9 [file] [log] [blame] [raw]
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/sys/compat/linprocfs/linprocfs.c freebsd-10.4/sys/compat/linprocfs/linprocfs.c
--- /var/archive3/public/freebsd-releng-10.4-src/sys/compat/linprocfs/linprocfs.c 2017-09-29 08:19:56.000000000 +0800
+++ freebsd-10.4/sys/compat/linprocfs/linprocfs.c 2019-08-17 22:23:56.243622065 +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/10.4/sys/compat/linprocfs/linprocfs.c 299221 2016-05-07 19:05:39Z dchagin $");
@@ -356,20 +361,17 @@
/* determine fs type */
fstype = mp->mnt_stat.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,
- mp->mnt_stat.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,
- mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw");
+ fstype = "vfat";
}
+ sbuf_printf(sb, "%s %s %s %s", mntfrom, mntto, fstype,
+ mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw");
#define ADD_OPTION(opt, name) \
if (mp->mnt_stat.f_flags & (opt)) sbuf_printf(sb, "," name);
ADD_OPTION(MNT_SYNCHRONOUS, "sync");
@@ -541,7 +543,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);
}
/*
@@ -566,7 +569,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 /var/archive3/public/freebsd-releng-10.4-src/sys/modules/linprocfs/Makefile freebsd-10.4/sys/modules/linprocfs/Makefile
--- /var/archive3/public/freebsd-releng-10.4-src/sys/modules/linprocfs/Makefile 2017-09-29 08:19:59.000000000 +0800
+++ freebsd-10.4/sys/modules/linprocfs/Makefile 2019-08-17 22:23:56.243622065 +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>
--- /dev/null 2019-08-17 22:27:18.000000000 +0800
+++ freebsd-10.4/sys/modules/linprocfs/generate-linprocfs-version.sh 2019-08-17 22:24:15.370617775 +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