Build the ph4ntxm ISO on CachyOS
This guide walks you through building the ph4ntxm ISO from source using CachyOS as your host system. ph4ntxm is a custom Linux distribution based on Arch Linux, and its ISO is built with archiso. By the end, you’ll have a bootable .iso file ready to test in a VM or write to a USB drive. You’ll need a working CachyOS installation with an internet connection, about 10 GB of free disk space, and basic familiarity with the terminal.
What You’ll Need
- A CachyOS system (any edition) with an active internet connection.
- At least 10 GB of free disk space (the build process downloads packages and creates temporary files).
gitinstalled (comes default, but verify withgit --version).archisopackage installed (we’ll install it in the steps).- Basic terminal comfort: you’ll run commands as a normal user, with
sudofor installation steps.
Step-by-Step
- Update your system
Open a terminal and run:sudo pacman -Syu
Reboot if the kernel was updated, to ensure a clean build environment. - Install archiso
sudo pacman -S archiso
This provides themkarchisotool and the default releng profile. - Clone the ph4ntxm repository
git clone https://github.com/ph4ntxm/ph4ntxm-iso.git
If the repository URL differs (check the project’s official page), adjust accordingly. This downloads the customarchisoprofile. - Enter the project directory
cd ph4ntxm-iso
List the contents to see theprofilesfolder and any README. - Review the profile configuration
Openprofiles/x86_64/(or the relevant profile directory) and inspectpacman.conf,packages.x86_64, andcustomize_airootfs.sh. Make sure the repository URLs and package names are valid for your current Arch/CachyOS mirror. - Build the ISO
Run the build command from the project root:sudo mkarchiso -v -w /tmp/archiso-tmp -o /path/to/output profiles/x86_64
Replace/path/to/outputwith a directory you want the ISO in (e.g.,~/iso). The-wflag sets the working directory; use a location with plenty of space. The build takes 10–30 minutes depending on your CPU and internet speed. - Verify the output
After the build finishes, you’ll see a message likeBuild completed successfully. Check the output directory for a file namedph4ntxm-*.iso. - Test the ISO (optional but recommended)
Boot it in a virtual machine (e.g., QEMU, VirtualBox) to confirm it works before writing to physical media.
Common Mistakes
- Running mkarchiso as root without sudo – The tool requires root privileges, but using
sudois fine. Running as a normal user will fail with permission errors. - Not updating the system first – Outdated packages can cause conflicts with the archiso scripts or the packages being pulled into the ISO.
- Using the wrong profile path – Ensure you point to the directory containing
pacman.confandpackages.x86_64, not the parent directory. - Insufficient disk space – The temporary working directory (
-w) can grow to several GB. Check withdf -hbefore starting. - Ignoring package name changes – If the repository is old, package names may have changed. The build will fail with “target not found�. Update the
packages.x86_64file accordingly.
Tips
- Use a clean working directory each time. If a build fails, delete the
-wdirectory and start fresh to avoid stale caches. - Keep the output directory separate from the working directory; the ISO is large and you don’t want it mixed with temporary files.
- If you modify the profile, test incrementally. Change one thing (e.g., add a package) and rebuild rather than making many changes at once.
- Use a fast mirror for pacman. CachyOS has its own mirrors, but for the ISO build, the profile uses Arch repositories. You can set
Serverlines in the profile’spacman.confto a fast mirror for your region. - Consider using
mkarchiso -vto see verbose output. It helps pinpoint where a failure occurs.
Troubleshooting
Build fails with “ERROR: Failed to install packages to new root�
This usually means a package name is wrong or a repository is unreachable. Check the packages.x86_64 file for typos, and verify that the repository URLs in pacman.conf are accessible (try curl on them). Update the package list if needed.
“ERROR: Failed to create squashfs�
This is often due to insufficient disk space or a corrupted cache. Free up space and delete the working directory before retrying.
Kernel panic or boot failure when testing the ISO
Ensure the ISO was built with the correct architecture (x86_64). If you modified the kernel command line in the profile, double-check the parameters. Also test in a VM with enough RAM (2 GB minimum).
The build hangs at “Downloading packages�
Network issue. Press Ctrl+C, then rerun with a different mirror or check your internet connection. You can also try sudo pacman -Syy to refresh the host’s package database.
“mkarchiso: command not found�
You haven’t installed archiso, or you’re not running the command with the correct path. Install it with sudo pacman -S archiso and ensure you’re in the profile directory.
Frequently Asked Questions
Q: Can I build the ISO on a non-Arch system?
A: No, archiso is designed to run on Arch-based systems. CachyOS is Arch-compatible, so it works. Other distros would need a chroot environment.
Q: How long does the build take?
A: Typically 10–30 minutes, depending on your CPU, RAM, and internet speed. The first build downloads many packages, so it may take longer.
Q: Can I customize the ISO further?
A: Yes, edit the packages.x86_64 file to add/remove packages, and modify customize_airootfs.sh to run custom commands inside the live environment.
Q: Do I need to be root to run mkarchiso?
A: Yes, it requires root privileges. Use sudo as shown.
Q: The ISO builds but doesn’t boot on my hardware. What’s wrong?
A: Check the boot parameters in the profile. Some hardware requires specific kernel modules. You can add them to the MODULES array in mkinitcpio.conf within the profile.
Q: Can I write the ISO to a USB drive with dd?
A: Yes, after building, use sudo dd if=ph4ntxm.iso of=/dev/sdX bs=4M status=progress (replace /dev/sdX with your USB device). Be careful to select the correct device.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.