From patchwork Thu Oct 20 14:42:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Li X-Patchwork-Id: 6231 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp150618wrr; Thu, 20 Oct 2022 07:45:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6DUkXYWYonLhKvA4XPFDze16w0tAaGYRAfRTxu83NRPOgjwibbh7UxGMEcGvNK8zkcvX5p X-Received: by 2002:a05:6a02:282:b0:439:7a97:ccd with SMTP id bk2-20020a056a02028200b004397a970ccdmr12308529pgb.297.1666277122675; Thu, 20 Oct 2022 07:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666277122; cv=none; d=google.com; s=arc-20160816; b=pZtkTtjxx/Smg/cnML/GYaufa04TC2hoy1NtQMpDRAtDYPRT+3vAQnZqccKujCLtDy vdKy4hc+GBARDCT9J/5ti3d6ODgrHRfWy6Z/7/cQyTqFbacD/bFvgIx0p5pt1oir/TCs FGLWiFmgdtInIiafM1q3m8BupbCX3us58jorbuiQ9e8p0sD0Ir32t79ddjDQ1HY0mkCO 6YViUSq0HBzxee/IzMSu6DdGo6omyjjZoYlXC/NH1dSF8/D9UjHoMZh4HZ6nFe4w98jJ lYQLh7VHCw/zoTxHCxvRBXvwJa5DjP7WTY0+WLY4wnmvJaugR9G94Jy/tEBS+JNl2t2r aBDw== 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=Xk0Uk+J+pVoMTHPZFbUY4tpbaiEtgAbphQcQ8hSyJIQ=; b=tGZ5TFwTDlqsDPPrR0fFgNoNgDcOI5QJy4ETiiP/OfnwCDvzzRa4zRbB2lJQne4nJ4 8Qq5Z7Cp7kdirEUvrDL50SGBqJE0c+MRHGR0iuj8nvxzdJfvMjDOzXmZci4jLgguYqeR ELYfcJ+2AydaqtuM2lKu+sWTMzYOG8sOS+xe+ivPXKD2rKHjaQi2zJxoQ4+97jL8mJJ6 5zK8mu26Ra1Ne5kN6EN4xcR00UBuMPTvzyL7nbHORcWrbRRASPwnJmzVxZCugEW6r6Nk +FJ5wpvdFo3Gb+p0EXxnAruYRho9yU0ALafkNaN0IDYb50D35jCLXqUxJSthLq6l6qDs WsvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lirui.org header.s=key1 header.b="S39Khm//"; 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 q36-20020a17090a752700b0020c2253cbc2si3742597pjk.54.2022.10.20.07.45.08; Thu, 20 Oct 2022 07:45:22 -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="S39Khm//"; 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 S229489AbiJTOm3 (ORCPT + 99 others); Thu, 20 Oct 2022 10:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbiJTOmZ (ORCPT ); Thu, 20 Oct 2022 10:42:25 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 027E413729F; Thu, 20 Oct 2022 07:42:25 -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=1666276943; 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=Xk0Uk+J+pVoMTHPZFbUY4tpbaiEtgAbphQcQ8hSyJIQ=; b=S39Khm//T4WQuI6477FAawK+z78sKoNdc1UZDPK7e1q969ZyhllvEDON2G47aumxO22ZUy P6cr7ce+t01H9w+U3t5bxfKvPsRfQAZnUYfs6lKmjiiQDnUAXVGR9eRIAQfTBgRQH6CkaI K6RwNCyOr+kylX1kqj5iiMFXmYSeJ7VajNhn6WSlb8s0EvFOwVxgQt/ffoSWYUiDbCg2mH 2J+8AtlNMCbHLgFVWb/yTSYHx9evnR/N43FDOdjmro+oKuQuDs6F3PlheZBKfOIPqCRVav eoC+tW9i6ICkraJgXQZkfG6fxk/5x2RaRa1wMAKzVNTV/NVoOX9NrdSMrhgpCQ== From: Rui Li To: Alex Shi , Yanteng Si Cc: Jonathan Corbet , Wu XiangCheng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Rui Li Subject: [PATCH v3 1/2] docs/zh_CN: Add staging/index Chinese translation Date: Thu, 20 Oct 2022 22:42:13 +0800 Message-Id: <50ffa90ad6dacc321cedc194d30a029383a737a9.1666275798.git.me@lirui.org> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED 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?1747218200085642223?= X-GMAIL-MSGID: =?utf-8?q?1747218200085642223?= 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 --- No change since v2 Changes since v1: - Add xz into menu later --- Documentation/translations/zh_CN/index.rst | 8 +++---- .../translations/zh_CN/staging/index.rst | 22 +++++++++++++++++++ 2 files changed, 26 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..e26603892a6f --- /dev/null +++ b/Documentation/translations/zh_CN/staging/index.rst @@ -0,0 +1,22 @@ +.. SPDX-License-Identifier: GPL-2.0 +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/staging/index.rst + +:翻译: + + 李睿 Rui Li + +未分类文档 +========== + +TODOList: + +* crc32 +* lzo +* remoteproc +* rpmsg +* speculation +* static-keys +* tee +* xz From patchwork Thu Oct 20 14:42:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Li X-Patchwork-Id: 6232 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp150658wrr; Thu, 20 Oct 2022 07:45:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6vWYFgH1nGMfZgWIhEU5AZTBE9GWYytZVDiyOmj0oZApU+gm8Y4UkGfkVRqUFcpE2ynEch X-Received: by 2002:a65:4c0c:0:b0:45f:f12d:f46f with SMTP id u12-20020a654c0c000000b0045ff12df46fmr12122654pgq.579.1666277127982; Thu, 20 Oct 2022 07:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666277127; cv=none; d=google.com; s=arc-20160816; b=NqWTwCFyjIdhiMBpiK9L6PJLp81Z+dJxtb8Ib0Z8LGYW0XfsykgcSYyKFphDxmpohK YlIi7y3Dr9nE63YE/fTQiejWgTMAxmfQdHEOsvgmfs/NNOfh4vEZi7k+OIg/KVAChCjJ 5mNb/VFEVH9lfjm4jK/d1r+32B9pZ01ybEFme3/0zPKZ4W4vnzTdlulFtM48xWcBRKiS pUZmkoFmr7U9yOgKzVS7ziiTn4VtaepLTkbuGRbWuXN5DGwdeXiSFAV3axPCBIyH48Q/ OrjHWSk99l6vbJfFnTk1e6oAUm6v2QFi9LCjjJbbi9asm7HgBVXTS7l4lSGQJq8xpj6B jENg== 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=HaokKNjTlhG1x6gJmoBwjqx6K1/rVFpkVE+Oghg0w3M=; b=ORZo0w1L5Qm1Q3V70p+bUf0qNnoZPiyQTTTwdjEQ2wSlCuA2oHNtIiXlm15JrPbrls ElzbuPlTyRSRUL4DZ40kCLMMeYUGzRe7F/3b2KB2UT4iyQZ6YI2gUUYU7CxBsvpuYds9 QijXB9R7uAD90HxDrmybP62iMN/WXEHdX7g/IqPdt5j44RHfHo+1CHnYzHruAiD3fMCB nTGZ1iL0DRBrrzF+q1OS2+kB/BvhBkYlWelEm/BrijQ2SVZOzPEUN7dKmawgabJuThO+ HXzANQzZwToEtk3ccOMeERUWA4sdPvEXVXSES3cT5OWhsbZ3f7nr0RHRuahTyNg2EH1g RC0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lirui.org header.s=key1 header.b=XeMTU0SE; 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 n7-20020a170902f60700b0017cf07295c2si22111526plg.484.2022.10.20.07.45.09; Thu, 20 Oct 2022 07:45:27 -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=XeMTU0SE; 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 S230209AbiJTOmf (ORCPT + 99 others); Thu, 20 Oct 2022 10:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiJTOm3 (ORCPT ); Thu, 20 Oct 2022 10:42:29 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15A40157F41; Thu, 20 Oct 2022 07:42:28 -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=1666276946; 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=HaokKNjTlhG1x6gJmoBwjqx6K1/rVFpkVE+Oghg0w3M=; b=XeMTU0SE1rks0U1gxboL20jB+2GoOxq9mjAWWpj8x8LUFXxwF8X2y/rsoIsiK2w3tzgjH1 x6k0KYwWoigV/xjAvsUDn0yk6lUJNzMp1nYx8sOs6xYuf8vO1wPjmRHTTwDIHc8YySqA1D l6yq4HCs0vQfwTXBP0pJ7SpGU7ea/HTqluhNzTqF7zzWojfaHpCy2qi2gmJTSKZQzyhD/K eao/LDHp35E8G7wcehKt1SquvdOM1ukqPTUzBDCQeYoKgs+wDF8zFG3zdDn7CHeUlon8bz 21DDlibWSYMvKBOUeeJO4yHt3/sU2/1cAsSUt7VWXe5qL0NbNSViGq4Lmp1ILA== From: Rui Li To: Alex Shi , Yanteng Si Cc: Jonathan Corbet , Wu XiangCheng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Rui Li Subject: [PATCH v3 2/2] docs/zh_CN: Add staging/xz Chinese translation Date: Thu, 20 Oct 2022 22:42:14 +0800 Message-Id: <73796d27e13e2f479bad6e80e41f44b09fc1702b.1666275798.git.me@lirui.org> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED 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?1747218205876644355?= X-GMAIL-MSGID: =?utf-8?q?1747218205876644355?= Translate the following files into Chinese: - Documentation/staging/xz.rst Signed-off-by: Rui Li --- Changes since v2: - Add GPLv2 declaration for xz.rst Changes since v1: - Align title - Adjust patch set order - Add xz into index here --- .../translations/zh_CN/staging/index.rst | 6 +- .../translations/zh_CN/staging/xz.rst | 100 ++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/staging/xz.rst diff --git a/Documentation/translations/zh_CN/staging/index.rst b/Documentation/translations/zh_CN/staging/index.rst index e26603892a6f..bb55c81c84a3 100644 --- a/Documentation/translations/zh_CN/staging/index.rst +++ b/Documentation/translations/zh_CN/staging/index.rst @@ -10,6 +10,11 @@ 未分类文档 ========== +.. toctree:: + :maxdepth: 2 + + xz + TODOList: * crc32 @@ -19,4 +24,3 @@ TODOList: * speculation * static-keys * tee -* xz diff --git a/Documentation/translations/zh_CN/staging/xz.rst b/Documentation/translations/zh_CN/staging/xz.rst new file mode 100644 index 000000000000..211c487bcb62 --- /dev/null +++ b/Documentation/translations/zh_CN/staging/xz.rst @@ -0,0 +1,100 @@ +.. SPDX-License-Identifier: GPL-2.0 +.. 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的代码上的重要源码,但并不由他维护和提供支持。