Re: how to create a powerpc64 poudriere jail ?

2016-05-23 Thread Kurt Jaeger
Hi!

> Kurt Jaeger  writes:
> 
> > /pou/jails/p64/usr/bin/id
> > Unable to load interpreter
> 
> Before bug 209706 try running as
> 
>   $ chroot /pou/jails/p64 /usr/bin/id

This happens:

chroot /pou/jails/p64 /usr/bin/id
Invalid data memory access: 0x003f8000
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault

-- 
p...@opsec.eu+49 171 3101372 4 years to go !
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: how to create a powerpc64 poudriere jail ?

2016-05-23 Thread Jan Beich
Kurt Jaeger  writes:

> /pou/jails/p64/usr/bin/id
> Unable to load interpreter

Before bug 209706 try running as

  $ chroot /pou/jails/p64 /usr/bin/id


signature.asc
Description: PGP signature


Re: how to create a powerpc64 poudriere jail ?

2016-05-22 Thread Kurt Jaeger
Hi!

> > [00:00:08] >> Starting jail p64-default
> > [00:00:08] >> Error: Unable to execute id(1) in jail. Emulation or ABI 
> > wrong.
> 
> Check foreign ABI support by running a static binary. If you see something
> like the following then --magic or --mask argument (for ELF header) is wrong.
> 
>   $ /poudriere/jails/head-powerpc64/rescue/ls
>   sh: /poudriere/jails/head-powerpc64/rescue/ls: Exec format error

Yes, this happened.

> but it may not help if dynamically linked binaries still fail
> 
>   [00:00:01] >> Starting jail head-powerpc64-default
>   Invalid data memory access: 0x07ec
>   qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>   Segmentation fault
>   [00:00:01] >> Error: Unable to execute id(1) in jail. Emulation or ABI 
> wrong.
> 
> > magic: 0x7f 0x45 0x4c 0x46  0x01 0x02 0x01 0x00  0x00 0x00 0x00 0x00 
> ^^
> This byte looks wrong. After applying the attached patch run

The source of that byte was:

https://wiki.freebsd.org/QemuUserModeHowTo

(now fixed). After fixing this:

/pou/jails/p64/rescue/ls 

works.

But:

/pou/jails/p64/usr/bin/id
Unable to load interpreter

-- 
p...@opsec.eu+49 171 3101372 4 years to go !
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: how to create a powerpc64 poudriere jail ?

2016-05-22 Thread Jan Beich
Kurt Jaeger  writes:

> [00:00:08] >> Starting jail p64-default
> [00:00:08] >> Error: Unable to execute id(1) in jail. Emulation or ABI 
> wrong.

Check foreign ABI support by running a static binary. If you see something
like the following then --magic or --mask argument (for ELF header) is wrong.

  $ /poudriere/jails/head-powerpc64/rescue/ls
  sh: /poudriere/jails/head-powerpc64/rescue/ls: Exec format error

but it may not help if dynamically linked binaries still fail

  [00:00:01] >> Starting jail head-powerpc64-default
  Invalid data memory access: 0x07ec
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  Segmentation fault
  [00:00:01] >> Error: Unable to execute id(1) in jail. Emulation or ABI 
wrong.

> magic: 0x7f 0x45 0x4c 0x46  0x01 0x02 0x01 0x00  0x00 0x00 0x00 0x00 
^^
This byte looks wrong. After applying the attached patch run

  $ service qemu_user_static onerestart

>0x00 0x00 0x00 0x00  0x00 0x02 0x00 0x15 
> mask:  0xff 0xff 0xff 0xff  0xff 0xff 0xff 0x00  0xff 0xff 0xff 0xff 
>0xff 0xff 0xff 0xff  0xff 0xfe 0xff 0xff 

$ hd -n20 /poudriere/jails/head-powerpc64/rescue/ls
  7f 45 4c 46 02 02 01 09  00 00 00 00 00 00 00 00  |.ELF|
0010  00 02 00 15   ||
0014

Index: emulators/qemu-sbruno/files/qemu_user_static.in
===
--- emulators/qemu-sbruno/files/qemu_user_static.in (revision 415647)
+++ emulators/qemu-sbruno/files/qemu_user_static.in (working copy)
@@ -98,7 +98,7 @@ list_cmd="${BINMISCCTL} list"
interpreter=${QEMU_DIR}/${QEMU_PREFIX}ppc64${QEMU_SUFFIX}
if [ -x "${interpreter}" ]; then
${BINMISCCTL} add powerpc64 --interpreter "${interpreter}" \
-   --magic 
"\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15"
 \
+   --magic 
"\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15"
 \
--mask 
"\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
 \
--size 20 --set-enabled
else


signature.asc
Description: PGP signature


Re: how to create a powerpc64 poudriere jail ?

2016-05-22 Thread Kurt Jaeger
Hi!

> freebsd-ppc@ folks may have a clue how to cross-build powerpc64 packages
> without real hardware. If you're just looking for logs, see

I want to test-build devel/jsoncpp, so...

This built a jail:

  poudriere jail -c -j p64 -a powerpc.powerpc64 -m svn+ssh -v head

But using it fails:

poudriere bulk -T -f ~/pkg/ppcone -j p64

[...]
[00:00:08] >> Raising MAX_EXECUTION_TIME and NOHANG_TIME for QEMU
/etc/resolv.conf -> /pou/data/.m/p64-default/ref/etc/resolv.conf
[00:00:08] >> Starting jail p64-default
[00:00:08] >> Error: Unable to execute id(1) in jail. Emulation or ABI 
wrong.
[00:00:08] >> Cleaning up
[00:00:09] >> Umounting file systems

binmiscctl list shows:

name: powerpc64
interpreter: /usr/local/bin/qemu-ppc64-static
flags: ENABLED USE_MASK 
magic size: 20
magic offset: 0
magic: 0x7f 0x45 0x4c 0x46  0x01 0x02 0x01 0x00  0x00 0x00 0x00 0x00 
   0x00 0x00 0x00 0x00  0x00 0x02 0x00 0x15 
mask:  0xff 0xff 0xff 0xff  0xff 0xff 0xff 0x00  0xff 0xff 0xff 0xff 
   0xff 0xff 0xff 0xff  0xff 0xfe 0xff 0xff 

-- 
p...@opsec.eu+49 171 3101372 4 years to go !
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: how to create a powerpc64 poudriere jail ?

2016-05-22 Thread Jan Beich
Kurt Jaeger  writes:

> Hi!
>
>> What is the correct way to create a powerpc64 poudriere jail ?
>> 
>> I've tried several versions of
>> 
>> poudriere jail -c -j p64 -a  -m svn+ssh -v head
>> 
>> with arch as powerpc, ppc64, powerpc64/powerpc, to no avail.
>
> Ah, one more thing: I added the binmiscctl environment for ppc64, as
> described in
>
>   https://wiki.freebsd.org/QemuUserModeHowTo
>
> The problem is the correct name for binmiscctl and the correct 
> for poudriere. That's what I'm missing.

qemu-user-static support for powerpc64 seems to be incomplete but
otherwise is supposed to work as follows. Only stuff represented on
pkg-fallout@ is known to work. aarch64 is also in a good shape but needs
devel/aarch64-binutils built with LDFLAGS+=-all-static copied inside jail.

freebsd-ppc@ folks may have a clue how to cross-build powerpc64 packages
without real hardware. If you're just looking for logs, see

https://lists.freebsd.org/pipermail/freebsd-ports/2016-April/102952.html

--
# run rc.d script that defines common targets for poudriere
$ service qemu_user_static onestart

# check desired target is defined
$ binmiscctl list
[...]
name: powerpc64
interpreter: /usr/local/bin/qemu-ppc64-static
flags: ENABLED USE_MASK
magic size: 20
magic offset: 0
magic: 0x7f 0x45 0x4c 0x46  0x01 0x02 0x01 0x00  0x00 0x00 0x00 0x00
   0x00 0x00 0x00 0x00  0x00 0x02 0x00 0x15
mask:  0xff 0xff 0xff 0xff  0xff 0xff 0xff 0x00  0xff 0xff 0xff 0xff
   0xff 0xff 0xff 0xff  0xff 0xfe 0xff 0xff
[...]

# get TARGET.TARGET_ARCH tuple for |-a| from the source
$ make targets -C/usr/src | sed '1d; y,/,.,' | fgrep powerpc64
powerpc.powerpc64

# build a jail for the target
$ poudriere jail -cj head-powerpc64 -a powerpc.powerpc64 -m svn+ssh -v head
[...]
[00:41:56] >> Recording filesystem state for clean... done
[00:41:57] >> Jail head-powerpc64 head powerpc.powerpc64 is ready to be used

# check qemu-user-static can run target (static) binaries
$ /poudriere/jails/head-powerpc64/rescue/ls /var/empty

# start building various packages
$ poudriere bulk -j head-powerpc64 devel/gmake  
~


signature.asc
Description: PGP signature


Re: how to create a powerpc64 poudriere jail ?

2016-05-22 Thread Kurt Jaeger
Hi!

> What is the correct way to create a powerpc64 poudriere jail ?
> 
> I've tried several versions of
> 
> poudriere jail -c -j p64 -a  -m svn+ssh -v head
> 
> with arch as powerpc, ppc64, powerpc64/powerpc, to no avail.

Ah, one more thing: I added the binmiscctl environment for ppc64, as
described in

  https://wiki.freebsd.org/QemuUserModeHowTo

The problem is the correct name for binmiscctl and the correct 
for poudriere. That's what I'm missing.

-- 
p...@opsec.eu+49 171 3101372 4 years to go !
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"