Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/mkarchiso
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2020-10-24 15:53:57 +0300
committernl6720 <nl6720@gmail.com>2021-03-09 16:25:45 +0200
commitbc67933af14c28eb385b537a6afa3aa6e458af59 (patch)
tree9aa3f2e015c1bb6d4d377b7aca6de54897d74cdd /archiso/mkarchiso
parent711ab4cd1ed8a38eaed4dadcc8d1fed5d4002008 (diff)
Support EROFS
EROFS, like Squashfs, is a read-only file system. It can be used to store airootfs in an image file. Its advantage is the support for POSIX ACLs. EROFS downside is that currently it only supports LZ4 compression (LZMA support is not yet fully implemented). A difference from Squashfs is that, EROFS stores change time (ctime) not modification time (mtime). The reverse is true for Squashfs. Implements https://gitlab.archlinux.org/archlinux/archiso/-/issues/59
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-xarchiso/mkarchiso32
1 files changed, 30 insertions, 2 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 021bcfa..0d7c698 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -200,13 +200,30 @@ _mkairootfs_squashfs() {
install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}"
_msg_info "Creating SquashFS image, this may take some time..."
_run_mksquashfs "${airootfs_dir}"
+}
+
+# Makes an EROFS file system from a source directory.
+_mkairootfs_erofs() {
+ local fsuuid
+ [[ -e "${airootfs_dir}" ]] || _msg_error "The path '${airootfs_dir}' does not exist" 1
+
+ install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}"
+ local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.erofs"
+ # Generate reproducible file system UUID from SOURCE_DATE_EPOCH
+ fsuuid="$(uuidgen --sha1 --namespace 93a870ff-8565-4cf3-a67b-f47299271a96 --name "${SOURCE_DATE_EPOCH}")"
+ _msg_info "Creating EROFS image, this may take some time..."
+ mkfs.erofs -U "${fsuuid}" "${airootfs_image_tool_options[@]}" -- "${image_path}" "${airootfs_dir}"
_msg_info "Done!"
}
_mkchecksum() {
_msg_info "Creating checksum file for self-test..."
cd -- "${isofs_dir}/${install_dir}/${arch}"
- sha512sum airootfs.sfs > airootfs.sha512
+ if [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" ]]; then
+ sha512sum airootfs.sfs > airootfs.sha512
+ elif [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" ]]; then
+ sha512sum airootfs.erofs > airootfs.sha512
+ fi
cd -- "${OLDPWD}"
_msg_info "Done!"
}
@@ -214,7 +231,11 @@ _mkchecksum() {
_mksignature() {
_msg_info "Signing SquashFS image..."
cd -- "${isofs_dir}/${install_dir}/${arch}"
- gpg --detach-sign --default-key "${gpg_key}" airootfs.sfs
+ if [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" ]]; then
+ gpg --detach-sign --default-key "${gpg_key}" airootfs.sfs
+ elif [[ -e "${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" ]]; then
+ gpg --detach-sign --default-key "${gpg_key}" airootfs.erofs
+ fi
cd -- "${OLDPWD}"
_msg_info "Done!"
}
@@ -634,6 +655,13 @@ _validate_requirements_airootfs_image_type_ext4+squashfs() {
_validate_requirements_airootfs_image_type_squashfs
}
+_validate_requirements_airootfs_image_type_erofs() {
+ if ! command -v mkfs.erofs; then
+ (( validation_error=validation_error+1 ))
+ _msg_error "Validating '${airootfs_image_type}': mkfs.erofs is not available on this host. Install 'erofs-utils'!" 0
+ fi
+}
+
# SYSLINUX El Torito
_add_xorrisofs_options_bios.syslinux.eltorito() {
xorrisofs_options+=(