From nobody Mon Aug 22 15:56:05 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 4MBH5t0FY5z4Z0V9 for ; Mon, 22 Aug 2022 15:56:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MBH5s3BLvz3LgY for ; Mon, 22 Aug 2022 15:56:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe35.google.com with SMTP id 190so3380050vsz.7 for ; Mon, 22 Aug 2022 08:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=1Q4kixV3PmPKjE7w30iG7pUNC86hWYrUEXJnd3fOaPU=; b=YSho0awrrHZ7kekupn6WPzoM1y8KqQ27VGoGPOXFA/OqOrxIXbK3tNBzpqyDQGZf8E 85BHzDvNvND1w93z8Zzhtu39aa3FI3FG1w3ztBG0brVmGKg81D//pnQVzweqHDkYSNsE 9wcrcBTuAnE4uL/8Z5PMXZo7qz8eqAwLUI6q52O62wfFCG3mGgiL9mOuS4KwIuXVxyrF skndV/1+Fg4uGCjWK/9Pq9Jx+Vhg+JsSHN/DHm7insTeewJcV9uxR4y0Kt08efQcU0i7 i5XQ5J64xTVeaKIy/VMhrd/VEYC/aI3VCOf2Qe5Pn+cLdPqw4YxaJf2JtR7E0g5PoHTJ /k9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=1Q4kixV3PmPKjE7w30iG7pUNC86hWYrUEXJnd3fOaPU=; b=2svrkwVzZJ9/mxEXhWOxkZTdRuyRXltLWxXq6hb7GnqOPjsE0uhPNNEy65PFYHqnhJ aXNpNr/wJHNbz+JQ1rpRP72ct4iQFaAc3J4CTtH706Dqq1tmtlF7o03rVcbVlg1aVpkr yD8Mb6wXFv1oun8tTnol/1Ae2ALulIWpyYVMF2PUS1we/nZbmhLyeHIE70POgZwo7ISu vjfsFGOFsIEfIEpwqSIwIIxDR1FtQln73zEqYZa7WcKm2sN7TJbwUtkfBNErpa42uPQz Non5GB0hpvRGYZgCtRrXdQEsIr0Q8otkGktZdZsqW8Mhtz6+uecncLwiAR+BDQBZr88B NfWQ== X-Gm-Message-State: ACgBeo3WQj773n+aclWlgFLuoDyQamqE7EUh2ludrFDyvNTV8xTMhwge mi7Q+U1NeT+x4zfCWShm5XpMiuLNQhxFf98UN2aa0w== X-Google-Smtp-Source: AA6agR7vpbPfAoNRodH2KjjdmrYnPudWo0MG8VM4UypcoOhknMEWohf60susjZzOF7931lvpr6sPYUN39yx2NwcZfH0= X-Received: by 2002:a67:ac45:0:b0:388:a1ff:7e89 with SMTP id n5-20020a67ac45000000b00388a1ff7e89mr7804936vsh.42.1661183776488; Mon, 22 Aug 2022 08:56:16 -0700 (PDT) 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 References: In-Reply-To: From: Warner Losh Date: Mon, 22 Aug 2022 09:56:05 -0600 Message-ID: Subject: Re: init (/rescue/sh) died To: Konstantin Belousov Cc: "Bjoern A. Zeeb" , FreeBSD Current Content-Type: multipart/alternative; boundary="000000000000e791b205e6d67c50" X-Rspamd-Queue-Id: 4MBH5s3BLvz3LgY X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=YSho0awr; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::e35) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.990]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEMAIL_TO(0.00)[gmail.com]; MLMMJ_DEST(0.00)[current@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e35:from]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; TO_DN_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --000000000000e791b205e6d67c50 Content-Type: text/plain; charset="UTF-8" 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. Warner --000000000000e791b205e6d67c50 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Aug 22, 2022 at 9:17 AM Konst= antin Belousov <kostikbel@gmail.c= om> wrote: