From: Jing Huang <jing.huang.pku@gmail.com>
To: lu_zero@gentoo.org, gentoo-soc@lists.gentoo.org
Subject: [gentoo-soc] cross_container_support - progress report #7
Date: Tue, 10 Jul 2012 13:31:15 +0000 [thread overview]
Message-ID: <CAK8mDgrKjP_GUttkoy3_78gZC4=DFMAiGgPyO9nq9L8c6hnR=w@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]
Hi,
== Progress of last Week ==
In the last week, I continue to debug the lxc script for arm-gentoo
container and investigate how to execute x86 program in arm container.
First, I try to fix the ping issues in qemu-user of arm-gentoo
container. The patch is attached.
* The do_setsockopts function in qemu-user does not support SOL_RAW
socket which is used in ping program.
* The recvmsg in main_loop of ping_common.c could not fetch
sockaddr_in struct. That is because do_sendrecvmsg in qemu-user does
not pass the msg->msg_name to the target.
So the ping will show "64 bytes from 0.0.0.0: icmp_req=1 ttl=64 time=1.16 ms".
Second, I am investigating how to execute local gcc toolchain in
arm-gentoo container.
At begging, I want to use ldd to parse each cross-gcc toolchain
executable in arm container. Then copy the related libraries to
gentoo-arm rootfs and config the ld.so.conf to make cross-gcc running
locally.
Now, I think I could modify the crossdev script and build cross-gcc
with LDFLAGS="-static". So the cross-gcc can be executed locally in
arm-gentoo container.
I have about one week behind the schedule. I hope I could catch up it
as soon as possible.
Jing.
[-- Attachment #2: support-to-guest-ping-nettool.patch --]
[-- Type: application/octet-stream, Size: 1800 bytes --]
diff -ruN a/linux-user/syscall.c b/linux-user/syscall.c
--- a/linux-user/syscall.c 2012-07-06 13:23:47.000000000 +0000
+++ b/linux-user/syscall.c 2012-07-10 04:22:20.000000000 +0000
@@ -1349,7 +1349,14 @@
target_cmsg->cmsg_len = tswapal(TARGET_CMSG_LEN(len));
if (cmsg->cmsg_level != TARGET_SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) {
- gemu_log("Unsupported ancillary data: %d/%d\n", cmsg->cmsg_level, cmsg->cmsg_type);
+ if(cmsg->cmsg_type == SO_TIMESTAMP) {
+ /*copy msg_name to target_msgh*/
+ target_msgh->msg_namelen = msgh->msg_namelen;
+ memcpy(g2h((void *)(unsigned long)(target_ulong)target_msgh->msg_name), msgh->msg_name, msgh->msg_namelen);
+ } else {
+ gemu_log("Unsupported ancillary data: %d/%d\n", cmsg->cmsg_level, cmsg->cmsg_type);
+ }
memcpy(target_data, data, len);
} else {
int *fd = (int *)data;
@@ -1442,6 +1449,23 @@
goto unimplemented;
}
break;
+ case SOL_RAW:
+ switch (optname) {
+#define ICMP_FILTER 1
+ case ICMP_FILTER:
+ /*struct icmp_filter takes an u32 value*/
+ optname = ICMP_FILTER;
+ if (optlen < sizeof(uint32_t))
+ return -TARGET_EINVAL;
+
+ if (get_user_u32(val, optval_addr))
+ return -TARGET_EFAULT;
+ ret = get_errno(setsockopt(sockfd, level, optname, (char *)&val, sizeof(val)));
+ break;
+ default:
+ goto unimplemented;
+ }
+ break;
case TARGET_SOL_SOCKET:
switch (optname) {
/* Options with 'int' argument. */
next reply other threads:[~2012-07-10 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-10 13:31 Jing Huang [this message]
2012-07-10 14:12 ` [gentoo-soc] cross_container_support - progress report #7 Luca Barbato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK8mDgrKjP_GUttkoy3_78gZC4=DFMAiGgPyO9nq9L8c6hnR=w@mail.gmail.com' \
--to=jing.huang.pku@gmail.com \
--cc=gentoo-soc@lists.gentoo.org \
--cc=lu_zero@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox