Skip to content

Instantly share code, notes, and snippets.

@p7cq
Last active November 5, 2024 10:37
Show Gist options
  • Save p7cq/4f6e1e69b82a865a3ae4593ae124b6bf to your computer and use it in GitHub Desktop.
Save p7cq/4f6e1e69b82a865a3ae4593ae124b6bf to your computer and use it in GitHub Desktop.
Create Arch Linux ISO with ZFS builtin

Create an Arch Linux ISO with ZFS builtin

The following will create an Arch Linux installation ISO with LTS kernel and ZFS builtin. Based on the ZFS on Arch Linux project.

Create a working directory

sudo mkdir -p /local/zfs
sudo chown user:group /local/zfs

Build ZFS

Clone archzfs and build current kernel. See References.

Install clean-chroot-manager:

cd /local/zfs
git clone https://aur.archlinux.org/clean-chroot-manager.git
cd clean-chroot-manager
makepkg -si

Configure clean-chroot-manager:

sudo ccm64 p

Edit ~/.config/clean-chroot-manager.conf:

CHROOTPATH64="/local/zfs/.buildroot"
# ...
REPO="/local/zfs/repo"
REPO_NAME='zfs'
# ...

Create paths:

mkdir /local/zfs/{.buildroot,repo}

Clone archzfs:

cd /local/zfs
git clone https://github.com/archzfs/archzfs.git
cd archzfs

Edit conf.sh:

  • zfs_src_hash - must match the SHA 256 hash of the source tarball (e.g., zfs-2.2.6.tar.gz) for the version specified in openzfs_version
  • zfs_rc_src_hash - same as above
  • email - change to something else
  • makepkg_nonpriv_user - change to current user

Example:

openzfs_version="2.2.6"
openzfs_rc_version="2.3.0-rc1"

zfs_src_hash="c92e02103ac5dd77bf01d7209eabdca55c7b3356aa747bb2357ec4222652a2a7"
zfs_rc_src_hash="a74b54788640629b426bd3ab3f2484e62c4620e899c92096bc8ef5fed1360a0a"
# ...
email="[email protected]"
# ...
makepkg_nonpriv_user=user

Build ZFS:

sudo ./build.sh -s utils lts update make

-s: do not build git packages

Create ISO

Install archiso.

Create a working directory:

mkdir -p /local/zfs/archiso/work

Copy an existing profile:

cp -r /usr/share/archiso/configs/releng /local/zfs/archiso/profile
cd /local/zfs/archiso/profile

Edit packages.x86_64:

  • change linux to linux-lts
  • add ZFS packages: zfs-linux-lts, zfs-linux-lts-headers, zfs-utils

Edit /local/zfs/archiso/profile/pacman.conf to add the local repo created earlier. At the end of file, uncomment the custom repo then change it to:

[zfs]
SigLevel = Optional TrustAll
Server = file:///local/zfs/repo

In profiledef.sh, change iso_name to archlinux-zfs.

Build ISO:

sudo mkarchiso -v -w /local/zfs/archiso/work -o /local/zfs /local/zfs/archiso/profile

The ISO should now be available in /local/zfs.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment