Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4511198imw; Tue, 19 Jul 2022 08:00:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uIZlqRMpM5qySrGFTa5m44K5hUTUFDVj6vp9d1+H9uaTXEcxC2Iw9SVb+CLTJatEnAozm7 X-Received: by 2002:a63:ef54:0:b0:41a:56e7:aeb3 with SMTP id c20-20020a63ef54000000b0041a56e7aeb3mr1109579pgk.49.1658242833980; Tue, 19 Jul 2022 08:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658242833; cv=none; d=google.com; s=arc-20160816; b=c/TOr8LEgHEUTLfSPCaZsUJbd428km7+Llwp2ImBdXTtqYiiwnWKh5gPgMcOEg7Hju 8GfWy7jkXcccNGzjTBXrzwZWF+JgI39GAd+72UXXmCpcfXWWtOJ7EBU2HRXef93ZvyFY LxfVPrzUWch1IaLX4tk8KwqceAlt9MBixYyM+sQ4i2o8PzhtMJIK44uWlfuId323mMVh aJTmzxXwSZQxeLYaEm2OgSVOErQ4z6Aw9HRBoHBsxxi37/zNJYQE5PTzhh4n8a9leygI v8yb2SDZeg1pthISNRqHlKbF5wgsA4HX3iuv7Fg+GYBeDumn44baFNq0kF6fyYHhT+kV fMxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=osSTkxJZgJpQ+PpleR38uqX6sr8qSursZWPy8Gnrp3c=; b=FbMvUlfowRwbXSiyfJlulHlCBYKpKuyIAerGBAHoiwMzIwirxVcBrehAswfnCLT5Iz vrtV2D/UHU6cNgh+PVuO7EiAHe/fFmE+rkSJuV5mMxTRSuiExHfI3mpGiUogyopTXPSC wjcf9HhhPi2iY3yfB0zrnNaZqiiPFHbQ5WA7oqqYIPjgHbJYA7Xp9Nmb9lM6NfgeQUX9 Ea1JzNfkZwF8kWQ9Ppja5lImWuQLm3vymaPdDWbDJwW9xgXk2+hxUGujhKoACT4luqPx pTo6sGHfg42HwELGvnMTiMQFwYEjybK2UEQ3Ma0P0o6BLOTGeU7AWCKx48f81KqVC58k 8FsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20210112.gappssmtp.com header.s=20210112 header.b=5y+y11aL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a63a803000000b00412a34ca92esi18215235pgf.153.2022.07.19.08.00.18; Tue, 19 Jul 2022 08:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@landley-net.20210112.gappssmtp.com header.s=20210112 header.b=5y+y11aL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238456AbiGSOXu (ORCPT + 99 others); Tue, 19 Jul 2022 10:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238167AbiGSOXg (ORCPT ); Tue, 19 Jul 2022 10:23:36 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9E704BD21 for ; Tue, 19 Jul 2022 07:07:48 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id u76so6695479oie.3 for ; Tue, 19 Jul 2022 07:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=osSTkxJZgJpQ+PpleR38uqX6sr8qSursZWPy8Gnrp3c=; b=5y+y11aL9cS10irNQNHyhFUmcki91yUAvNRnUHVQQjaZI8FJ67zeroCwMy8y0/831o 3HovzzmXdiTc7Ulu8mCPh4Odn+lqgV9msAQyOaoO2kmchswvnug4cd3y0lfu1Zp4R/mU qvPRaU6EZNBZKLUiN1OlNlST0MeNu+R2icr7MP9fzpwsOXq6O++mC26QEAYGSsEAtbEh UUQV6fildXbvGSSb1c7MhBetE4IxaiJ7v294jkq8/eEZG7kaDBKwQCyZVF3FeAP5Al7o H6Q2EDuVjUSGqUqYNK8n0ElWaMCQeIgc2PYJKXOWJl4x079dKrHLDRzBC8CgnJImfbtv Wbrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=osSTkxJZgJpQ+PpleR38uqX6sr8qSursZWPy8Gnrp3c=; b=Rhyzs93ZKE7+JZCjjmu4kxjcHW/001Cb8GB5mh2O4BKDBnCxEWS1/nPAKnM0K5HrIL yIyHr8FbAAqspScOkJpiimqKZRbARL2jDXauc/fhf44mqoNwlteZQZFpqC8WBCS4cgb0 2+E/WBFTGoTPTBWEFEtnbcDUgYg1tnsOP+z3krfSOyzS8RKUGJQ101fugmXNh4YujSy0 Nit/Hqbkc10jQcIp87IT4Xagn27btxY8k+PqKsJX4KH2ctHpkWQWw4BMECZCE25Y3VAw zkbODxrgBnLrrRP08iSH3gQIQPHJ3/c2JrShWb7/mE1s3kdeze8xOOMy9pKEqEDUBK1z 6QUg== X-Gm-Message-State: AJIora+if9sS8LdcNJF9NxNLoU58HVLtCZyKGdInYaJT9vvxBIYtw9dS 06LRKwYZI+3W+XS32RgW0X7/Tw== X-Received: by 2002:a05:6808:220c:b0:33a:2e51:3cd1 with SMTP id bd12-20020a056808220c00b0033a2e513cd1mr15017715oib.293.1658239668225; Tue, 19 Jul 2022 07:07:48 -0700 (PDT) Received: from [192.168.86.210] ([136.62.38.22]) by smtp.gmail.com with ESMTPSA id er10-20020a056870c88a00b0010cbd1baf5esm7625192oab.51.2022.07.19.07.07.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jul 2022 07:07:47 -0700 (PDT) Message-ID: <3d77db23-51da-be5e-b40d-a92aeb568833@landley.net> Date: Tue, 19 Jul 2022 09:14:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v4 0/3] initramfs: add support for xattrs in the initial ram disk Content-Language: en-US To: Roberto Sassu , Jim Baxter , Eugeniu Rosca Cc: "hpa@zytor.com" , Masahiro Yamada , Arvind Sankar , Mimi Zohar , "viro@zeniv.linux.org.uk" , "linux-security-module@vger.kernel.org" , "linux-integrity@vger.kernel.org" , "initramfs@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bug-cpio@gnu.org" , "zohar@linux.vnet.ibm.com" , Silviu Vlasceanu , Dmitry Kasatkin , "takondra@cisco.com" , "kamensky@cisco.com" , "arnd@arndb.de" , "james.w.mcmechan@gmail.com" , "linux-kbuild@vger.kernel.org" , Dirk Behme , Eugeniu Rosca References: <33cfb804-6a17-39f0-92b7-01d54e9c452d@huawei.com> <1561909199.3985.33.camel@linux.ibm.com> <45164486-782f-a442-e442-6f56f9299c66@huawei.com> <1561991485.4067.14.camel@linux.ibm.com> <0c17bf9e-9b0b-b067-cf18-24516315b682@huawei.com> <20220609102627.GA3922@lxhi-065> <21b3aeab20554a30b9796b82cc58e55b@huawei.com> <20220610153336.GA8881@lxhi-065> <4bc349a59e4042f7831b1190914851fe@huawei.com> <20220615092712.GA4068@lxhi-065> <032ade35-6eb8-d698-ac44-aa45d46752dd@mentor.com> <737ddf72-05f4-a47e-c901-fec5b1dfa7a6@mentor.com> <8e6a723874644449be99fcebb0905058@huawei.com> <5b8b0bcac01b477eaa777ceb8c109f58@huawei.com> From: Rob Landley In-Reply-To: <5b8b0bcac01b477eaa777ceb8c109f58@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/22 07:26, Roberto Sassu wrote: >> P.P.S. If you want to run a command other than /init out of initramfs or initrd, >> use the rdinit=/run/this option. Note the root= overmount mechanism is >> completely different code and uses the init=/run/this argument instead, which >> means nothing to initramfs. Again, specifying root= says we are NOT staying in >> initramfs. > > Sorry, it was some time ago. I have to go back and see why we needed > a separate option. Did I mention that init/do_mounts.c already has: __setup("rootfstype=", fs_names_setup); static char * __initdata root_fs_names; static int __init fs_names_setup(char *str) { root_fs_names = str; return 1; } void __init init_rootfs(void) { if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && (!root_fs_names || strstr(root_fs_names, "tmpfs"))) is_tmpfs = true; } I thought I'd dealt with this back in commit 6e19eded3684? Hmmm, looks like it might need something like: diff --git a/init/do_mounts.c b/init/do_mounts.c index 7058e14ad5f7..4b4e1ffa20e1 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -665,7 +665,7 @@ struct file_system_type rootfs_fs_type = { void __init init_rootfs(void) { - if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && - (!root_fs_names || strstr(root_fs_names, "tmpfs"))) + if (IS_ENABLED(CONFIG_TMPFS) && (!root_fs_names ? !saved_root_name[0] : + strstr(root_fs_names, "tmpfs")) is_tmpfs = true; } > Maybe omitting root= was impacting on mounting > the real root filesystem. Will get that information. I know some old bootloaders hardwire in the command line so people can't _remove_ the root=. The reason I didn't just make rootfs always be tmpfs when CONFIG_TMPFS is enabled is: A) It uses very slightly more resources, and the common case is overmounting an empty rootfs. (And then hiding it from /proc/mounts so people don't ask too many questions.) B) Some embedded systems use more than 50% of the system's memory for initramfs contents, which the tmpfs defaults won't allow (fills up at 50%), and I'm not sure I ever hooked up I don't think I ever hooked up rootflags= ala root_mount_data to the initramfs mount? (If so, setting size= through that should work...) > Intuitively, given that root= is consumed for example by dracut, it seems > a safer choice to have an option to explicitly choose the desired filesystem. Sounds like a dracut issue. Have you used dracut in a system running from initramfs? Lots of systems running from initramfs already DON'T have a root=, so you're saying dracut being broken when there is no root= is something to work around rather than fix in dracut, even though it's been easy to create a system without a root= for a decade and a half already... > Roberto Rob