abhishek-kakkar / BeagleLogic

A Software Suite that implements a logic analyzer with the PRU on the BeagleBone / BeagleBone Black.
www.beaglelogic.net
GNU General Public License v3.0
465 stars 71 forks source link

Upgrading prebuilt image #26

Closed Vagabond closed 6 years ago

Vagabond commented 7 years ago

I've tried to update the git repo in the prebuilt image (both with simply updating git and also running install.sh) and it seems to break things badly. Is this still expected to work?

abhishek-kakkar commented 7 years ago

Did you run install.sh as-is or "install.sh --upgrade" (see http://docs.beaglelogic.net/en/latest/install.html#upgrading-an-existing-installation)?

Running install.sh as-is modifies /boot/uEnv.txt and if you run it more than once, your /boot/uEnv.txt needs fixing.

Can you also describe as to what is broken?

Vagabond commented 6 years ago

Sorry, I didn't have my beaglebone over the weekend.

First thing is that a git pull doesn't actually work out of the box:

debian@beaglebone:/opt/BeagleLogic$ sudo git pull
remote: Counting objects: 425, done.
remote: Total 425 (delta 129), reused 129 (delta 129), pack-reused 296
Receiving objects: 100% (425/425), 82.72 KiB | 0 bytes/s, done.
Resolving deltas: 100% (267/267), completed with 16 local objects.
From https://github.com/abhishek-kakkar/BeagleLogic
   2cdc9c6..3cea157  master     -> origin/master
 * [new branch]      4.4-dev    -> origin/4.4-dev
 * [new branch]      standalone -> origin/standalone
Auto-merging kernel/beaglelogic.h
Auto-merging kernel/beaglelogic.c
Auto-merging firmware/beaglelogic-pru1-core.asm
Auto-merging firmware/beaglelogic-pru0-core.asm
Auto-merging firmware/beaglelogic-pru-defs.inc
Removing beaglelogic-kernel-driver/beaglelogic_glue.h
CONFLICT (modify/delete): beaglelogic-kernel-driver/Makefile deleted in 3cea157d312a685547a2ca9aa66cefacd1fd2cee and modified in HEAD. Version HEAD of beaglelogic-kernel-driver/Makefile left in tree.
Removing beaglelogic-kernel-driver/BB-BEAGLELOGIC-00A0.dts
Removing beaglelogic-firmware/pru_syscalls.h
Removing beaglelogic-firmware/pru_syscalls.asm
Removing beaglelogic-firmware/pru_defs.h
Removing beaglelogic-firmware/beaglelogic-pru0.c
Removing beaglelogic-firmware/beaglelogic-pru0-syscalls.asm
Removing beaglelogic-firmware/am335x_pru.cmd
Removing beaglelogic-firmware/Makefile
Automatic merge failed; fix conflicts and then commit the result.

I did a git reset --hard origin/master to get the latest git code.

Then, when I run the install --upgrade, I get several 'catastrophic' errors:

debian@beaglebone:/opt/BeagleLogic$ sudo sh install.sh --upgrade
beaglelogic: Building and installing PRU firmware

************************************************************
Building project: firmware

Building file: beaglelogic-pru0.c
Invoking: PRU Compiler
/usr/share/ti/cgt-pru/bin/clpru --include_path=/usr/share/ti/cgt-pru/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=release --pp_directory=release -ppd -ppa -fe release/beaglelogic-pru0.object beaglelogic-pru0.c
"beaglelogic-pru0.c", line 18: fatal error #1965: cannot open source file "pru_cfg.h"
1 catastrophic error detected in the compilation of "beaglelogic-pru0.c".
Compilation terminated.

>> Compilation failure
Makefile:101: recipe for target 'release/beaglelogic-pru0.object' failed
make: *** [release/beaglelogic-pru0.object] Error 1

Building file: beaglelogic-pru0.c
Invoking: PRU Compiler
/usr/share/ti/cgt-pru/bin/clpru --include_path=/usr/share/ti/cgt-pru/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=release --pp_directory=release -ppd -ppa -fe release/beaglelogic-pru0.object beaglelogic-pru0.c
"beaglelogic-pru0.c", line 18: fatal error #1965: cannot open source file "pru_cfg.h"
1 catastrophic error detected in the compilation of "beaglelogic-pru0.c".
Compilation terminated.

>> Compilation failure
Makefile:101: recipe for target 'release/beaglelogic-pru0.object' failed
make: *** [release/beaglelogic-pru0.object] Error 1

************************************************************
Building project: prudaq

Building file: beaglelogic-pru1.c
Invoking: PRU Compiler
/usr/share/ti/cgt-pru/bin/clpru --include_path=/usr/share/ti/cgt-pru/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=release --pp_directory=release -ppd -ppa -fe release/beaglelogic-pru1.object beaglelogic-pru1.c
"resource_table_1.h", line 56: fatal error #1965: cannot open source file "rsc_types.h"
1 catastrophic error detected in the compilation of "beaglelogic-pru1.c".
Compilation terminated.

>> Compilation failure
Makefile:109: recipe for target 'release/beaglelogic-pru1.object' failed
make: *** [release/beaglelogic-pru1.object] Error 1

Building file: beaglelogic-pru1.c
Invoking: PRU Compiler
/usr/share/ti/cgt-pru/bin/clpru --include_path=/usr/share/ti/cgt-pru/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=release --pp_directory=release -ppd -ppa -fe release/beaglelogic-pru1.object beaglelogic-pru1.c
"resource_table_1.h", line 56: fatal error #1965: cannot open source file "rsc_types.h"
1 catastrophic error detected in the compilation of "beaglelogic-pru1.c".
Compilation terminated.

>> Compilation failure
Makefile:109: recipe for target 'release/beaglelogic-pru1.object' failed
make: *** [release/beaglelogic-pru1.object] Error 1
update-initramfs: Generating /boot/initrd.img-3.8.13-bone79
beaglelogic: Installing udev rules
‘/opt/BeagleLogic/scripts/90-beaglelogic.rules’ -> ‘/etc/udev/rules.d/90-beaglelogic.rules’
beaglelogic: Installing systemd startup service
‘/opt/BeagleLogic/scripts/beaglelogic’ -> ‘/etc/default/beaglelogic’
‘/opt/BeagleLogic/scripts/beaglelogic-tcp’ -> ‘/etc/default/beaglelogic-tcp’
‘/opt/BeagleLogic/scripts/beaglelogic.service’ -> ‘/lib/systemd/system/beaglelogic.service’
‘/opt/BeagleLogic/scripts/beaglelogic-startup.service’ -> ‘/lib/systemd/system/beaglelogic-startup.service’
‘/opt/BeagleLogic/scripts/beaglelogic-tcp.service’ -> ‘/lib/systemd/system/beaglelogic-tcp.service’
Created symlink from /etc/systemd/system/multi-user.target.wants/beaglelogic-startup.service to /lib/systemd/system/beaglelogic-startup.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/beaglelogic-tcp.service to /lib/systemd/system/beaglelogic-tcp.service.
beaglelogic: Installing npm components for beaglelogic-server
npm WARN deprecated connect@2.7.11: connect 2.x series is deprecated
npm WARN checkPermissions Missing write access to /opt/BeagleLogic/server
beaglelogic-webapp@0.0.2 /opt/BeagleLogic/server
├─┬ express@3.2.6
│ ├── buffer-crc32@0.2.1
│ ├── commander@0.6.1
│ ├─┬ connect@2.7.11
│ │ ├── bytes@0.2.0
│ │ ├── cookie@0.0.5
│ │ ├── formidable@1.0.14
│ │ ├── pause@0.0.1
│ │ ├── qs@0.6.5
│ │ └─┬ send@0.1.1
│ │   └── mime@1.2.11
│ ├── cookie@0.1.0
│ ├── cookie-signature@1.0.1
│ ├─┬ debug@3.1.0
│ │ └── ms@2.0.0
│ ├── fresh@0.1.0
│ ├── methods@0.0.1
│ ├── mkdirp@0.3.4
│ ├── range-parser@0.0.4
│ └─┬ send@0.1.0
│   └── mime@1.2.6
├─┬ lz4@0.5.3
│ ├── cuint@0.2.2
│ ├── nan@2.7.0
│ └─┬ xxhashjs@0.1.1
│   └── cuint@0.2.2
└─┬ socket.io@1.7.4
  ├─┬ debug@2.3.3
  │ └── ms@0.7.2
  ├─┬ engine.io@1.8.4
  │ ├─┬ accepts@1.3.3
  │ │ ├─┬ mime-types@2.1.17
  │ │ │ └── mime-db@1.30.0
  │ │ └── negotiator@0.6.1
  │ ├── base64id@1.0.0
  │ ├── cookie@0.3.1
  │ ├─┬ debug@2.3.3
  │ │ └── ms@0.7.2
  │ ├─┬ engine.io-parser@1.3.2
  │ │ ├── after@0.8.2
  │ │ ├── arraybuffer.slice@0.0.6
  │ │ ├── base64-arraybuffer@0.1.5
  │ │ ├── blob@0.0.4
  │ │ └── wtf-8@1.0.0
  │ └─┬ ws@1.1.4
  │   ├── options@0.0.6
  │   └── ultron@1.0.2
  ├─┬ has-binary@0.1.7
  │ └── isarray@0.0.1
  ├── object-assign@4.1.0
  ├─┬ socket.io-adapter@0.5.0
  │ └─┬ debug@2.3.3
  │   └── ms@0.7.2
  ├─┬ socket.io-client@1.7.4
  │ ├── backo2@1.0.2
  │ ├── component-bind@1.0.0
  │ ├── component-emitter@1.2.1
  │ ├─┬ debug@2.3.3
  │ │ └── ms@0.7.2
  │ ├─┬ engine.io-client@1.8.4
  │ │ ├── component-emitter@1.2.1
  │ │ ├── component-inherit@0.0.3
  │ │ ├─┬ debug@2.3.3
  │ │ │ └── ms@0.7.2
  │ │ ├── has-cors@1.1.0
  │ │ ├── parsejson@0.0.3
  │ │ ├── parseqs@0.0.5
  │ │ ├── ws@1.1.2
  │ │ ├── xmlhttprequest-ssl@1.5.3
  │ │ └── yeast@0.1.2
  │ ├── indexof@0.0.1
  │ ├── object-component@0.0.3
  │ ├─┬ parseuri@0.0.5
  │ │ └─┬ better-assert@1.0.2
  │ │   └── callsite@1.0.0
  │ └── to-array@0.1.4
  └─┬ socket.io-parser@2.3.1
    ├── component-emitter@1.1.2
    ├─┬ debug@2.2.0
    │ └── ms@0.7.1
    └── json3@3.3.2

npm ERR! Linux 3.8.13-bone79
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.13
npm ERR! npm  v3.8.2
npm ERR! path /opt/BeagleLogic/server
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, access '/opt/BeagleLogic/server'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, access '/opt/BeagleLogic/server'] errno: -13, code: 'EACCES', path: '/opt/BeagleLogic/server' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.8.13-bone79
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.13
npm ERR! npm  v3.8.2
npm ERR! path npm-debug.log.4055207882
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, open 'npm-debug.log.4055207882'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, open 'npm-debug.log.4055207882'] errno: -13, code: 'EACCES', path: 'npm-debug.log.4055207882' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/BeagleLogic/server/npm-debug.log
beaglelogic: Installing Go
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libaudio2 libmng1 libqt4-network libqt4-xml libqtcore4 libqtdbus4 libqtgui4
  qtcore4-l10n
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  golang-doc golang-go golang-go-linux-arm golang-go.tools golang-src
The following NEW packages will be installed:
  golang golang-doc golang-go golang-go-linux-arm golang-go.tools golang-src
0 upgraded, 6 newly installed, 0 to remove and 11 not upgraded.
Need to get 26.9 MB of archives.
After this operation, 163 MB of additional disk space will be used.
Get:1 http://httpredir.debian.org/debian/ jessie/main golang-src armhf 2:1.3.3-1 [5,143 kB]
Get:2 http://httpredir.debian.org/debian/ jessie/main golang-go-linux-arm armhf 2:1.3.3-1 [3,361 kB]
Get:3 http://httpredir.debian.org/debian/ jessie/main golang-go armhf 2:1.3.3-1 [8,193 kB]
Get:4 http://httpredir.debian.org/debian/ jessie/main golang-doc all 2:1.3.3-1 [1,950 kB]
Get:5 http://httpredir.debian.org/debian/ jessie/main golang all 2:1.3.3-1 [25.0 kB]
Get:6 http://httpredir.debian.org/debian/ jessie/main golang-go.tools armhf 0.0~hg20140703-4 [8,214 kB]
Fetched 26.9 MB in 14s (1,797 kB/s)
beaglelogic: Successfully Installed. Please reboot

I also see several errors that get overwritten about no space left on device, so it is clearly running out of room on the SD card.

Vagabond commented 6 years ago

And, after rebooting as instructed, systemctl -l shows both the beaglebone-tcp.service and the lightdm.service in a failed state.

Additionally, no services are listening on port 4000 anymore, either.

Vagabond commented 6 years ago

I did a partition/filesystem resize with fdisk and resize2fs, so there's space now, and things work a bit better. However, I still have the 2 previously mentioned failed services, but now there's a third one called beaglelogic.service.

Additionally, it looks like the beaglelogic user/group does not exist, and it is only added in non-upgrade mode. The npm install tries to use the 'debian' (or maybe the beaglelogic) user to install with, but it is failing because of the root ownership of /opt/BeagleLogic.

I was able to, I think, fix things by doing npm install and the go build as root in the appropriate directories. The services are running again, at least.

Vagabond commented 6 years ago

I did a partition/filesystem resize with fdisk and resize2fs, so there's space now, and things work a bit better. However, I still have the 2 previously mentioned failed services, but now there's a third one called beaglelogic.service.

Additionally, it looks like the beaglelogic user/group does not exist, and it is only added in non-upgrade mode. The npm install tries to use the 'debian' (or maybe the beaglelogic) user to install with, but it is failing because of the root ownership of /opt/BeagleLogic.

I was able to, I think, fix things by doing npm install and the go build as root in the appropriate directories. The services are running again, at least.

abhishek-kakkar commented 6 years ago

Ah I see why you are getting the error now. You're using the prebuilt image from the wiki that's based on the 3.8.13 kernel.

You have to switch to a new prebuilt image available at : http://docs.beaglelogic.net/en/latest/beaglelogic_system_image.html . This is based on the 4.9 kernel version and is a major upgrade from the 3.8.13 system image.

Vagabond commented 6 years ago

Ah, I see. The older image is the one that I found a download link for. Thanks for the help.

abhishek-kakkar commented 6 years ago

Let me know when you are able to run the new image successfully and able to sample data so that I can close the issue.

Vagabond commented 6 years ago

It seems to work, I think we can close this.