User:Ctag/CCS

From ArchWiki
< User:Ctag
Revision as of 12:46, 11 November 2017 by Lmx947 (talk | contribs) (/car/ccs-root -> /var/ccs-root)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

There are three installation methods:

Manual installation guide

Notes on installing Ti's Code Composer Studio V6.2

Why

CCS is released for Linux, but since ~January 2017 it is broken on Archlinux because glibc has been updated. Rather than roll back my entire system, I'm running CCS in a chroot jail, which is something I've never done before and am learning about as I go.

References in the wild:

http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/583306/2144268#pi316318=1

http://stackoverflow.com/questions/42960886/arch-linux-ccs-install-stuck-at-com-ti-debug

How

This method consumes ~6 gigabytes of space on my disk. FYI.

I'm using directions from here and modifying them to suite my needs.

Download CCS, good luck with Ti's POS website: http://processors.wiki.ti.com/index.php/Download_CCS#Code_Composer_Studio_Version_6_Downloads

Tip: it can get confusing when you're shelling multiple levels into a chroot (user -> root -> chroot -> new user) so to tell if you're in a chroot currently, run ls -di / and if the root directory has an inode other than 2, then you're in a chroot!

Example:

In chroot
# ls -di /
14286889 /
Normal system
$ ls -di /
2 /

Create a chroot:

# mkdir /var/ccs-root            # create an empty folder
# pacstrap -d /var/ccs-root base # Install a base archlinux filesystem to the chroot
# arch-chroot /var/ccs-root      # enter the chroot
## pacman -S vim                 # run this in the chroot

In the chroot, edit /etc/pacman.d/mirrorlist to use Archlinux Archive:

/etc/pacman.d/mirrorlist
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################

# With:       reflector --verbose --latest 40 --number 10 --sort rate --protocol http --save /etc/pacman.d/mirrorlist
# When:       2017-03-16 21:58:20 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2017-03-16 21:57:43 UTC
# Last Check: 2017-03-16 21:17:08 UTC

Server = https://archive.archlinux.org/repos/2016/12/05/$repo/os/$arch

Here I've set my chroot's system to be 'stuck' in December 2016. You can try different year/month/day values in that url.

Still in the chroot:

## pacman -Syyuu # force downgrade entire chroot jail
## pacman -U /var/cache/pacman/pkg/ca-certificates-utils-20170307-1-any.pkg.tar.xz # Retain newer certs in order to keep pacman working
## pacman -S xterm base-devel libstdc++5 glibc unzip libcanberra python2 dbus-glib chromium libusb-compat libxss lib32-glibc
## cd /lib
## ln -s libncursesw.so.6.0 libncurses.so.5
## useradd -m ctag

Copy the CCS tarball (web or standalone) into the new user's home directory. Chown it to the user, and then unpack it as the user.

On the host system:

$ xhost +local: # run as _not_ root

Now you should be able to open a window as the jailed user:

#$ cd CCS6.2.0.00050_linux-x64/
#$ ./ccs_setup_linux64_6.2.0.00050.bin

From there you should be free to run the IDE from the chroot. It's not a perfect solution, but it should be a little lighter on system resources than running a VM.

To be able to upload/debug from the chroot jail. I had to copy the udev rules over to my host system, restart udev, and also put the jailed 'ctag' user in the uucp group.

To make launching CCS easier, here are some shell scripts:

In main system:

launch_ccs.sh
#!/bin/bash
arch-chroot -u ctag:ctag /var/ccs-root /home/ctag/ccs.sh
/home/ctag/ccs.sh
#!/bin/bash
/home/ctag/ti/ccsv6/eclipse/ccstudio