Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp112497imm; Thu, 16 Aug 2018 16:36:33 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwDX+dNhGUQEE9DxrdOfnh6T4/SVK9WkFznXc8B8UAsJyqeaxwSQj+lBnQnR12kIiGUO5l3 X-Received: by 2002:a63:e40d:: with SMTP id a13-v6mr30371813pgi.289.1534462593595; Thu, 16 Aug 2018 16:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534462593; cv=none; d=google.com; s=arc-20160816; b=b+V2mthh88JWntRtNnQ3ux/IDRJC/wRdGNRin1PdGlRWOMzEwvzHCqb24/Eyi1UwXj ku0in3jpoNhcl7Pa8cQuKtJxLlsa6OebIqKJ1vJyRa5Lavcp9gmsGAogOT8FOqHa7X1E qnBlFlNJtrqDoq7Z0u3iN++nmlLcLbWhmbJU+gI4kRHzNcxWecK4X4EvbgsAlWe/c+Nj eLwE4Npn+ktKlsMRsalARLpImiWS+QPQQlTJBHHiMEawGsW6RcQ6QGKgkWQwgJEhPzll 0v9Cfqo0A8OR2LQYlfsrR1MrEEMQnWY/RnpVcetzbptES+54baY4iERlYGnitYplsJH9 HReg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=3PyjKcCVKXNdX0/EuBi1AluHRvGNiq8M6Yozp3l9zgI=; b=I4V0Qa6JgeuNf9ccgFl8koDZE13Tgj/Z3NHilJ9BYUy55DUkwL2px2UoW4AvEOHoFm 34d7r/pgSMR/q8eckihHCWqeH44UZyY/beWhIm3jXv/6xABv9C+sFo8rvuhqHP+VrgZ6 RSM+Fas3l8ZFxvV8VB+ouhonrMSqZnO0PGIQDQgjzaT+1Uu51kGZ5vY3JA7UsnMk9WiL DyTmsca5k57HUhQTF8wsP0Cd8EGM8fUioXTeavlOTdm87byKpZ9AkXRp8vUVF16nf0xt OAiyEQahp8oUw8VYjiN0XKYGsMvcxnA8FWvaT7zxFzgSPqdhIYMWFAEnEMQpKhDw/i+d SK9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sn6jJzHX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h89-v6si590836pld.517.2018.08.16.16.36.15; Thu, 16 Aug 2018 16:36:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sn6jJzHX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726172AbeHQCfq (ORCPT + 99 others); Thu, 16 Aug 2018 22:35:46 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:55475 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbeHQCfq (ORCPT ); Thu, 16 Aug 2018 22:35:46 -0400 Received: by mail-it0-f68.google.com with SMTP id d10-v6so8779627itj.5 for ; Thu, 16 Aug 2018 16:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3PyjKcCVKXNdX0/EuBi1AluHRvGNiq8M6Yozp3l9zgI=; b=Sn6jJzHXlid4pgR6w4jZ1eba2uZSjgDNa18C3SjegRb7GTSIZYVyA2nNe5DSa32Ty4 fKzGZH7k/J9D0k70Euar8Hoc9tczp+A82TxiRiZ0Z9mJ3uoH3fsZUvjd1ihl6uNQbvqc BzcSeNpA1j+NtM7hEOj2JE5lpBwNXYIN7nVoC6cwHq0lja+fqx4i7Lt/VMgMYRIV62Kc v0/zksMjUHQ6qHSVq3Q5YXB/f3B049wHWrMyhXkCct7oG/E+LfztrMMPWycBg2njT2vy F5WHBK/Vo2BWBZG76sIxYfW5/WqZZrALGki3jNJSFemwjrC6PWsXsX6mg5pUr6RlB+LL Q/ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3PyjKcCVKXNdX0/EuBi1AluHRvGNiq8M6Yozp3l9zgI=; b=MGiRRtH02cbxXyYbB8FBOmxoG71n8waC8v6SPAUNgoqeu7TIdszpi7J8lvjNUFvpcT F72nG8xN/7DJh4L46K2GmRdcmX76uepoGBl3s+hAI9jGhSIH5k3vT5a8naVfvDLjsiVU fJJ5EEHk1u4JQBDVgAsgI4cR8IZn67qYrKwWdKuHfeRw85sl1vbnN8FA4FM3RYGgrkLT 849fAexLVoRZmr41ppiBbf3IaFKjG76ujbBjoeQ3DFXrgExUVwcyG6ujuMKCyGASCqmU MM52gKO1H5f/Ii5Eyww0Q+pOLBjPi1NAN8zGUyPPK547ceZp2/VQnqqiFqepfvaKT5L8 pUeg== X-Gm-Message-State: AOUpUlF3epLbhlDhGQWVCXeydteYMM4BqDV84CGZbiilFXMjI2cO/S8I 85BYI8f0iHQC1O/i5eSl0BR9HL6md6Jr+dPqiA== X-Received: by 2002:a24:5d45:: with SMTP id w66-v6mr2370389ita.121.1534462483104; Thu, 16 Aug 2018 16:34:43 -0700 (PDT) MIME-Version: 1.0 References: <20180816161817.12267-1-andrzej.p@samsung.com> In-Reply-To: <20180816161817.12267-1-andrzej.p@samsung.com> From: =?UTF-8?Q?Bj=C3=B8rn_Forsman?= Date: Fri, 17 Aug 2018 01:34:30 +0200 Message-ID: Subject: Re: [PATCH] Revert "kbuild: create deterministic initramfs directory listings" To: andrzej.p@samsung.com Cc: LKML , forney@google.com, Masahiro Yamada Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Aug 2018 at 18:18, Andrzej Pietrasiewicz wrote: > > This reverts commit 9e6e0d5f2a2713402cf9dce69b9f9b516e4185d2. > > The reverted commit introduces broken builds. Even though the cpio archiv= e > does contain all the specified files, it seems that the kernel, while > populating rootfs, scans the cpio buffer linearly and fails to create > files whose parent directories are nonexistent at the moment of this fail= ed > creation. As a result, such files are not accessible when kernel boots in= to > initramfs. > > Here is how to reproduce, from inside kernel source directory, with the > patch in question not reverted: > > $ mkdir -p ../test/find/me/if/you/can > $ touch ../test/find/me/if/you/can/file.txt > $ cat ../initramfs.list > file /busybox-x86_64 ../initramfs/busybox-x86_64 0755 0 0 > dir /sbin 0755 0 0 > dir /proc 0755 0 0 > dir /sys 0755 0 0 > dir /bin 0755 0 0 > dir /usr 0755 0 0 > dir /usr/sbin 0755 0 0 > dir /usr/bin 0755 0 0 > dir /etc 0755 0 0 > dir /etc/init.d 0755 0 0 > file /etc/inittab ../initramfs/inittab 0755 0 0 > file /etc/init.d/rcS ../initramfs/rcS-x86_64 0755 0 0 > dir /lib 0755 0 0 > dir /lib/modules 0755 0 0 > $ ls ../initramfs > busybox-x86_64 inittab rcS-x86_64 > $ cat ../initramfs/inittab > ::sysinit:/etc/init.d/rcS > ::askfirst:-/bin/sh > ::ctrlaltdel:/sbin/reboot > ::shutdown:/sbin/swapoff -a > ::shutdown:/sbin/umount -a -r > ::restart:/sbin/init > $ cat ../initramfs/rcS-x86_64 > #!/busybox-x86_64 sh > > /busybox-x86_64 --install > > mount -t proc none /proc > mount -t sysfs none /sys > > mdev -s > echo /sbin/mdev > /proc/sys/kernel/hotplug > $ scripts/gen_initramfs_list.sh ../test/ ../initramfs.list > > ##################### > # ../test/ > # Last modified: 1534428527.0818855150 > > file /find/me/if/you/can/file.txt ../test/find/me/if/you/can/file.txt 664= 1000 1000 > dir /find/me/if/you/can 775 1000 1000 > dir /find/me/if/you 775 1000 1000 > dir /find/me/if 775 1000 1000 > dir /find/me 775 1000 1000 > dir /find 775 1000 1000 I'm unable to reproduce it. On my system the listing is sorted so that it works (parent directories appear before files). I tried to run with LANG=3DC and it also sorts correctly. What is your LANG=3D? I think we better add a LANG=3DC somewhere in the kernel build system, because I think you have a LANG=3D that makes it sort differently. A quick fix would of course be to insert it right next to sort, but there may be other places that may break due to LANG=3D settings. Best regards, Bj=C3=B8rn Forsman