EmcOnGentoo - rmu75/linuxcnc-wiki GitHub Wiki
https://openlunchbox.com/mw19/index.php/HOWTO:_Gentoo_for_LinuxCNC
The information below on this page is very outdated, incomplete and will not work like this without a lot of work.
The documentation below is being kept for historical purposes only.
GentooPreemtrt is also outdated.
This page describe how to compile and install EMC2 on Gentoo using portage. This howto is targeted for experienced Linux user. User are expected to atleast be able to compile a kernel without much difficulty. For others, please see Installing_EMC2.
Note: The provided ebuilds here is created with minimal efforts. It's only tested on x86 and with default package USE flags. Some dependencies might be missing, please update this page if you found any.
|
First, create a local overlay mkdir /usr/local/portage
Then, add overlay to /etc/make.conf PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage"
Next, create folder for EMC2 and RTAI ebuilds mkdir /usr/local/portage/sys-kernel/rtai-sources mkdir /usr/local/portage/sci-misc/rtai mkdir /usr/local/portage/sci-misc/emc
Note: Skip RTAI kernel and library installation step if you only need EMC2 with simulation.
Save the following content to /usr/local/portage/sys-kernel/rtai-sources/rtai-sources-2.6.34.5-r4.ebuild
EAPI="2" K_SECURITY_UNSUPPORTED="1" K_DEBLOB_AVAILABLE="1" ETYPE="sources" inherit kernel-2 detect_version |
Next, download RTAI kernel patches from RTAI CVS 1, and save it under /usr/local/portage/sys-kernel/rtai-sources/files
Then, create manifest files for rtai-sources ebuild. ebuild /usr/local/portage/sys-kernel/rtai-sources/rtai-sources-2.6.34.5-r4.ebuild manifest
Unmask the rtai-sources. Edit /etc/portage/package.keywords and add new line with: sys-kernel/rtai-sources **
Then, install the rtai kernel source emerge -av rtai-sources
Select RTAI kernel as default then build the kernel with genkernel or make menuconfig eselect kernel list (this will show RTAI kernel index number> eselect kernel set <RTAI kernel index number> genkernel --menuconfig all
Update grub to point to new rtai kernel image
To upgrade rtai kernel, you need to copy the rtai-sources ebuild and rename it to proper versioning scheme. You'll also need to edit the ebuild and change MY_PV value to correct patch version. The get latest patch version, visit RTAI CVS 1 , download the patch and save it under /usr/local/portage/sys-kernel/rtai-sources/files
For example, if the patches is named hal-linux-2.6.35.7-x86-2.7-04.patch:
New ebuild name: rtai-sources-2.6.35.7-r<something>.ebuild MY_PV value: 2.7-04 r<something> value: can be any number and useful if you want to bump package when new RTAI patch released but still using the same kernel version
Finally, you'll need to update manifest for the new ebuild. ebuild /usr/local/portage/sys-kernel/rtai-sources/rtai-sources-2.6.36.7-r1.ebuild manifest
Then follow the Installing RTAI kernel Finally, rebuild all related modules with module-rebuild (Install with "emerge -av module-rebuild" if you haven't install it) module-rebuild rebuild That will rebuild RTAI and EMC2 modules to match with new kernel
Before continuing, you must reboot the system with RTAI kernel. Next, save the following content to /usr/local/portage/sci-misc/rtai/rtai-9999.ebuild
EAPI="3" |
As usual, create the manifest for the new ebuild. ebuild /usr/local/portage/sci-misc/rtai/rtai-9999.ebuild manifest
Note: In theory, this ebuild will allow user to enable or disable any RTAI modules based on USE flag. But in practice, it's never tested so it might not work with certain USE flags combination.
To install, unmask the rtai ebuild first. Edit /etc/portage/package.keywords and add the following line: sci-misc/rtai **
Since the rtai will get installed automatically by EMC2 dependencies, we'll skip manual install and go to EMC2 installation.
As this is a live ebuild, simply rebuild the package and portage will fetch a source for the latest commit in RTAI CVS. Also, user can use ECVS_REVISION variable to build package to specific CVS commit revision.eg: ECVS_REVISION=1000 emerge -1 rtai (this will build rtai at commit 1000)
Save the following content to /usr/local/portage/sci-misc/emc/emc-9999.ebuild
EAPI="3" |
Create the manifest. ebuild /usr/local/portage/sci-misc/emc/emc-9999.ebuild manifest
While the EMC2 main program itself doesn't need GNOME libraries, some tools bundle with EMC2 such as stepconf and ladder diagram printing do need GNOME libraries to work. If you want to use those tools, maybe it's better to install GNOME first. Skip this step if you don't need such function and prefer minimalistic setup. emerge -av gnome
To install EMC2, unmask the ebuild first. Edit /etc/portage/package.keywords and add the following line: sci-misc/emc **
Next, if you previously installed rtai manually these files should be removed.
Next, install EMC2 emerge -av emc RTAI library will automatically installed as a dependecies.
To enable simulation only, set USE flag to simulator. This will skip RTAI kernel and library installation. Edit /etc/portage/package.use, add new line sci-misc/emc simulator
As this is a live ebuild, simply rebuild the package and portage will fetch a source for the latest commit in EMC2 GIT. Also, user can use EGIT_COMMIT variable to build package to specific GIT commit revision. eg: EGIT_COMMIT=db9bfd3653de23693db67ec5a0534e4d4ac97f7d emerge -1 emc (this will build emc at commit db9bfd3653de23693db67ec5a0534e4d4ac97f7d) There's also EGIT_BRANCH variable if user want to switch to another git branch