From owner-freebsd-questions@freebsd.org Fri Jun 12 09:26:23 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCCD9334937 for ; Fri, 12 Jun 2020 09:26:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jwMf4BYzz4DJT for ; Fri, 12 Jun 2020 09:26:22 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.8.39.138]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPA (Nemesis) id 1McY0J-1jDdaQ3gfF-00d0xy; Fri, 12 Jun 2020 11:26:20 +0200 Date: Fri, 12 Jun 2020 11:26:19 +0200 From: Polytropon To: "Steve O'Hara-Smith" Cc: listac@nebelschwaden.de, freebsd-questions@freebsd.org Subject: Re: Find out OS version and plattform? Message-Id: <20200612112619.0cb734ef.freebsd@edvax.de> In-Reply-To: <20200612101500.f455a884199613961283ed48@sohara.org> References: <16b61b7a-a313-883a-067a-b424b488b2de@nebelschwaden.de> <20200612101500.f455a884199613961283ed48@sohara.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Vn5Vcpi2WoLMkOixDJot1U2NX66WLP5o31wFN/+xjgMtzmC3Jqb 3XnlAB/X4rQ4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GJi1S82sYjtX04OTVnGpyZYRbbfxgjMNp1J2cWycnwEX X-Rspamd-Queue-Id: 49jwMf4BYzz4DJT X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.17.10) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.98 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_SHORT(-0.46)[-0.462]; RECEIVED_SPAMHAUS_PBL(0.00)[178.8.39.138:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.56)[0.562]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.48)[0.477]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.17.10:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.17.10:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 09:26:23 -0000 On Fri, 12 Jun 2020 10:15:00 +0100, Steve O'Hara-Smith wrote: > On Fri, 12 Jun 2020 11:03:22 +0200 > Ede Wolf wrote: > > > Hi, > > > > is there a way to find out which version of FreeBSD was installed - and > > for what architecture, simply by mounting the disk? > > If you mount it on FreeBSD then you can do something like this > (taken from man freebsd-version). > > mount -rt ufs /dev/ada0p2 /mnt > env ROOT=/mnt /mnt/bin/freebsd-version -ku > > You could inspect the sources of freebsd-version to find out how > this is done. This does work for the same (or compatible) arch. > > I am not talking about uname, where you have to be inside the os, but if > > you simply mount the root partition to another computer, where to look > > for these information? > > The kernel version is pulled from the kernel, I'm not sure where > the userland version is stored. The kernel version could be "binary-grepped" from /boot/kernel/kernel, it starts with "@(#)FreeBSD", but freebsd-version uses a much more elegant approach, see /usr/src/bin/freebsd-version/freebsd-version.sh.in. Further magic happens in /usr/src/sys/conf/newvers.sh at build time. If, and only if, the installed source tree matches the OS version installed, the information can be found in that particular file (search for TYPE, REVISION, BRANCH at the top). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...