Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fri Oct 22 07:51:28 EDT 2010
- In this file I will try to clean up all of my garbled note files into one
- coherent one. I'm sure I will miss something here but this list will be
- fairly comprehensive of what must be done in order to run EMC2 on
- a bare Debian system. I used about 5 GB (4.5 actually) on my root
- partition to get EMC2 installed. That is for my total system.
- Install minimal Debian.
- #aptitude update && aptitude safe-upgrade
- Might need this later:
- #hwinfo > MySystem.txt ; less MySystem.txt
- Strip it down even more.
- #update-rc.d -f cups remove
- #update-rc.d -f gdm remove
- $echo "exec fluxbox" > ~/.xinitrc
- At a console prompt use the command startx to get into X Window.
- #apt-get remove network-manager
- #update-rc.d -f avahi-daemon remove
- #/etc/init.d/networking restart
- Configure system so it will boot a different kernel:
- #e2label /dev/hda1 h1p1
- #e2label /dev/hda3 h1p3
- #swapoff -a
- #mkswap -L h1d2 /dev/hda2
- #swapon
- How cnc is partitioned:
- $df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/hda1 14G 3.7G 9.5G 28% /
- tmpfs 253M 0 253M 0% /lib/init/rw
- udev 10M 620K 9.4M 7% /dev
- tmpfs 253M 0 253M 0% /dev/shm
- /dev/hda3 59G 213M 56G 1% /home
- #gedit /etc/fstab
- # <file system> <mount point> <type> <options> <dump> <pass>
- proc /proc proc defaults 0 0
- LABEL=h1p1 / ext2 errors=remount-ro 0 1
- LABEL=h1p3 /home ext2 defaults 0 2
- LABEL=h1p2 none swap sw 0 0
- /dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
- /dev/hdd /media/cdrom1 udf,iso9660 user,noauto 0 0
- /dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
- ############################################
- #gedit /boot/grub/menu.lst
- and change the line:
- # kopt=root=/dev/hda1 ro
- to
- # kopt=root=LABEL=h1d1 ro
- #update-grub
- #update-initramfs -u -k all
- $sudo -i
- #aptitude update && aptitude safe-upgrade
- #aptitude install \
- kernel-package \
- build-essential \
- dh-make \
- module-assistant \
- libncurses5-dev \
- zlib1g-dev \
- dh-kpatches \
- fakeroot \
- autoconf \
- dctrl-tools
- #touch /etc/udev/rules.d/92-rtai.rules
- /etc/udev/rules.d/92-rtai.rules
- ACTION!="add|change", GOTO="rtai_end"
- KERNEL=="rtf*", MODE="0666"
- KERNEL=="rtai*", MODE="0666"
- LABEL="rtai_end"
- #gedit /etc/security/limits.conf
- * hard memlock 8192
- #adduser paulcnc src
- #exit
- Get kernel source and install it:
- $mkdir rtai
- $cd rtai
- $wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.5.tar.bz2
- $tar xjf linux-2.6.30.5.tar.bz2 -C /usr/src
- $cd /usr/src
- $ln -s linux-2.6.30.5/ /usr/src/linux
- Getting the RTAI source
- $wget http://linuxcnc.org/experimental/lenny/rtai_3.7.1.orig.tar.gz
- $tar zxf rtai_3.7.1.orig.tar.gz
- Getting the Debianization patch
- $wget http://linuxcnc.org/experimental/lenny/rtai_3.7.1-2.diff.gz
- $cd rtai-3.7.1/
- $gunzip -c ../rtai_3.7.1-2.diff.gz | patch -p1 --dry-run
- $gunzip -c ../rtai_3.7.1-2.diff.gz | patch -p1
- $chmod u+x debian/rules
- Building the packages.
- $dpkg-buildpackage -rfakeroot -uc
- Installing the RTAI packages.
- $cd ..
- #dpkg -i librtai1_3.7.1-2_i386.deb
- #dpkg -i librtai-dev_3.7.1-2_i386.deb
- #dpkg -i rtai-source_3.7.1-2_i386.deb
- #exit
- Building the kernel packages.
- $cd /usr/src/linux
- $make-kpkg clean
- $time fakeroot make-kpkg --initrd --append-to-version -rtai --revision r1 --added-patches rtai --config menuconfig kernel-image kernel-headers kernel-source
- Here I screwed up royally but eventually managed to get a kernel that ran.
- Probably not a very good idea:
- $make mrproper
- Also not a very good idea:
- $make allnoconfig
- I didn't try it but if it works it sounds good:
- $make localmodconfig
- How to search for what you think you need in the kernel:
- $grep -i ipipe .config
- CONFIG_IPIPE=y
- $find -type f -name Makefile | xargs grep CONFIG_IPIPE
- ./arch/x86/kernel/Makefile:obj-$(CONFIG_IPIPE) += ipipe.o
- then use / to search in the make menuconfig menu
- Close to what I picked for my kernel configuration:
- General setup --->
- [*] Prompt for development and/or incomplete code/drivers
- [*] Automatically append version information to the version strin
- Kernel compression mode (Bzip2) --->
- [*] Support for paging of anonymous memory (swap)
- [*] System V IPC
- [*] POSIX Message Queues
- [*] BSD Process Accounting
- [*] Initial RAM filesystem and RAM disk (initramfs/initrd) suppor
- [*] Strip assembler-generated symbols during link
- [*] Enable loadable module support --->
- [*] Forced module loading
- [*] Module unloading
- -*- Enable the block layer --->
- [*] Support for large block devices and files
- [*] Block layer SG support v4
- IO Schedulers --->
- <M> Anticipatory I/O scheduler
- Processor type and features --->
- Processor family (Pentium-III/Celeron(Coppermine)/Pentium-III
- Preemption Model (Preemptible Kernel (Low-Latency Desktop))
- [*] Interrupt pipeline < Help > Symbol: IPIPE [=y]
- [*] Maintain code compatibility with older releases (NEW)
- [*] Local APIC support on uniprocessors
- High Memory Support (X) off
- [*] MTRR (Memory Type Range Register) support
- [*] x86 PAT support <-- disable if freeze up
- Timer frequency (300 HZ) --->
- [ ] Check for low memory corruption <-- (I can try this after things work)
- [*] Reserve low 64K of RAM on AMI/Phoenix BIOSen
- Power management and ACPI options --->
- [*] Power Management support
- [*] Dock
- Bus options (PCI etc.) --->
- [*] PCI support
- PCI access mode (Any) --->
- [*] Interrupts on hypertransport devices (NEW)
- [*] ISA support
- Executable file formats / Emulations --->
- [*] Kernel support for ELF binaries
- [*] Networking support --->
- Networking options --->
- <M> Unix domain sockets
- [*] TCP/IP networking
- <*> IP: IPsec transport mode (NEW)
- <*> IP: IPsec tunnel mode (NEW)
- <*> IP: IPsec BEET mode (NEW)
- [*] Large Receive Offload (ipv4/tcp) (NEW)
- <*> INET: socket monitoring interface (NEW)
- <M> The IPv6 protocol (NEW) --->
- Device Drivers --->
- Generic Driver Options --->
- [*] Select only drivers that don't need compile-time external fir
- -*- Userspace firmware loading support
- -*- Plug and Play support --->
- <M> Parallel port support --->
- <M> PC-style hardware
- [*] IEEE 1284 transfer modes
- [*] Block devices --->
- <M> Normal floppy disk support
- <M> Loopback device support
- <M> Network block device support
- {change this!}
- <M> ATA/ATAPI/MFM/RLL support --->
- <M> generic ATA/ATAPI disk support (NEW)
- [*] ATA disk support (NEW)
- <M> Include IDE/ATAPI CDROM support
- [*] IDE ACPI support
- <M> generic/default IDE chipset support
- <M> Generic PCI IDE Chipset Support
- <M> Intel PIIX/ICH chipsets support
- {go with this:}
- { [*] Serial ATA (prod) and Parallel ATA (experimental) drivers -- }
- SCSI device support --->
- <M> SCSI device support
- [*] legacy /proc/scsi/ support (NEW)
- <M> SCSI generic support
- [*] SCSI low-level drivers (NEW) --->
- <M> I2O device support --->
- [*] Network device support --->
- <M> Dummy net driver support
- [*] Ethernet (10 or 100Mbit) --->
- [*] EISA, VLB, PCI and on board controllers
- <M> PCI NE2000 and clones support (see help) ne2k-pci
- say Y and read the Ethernet-HOWTO, available from
- <http://www.tldp.org/docs.html#howto>.
- Input device support --->
- -*- Generic input layer (needed for keyboard, mouse, ...)
- [*] Provide legacy /dev/psaux device
- [*] Mice --->
- <M> PS/2 mouse
- [*] Miscellaneous devices --->
- <M> PC Speaker support
- Character devices --->
- Serial drivers --->
- <M> 8250/16550 and compatible serial support
- -*- Unix98 PTY support
- <M> Parallel printer support
- <M> Support for user-space parallel port device drivers
- <M> Hardware Random Number Generator Core support
- <M> Intel HW Random Number Generator support
- <M> Hardware Random Number Generator Core support
- <M> Intel HW Random Number Generator support (NEW)
- Graphics support --->
- <M> /dev/agpgart (AGP Support) --->
- <M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI suppor
- <M> Support for frame buffer devices --->
- <M> ATI Rage128 display support ( note this messes up EMC2 )
- [*] Support for backlight control
- Console display driver support --->
- -*- VGA text console
- [*] USB support --->
- <M> Real Time Clock --->
- <M> PC-style 'CMOS' (NEW)
- File systems --->
- <M> Second extended fs support
- [*] Inotify file change notification support
- [*] Inotify support for userspace (NEW)
- CD-ROM/DVD Filesystems --->
- <M> ISO 9660 CDROM file system support
- [*] Microsoft Joliet CDROM extensions
- Pseudo filesystems --->
- -*- /proc file system support
- [*] /proc/kcore support
- [*] Virtual memory file system support (former shm fs)
- Library routines --->
- {M} CRC32 functions
- I'm sure in all of the excitement I missed a few things but it is close.
- reboot and cross your fingers!
- #less MySystem.txt
- might help
- Along with
- #dmesg
- and
- #less /var/log/messages
- Anyhow once you have a kernel that runs and does what you want it to
- (took me about 6 tries) Then you can move on.
- $cd /usr/src
- $tar jxf rtai-source.tar.bz2
- $cd /usr/src/linux
- $fakeroot make-kpkg --append-to-version -rtai --added-modules rtai --config menuconfig modules_image
- For EMC2 2.3 and newer, enable CONFIG_RTAI_MATH parameter.
- Base system ---> Other features ---> Mathfuns support in kernel ---> enabled
- Default values are OK for other parameters. Save and exit.
- $sudo -i
- #cd /usr/src
- #dpkg -i rtai-modules-2.6.30.5-rtai_3.7.1-2+r1_i386.deb
- or
- #dpkg -i rtai-modules-2.6.30.5-rtai-cnc_3.7.1-2+r6_i386.deb
- #cd /usr/src/linux
- #cp Module.symvers Module.symvers.old
- #cat /usr/realtime/modules/Module.symvers >> Module.symvers
- Adjust to your kernel name:
- #ln -s /usr/realtime/modules/ /lib/modules/2.6.30.5-rtai-cnc/rtai
- #depmod -a
- cnc:~# ls /dev/rtai
- ls: cannot access /dev/rtai: No such file or directory
- I found this script in the RTAI documentation and gave it a shot:
- #touch restoreRT.sh
- #gedit restoreRT.sh
- cnc:~# cat restoreRT.sh
- ------------ copy from here -------------------------
- #!/bin/sh
- if test \! -c /dev/rtai_shm; then
- mknod -m 666 /dev/rtai_shm c 10 254
- fi
- for n in `seq 0 9`; do
- f=/dev/rtf$n
- if test \! -c $f; then
- mknod -m 666 $f c 150 $n
- fi
- done
- -------------------- to here ----------------------------
- #chmod +x restoreRT.sh
- #./restoreRT.sh
- Marvel at incomprehensible numbers for a while:
- #cd /usr/realtime/testsuite/kern/latency/; time ./run
- #cd /usr/realtime/testsuite/kern/preempt/; time ./run
- #cd /usr/realtime/testsuite/kern/switches/; ./run
- If the above really fascinates you go through
- /usr/realtime/testsuite/user
- as well to compare and contrast the differences. Or not.
- OK back to installing EMC2
- Get everything else you need to build EMC2:
- aptitude install git-core \
- gitk \
- git-gui \
- autoconf \
- tk-dev \
- bwidget \
- build-essential \
- gettext \
- python-dev \
- libglu1-mesa-dev \
- libxmu-dev \
- libgtk2.0-dev \
- libgnomeprintui2.2-dev \
- libxaw7-dev \
- libncurses5-dev \
- libreadline5-dev \
- python-tk \
- python-imaging \
- python-imaging-tk \
- python-numarray \
- pciutils \
- libpci-dev \
- python-glade2 \
- python-xml \
- bc \
- libpth-dev \
- lyx \
- texlive-extra-utils \
- groff
- Or:
- aptitude install git-core gitk git-gui autoconf tk-dev bwidget build-essential gettext python-dev libglu1-mesa-dev libxmu-dev libgtk2.0-dev libgnomeprintui2.2-dev libxaw7-dev libncurses5-dev libreadline5-dev python-tk python-imaging python-imaging-tk python-numarray pciutils libpci-dev python-glade2 python-xml bc
- aptitude install libpth-dev lyx texlive-extra-utils groff
- Aptitude will install a bunch of other junk besides that list to satisfy
- dependencies.
- $mkdir ~/EMC2
- $cd ~/EMC2
- $ wget http://downloads.sourceforge.net/project/emc/emc2/2.4.x/emc2_2.4.4/emc2_2.4.4.tar.gz
- $ tar zxf emc2_2.4.4.tar.gz
- $ cd emc2_2.4.4/src/hal/drivers
- $ sed -i 's/pci_find_device/pci_get_device/g' *.c
- $ cd ../..
- $ ./autogen.sh
- $ ./configure --enable-run-in-place
- $ make clean
- $ make
- $ sudo make setuid
- Go to the top directory of emc2-2.4.4
- $ cd ..
- If you're religious now might be a good time to pray.
- $ . scripts/emc-environment ; scripts/emc
- All of this junk took me about a week to figure out and the information was
- gathered from a variety of sources but mainly is from the Lenny pages
- at linuxcnc.org I just fleshed out some of the steps that got me stuck a bit
- more. With this file I could probably do it in a sitting or two.
- I did all of this to avoid some of the overhead in Ubuntu on my antique
- machine I have dedicated to running EMC2. In the end I didn't actually
- gain anything in latency. Machines are what they are. But I might not hit
- those spikes as often. I don't know. I still like Debian more than Ubuntu.
- Other stuff I did to this system to make it a bit more usable to me include:
- #aptitude install mesa-utils xlibmesa-dri xlibmesa-gl xlibmesa-glu
- #aptitude install htop
- #aptitude install bootchart
- #usermod -a -G video paulcnc
- #gedit /etc/apt/sources.list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement