获取已安装但未引导的 ZFS 引导环境的 FreeBSD 版本级别

获取已安装但未引导的 ZFS 引导环境的 FreeBSD 版本级别

uname -v给我启动环境的版本级别。

如何在不启动环境的情况下获取环境的版本级别?

在下面的示例中,TrueOS Desktop 将引导环境 (BE) 安装在临时路径上。我可以访问文件系统的相关部分,但我不知道在哪里寻找所需的信息:

$ date ; uname -v
Fri 25 Nov 2016 21:15:19 GMT
FreeBSD 12.0-CURRENT #14 1717ae3(drm-next-4.7): Fri Oct 28 13:49:49 UTC 2016     root@gauntlet:/usr/obj/usr/src/sys/GENERIC 
$ beadm list
BE                              Active Mountpoint                                        Space Created           Nickname
initial                         -      -                                                  5.4G 2016-08-22 11:24  initial
20161005193649_201610142022     -      -                                                  3.1G 2016-10-14 20:22  12.0-CURRENT-up-20161014_204827
20161028134949_201610291803     -      -                                                753.6M 2016-10-29 18:03  12.0-CURRENT-up-20161029_180801
20161028134949_14_201611081710  NR     /                                                 45.4G 2016-11-08 17:10  12.0-CURRENT-up-20161108_171012
12.0-CURRENT-up-20161125_173806 -      -                                                  7.5G 2016-11-25 17:12  12.0-CURRENT-up-20161125_173806
12.0-CURRENT-up-20161125_201510 -      /tmp/BE-12.0-CURRENT-up-20161125_201510.nsZfNFVo   7.4G 2016-11-25 19:49  12.0-CURRENT-up-20161125_201510
$ ls -hl /tmp/BE-12.0-CURRENT-up-20161125_201510.nsZfNFVo
total 215
drwxr-xr-x   2 root  wheel    48B 25 Nov 19:56 bin
drwxr-xr-x  10 root  wheel    60B 25 Nov 20:15 boot
drwxr-xr-x   3 root  wheel     3B 25 Nov 20:02 compat
-r--r--r--   1 root  wheel   6.0K 17 Aug 16:12 COPYRIGHT
dr-xr-xr-x   2 root  wheel     3B 22 Aug 11:31 dev
-rw-------   1 root  wheel   4.0K 25 Nov 19:48 entropy
drwxr-xr-x  30 root  wheel   129B 25 Nov 20:15 etc
lrwxr-xr-x   1 root  wheel     9B 22 Aug 11:35 home -> /usr/home
drwxr-xr-x   4 root  wheel    59B 25 Nov 19:56 lib
drwxr-xr-x   4 root  wheel     6B 25 Nov 19:56 libexec
drwxr-xr-x   2 root  wheel     2B 21 Nov 03:14 media
drwxr-xr-x   2 root  wheel     2B  8 Oct 12:21 mnt
drwxr-xr-x   2 root  wheel     2B 22 Aug 12:05 net
drwxr-xr-x   2 root  wheel     2B 22 Aug 11:25 packages
-rw-r--r--   1 root  wheel    21K 25 Nov 20:15 pkg-add.log
dr-xr-xr-x   2 root  wheel     2B 17 Aug 16:12 proc
drwxr-xr-x   2 root  wheel   146B 25 Nov 19:56 rescue
drwxr-xr-x  10 root  wheel    21B 13 Nov 20:13 root
drwxr-xr-x   2 root  wheel   146B 25 Nov 19:56 sbin
lrwxr-xr-x   1 root  wheel    11B 17 Aug 16:12 sys -> usr/src/sys
drwxr-xr-x   6 root  wheel     8B 25 Nov 20:20 tmp
drwxr-xr-x  17 root  wheel    17B 22 Aug 11:32 usr
drwxr-xr-x  28 root  wheel    30B 25 Nov 20:11 var
$ 

参考

beadm 的 FreeBSD 手册页(1)

答案1

strings /tmp/BE-.../boot/kernel/kernel | egrep ^FreeBSD解决您的问题吗?

相关内容