mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
only use zstd for compression and decompression
This commit is contained in:
parent
496748d49f
commit
6053af84a9
16 changed files with 14 additions and 125 deletions
|
@ -12,6 +12,7 @@ cpio:
|
|||
- create new base_ hooks
|
||||
- added error message on failed _binary adding
|
||||
- added message about used config file
|
||||
- only allow to use zstd compression/decompression
|
||||
setup:
|
||||
changed default installation path to /mnt/install
|
||||
2023.10 Highlights:
|
||||
|
|
|
@ -2,11 +2,4 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
_KERNEL="/boot/Image.gz"
|
||||
_HOOKS=(base_common base_common_mods base_init base_init_mods block_mods)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -3,11 +3,4 @@
|
|||
_KERNEL="/boot/Image.gz"
|
||||
_HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
||||
kexec kms_mods installer_common licenses net_common net_mods remote)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -3,11 +3,4 @@
|
|||
_KERNEL="/boot/Image.gz"
|
||||
_HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
||||
cache installer_common kexec kms_mods licenses)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -9,11 +9,4 @@ _HOOKS=(cache cache_cleanup firmware firmware_mods firmware_cleanup base_common_
|
|||
devicemapper efi filesystems filesystems_cleanup installer_common installer
|
||||
kexec licenses lshw lvm2 mdadm motd neovim net net_cleanup net_common pciutils
|
||||
remote secureboot smartmontools usbutils vconsole wireless)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
#_COMP_OPTS=()
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -8,11 +8,4 @@ _HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
|||
licenses lshw lvm2 mdadm mdadm_mods motd neovim net_common net net_mods
|
||||
pciutils remote secureboot smartmontools usbutils vconsole wireless
|
||||
wireless_mods)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -2,11 +2,4 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
_KERNEL="/usr/lib/modules/*/vmlinuz"
|
||||
_HOOKS=(base_common base_common_mods base_init base_init_mods block_mods)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -7,11 +7,4 @@ _HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
|||
installer_common installer kexec kms_mods licenses lshw lvm2 mdadm
|
||||
mdadm_mods motd neovim net_common net net_mods pciutils remote
|
||||
secureboot smartmontools usbutils vconsole wireless wireless_mods)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -2,11 +2,4 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
_KERNEL="/usr/lib/modules/*/vmlinuz"
|
||||
_HOOKS=(base_common base_common_mods base_init base_init_mods block_mods)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -3,11 +3,4 @@
|
|||
_KERNEL="/usr/lib/modules/*/vmlinuz"
|
||||
_HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
||||
kexec kms_mods installer_common licenses net_common net_mods remote)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -3,11 +3,4 @@
|
|||
_KERNEL="/usr/lib/modules/*/vmlinuz"
|
||||
_HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
||||
cache installer_common kexec kms_mods licenses)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -9,11 +9,4 @@ _HOOKS=(cache cache_cleanup firmware firmware_mods firmware_cleanup base_common_
|
|||
devicemapper efi filesystems filesystems_cleanup installer_common installer
|
||||
kexec licenses lshw lvm2 mdadm motd neovim net net_cleanup net_common pciutils
|
||||
remote secureboot smartmontools usbutils vconsole wireless)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
#_COMP_OPTS=()
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -8,11 +8,4 @@ _HOOKS=(base_common base_common_mods base_common_system base_common_system_mods
|
|||
licenses lshw lvm2 mdadm mdadm_mods motd neovim net_common net net_mods
|
||||
pciutils remote secureboot smartmontools usbutils vconsole wireless
|
||||
wireless_mods)
|
||||
|
||||
# COMPRESSION
|
||||
# Use 'cat' to create an uncompressed image.
|
||||
# Possible compressors: cat gzip bzip2 lzma xz lzop lz4 zstd
|
||||
_COMP="zstd"
|
||||
# Additional options for the compressor
|
||||
_COMP_OPTS=(-19)
|
||||
# vim: set ft=sh ts=4 sw=4 et:
|
||||
|
|
|
@ -223,24 +223,14 @@ _install_libs() {
|
|||
}
|
||||
|
||||
_create_cpio() {
|
||||
case "${_COMP}" in
|
||||
cat) echo "Creating uncompressed image..."
|
||||
unset _COMP_OPTS
|
||||
;;
|
||||
*) echo "Creating ${_COMP} compressed image..."
|
||||
;;&
|
||||
xz) _COMP_OPTS=('-T0' '--check=crc32' "${_COMP_OPTS[@]}")
|
||||
;;
|
||||
lz4) _COMP_OPTS=('-l' "${_COMP_OPTS[@]}")
|
||||
;;
|
||||
zstd) _COMP_OPTS=('-T0' "${_COMP_OPTS[@]}")
|
||||
;;
|
||||
esac
|
||||
echo "Creating zstd compressed image..."
|
||||
pushd "${_ROOTFS}" >"${_NO_LOG}" || return
|
||||
# Reproducibility: set all timestamps to 0
|
||||
find . -mindepth 1 -execdir touch -hcd "@0" "{}" +
|
||||
find . -mindepth 1 -printf '%P\0' | sort -z | LANG=C bsdtar --null -cnf - -T - |
|
||||
# use zstd only it has best compression and decompression
|
||||
find . -mindepth 1 -printf '%P\0' | sort -z |
|
||||
LANG=C bsdtar --null -cnf - -T - |
|
||||
LANG=C bsdtar --null -cf - --format=newc @- |
|
||||
${_COMP} "${_COMP_OPTS[@]}" > "${_GENERATE_IMAGE}" || _abort "Image creation failed!"
|
||||
zstd -T0 -19 > "${_GENERATE_IMAGE}" || _abort "Image creation failed!"
|
||||
popd >"${_NO_LOG}" || return
|
||||
}
|
||||
|
|
|
@ -32,25 +32,15 @@ _create_initrd_dir() {
|
|||
}
|
||||
|
||||
_compress_initrd() {
|
||||
case "${_COMP}" in
|
||||
cat) echo "Creating uncompressed image: ${1}"
|
||||
unset _COMP_OPTS
|
||||
;;
|
||||
*) echo "Creating ${_COMP} compressed image: ${1}"
|
||||
;;&
|
||||
xz) _COMP_OPTS=('-T0' '--check=crc32' "${_COMP_OPTS[@]}")
|
||||
;;
|
||||
lz4) _COMP_OPTS=('-l' "${_COMP_OPTS[@]}")
|
||||
;;
|
||||
zstd) _COMP_OPTS=('-T0' "${_COMP_OPTS[@]}")
|
||||
;;
|
||||
esac
|
||||
echo "Creating zstd compressed image: ${1}"
|
||||
pushd "${_W_DIR}/tmp/initrd" >"${_NO_LOG}" || return
|
||||
# Reproducibility: set all timestamps to 0
|
||||
find . -mindepth 1 -execdir touch -hcd "@0" "{}" +
|
||||
find . -mindepth 1 -printf '%P\0' | sort -z | LANG=C bsdtar --null -cnf - -T - |
|
||||
# use zstd only it has best compression and decompression
|
||||
find . -mindepth 1 -printf '%P\0' | sort -z |
|
||||
LANG=C bsdtar --null -cnf - -T - |
|
||||
LANG=C bsdtar --null -cf - --format=newc @- |
|
||||
${_COMP} "${_COMP_OPTS[@]}" > "../../${1}" || exit 1
|
||||
zstd -T0 -19 > "../../${1}" || exit 1
|
||||
popd >"${_NO_LOG}" || return
|
||||
echo "Build complete."
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<body>
|
||||
<p><span><img src="logo.png" alt="Logo"></span></p>
|
||||
<h1>Archboot Project | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z7GXKW4MKHK7C"><img src="donate.png" alt="Donate"></a></h1>
|
||||
<p><strong>© 2006 - 2023 | <a href=mailto:tpowa@archlinux.org>Tobias Powalowski</a></strong> | Arch Linux Developer <strong><a href="https://archlinux.org/people/developers/#tpowa">tpowa</a></strong><br><strong>Last update: 14.11.2023 08:59</strong></p>
|
||||
<p><strong>© 2006 - 2023 | <a href=mailto:tpowa@archlinux.org>Tobias Powalowski</a></strong> | Arch Linux Developer <strong><a href="https://archlinux.org/people/developers/#tpowa">tpowa</a></strong><br><strong>Last update: 15.11.2023 11:18</strong></p>
|
||||
<nav id="TOC" role="doc-toc">
|
||||
<ul>
|
||||
<li><a href="#introduction" id="toc-introduction"><strong><span class="toc-section-number">1.</span> Introduction</strong></a></li>
|
||||
|
@ -1089,14 +1089,6 @@ Options supported in <strong>/etc/archboot/<profile>.conf</strong> files:<
|
|||
<td>_HOOKS=()</td>
|
||||
<td>Array that defines the used hooks</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>_COMP=""</td>
|
||||
<td>defines used compression method</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>_COMP_OPTS=()</td>
|
||||
<td>Array that defines any options for the compressor</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
Functions supported in <strong>/usr/lib/archboot/cpio/hooks/<hook></strong> files:<br>
|
||||
|
|
Loading…
Reference in a new issue