Skip to content

Instantly share code, notes, and snippets.

@ohmantics
Created September 11, 2023 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohmantics/0f65deaf28427058fded1d415677484d to your computer and use it in GitHub Desktop.
Save ohmantics/0f65deaf28427058fded1d415677484d to your computer and use it in GitHub Desktop.
Procedure for building zectl for Proxmox 7
# Make a new Proxmox 7.4 VM
# Set the processor type to 'Host'
# Add a single disk. I use a VirtIO Block device.
# Pick OVMF (UEFI)
# On first boot, enter the BIOS and disable Secure Boot
# When installing, pick ZFS RAID0
# After reboot, ssh in so you can paste
rm /etc/apt/sources.list.d/pve-enterprise.list
echo 'deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription' > /etc/apt/sources.list.d/pve-no-subscription.list
apt update
apt install build-essential git libzfslinux-dev libzfs4linux cmake check
apt install linux-headers-amd64 linux-image-amd64 linux-headers-5.10.0-20-amd64
apt install pkg-config libblkid-dev zlib1g-dev
git clone https://github.com/johnramsden/zectl.git
cd zectl/
git remote add truenas https://github.com/truenas/zectl.git
git remote update
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DPLUGINS_DIRECTORY=/usr/share/zectl/libze_plugin -DCMAKE_BUILD_TYPE=Debug
make
mkdir -p root/usr/bin
mkdir -p root/usr/share/zectl/libze_plugin
mkdir -p root/usr/include/libze
mkdir -p root/usr/lib
cp src/zectl root/usr/bin/
cp lib/libze/libze.so root/usr/lib/
cp lib/libze_plugin/libze_plugin_systemdboot.so root/usr/share/zectl/libze_plugin/
cp ../include/libze/libze.h root/usr/include/libze/
cp ../include/libze/libze_* root/usr/include/libze/
cd root
tar zcvf ../zectl.tgz .
# Copy the tarball to the target Proxmox install
cd /
tar zxvf /root/zectl.tgz
# Test
zectl list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment