HOWTO: Gentoo for LinuxCNC

From OpenLunchbox Wiki
Revision as of 05:43, 11 October 2023 by NTULINUX (talk | contribs) (Major update)
Jump to navigation Jump to search

Prerequisites

For using the installer, you must have the following:

  • btrfs-progs
  • dosfstools
  • e2fsprogs
  • f2fs-tools
  • parted
  • xfsprogs

IMPORTANT: If using SystemRescue, any block device will easily be susceptible to destruction. It is your responsibility to ensure the correct device is selected upon execution! The author of this wiki and the installer is not responsible for any damages or loss of data. To ensure the integrity of your data, unplug any and all devices that you will not be using for the install in advance.

There is no support for RAID or LVM configurations.

A working internet connection is also required. This is not only to fetch the installer, but also because the installer downloads the required files for the Gentoo system (~1.2GB of data.)

Downloading SystemRescue

If you intend on using SystemRescue, download the latest version from here:

https://www.system-rescue.org/Download/

After downloading the iso, you must install syslinux. On Debian, syslinux-utils is required instead. This is to modify the iso to ensure the boot works properly.

SystemRescue for UEFI

isohybrid --uefi <path-to-System-Rescue.iso>

Example:

isohybrid --uefi /home/lcnc/systemrescue-10.02-amd64.iso

SystemRescue for Legacy BIOS

isohybrid -s 63 -h 255 <path-to-System-Rescue.iso>

Example:

isohybrid -s 63 -h 255 /home/lcnc/systemrescue-10.02-amd64.iso

Burning SystemRescue to USB

Before inserting the USB device that will be used as SystemRescue, as root, run:

fdisk -l

Or:

lsblk

To list available block devices.

After inserting the USB device, re-run the same command again. The device that did not appear before is most likely the intended target. Do not specify a partition. If for example you have:

/dev/sda1
/dev/sda2
/dev/sda3

Then after plugging in the USB device, you have:

/dev/sda1
/dev/sda2
/dev/sda3
/dev/sdb1
/dev/sdb2

You would likely use /dev/sdb as the USB device.

IMPORTANT: All data on the device will be destroyed so proceed with caution!

As root, run:

dd if=/path/to/system-rescue.iso of=/dev/<USB block device> bs=8M oflag=sync status=progress

Example:

dd if=/path/to/system-rescue.iso of=/dev/sdb bs=8M oflag=sync status=progress

Fetching the installer

In a terminal, run the following three commands:

git clone https://github.com/NTULINUX/gentoo_backup.git
cd gentoo_backup	
git checkout linuxcnc

Running the installer

Once you are in the gentoo_backup directory, simply run:

./installer.sh

Upon installation, you will be asked some questions in regards to UEFI or legacy BIOS for GRUB, filesystem type and filesystem sizes. If you specify any erroneous options, or a filesystem size that is too large for the block device, the script will fail.

Finishing up

You should see a message if the program ran successfully. Reboot and select the Gentoo installation media.

The password for root and lcnc (the regular Linux user) is: gentoo-cnc123

Use NetworkManager to add or modify network settings. A working internet connection is required for the remaining steps. Due to licensing restrictions (something to do with GNU readline) LinuxCNC cannot be pre-packaged in binary form.

You will need to run the following to compile and install LinuxCNC:

sudo emerge --sync
sudo emerge linuxcnc

After installation, you must log out and log back in again for the new environment variables (TCLLIBPATH) to be set.

LinuxCNC will show up under "Accessories" in the applications menu, as well as latency histogram, latency test and some others.