User:Peter242/Gentoo for LinuxCNC

From Dallas Makerspace
Jump to: navigation, search

Gentoo for LinuxCNC

  • Boot from ISO
gentoo dolvm dosshd
  • Extract stage3
tar jxvf stage3-amd64-20141204.tar.bz2
  • Configure a mirror
echo 'GENTOO_MIRRORS=""' >> /mnt/gentoo/etc/portage/make.conf
  • Mount
mount /dev/<FIXME> /mnt/gentoo
swapon /dev/<FIXME>
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
  • Enter system
chroot /mnt/gentoo /bin/bash
source /etc/profile
  • Improve MAKE
echo 'MAKEOPTS="-j2"' >> /etc/portage/make.conf
  • Do initial emerge fix
  • Do full emerge fix
## Upgrade all installed packages, dependencies, and deep dependencies that are outdated or have USE flag changes:
emerge -uDN --with-bdeps=y @world
  • Install LVM2
emerge sys-fs/lvm2
  • Enable LVM2 at boot
rc-update add lvm boot
  • Install GRUB
emerge sys-boot/grub
  • Install Kernel
emerge sys-kernel/rt-sources
  • Build Kernel
cd /usr/src/linux
make mrproper
cat /etc/kernels/kernel-config-x86_64-3.14.25-rt-rt22 > .config
cat <<EOF >> /usr/src/linux/.config
while true;do echo;done | make oldconfig
make -j2 bzImage
  • Now emerge normal extras
emerge app-editors/vim sys-boot/grub sys-fs/lvm2 sys-kernel/rt-sources
emerge app-misc/screen app-portage/gentoolkit sys-block/parted dev-python/pypy net-misc/dhcpcd net-misc/ntp
  • Install dependencies for LinuxCNC compile:
emerge tcl dev-libs/libusb dev-libs/libmodbus tk dev-tcltk/bwidget dev-tcltk/tkimg tclx x11-libs/libXinerama
  • Need to recompile Python-2.7 to include TK (LinuxCNC seems to only support Python2)
USE="tk" emerge --newuse python:2.7
  • Install Boost
    • Either run the following as a one-time event
      • MAKEOPTS='-j1' USE='python python_targets=python2_7' emerge dev-libs/boost
    • Or configure portage to compile boost according to our specifications
mkdir -p /etc/portage/env/
cat > /etc/portage/env/boost.conf <<EOF
USE="$USE python python_targets=python2_7"
cat >> /etc/portage/package.env <<EOF
dev-libs/boost boost.conf
    • Fixup the boost library
ln -s /usr/lib64/ /usr/lib64/
  • Additional dependency installation
emerge x11-libs/libGLw media-libs/glu

Misc Resources