ThisCalculator

Everyday

Build the ph4ntxm ISO on CachyOS

Updated · Standard formula, shown below

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).
  • git installed (comes default, but verify with git --version).
  • archiso package installed (we’ll install it in the steps).
  • Basic terminal comfort: you’ll run commands as a normal user, with sudo for installation steps.

Step-by-Step

  1. Update your system
    Open a terminal and run:
    sudo pacman -Syu
    Reboot if the kernel was updated, to ensure a clean build environment.
  2. Install archiso
    sudo pacman -S archiso
    This provides the mkarchiso tool and the default releng profile.
  3. 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 custom archiso profile.
  4. Enter the project directory
    cd ph4ntxm-iso
    List the contents to see the profiles folder and any README.
  5. Review the profile configuration
    Open profiles/x86_64/ (or the relevant profile directory) and inspect pacman.conf, packages.x86_64, and customize_airootfs.sh. Make sure the repository URLs and package names are valid for your current Arch/CachyOS mirror.
  6. 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/output with a directory you want the ISO in (e.g., ~/iso). The -w flag sets the working directory; use a location with plenty of space. The build takes 10–30 minutes depending on your CPU and internet speed.
  7. Verify the output
    After the build finishes, you’ll see a message like Build completed successfully. Check the output directory for a file named ph4ntxm-*.iso.
  8. 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 sudo is 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.conf and packages.x86_64, not the parent directory.
  • Insufficient disk space – The temporary working directory (-w) can grow to several GB. Check with df -h before 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_64 file accordingly.

Tips

  • Use a clean working directory each time. If a build fails, delete the -w directory 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 Server lines in the profile’s pacman.conf to a fast mirror for your region.
  • Consider using mkarchiso -v to 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.