Skip to content

Instantly share code, notes, and snippets.

@zultron
Last active December 13, 2015 05:06
Show Gist options
  • Save zultron/23f821c979315cc0e0d1 to your computer and use it in GitHub Desktop.
Save zultron/23f821c979315cc0e0d1 to your computer and use it in GitHub Desktop.
@zultron's Dovetail Automata repo update tests

Machinekit: Simulate and test new DA package repo upgrades

This procedure simulates the Machinekit package upgrade flow when the deb.dovetail-automata.com APT repository is switched from the old to the new. The goal is a smooth upgrade with no changes to existing APT configurations.

See below for step-by-step instructions:

Test overview and goals

The steps below simulate this switch and update:

  • Purge any existing packages
    • Puts OS into known state
  • Install Machinekit packages from legacy repository
    • Simulates current user configurations
  • Point APT configuration to new repo and upgrade packages
    • Simulates repo switch-over and following upgrade

Check that goals are being met:

  • No problems with APT signing keys
    • New repo keys are unchanged
  • No problems updating to new Machinekit packages and dependencies
    • Esp. obsolete libzmq4 package is automatically removed and replaced with new libzmq3 package
  • No problems running Machinekit
    • New package builders are correctly building packages

WARNING: Packages will be removed and reinstalled; only perform these tests on a non-critical machine

Procedure for x86

WARNING: Packages will be removed and reinstalled; only perform these tests on a non-critical machine

Configure legacy repository

  • If the repo isn't currently configured, follow the machinekit.io documentation:

      sudo sh -c \
          "echo 'deb http://deb.dovetail-automata.com wheezy main' > \
          /etc/apt/sources.list.d/machinekit.list; \
          apt-get update ; \
          apt-get install dovetail-automata-keyring"
    

Clean out any existing packages

  • Check what packages are already installed

      $ dpkg-query -W linux-image-\* machinekit\* libzmq\*
    
    • All packages showing versions above will be removed below, except for non-RT vanilla kernel package linux-image-[ABI]-[ARCH]
  • Reboot into vanilla kernel

      $ sudo reboot
      [...select vanilla kernel in GRUB and boot]
      $ uname -r
    
    • Check for running vanilla kernel:
      • Wheezy: 3.2.0-4-[ARCH]
      • Jessie: 3.16.0-4-[ARCH]
  • Remove any installed RT kernel and Machinekit + dependency packages & verify

      $ sudo apt-get purge --auto-remove '(linux-(image|headers).*-(rt|xenomai|rtai)|machinekit)([-.][^.]*|.*-kernel-.*)?$'
      $ dpkg-query -W linux-image-\* machinekit\* libzmq\*
    
    • WARNING: check that the non-RT linux-image-* package is not removed
    • dpkg-query should show no version for any package (== all uninstalled)
  • Check that we can still reboot into default vanilla kernel

      $ sudo reboot
      [...vanilla kernel should automatically boot]
      $ uname -r
    
    • Double-check running vanilla kernel
      • Wheezy: 3.2.0-4-[ARCH]
      • Jessie: 3.16.0-4-[ARCH]

Install Machinekit RT_PREEMPT or Xenomai and kernel from legacy package repo

  • Configure legacy package repo in APT and verify

      $ sudo sed -i /etc/apt/sources.list.d/machinekit.list -e 's/builder2.zultron.com/deb.dovetail-automata.com/'
      $ sudo apt-get update
      $ cat /etc/apt/sources.list.d/machinekit.list
    
    • Verify deb.dovetail-automata.com in machinekit.list
  • From legacy repo: Install Machinekit RT_PREEMPT or Xenomai and matching kernel

    • RT_PREEMPT:

        $ sudo apt-get install '^(linux-image-rt-|machinekit-rt-preempt)'
        $ dpkg-query -W linux-image-\* machinekit\* libzmq\*
      
    • Xenomai:

        $ sudo apt-get install '^(linux-image-xenomai\.|machinekit-xenomai$)'
        $ dpkg-query -W linux-image-\* machinekit\* libzmq\*
      
    • Check that dpkg-query shows versions for the following packages:

      • All distros:
        • RT_PREEMPT: linux-image-rt-[ARCH], machinekit-rt-preempt
        • Xenomai: linux-image-xenomai-[ARCH], machinekit-xenomai
      • Wheezy: libzmq4
  • Reboot and check running kernel

      $ sudo reboot
      [...the just-installed kernel, *-rt-* or *-xenomai-*, should automatically boot]
      $ uname -r
    
    • Verify kernel version is for RT kernel
      • Wheezy x86 RT_PREEMPT: 3.2.0-4-rt-[ARCH]
      • Wheezy/Jessie x86 Xenomai: 3.8-1-xenomai.x86-[ARCH]

Upgrade Machinekit from new package repo

  • Configure new package repo in APT and verify

      $ sudo sed -i /etc/apt/sources.list.d/machinekit.list -e 's/deb.dovetail-automata.com/builder2.zultron.com/'
      $ sudo apt-get update
      $ cat /etc/apt/sources.list.d/machinekit.list
    
  • From new repo: Install (upgraded) Machinekit RT_PREEMPT or Xenomai and dependency packages

      $ sudo apt-get install --purge machinekit-rt-preempt # RT_PREEMPT
      $ sudo apt-get install --purge machinekit-xenomai    # Xenomai
      $ dpkg-query -W linux-image-\* machinekit\* libzmq\*
    
    • Check that dpkg-query shows versions (== installed) for the following packages:
      • All distros: libzmq3
      • All distros, RT_PREEMPT: linux-image-rt-[ARCH], machinekit-rt-preempt
      • All distros, Xenomai: linux-image-xenomai-[ARCH], machinekit-xenomai
    • Wheezy: Check no version (== uninstalled) for libzmq4
  • Basic run-time checks: latency-test or machinekit

      $ latency-test
      $ machinekit
    
    • Programs should run without error

    • Problems with run-time checks? Re-run with debug output as follows, pastebin /var/log/linuxcnc.log, report to list with link

      $ DEBUG=5 machinekit
      

Procedure for Beaglebone

WARNING: Packages will be removed and reinstalled; only perform these tests on a non-critical machine

Clean out any existing packages

  • Check what packages are already installed

      $ dpkg-query -W machinekit\* libzmq\*
    
    • All packages showing versions above will be removed below
  • Remove any installed Machinekit + dependency packages & verify

      $ sudo apt-get purge --auto-remove 'machinekit.*$'
      $ dpkg-query -W machinekit\* libzmq\*
    
    • dpkg-query should show no version for any machinekit or libzmq package (== all uninstalled)

Install Machinekit Xenomai from legacy package repo

  • Configure legacy package repo in APT and verify

      $ sudo sed -i /etc/apt/sources.list.d/machinekit.list -e 's/builder2.zultron.com/deb.dovetail-automata.com/'
      $ sudo apt-get update
      $ cat /etc/apt/sources.list.d/machinekit.list
    
    • Verify deb.dovetail-automata.com in machinekit.list
  • From legacy repo: Install Machinekit Xenomai

      $ sudo apt-get install machinekit-xenomai
      $ dpkg-query -W machinekit\* libzmq\*
    
    • Check that dpkg-query shows versions for the following packages:
      • machinekit-xenomai and libzmq4

Upgrade Machinekit from new package repo

  • Configure new package repo in APT and verify

      $ sudo sed -i /etc/apt/sources.list.d/machinekit.list -e 's/deb.dovetail-automata.com/builder2.zultron.com/'
      $ sudo apt-get update
      $ cat /etc/apt/sources.list.d/machinekit.list
    
  • From new repo: Install (upgraded) Machinekit Xenomai and dependency packages

      $ sudo apt-get install --purge machinekit-xenomai
      $ dpkg-query -W machinekit\* libzmq\*
    
    • Check that dpkg-query shows versions (== installed) for the libzmq3, machinekit-xenomai packages
    • Check that dpkg-query shows no versions (== uninstalled) for the libzmq4 package
  • Basic run-time checks: latency-test or machinekit

      $ latency-test
      $ machinekit
    
    • Programs should run without error

    • Problems with run-time checks? Re-run with debug output as follows, pastebin /var/log/linuxcnc.log, report to list with link

      $ DEBUG=5 machinekit
      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment