Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp293761pxj; Fri, 28 May 2021 04:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwveSgsLHOUxc04cdP2afTNyG/RiJag3ShM8bCRN6z9NDSfqjGJ5Cq24hT7PYSEtoUG/pea X-Received: by 2002:a92:c846:: with SMTP id b6mr6670379ilq.196.1622200526211; Fri, 28 May 2021 04:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622200526; cv=none; d=google.com; s=arc-20160816; b=QkoSoNHrE7hVkQ2aL/MWAhRId9VKM5a4g3Oroj9iL2S3o4KsF+5iP2yu+S1Qmy2NWW gOVfM/p3Zv+j52Yi635er1HgzNagU2V3/LBXrw7kF6ZtmlUCygecutQ6vw108vZbZCIn rPO2GxBK7Y0NtgGdDUBcdCKAmnlxt7ZUUw31qCqnSqMT0KvFbP94eihHoI86/Tfj/aZF th8dmGx1bPvwOAev/TJXaqOR9NuCUYedXC9ORKIdAy4XaEfXLGCROo1aN+/pTdLhBTfj 7rfomHLiEMUbVigiUfpYbHifXOaSf4+t6B15Whhmzt80WlpCHObVAADl7Fg++rcEAjXe yXjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=i9aQrkK3A/2iUH33PC4Q5ogZLNwmulvDJ+vq0nUTwFk=; b=WJzrNR8EMXWQ5uxSBhRp09G22v1+5CQQsvewUOqkxdS1cM55y24zdZXLxRjMB7eWEc 7VBSgSljPQRkEhM8Q/XLZZr/CDPeo5X7z9EMem9ukHOUevUraaFOu5NIFnospZOWqWwm Z/31CwfBZewMRyrQiVrPMJ/gx/wRrZDOw2VGf4nN4xYM1OGcD75B+5dpXKnL95JLqejn ZCZSg4d8AgsT05n9PJUvlhfoyZ6U/DAu6ng0eNgZjsp5V1rJGYH/a1ptt3ozpAscd7m5 VDvqIPz60AD1bh3OqnaYqaxaQZt9/9lM0LrFggpfitXq+6xhQnVCZYDPMm49I2tnR8VC 7NNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sx81GL41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si5642871jal.79.2021.05.28.04.15.12; Fri, 28 May 2021 04:15:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sx81GL41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234925AbhE1HL4 (ORCPT + 99 others); Fri, 28 May 2021 03:11:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:47346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbhE1HLz (ORCPT ); Fri, 28 May 2021 03:11:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA2DF61184; Fri, 28 May 2021 07:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622185821; bh=twOSogob9U7tH3qyhjqMUT0yEHNVGQWQtNnmxz91UXM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Sx81GL41SR7HSZiWnd6+pFuwBz/LWK5WI1c8SpKgr8e4I74BpdG8wy4TPSwPPMD6g noh62Cw4H1FZg+NsL98P2brMVOynLLsdhMcm6uut/bplA/2DfLQGc9AbFYJf/Nw+Pw toIsV6sbhT/riBTbeM+f8l+2h+A6kCbWyJGzJuMa2OYNe0h01ktr9kN4XOp20Tdosl GA7QDM+ZfqZPCgubB31xAEaZ3XI8GNt5tHuAdmKAdKgPGInvnABBWGfzsD+akY148R a6LLC0balh5WkKOH50KpTKKJeji0Nga92yeY+s2JoAQPjo9wE1GDBFYtOEqvS9RTPE 6fUvuHS76th9Q== Date: Fri, 28 May 2021 16:10:12 +0900 From: Masami Hiramatsu To: menglong8.dong@gmail.com Cc: mcgrof@kernel.org, josh@joshtriplett.org, viro@zeniv.linux.org.uk, keescook@chromium.org, samitolvanen@google.com, ojeda@kernel.org, johan@kernel.org, bhelgaas@google.com, masahiroy@kernel.org, dong.menglong@zte.com.cn, joe@perches.com, axboe@kernel.dk, hare@suse.de, jack@suse.cz, tj@kernel.org, gregkh@linuxfoundation.org, song@kernel.org, neilb@suse.de, akpm@linux-foundation.org, f.fainelli@gmail.com, arnd@arndb.de, linux@rasmusvillemoes.dk, wangkefeng.wang@huawei.com, brho@google.com, mhiramat@kernel.org, rostedt@goodmis.org, vbabka@suse.cz, glider@google.com, pmladek@suse.com, chris@chrisdown.name, ebiederm@xmission.com, jojing64@gmail.com, terrelln@fb.com, geert@linux-m68k.org, mingo@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, jeyu@kernel.org Subject: Re: [PATCH v2 0/3] init/initramfs.c: make initramfs support pivot_root Message-Id: <20210528161012.c9c8e25db29df3dbc142c62e@kernel.org> In-Reply-To: <20210525141524.3995-1-dong.menglong@zte.com.cn> References: <20210525141524.3995-1-dong.menglong@zte.com.cn> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, 25 May 2021 22:15:21 +0800 menglong8.dong@gmail.com wrote: > From: Menglong Dong > > As Luis Chamberlain suggested, I split the patch: > [init/initramfs.c: make initramfs support pivot_root] > (https://lore.kernel.org/linux-fsdevel/20210520154244.20209-1-dong.menglong@zte.com.cn/) > into three. > > The goal of the series patches is to make pivot_root() support initramfs. > > In the first patch, I introduce the function ramdisk_exec_exist(), which > is used to check the exist of 'ramdisk_execute_command' in LOOKUP_DOWN > lookup mode. > > In the second patch, I create a second mount, which is called > 'user root', and make it become the root. Therefore, the root has a > parent mount, and it can be umounted or pivot_root. > > In the third patch, I fix rootfs_fs_type with ramfs, as it is not used > directly any more, and it make no sense to switch it between ramfs and > tmpfs, just fix it with ramfs to simplify the code. This idea sounds good to me. I have tested it with MINCS container shell script (https://github.com/mhiramat/mincs). However, I found different issue on init_eaccess() (or symlink lookup) with this series. I'm using a busybox initramfs, and it makes /init as a symlink of "/sbin/init" (absolute path) When CONFIG_INITRAMFS_USER_ROOT=n, it booted. But CONFIG_INITRAMFS_USER_ROOT=y, it failed to boot because it failed to find /init. If I made the /init as a symlink of "sbin/init" (relative path), it works. Would you have any idea? Thank you, -- Masami Hiramatsu