HOWTO: Gentoo for LinuxCNC: Difference between revisions

From OpenLunchbox Wiki
Jump to navigation Jump to search
Line 27: Line 27:
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.
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 ===
=== SystemRescue for UEFI (Recommended) ===


  isohybrid --uefi <path-to-System-Rescue.iso>
  isohybrid --uefi <path-to-System-Rescue.iso>
Line 98: Line 98:


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.
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.
If you wish to use the same USB device as SystemRescue, you must use the "copytoram" function. This can be selected when first booting into SystemRescue at the GRUB menu.
'''IMPORTANT: Theoretically, it should be possible to boot the Gentoo image off a USB device when specifying legacy BIOS during the install, however it fails to boot on the author's system. It is therefore suggested to specify UEFI during the installation for USB devices.'''
'''IMPORTANT: For NVMe devices, UEFI is required.'''


== Finishing up ==
== Finishing up ==

Revision as of 06:03, 11 October 2023

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.

IMPORTANT: It is strongly advised to backup all data before proceeding!

Prerequisites

For using the installer, you must have the following:

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

All of these are included in SystemRescue however these can all be installed on Debian 12/Bookworm. Versions of Debian older than 12/Bookworm will not work.

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 (Recommended)

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.

If you wish to use the same USB device as SystemRescue, you must use the "copytoram" function. This can be selected when first booting into SystemRescue at the GRUB menu.

IMPORTANT: Theoretically, it should be possible to boot the Gentoo image off a USB device when specifying legacy BIOS during the install, however it fails to boot on the author's system. It is therefore suggested to specify UEFI during the installation for USB devices.

IMPORTANT: For NVMe devices, UEFI is required.

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.