From patchwork Tue Oct 18 04:31:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Li X-Patchwork-Id: 3934 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1772890wrs; Mon, 17 Oct 2022 21:37:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gb04BTLi4yTv2zSm43CKMgVol7zZI7eLybdb6NEAifHEuJrjcz2w5pJE9yUhfeorWwJGD X-Received: by 2002:a17:907:1c86:b0:78d:b8dd:4826 with SMTP id nb6-20020a1709071c8600b0078db8dd4826mr839452ejc.492.1666067826660; Mon, 17 Oct 2022 21:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666067826; cv=none; d=google.com; s=arc-20160816; b=PClcZ1qE+Md0bM4+9CUT7RA7O1PYJPe8WMk3wA+uhZkwdRR5Gq858MOViJQ2V/PONU Gs9i41/a0mP8gOsY7D2Si4UIF1swrL2XK4AzP0Q2KB7zgwt1R8eOV+0iW4gZDH5xEoXd u7vbpK5YsIO37WSkq5nNwbPOuV1kamtPG6AVvzGw26M7KRJTIZCDN8JwLy0aoVhS9Sr1 oB2nRUJageZKgKtsf10Cmi80eBQgHC3H0gGzTt4LULP46nSCHP8erVQdf6qwS8AuQbTI 2cK/tVefU8JINXrRnXG4hA2BADsuGACPqhpcaa5aDoNwdBcWpm1hbHBYa345U0Gm52LY jZBQ== 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:date:subject:cc:to:from :dkim-signature; bh=dmXSZOocKWle7WJN1Yv0WbcwhJdK1zNL4uIqVNuJpco=; b=ZSQ9UKdPdhu+ysKMkxtpe/2DAOCYerTprr61YnTJW7JCGJWD8Jf2+t4Vh32zn14ifR wn8k0lrQaa2HmWhG7GqYESKo5U2deRlQs39jiRyccx3WoY2TBBqRtf4UZ5n0VnsZAfZJ RABbwb11H0ct2z81oP0h8HzzhlJT/dVOKYxNYyNcFmrd+2BxtNXGZw6WdLjjHf4wfb7K YGqdQAISxNRPnTfRRjTJu99XlVMn8hADsqyNPVyCNNiZMfccdq42pLUekv9BBcRPj8Wl EfqqeNRvro8xoW//MJNp8XUirzzHJbpTtGdUzK+07h06fuxKm1tcOfdvhGkuSDQoKX01 2rnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lirui.org header.s=key1 header.b=aTvWY65p; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lirui.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd40-20020a17090796a800b0078d3ab37efasi11865565ejc.84.2022.10.17.21.36.41; Mon, 17 Oct 2022 21:37:06 -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=@lirui.org header.s=key1 header.b=aTvWY65p; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lirui.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbiJREbp (ORCPT + 99 others); Tue, 18 Oct 2022 00:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiJREbn (ORCPT ); Tue, 18 Oct 2022 00:31:43 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C34582750; Mon, 17 Oct 2022 21:31:41 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lirui.org; s=key1; t=1666067499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dmXSZOocKWle7WJN1Yv0WbcwhJdK1zNL4uIqVNuJpco=; b=aTvWY65prFjEJWfbjZPDuU9HA16ainhU+vmOJqu4uPXJl/DBmEEHdZxEUZMyjRNh78rHFs YJ336DRI/z3mfMMn/GljrlxvZ2JFXgAlaKNos7evmPwW/+8nRr+az1lpm/rJO1cj1j4Iiv JCfhcD/N/9RmKq5HCY8aSD7SC1jcbD0zhm2FOzCLC8TQsWY4m7B4TgLUDIx2FDv/xYEBN7 /rEP3e0xH9jiOhkwAAOdkiis4MX+QcRLV8XJJiFMU8LSJUCdreoxK0i6yX2dQcYKuWeJA/ ZBEEjLOHSWOnUmY/hg2l0qqvfD1g07TFzF2yC+HILYzz8CKeA4LtZLISygJNEA== From: Rui Li To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Shi , Yanteng Si , Jonathan Corbet , Wu XiangCheng , Rui Li Subject: [PATCH 1/2] docs/zh_CN: Add staging/xz Chinese translation Date: Tue, 18 Oct 2022 12:31:05 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746998736981390147?= X-GMAIL-MSGID: =?utf-8?q?1746998736981390147?= Translate the following files into Chinese: - Documentation/staging/xz.rst Signed-off-by: Rui Li --- .../translations/zh_CN/staging/xz.rst | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Documentation/translations/zh_CN/staging/xz.rst diff --git a/Documentation/translations/zh_CN/staging/xz.rst b/Documentation/translations/zh_CN/staging/xz.rst new file mode 100644 index 000000000000..a50e7ee10bad --- /dev/null +++ b/Documentation/translations/zh_CN/staging/xz.rst @@ -0,0 +1,99 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/staging/xz.rst + +:翻译: + + 李睿 Rui Li + +============================ +Linux中的XZ数据压缩 +============================ + +介绍 +============ + +XZ是一种通用的数据压缩格式,其具有高压缩率和相对快的解压速度。主要的压缩算法( +过滤器)是LZMA2。额外的过滤器可以被用来进一步提高压缩率,比如用来提高可执行数据 +压缩率的Branch/Call/Jump (BCJ)过滤器。 + +XZ解压器在Linux中被称作XZ Embedded。它支持LZMA2过滤器和可选的BCJ过滤器,并支持 +CRC32完整性校验。你可以在XZ Embedded的主页 +中找到最新版本和关于在Linux内核之外使用源码的信息。 + +对于用户空间来说,XZ Utils提供了类似于zlib的压缩库和类似于gzip的命令行工具。 +XZ Utils可以从下载。 + +内核中的XZ相关组件 +=================================== + +xz_dec模块为XZ解压器提供了单次调用(缓冲区到缓冲区)和多次调用(有状态)的 +API。xz_dec模块的用法记录在include/linux/xz.h中。 + +xz_dec_test模块用于测试xz_dec。除非你想魔改XZ解压器,否则xz_dec_test是 +没有用的。xz_dec_test会动态分配一个字符设备主设备号,你可以从用户空间向它 +写入.xz文件,解压的输出会被丢弃。关注dmesg可以找到xz_dec_test输出的诊断信息。 +详细内容请查看xz_dec_test的源码。 + +为了解压内核镜像、初始ram文件系统和初始ram磁盘,lib/decompress_unxz.c实现 +了一个包装函数。它的API与其他 decompress_*.c 文件相同,那些API定义在 +include/linux/decompress/generic.h中。 + +scripts/xz_wrap.sh是一个XZ Utils中的xz命令行工具包装器。这个包装器会 +设置合适的压缩选项来压缩内核镜像。 + +在内核的makefiles中,提供了使用$(call if_needed)的两个命令。内核镜像应该 +使用$(call if_needed,xzkern)来压缩,它会使用BCJ过滤器和一个大LZMA2字典。 +它还会附加一个四字节的包含源文件大小的预告,这会在启动代码中被用到。其他文件 +应该使用$(call if_needed,xzmisc)来压缩,它会使用1 MiB的LZMA2字典并禁用 +BCJ过滤器。 + +关于压缩选项的说明 +============================ + +因为XZ Embedded只支持没有完整性校验的数据流或者CRC32,请确保你在编码未来将被 +内核解码的文件时没有使用其他完整性校验方式。使用liblzma时,你需要使用LZMA_CHECK_NONE +或LZMA_CHECK_CRC32。使用xz命令行工具时,使用--check=none或--check=crc32。 + +除非有其他环节会验证解压数据的完整性,否则强烈使用CRC32。双重验证可能会浪费 +CPU周期。请注意头部总是会包含用于解压器验证的CRC32,你只能修改或禁用解压后数据 +的完整性校验方式。 + +在用户中间中,LZMA2通常使用几兆字节大小的字典。解码器需要在RAM中放置字典, +因此大字典不能被用于那些意在被内核解码的文件。1 MiB在内核中大概是可接受的最大 +字典大小(可能对初始ram文件系统也适用)。XZ Utils中的预设值可能并不适合创建 +内核文件,所以请别犹豫使用自定义设置。比如:: + + xz --check=crc32 --lzma2=dict=512KiB inputfile + +使用上面字典大小的一个例外是在单一调用模式下使用解码器。解压内核自身就是一个例 +子。在单一调用模式下,内存用量并不和字典大小有关,这种情况就是使用大字典的好地 +方:为了最大化压缩,字典至少应该和解压后的数据一样大。 + +未来计划 +============ + +如果有人认为有用的话,可能会考虑创建一个受限的XZ编码器。LZMA2的压缩速率比Deflate +或LZO等要慢,即使在最快的配置选项下。所以并不清楚LZMA2编码器是否需要并入内核。 + +有计划在解压代码中支持有限的随机访问读数据。不知道这能否在内核中有任何用,但是我 +知道这会在一些Linux内核以外的嵌入式项目中有用。 + +.xz文件格式规范的一致性 +================================================ + +在一些边缘情况下,为了简化事情牺牲了尽早地检测错误。因为并不会导致安全问题,实际 +上是没有关系的。但在测试代码的时候知道这一点很好,比如测试来自XZ Utils的文件。 + +报告错误 +============== + +请在报告错误前确认是否已经在上游修复。可以从 +获取最新的源码。 + +可以通过联系或者访问Freenode上的#tukaani +联系Larhzu。我并不经常阅读LKML或者其他内核相关的邮件列表,所以如果要告知我什么事情 +,你应该通过我的私人邮箱或者IRC联系我。 + +请不要因为内核中XZ的实现或关于XZ Utils的问题打扰Igor Pavlov。虽然这两种实现 +包含了建立在Igor Pavlov的代码上的重要源码,但并不由他维护和提供支持。 \ No newline at end of file From patchwork Tue Oct 18 04:31:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Li X-Patchwork-Id: 3935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1773459wrs; Mon, 17 Oct 2022 21:39:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6k1IL/ZhvJujOfZygIWihSajA2FZqb1aFbW8n6BsrcR5cvqnZXWq0uroyPLAY433xnTDTU X-Received: by 2002:a17:907:9603:b0:742:9ed3:3af2 with SMTP id gb3-20020a170907960300b007429ed33af2mr844491ejc.510.1666067964500; Mon, 17 Oct 2022 21:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666067964; cv=none; d=google.com; s=arc-20160816; b=RnYexchgwJkLIINxElVWFUpyes5B7ePL650NzJeDlOdeCwcxnv+bd+oAjxB/6mJZcX OowGL3fhvvqtP2VNspN/zH3m6LSGlJvWg4V5dQFlEGgKEfaKanb16k5Lo9Qgz5P5lZ57 VB3yLq6NRwvwX9eoEjmbJU65hITDdCn0n11ODTN2Mer8FKRoGzhLEr6cv5HbioMJqc8H tzdfAFgMXCPrbg1pCAQFxEfoujqIPopBwCPwBiSwkFmYr44QhpsZkH53TNdsJUgCttkT Htg7a9yf+HreBoH6k4JAFm3WG6mTVV1vwRixng62vkUFJ/RwNqSnCObCjgcgObzrggTS mP+g== 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:date:subject:cc:to:from :dkim-signature; bh=SNkLTBWKRr7ziif44CMcG6Xt4lqWvNg9BJRnMLOqhd4=; b=g+uKY/QJUgXG0OBrRHuxCZeQ+/tO7etNQIxsaeDVGRLCFKrQoAJp5NwxH5JX+ZdSQ2 TEYhbxkgDt5ygE5nLKjIXxhkEVtQrTr6AfWbCtLv3niRUz6HU5/0QFjjrtkqo5R02PXd Ca0ZVos3gLRsH35sebpXL6B2/oGsdc2bAng2sZvniQhd2ycUkVGYC8S5P0hqPedwkulg 8hkjUU0xeG7L2pEOgJ7p/MKjz8QPzaITo9i5KzHLMQUBhbSPkGFT/IgrH4CVVC+Nis+K msjZisEXtD4sKQBfv3gXII1sQf3u0RVhV9zplQyMsKPbGAGNEWHcgbWbPqz1Arw/zQkn k+jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lirui.org header.s=key1 header.b=GSR9WTdB; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lirui.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs14-20020a0564020c4e00b00447d567a77dsi11328028edb.207.2022.10.17.21.38.49; Mon, 17 Oct 2022 21:39:24 -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=@lirui.org header.s=key1 header.b=GSR9WTdB; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lirui.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbiJREbz (ORCPT + 99 others); Tue, 18 Oct 2022 00:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiJREbv (ORCPT ); Tue, 18 Oct 2022 00:31:51 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7708D9E699; Mon, 17 Oct 2022 21:31:44 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lirui.org; s=key1; t=1666067502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SNkLTBWKRr7ziif44CMcG6Xt4lqWvNg9BJRnMLOqhd4=; b=GSR9WTdB8V9lVJT32TYzyhovcSvogvH75l65aoQEdnX7f6pqQElGCgmycFT9HAoD77LSqS PGHrctomMWt0Qc3uVXCTaJJUz1QinCp/JQoJNGcGgGmpWHosGcfgrpWCPVZ00AtvAfY7fk uXqICng4smRy76VVSzpgL7yikhm0qpFOjInX7FQ5GUM6jCO3lKeCC6i5Igizo3ms0fiCX0 U3lStPmQR/hHGjmGp/8RLLGN/+pYwB83C7PmoRJ79GwBfSvxC6cFeCIvqwieQSkx5zu9Ie u16Iwuzf0nhTgINzKOw4TD61sArzeu0iEun0tubJOeMK5auU2bXCEV44EMMkrQ== From: Rui Li To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Shi , Yanteng Si , Jonathan Corbet , Wu XiangCheng , Rui Li Subject: [PATCH 2/2] docs/zh_CN: Add staging/index Chinese translation Date: Tue, 18 Oct 2022 12:31:06 +0800 Message-Id: <4ef47cfc6c85ad9c778af1f13761e8dd8e410ee8.1666067195.git.me@lirui.org> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746998881868505041?= X-GMAIL-MSGID: =?utf-8?q?1746998881868505041?= Translate the following files into Chinese: - Documentation/staging/index.rst Add it into the menu of zh_CN/index. Also fix one translation in the zh_CN/index file. Signed-off-by: Rui Li --- Documentation/translations/zh_CN/index.rst | 8 +++--- .../translations/zh_CN/staging/index.rst | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 Documentation/translations/zh_CN/staging/index.rst diff --git a/Documentation/translations/zh_CN/index.rst b/Documentation/translations/zh_CN/index.rst index ec99ef5fe990..3d07b3149afe 100644 --- a/Documentation/translations/zh_CN/index.rst +++ b/Documentation/translations/zh_CN/index.rst @@ -124,13 +124,13 @@ TODOList: 其他文档 -------- -有几份未排序的文档似乎不适合放在文档的其他部分,或者可能需要进行一些调整和/或 +有几份未分类的文档似乎不适合放在文档的其他部分,或者可能需要进行一些调整和/或 转换为reStructureText格式,也有可能太旧。 -TODOList: - -* staging/index +.. toctree:: + :maxdepth: 2 + staging/index 索引和表格 ---------- diff --git a/Documentation/translations/zh_CN/staging/index.rst b/Documentation/translations/zh_CN/staging/index.rst new file mode 100644 index 000000000000..7d074b34ac97 --- /dev/null +++ b/Documentation/translations/zh_CN/staging/index.rst @@ -0,0 +1,27 @@ +.. SPDX-License-Identifier: GPL-2.0 +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/staging/index.rst + +:翻译: + + 李睿 Rui Li + +未分类文档 +====================== + +.. toctree:: + :maxdepth: 2 + + xz + +TODOList: + +* crc32 +* lzo +* remoteproc +* rpmsg +* speculation +* static-keys +* tee +* xz