usbarmory / interlock

INTERLOCK - file encryption and HSM front-end
Other
295 stars 46 forks source link

Current not implemented on linux/arm #13

Closed azman0101 closed 9 years ago

azman0101 commented 9 years ago

Hello,

I've installed Golang on a Linux VM

sudo GOOS=linux GOARCH=arm ./make.bash --no-clean

Cross-complied with this command:

make -j8 GOARCH=arm CC=/usr/bin/arm-linux-gnueabihf-gcc-ar-4.8 CGO_ENABLE=1

And then, after following the tutoriel for encryptedfs creation:

2015/06/21 19:09:01 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksOpen /dev/lvmvolume/encryptedfs interlockfs]
2015/06/21 19:09:03 status.go:52: mounting encrypted volume to /home/usbarmory/.interlock-mnt
2015/06/21 19:09:03 cmd.go:42: executing system command, sudo: true, cmd: /bin/mount, args: [/dev/mapper/interlockfs /home/usbarmory/.interlock-mnt]
2015/06/21 19:09:04 status.go:52: unmounting encrypted volume on /home/usbarmory/.interlock-mnt
2015/06/21 19:09:05 api.go:23: 10.0.0.2:50849 POST /api/auth/login
2015/06/21 19:09:05 status.go:52: unlocking encrypted volume encryptedfs
2015/06/21 19:09:05 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksOpen /dev/lvmvolume/encryptedfs interlockfs]
2015/06/21 19:09:07 status.go:52: unmounting encrypted volume on /home/usbarmory/.interlock-mnt
2015/06/21 19:09:15 cmd.go:42: executing system command, sudo: true, cmd: /bin/umount, args: [/home/usbarmory/.interlock-mnt]
2015/06/21 19:09:15 cmd.go:42: executing system command, sudo: true, cmd: /bin/umount, args: [/home/usbarmory/.interlock-mnt]
2015/06/21 19:09:16 status.go:52: locking encrypted volume
2015/06/21 19:09:16 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksClose /dev/mapper/interlockfs]
2015/06/21 19:09:17 status.go:52: locking encrypted volume
2015/06/21 19:09:17 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksClose /dev/mapper/interlockfs]
2015/06/21 19:09:17 status.go:62: Device interlockfs already exists.
2015/06/21 19:09:17 api.go:156: {"response":["Device interlockfs already exists.\n"],"status":"INVALID_SESSION"}
2015/06/21 19:09:17 status.go:62: user: Current not implemented on linux/arm
2015/06/21 19:09:17 api.go:156: {"response":["user: Current not implemented on linux/arm"],"status":"INVALID_SESSION"}
abarisani commented 9 years ago

You have a typo in your compilation command, if you check INTERLOCK README file the command uses CGO_ENABLED and not CGO_ENABLE.

Let me know if this is the issue so that I can close the ticket.

Thanks!

azman0101 commented 9 years ago

I build Go as the doc says:

./all.bash

I got this error:

make GOARCH=arm CC=/usr/bin/arm-linux-gnueabihf-gcc-ar-4.8 CGO_ENABLED=1
cd src && GOPATH="/home/dev/interlock" go build -ldflags "-X main.InterlockBuild \"dev@dev on 2015-06-27 13:32:50\"" -o ../interlock
# runtime/cgo
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: invalid option -- 'E'
Usage: /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
       /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  s            - act as ranlib
  t            - display contents of archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
  [b]          - put file(s) before [member-name] (same as [i])
  [D]          - use zero for timestamps and uids/gids
  [U]          - use actual timestamps and uids/gids (default)
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
  [u]          - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
  [s]          - create an archive index (cf. ranlib)
  [S]          - do not build a symbol table
  [T]          - make a thin archive
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
  --target=BFDNAME - specify the target object format as BFDNAME
 optional:
  --plugin <p> - load the specified plugin
 emulation options: 
  No emulation specific options
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
go tool: no such tool "5g"
make: *** [build] Erreur 3

Then I've build Go like this:

 sudo GOOS=linux GOARCH=arm ./make.bash --no-clean

And then:

make GOARCH=arm CC=/usr/bin/arm-linux-gnueabihf-gcc-ar-4.8 CGO_ENABLED=1
cd src && GOPATH="/home/dev/interlock" go build -ldflags "-X main.InterlockBuild \"dev@dev on 2015-06-27 13:37:58\"" -o ../interlock
# runtime/cgo
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: invalid option -- 'E'
Usage: /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
       /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar -M [<mri-script]
 commands:
  d            - delete file(s) from the archive
  m[ab]        - move file(s) in the archive
  p            - print file(s) found in the archive
  q[f]         - quick append file(s) to the archive
  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  s            - act as ranlib
  t            - display contents of archive
  x[o]         - extract file(s) from the archive
 command specific modifiers:
  [a]          - put file(s) after [member-name]
  [b]          - put file(s) before [member-name] (same as [i])
  [D]          - use zero for timestamps and uids/gids
  [U]          - use actual timestamps and uids/gids (default)
  [N]          - use instance [count] of name
  [f]          - truncate inserted file names
  [P]          - use full path names when matching
  [o]          - preserve original dates
  [u]          - only replace files that are newer than current archive contents
 generic modifiers:
  [c]          - do not warn if the library had to be created
  [s]          - create an archive index (cf. ranlib)
  [S]          - do not build a symbol table
  [T]          - make a thin archive
  [v]          - be verbose
  [V]          - display the version number
  @<file>      - read options from <file>
  --target=BFDNAME - specify the target object format as BFDNAME
 optional:
  --plugin <p> - load the specified plugin
 emulation options: 
  No emulation specific options
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
make: *** [build] Erreur 2
abarisani commented 9 years ago

Your cross compiling environment has some issues, it might be not modern enough or not configured correctly. Rather than debugging those I suggest you build INTERLOCK directly on the target (which I am assuming it is the USB armory). If you want to try and fix your cross compiling environment you can try and set it up as suggested at https://github.com/inversepath/usbarmory/wiki/Preparing-a-bootable-microSD-image.

Keep in mind that if you are building for a non-ARM host (like an x86 machine) then cross compiling is not necessary and you can just use make.

I personally find it easier to just have native arm Go and compile INTERLOCK on my USB armory directly.

azman0101 commented 9 years ago

Thanks for your help. As you mentioned before, my cross compiling environment has some issues.