From owner-freebsd-emulation@freebsd.org Tue Feb 13 01:51:42 2018 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E95F10B89 for ; Tue, 13 Feb 2018 01:51:42 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB757BA16 for ; Tue, 13 Feb 2018 01:51:40 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qt0-x22a.google.com with SMTP id u6so1930470qtg.13 for ; Mon, 12 Feb 2018 17:51:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=gabS5EOxFmdbONKEIA6OpPMiragu+Ec/EU0HzQR2Sys=; b=KKlUNX+6mlIOXaC2WW/mBbWUj7X7iMXagNnWKANTaS+wQerRd2wreR81GHcwpdeqfH sKt2Hp6Ak0bWyXY08IN+8TPk7Qxuhgkdxtfow5EK/pfkcwpiY6tlVCr44ZmQGI1iUh9h vCcN8NVvPDLCCGXSpHQnJh9vwqw9BRb3ZfRPA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=gabS5EOxFmdbONKEIA6OpPMiragu+Ec/EU0HzQR2Sys=; b=g5U9rytTmFBq5Ap04+5/mUWdPELLghY4IsDEBkp+WB4VU0TBPNR7aRA04NPtywZbd0 Q5hPhZAna0a2OiWepjQoSHn56Fm2wqE5483byDsWDaq3852xniRMg40hrDST0LUbUimc DMcyv9MVSIUJSdzyIKxeRtUKWxHVGT1QQ736pkMsD+ShyUH/kBjYc935+mAM72A2fTL8 YRY8mkIWTsZR+GvV9wDkOZ/ctkkkhsqMxIGvSD7+Oh5+xo2PCT2wlMbwsEjKxsTa/j0o A65A2u0fGbWlKcIz/isq7/W5RCyhWY/PC2TqRDH4LhXHpQD6WSirdV0oxc8XBNZD6p08 aEhg== X-Gm-Message-State: APf1xPBUq/1H6zJpfQWLaxecLbbWa+DqYkNURugdPHNe1LOudQMBW9/V rupt3/mpg+hM+lcjnskFJ+HKzoP72uo= X-Google-Smtp-Source: AH8x2279bjhy4IRGzoFlHx+YrIZK/SfZfERTZ58dpA74F6g7LTKsce2R9PWH4tTeWujAG/DTcePKIw== X-Received: by 10.200.28.8 with SMTP id a8mr6566168qtk.280.1518486700082; Mon, 12 Feb 2018 17:51:40 -0800 (PST) Received: from ?IPv6:2804:54:19ef:cc00:a5eb:daa4:5c4d:8b9b? ([2804:54:19ef:cc00:a5eb:daa4:5c4d:8b9b]) by smtp.gmail.com with ESMTPSA id 6sm6619316qkj.13.2018.02.12.17.51.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 17:51:39 -0800 (PST) To: freebsd-emulation@freebsd.org From: Otacilio Subject: Executing beaglebone's programs by qemu-user-static Message-ID: <5071c535-c0de-5f00-7e76-1f1f18d2fb8d@bsd.com.br> Date: Mon, 12 Feb 2018 22:51:35 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 01:51:42 -0000 Hi I would like to ask for some help. I own a  beaglebone black and an amd64 machine. Both running FreeBSD 11.1. I want to write programs to the beaglebone by running codeblocks on the AMD64 machine and also to execute the beaglebone's C compiler. Firstly, I exported the beaglebone black / file system using NFS and mounted it on the AMD64 machine in the /usr/bbb folder. Then I installed qemu-user-static and added the entry in /etc/rc.conf to execute the beaglebone's ARM programs through qemu. For example, when I run /usr/bbb/usr/bin/cc the beaglebone's C compiler is executed on the amd64 machine through qemu. But, as far as I understand the C compiler of the beaglebone searches for the library files from the /usr/lib and /usr/local/lib folders and not /usr/bbb/usr/lib and /usr/bbb/usr/local/lib folders, where the port libraries that are installed on the beaglebone are in fact. I thought of modifying the qemu code to add a chroot call after qemu-arm-static loads the beaglebone's application, but the qemu would need to execute as root for this to happen. Is there any way to turn the qemu process restricted to the /usr/bbb folder after loading the beaglebone application without the qemu running as a root? So far I'm thinking that perhaps I'll need to add something like a dir base on qemu to do that, so any systems that call or access a file or directory always start from that base folder (/usr/bbb). Faithfully, -Otacílio