From owner-freebsd-stable@freebsd.org Thu Nov 21 10:48:00 2019 Return-Path: Delivered-To: freebsd-stable@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 C38CB1B91C7 for ; Thu, 21 Nov 2019 10:48:00 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Jbr00dM4z4CcY for ; Thu, 21 Nov 2019 10:47:59 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id xALAhuKS054560 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2019 10:43:56 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: bzeeb-lists@lists.zabbadoz.net Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id xALAhrRM046105 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 21 Nov 2019 17:43:53 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Logging boot messages from the loader To: "Bjoern A. Zeeb" References: Cc: FreeBSD stable From: Eugene Grosbein Message-ID: <4c45a371-c352-b8c4-65c6-d1bff55b4a2e@grosbein.net> Date: Thu, 21 Nov 2019 17:43:48 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_00,HELO_MISC_IP, LOCAL_FROM,RDNS_NONE,SPF_PASS,T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 T_DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after * Received: date * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 1.1 HELO_MISC_IP Looking for more Dynamic IP Relays X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eg.sd.rdtc.ru X-Rspamd-Queue-Id: 47Jbr00dM4z4CcY X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.78 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-1.68)[ip: (-4.43), ipnet: 2a01:4f8::/29(-2.32), asn: 24940(-1.64), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2019 10:48:00 -0000 21.11.2019 17:22, Bjoern A. Zeeb wrote: > On 21 Nov 2019, at 9:51, Eugene Grosbein wrote: > >> Hi! >> >> How do I get boot messages generated by loader itself written to some log after successfull boot? >> This is generic BIOS-based 11.3-STABLE/amd64 system with syscons console driver. >> >> /var/run/dmesg.boot starts with kernel messages without previous lines from the loader. >> Specifically, I need messages about loading kernel modules with full paths. > > loader cannot write to the kernel message buffer as there is no kernel yet. There might be possible ways to preserve that but I doubt loader is fit for that task. Some hardware does not clear memory while warm booting, so KDB trace from previous panic sometimes survive reboot and ends up in /var/run/dmesg.boot for successful boot. I wonder why loader messages cannot be there, too. In fact, kernel message buffer can be found even in absence of kernel :-) I've already searched through the sources in stand/ and see there is no code to support this yet. > A boot -v (boot_verbose=“YES”) might spit the information out from the kernel as well. Not sure if that helps you. However on modern server machines a boot -v often overflows the message buffer.. so you might have to tune that as well. > > Extracted from an older console log of a random lab machine of someone else: > .. > WARNING: WITNESS option enabled, expect reduced performance.^M^@ > WARNING: DIAGNOSTIC option enabled, expect reduced performance.^M^@ > Preloaded elf kernel "/boot/kernel/kernel" at 0xffffffff80e66000.^M^@ > Preloaded elf obj module "/boot/kernel/if_igb.ko" at 0xffffffff80e66968.^M^@ > Preloaded elf obj module "/boot/kernel/nfscl.ko" at 0xffffffff80e66fd0.^M^@ > Preloaded elf obj module "/boot/kernel/nfslock.ko" at 0xffffffff80e67638.^M^@ > Preloaded elf obj module "/boot/kernel/nfssvc.ko" at 0xffffffff80e67ba0.^M^@ > Preloaded elf obj module "/boot/kernel/krpc.ko" at 0xffffffff80e68088.^M^@ > Preloaded elf obj module "/boot/kernel/nfscommon.ko" at 0xffffffff80e686b0.^M^@ > Preloaded elf obj module "/boot/kernel/ahci.ko" at 0xffffffff80e68d20.^M^@ > Preloaded elf obj module "/boot/kernel/cam.ko" at 0xffffffff80e69308.^M^@ > Preloaded elf obj module "/boot/kernel/mfi.ko" at 0xffffffff80e699f0.^M^@ > Preloaded elf obj module "/boot/kernel/geom_part_gpt.ko" at 0xffffffff80e6a058.^M^@ > Preloaded elf obj module "/boot/kernel/sysvsem.ko" at 0xffffffff80e6a648.^M^@ > Preloaded elf obj module "/boot/kernel/sysvshm.ko" at 0xffffffff80e6acb0.^M^@ > Calibrating TSC clock ... TSC clock: 3400185886 Hz^M^@ > CPU: Intel(R) Xeon(R) CPU X5272 @ 3.40GHz (3400.19-MHz K8-class CPU)^M^@ Yes, but this only shows results of loader's work and kldstat -v shows paths too. I need to know why changing modules_path in the nextboot.conf does not work and why does loader uses stock zfs.ko insted of my patched version /boot/nextboot/zfs.ko if I use nextboot.conf with module_path="/boot/nextboot;/boot/kernel;/boot/modules" I have panicing production server (ZFS-only) and cannot reboot it often and I don't wont to make cycle-boot by mistake due to wrong debugging code I might add to the module.