Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7734687rdb; Thu, 4 Jan 2024 06:13:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMvssqOyWTXKr4HUfpmy0uhkPn6u9iUx5OBJC6IzzIH8rHow1QYUKXP0lqaTIWGCZZUZfD X-Received: by 2002:a17:907:72c1:b0:a23:690e:48bf with SMTP id du1-20020a17090772c100b00a23690e48bfmr794103ejc.12.1704377624781; Thu, 04 Jan 2024 06:13:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704377624; cv=none; d=google.com; s=arc-20160816; b=QSnNi0v8YZfo3WL8LmL2vYzbm/lhXnV/u9jjMdbz63FhX368Ths/cL97BeAYOFil0+ QmdENFQTp3X8/rKNd0qpVGGRNMBODJjF3xb6+yKmZRjHHYBnszZkGxzTA8W6qBjVrcSp 7kRwjbFhZ0nYs1ZsObBGsz8ydcIJf1pmxamMazMk7HbqzWP6XVt/k2ow5WUUrUYw186x nIJBJvC/69RgPNJt+p15m858atwl6G9S+ykUl6FuNz+/CGzJ8hPrQ8BPWuyJ28JhSG5I 48+C0I9kasEw4k7ShkHQTfzoIvwYKRgSf2VniPX8atEjojA9REoZEXRaqqTuoC+nvU6n 6AWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=9WJFEng3Ug5DgYTsbpEKXIzlw5GI6Nx7mpMBIOIDGCg=; fh=QAFpf2ar7Xw2i5b7cUFuoSc3UoEkeRaf6QrxHjv5z0o=; b=kxiu/ElSxkpzR8Dxnb0QmLNY4P1sfjthyk2tbjQ8O2AhOxqYIfUGhCMUhw7jmbHxZF 60JU2vWhvGU85B445v1OGmavM4KhanblGPA81UebzORmFJKHFyYXSQqHEMTXZg0ppJR9 qX/Q0I4AND79LCqQCrrxljwDKo+x0SMGvrFUKqXL865vSXolGsdiiStXYWxQwAHRn8ID dqPoKV9G+wm+2SJdyyThOk5/6Cg4xPsIlBnuYvrwPUcDpoDW31ccme47hIu+hvWtGoby tvJzrCv3AZmultT6H8mSJJQe9/YQufU8wl3sFx8afJxIyDg7CoNMPRfaD4AIos8swIII jr0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eoim6jWi; spf=pass (google.com: domain of linux-kernel+bounces-16755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fn24-20020a1709069d1800b00a272ec66d84si7095018ejc.0.2024.01.04.06.13.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 06:13:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eoim6jWi; spf=pass (google.com: domain of linux-kernel+bounces-16755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7B9921F229E8 for ; Thu, 4 Jan 2024 14:13:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFB16224E7; Thu, 4 Jan 2024 14:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eoim6jWi" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12775225AF; Thu, 4 Jan 2024 14:13:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BE15C433C7; Thu, 4 Jan 2024 14:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704377618; bh=5vBZUdnVGG54e1EEHK8EIcIM6ks58SMSIsV6NIeU8EM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eoim6jWidQUlAKXMoFo2AKkzo0fTFyfpgISn6i7YGiWDfDr1P53cADXJ7H03Vj18B 3qQePXmFX9Bgary2Aaqzz05x+fgtWEEFZw+L16y/H3Gh6b4U1d9kYevBwt8hapFq48 mRA5QfJZxLT6mtbKWsnV0xuWr/Ae5tp9o/3t8LKVYkxbTAONv0vlKceaFClFYIvrPm 6hX7e95gFqf6fHa4Sy0Nos6OiDadnb4hsN+idkz6dpDLOup/1sB7sUHk4y+9D3Tt6g fX8Do4Z/rcR5cQVkDvBpAXU1IpZQoBBojIGC4WKGxfyR9GZMsWTWSvXzrPZ9pu1s+p RFJaJ7SFRd0vQ== Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-204301f2934so291209fac.1; Thu, 04 Jan 2024 06:13:38 -0800 (PST) X-Gm-Message-State: AOJu0Yw7BVYdWbJ7BZ3SCL2kxxYrm82Z7hUCrnBBd1QYqucn2uawe49j wNSoHPPI1OvPVV4yUuLhfuBaHeote3ai9N2H1R8= X-Received: by 2002:a05:6870:9720:b0:203:2b71:dad5 with SMTP id n32-20020a056870972000b002032b71dad5mr709423oaq.8.1704377617843; Thu, 04 Jan 2024 06:13:37 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <941a566eb114701685dc44f708f81891b3bd085b.1703042082.git.kevinmbecause@gmail.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 4 Jan 2024 23:13:01 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] kbuild: Enable decompression for use by EXTRA_FIRMWARE The build system can currently only compress files. This patch adds the functionality to decompress files. Decompression is needed for building firmware files into the kernel if those files are compressed on the filesystem. Compressed firmware files are in use by Gentoo, Fedora, Arch, and others. To: Kevin Martin Cc: Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 4, 2024 at 4:04=E2=80=AFPM Kevin Martin wrote: > > > On Wed, 3 Jan 2024, Masahiro Yamada wrote: > > > On Wed, Dec 20, 2023 at 7:26=E2=80=AFPM Kevin Martin wrote: > > > > > > Signed-off-by: Kevin Martin > > > --- > > > scripts/Makefile.lib | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > > index 1a965fe68..d043be3dc 100644 > > > --- a/scripts/Makefile.lib > > > +++ b/scripts/Makefile.lib > > > @@ -523,6 +523,9 @@ quiet_cmd_xzkern_with_size =3D XZKERN $@ > > > quiet_cmd_xzmisc =3D XZMISC $@ > > > cmd_xzmisc =3D cat $(real-prereqs) | $(XZ) --check=3Dcrc32 --l= zma2=3Ddict=3D1MiB > $@ > > > > > > +quiet_cmd_xzdec =3D XZDEC $@ > > > + cmd_xzdec =3D cat $(real-prereqs) | $(XZ) --decompress > $@ > > > + > > > > > > > > Please do not fork the meaningless 'cat' process. > > > > This should be a single process to take just one input file. > > > > cmd_xzdec =3D $(XZ) --decompress --stdout $< > $@ > > > > > > > > > > Commit d3dd3b5a29bb9582957451531fed461628dfc834 > > was a very bad commit. > > > > The 'cat' and compression/decompression must be > > separate rules. > > > > We should not repeat the mistake in the past. > > > > Would it be preferable to change all of the compression rules or just the > new decompression rules? I do not require you to change the existing code. For decompression, it is unlikely that the recipe takes multiple input files. So, 'cat' is unneeded. > I could change just the new ones and then begin working on a different > patch to clean up the 'cat' processes in the compression rules. If you get rid of the 'cat', you need to refactor the user code. arch/x86/boot/compressed/Makefile relies on 'cat' and 'compress', but please double-check no other Makefile uses it. Also, you might need some research about the potential impact onto the reproducible builds. Without 'cat |', the compressed archive might encode the timestamp of the original file. GZIP records the timestamp in the header. > > > > > > > > # ZSTD > > > # ------------------------------------------------------------------= --------- > > > # Appends the uncompressed size of the data using size_append. The .= zst > > > @@ -548,6 +551,9 @@ quiet_cmd_zstd22 =3D ZSTD22 $@ > > > quiet_cmd_zstd22_with_size =3D ZSTD22 $@ > > > cmd_zstd22_with_size =3D { cat $(real-prereqs) | $(ZSTD) -22 -= -ultra; $(size_append); } > $@ > > > > > > +quiet_cmd_zstddec =3D ZSTDDEC $@ > > > + cmd_zstddec =3D cat $(real-prereqs) | $(ZSTD) --decompress > $= @ > > > + > > > > > > Same here. > > Please make this a single process: > > > > cmd_zstddec =3D $(ZSTD) --decompress --force --output=3D$@ $< > > > > > > > > > > > > > > One small concern in the future is, if we end up with adding > > quiet_cmd_bzip2dec, we will run out of the 7-column of the short log. > > > > quiet_cmd_bzip2dec =3D BZIP2DEC$@ > > > > We can increase the column size if needed, so I do not think > > it is a big issue. > > > > > > > > > > > > > > > > > > > > > > > # ASM offsets > > > # ------------------------------------------------------------------= --------- > > > > > > -- > > > 2.41.0 > > > > > > > > > -- > > Best Regards > > Masahiro Yamada > > --=20 Best Regards Masahiro Yamada