From patchwork Mon Jan 13 09:31:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Hesse X-Patchwork-Id: 1444 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 04F5C16388F92 for ; Mon, 13 Jan 2020 09:32:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED=0.1, DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001 autolearn=ham autolearn_force=no version=3.4.3 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 13 Jan 2020 09:32:35 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 965DA18154E657; Mon, 13 Jan 2020 09:32:33 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 7CFB918154E656; Mon, 13 Jan 2020 09:32:33 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=pass (1024-bit key) header.d=eworm.de header.i=@eworm.de header.b=ZSum38Zu Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 690762BFE4; Mon, 13 Jan 2020 09:32:33 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=pass (1024-bit key) header.d=eworm.de header.i=@eworm.de header.b=ZSum38Zu Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id F2FFE2BFE3 for ; Mon, 13 Jan 2020 09:32:28 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Mon, 13 Jan 2020 09:32:28 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id BFCB818154E650 for ; Mon, 13 Jan 2020 09:32:26 +0000 (UTC) Received: from mx.mylinuxtime.de (mx.mylinuxtime.de [IPv6:2a01:4f8:13a:16c2::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Mon, 13 Jan 2020 09:32:26 +0000 (UTC) Received: from leda.eworm.de (unknown [87.190.244.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.mylinuxtime.de (Postfix) with ESMTPSA id 9E080D3674; Mon, 13 Jan 2020 10:32:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 mx.mylinuxtime.de 9E080D3674 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eworm.de; s=mail; t=1578907945; bh=w4KUI6BaBVm/upFV3aDMpdqnzGby/B+TeWpKLnJSDkU=; h=From:To:Cc:Subject:Date; b=ZSum38ZuhzYvtbrhGOBWATvMWGostZkMwjN5pSkawfy30AeqEJgxWJ4ZDpl6eqNeG XnI3T/NyvecyuUy4U6CRNyRJQ+DHBzflawrQrob/uqky9nP8lQJEf1fkl8FPMHf/4n AJL27XbDe8W0VY9naIKRAZ0GcOpM7NsC2o0YwfOc= Received: by leda.eworm.de (Postfix, from userid 1000) id 6024B1207F4; Mon, 13 Jan 2020 10:31:55 +0100 (CET) From: Christian Hesse To: arch-releng@archlinux.org Date: Mon, 13 Jan 2020 10:31:52 +0100 Message-Id: <20200113093152.45326-1-list@eworm.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-Spamd-Bar: ++ Authentication-Results: mx.mylinuxtime.de; auth=pass smtp.auth=smtp-only@eworm.de smtp.mailfrom=eworm@leda.eworm.de X-Rspamd-Server: mx X-Stat-Signature: q9143i7ue8nztp53nx778g68s7hhe8jj X-Rspamd-Queue-Id: 9E080D3674 X-Spamd-Result: default: False [2.25 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-2.93)[-0.977,0]; FORGED_SENDER(0.30)[list@eworm.de,eworm@leda.eworm.de]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:~]; ASN(0.00)[asn:3320, ipnet:87.128.0.0/10, country:DE]; FROM_NEQ_ENVFROM(0.00)[list@eworm.de,eworm@leda.eworm.de]; BAYES_HAM(-0.12)[66.71%] Subject: [arch-releng] [PATCH 1/1] allow to set squashfs block size X-BeenThere: arch-releng@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux Release Engineering List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Arch Linux Release Engineering Cc: Christian Hesse Errors-To: arch-releng-bounces@archlinux.org Sender: "arch-releng" From: Christian Hesse This allows to set squashfs block size. Increasing block size may reduce image size, but add extra I/O and cpu penalty. Signed-off-by: Christian Hesse --- archiso/mkarchiso | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 567a5af..5c7bc4a 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -18,6 +18,7 @@ work_dir="work" out_dir="out" sfs_mode="sfs" sfs_comp="xz" +sfs_block_size="128K" gpg_key= # Show an INFO message @@ -95,6 +96,8 @@ _usage () echo " Default: ${sfs_mode}" echo " -c Set SquashFS compression type (gzip, lzma, lzo, xz, zstd)" echo " Default: '${sfs_comp}'" + echo " -b Set SquashFS block size" + echo " Default: '${sfs_block_size}'" echo " -v Enable verbose output" echo " -h This message" echo " commands:" @@ -223,9 +226,9 @@ _mkairootfs_img () { mkdir -p "${work_dir}/iso/${install_dir}/${arch}" _msg_info "Creating SquashFS image, this may take some time..." if [[ "${quiet}" = "y" ]]; then - mksquashfs "${work_dir}/airootfs.img" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -no-progress &> /dev/null + mksquashfs "${work_dir}/airootfs.img" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -b "${sfs_block_size}" -no-progress &> /dev/null else - mksquashfs "${work_dir}/airootfs.img" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -no-progress + mksquashfs "${work_dir}/airootfs.img" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -b "${sfs_block_size}" -no-progress fi _msg_info "Done!" rm ${work_dir}/airootfs.img @@ -240,9 +243,9 @@ _mkairootfs_sfs () { mkdir -p "${work_dir}/iso/${install_dir}/${arch}" _msg_info "Creating SquashFS image, this may take some time..." if [[ "${quiet}" = "y" ]]; then - mksquashfs "${work_dir}/airootfs" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -no-progress &> /dev/null + mksquashfs "${work_dir}/airootfs" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -b "${sfs_block_size}" -no-progress &> /dev/null else - mksquashfs "${work_dir}/airootfs" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -no-progress + mksquashfs "${work_dir}/airootfs" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" -b "${sfs_block_size}" -no-progress fi _msg_info "Done!" } @@ -369,7 +372,7 @@ fi umask 0022 -while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh' arg; do +while getopts 'p:r:C:L:P:A:D:w:o:s:c:b:g:vh' arg; do case "${arg}" in p) pkg_list="${pkg_list} ${OPTARG}" ;; r) run_cmd="${OPTARG}" ;; @@ -382,6 +385,7 @@ while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh' arg; do o) out_dir="${OPTARG}" ;; s) sfs_mode="${OPTARG}" ;; c) sfs_comp="${OPTARG}" ;; + b) sfs_block_size="${OPTARG}" ;; g) gpg_key="${OPTARG}" ;; v) quiet="n" ;; h|?) _usage 0 ;;