From nobody Mon Aug 22 18:29:04 2022 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MBLVH1Z32z4ZLDK for ; Mon, 22 Aug 2022 18:29:11 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MBLVG2cp4z3bJ7 for ; Mon, 22 Aug 2022 18:29:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E31778D4A178; Mon, 22 Aug 2022 18:29:07 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 281E65C3A831; Mon, 22 Aug 2022 18:29:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id vpt_O9N9PYj6; Mon, 22 Aug 2022 18:29:05 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5CCD15C3A82F; Mon, 22 Aug 2022 18:29:05 +0000 (UTC) Date: Mon, 22 Aug 2022 18:29:04 +0000 (UTC) From: "Bjoern A. Zeeb" To: Warner Losh cc: Konstantin Belousov , FreeBSD Current Subject: Re: init (/rescue/sh) died In-Reply-To: Message-ID: References: X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4MBLVG2cp4z3bJ7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 195.201.62.131 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip4:195.201.62.131]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[current@freebsd.org]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] X-ThisMailContainsUnwantedMimeParts: N On Mon, 22 Aug 2022, Warner Losh wrote: Hi, > On Mon, Aug 22, 2022 at 9:17 AM Konstantin Belousov > wrote: > >> On Mon, Aug 22, 2022 at 02:56:47PM +0000, Bjoern A. Zeeb wrote: >>> Hi, >>> >>> I am trying to get some arm64 up and running a bit but cannot use >>> loader. I have an MD_ROOT embedded in the kernel with /rescue on it. >>> I set INIT_PATH=/rescue/sh . >>> >>> However that doesn't seem to work: >>> >>> start_init: trying /rescue/sh >>> init died (signal 0, exit 0) >>> panic: Going nowhere without my init! >>> >>> Anyone any ideas? >> >> Kernel does not set up the standard file descriptors for stdin/out/err >> for init. When you try to directly exec /rescue/sh (or /bin/sh), it cannot >> perform any io. >> > > Agreed. init does lots of magic, in addition to setting up stdin/out/err > (like > deal with process groups, etc). /bin/sh doesn't do any of that magic, so it > can't possibly work as init (PID 1). > > Your best bet is to boot -s (RB_SINGLE in the kernel boot_single=yes in the > boot loader). You'd think you'd be able to symbolically link /etc/rc to > /rescue/sh, > but that will result in sh trying to execute /rescue/sh as a shell script > and no good > can come from it. I've had luck with "echo sh > $DESTDIR/etc/rc; > chmod +x $DESTDIR/etc/rc" in the past, but I haven't tried that trick in > ages... > The simple equivalent to a tmp file does work. /rescue/init was simply "hanging" on earlier boots which is why I had initially switche dto sh. Here's a few things I did overall: - disable GDB in kernel config (it gave 2 lines of jitterish on initial kernel printf lines before Copyrights. - Added bootargs = FreeBSD:-vs to the chosen section in FDT given I cannot have loader (no EFI); the guard trick is nice if you know about it ;) - Removed my previous env file I had added to the kernel to set tunables. - linked /bin/sh to /rescue/sh - put a printf "hello world\n"; exit 1 in the top of /etc/rc just in case -s wouldn't work - changed INIT_PATH=/rescue/init Got a sh and can run sysctl and dmesg and type echo * in /rescue :) Even reboot works :) Now that basic netbooting and user space work I can start adding SoC drivers bit by bit over the next weeks/months :) That'll be a lot more unfun. Thanks you two! Along with help from Andy earlier this made my day! Lots of joy! /bz -- Bjoern A. Zeeb r15:7