1 |
Hi! |
2 |
|
3 |
Well i have 2 arm lxc containers on amd64 machine. Its works good if |
4 |
qemu support most of needed cross arch instructions |
5 |
|
6 |
Jing Huang писал 2012-03-23 13:36: |
7 |
> Hi Everyone, |
8 |
> |
9 |
> I am a student at Peking University in China. I am very interested in |
10 |
> the project of Cross Container Support(). I have some ideas about the |
11 |
> project. Please help me to examine the thoughts. |
12 |
> |
13 |
> First, I think downloading stage and portage packets into specified |
14 |
> directory each time needs to be impoved(). It needs to build |
15 |
> execution |
16 |
> environment every time. So it is not convenient. On the other hand, |
17 |
> the files in specified directory would be modified by some process |
18 |
> potentially. It is not an isolated execution environment at all. |
19 |
> Therefore, I would make some img files for the each arch, including |
20 |
> arm, mips, etc. The img file contains arch-stage and portage. When |
21 |
> creating the qemu-user container, the iniscript mounts the img file |
22 |
> into specified directory then chroot to it. |
23 |
> |
24 |
> Second, if the process accesses disk frequently, I would to make a |
25 |
> tmpfs file for the qemu-user container. The process in the container |
26 |
> is running on tmpfs file and been sped up. |
27 |
> |
28 |
> Third, I would custom a lightweight qemu-user container for the |
29 |
> specified process if necessary. In my previous work, I made a custom |
30 |
> ramdisk VM for the process by modifying the mkinitrd script. With the |
31 |
> help of “ldd –v ” command, I could get the shared libraries of |
32 |
> the process and packet them into ramdisk. But in Gentoo, maybe I |
33 |
> could |
34 |
> custom the qemu-user container using the USE label. |
35 |
> |
36 |
> In my proposal, this project uses a small quantity of bash to |
37 |
> implement just the core tools (create, destroy, enter). In simpler |
38 |
> terms, I plan to implement them in this way: |
39 |
> |
40 |
> 1. create routine |
41 |
> |
42 |
> # qemu_container_create config_file |
43 |
> |
44 |
> The config_file specifies arch, arch-img file, chroot directory, |
45 |
> additional args of qemu(like "-cpu cortex-a8"). Then the create |
46 |
> routine will execute as: |
47 |
> |
48 |
> 1). If having the arch-img then mount it into chroot directory. |
49 |
> |
50 |
> 2). If not, make a new img file, download stageball&portage, unpack |
51 |
> them to the chroot directory. |
52 |
> |
53 |
> 2). modprobe binfmt_misc and register the qemu-user-arch to the |
54 |
> binfmt_misc. |
55 |
> |
56 |
> 3). install the static qemu-user into the chroot directory and mount |
57 |
> the required directories. |
58 |
> |
59 |
> 4). register this new container to our managment tool. The register |
60 |
> info includes container_id, stageball version, stageball arch, chroot |
61 |
> directory, etc. |
62 |
> |
63 |
> 2. enter routine |
64 |
> |
65 |
> #qemu_container_enter container_id |
66 |
> |
67 |
> The enter routine opens a terminal and chroot into the environment. |
68 |
> The management tool should also set the container is in "running" |
69 |
> state. |
70 |
> |
71 |
> 3. destroy routine |
72 |
> |
73 |
> #qemu_container_destroy container_id |
74 |
> |
75 |
> 1). exits from chroot environment |
76 |
> |
77 |
> 2). unmount stuff when not in use |
78 |
> |
79 |
> 3). clear the qemu-user-arch in binfmt_misc register file (maybe |
80 |
> other containers use it) |
81 |
> |
82 |
> 4). remove the container info from managment tool |
83 |
> |
84 |
> Besides these routines, I would also implement container_list and |
85 |
> container_export routines. The former lists the info/state of |
86 |
> containers. The latter is used to export system images. |
87 |
> |
88 |
> Questions: |
89 |
> |
90 |
> 1). Why integrate qemu-user container with crossdev? Crossdev is a |
91 |
> cross compiler. The qemu-user container not only compiles the |
92 |
> heterogeneous programs but also tests them. I thought if the |
93 |
> qemu-user |
94 |
> container was good enough, it could replace the crossdev. |
95 |
> |
96 |
> 2). "An additional task is to support layered systems so native |
97 |
> userspace can be used to further speed up the process (hybrid |
98 |
> chroot)." I don't very understand the task. Could someone help me and |
99 |
> explain the “hybrid chroot”? |
100 |
> |
101 |
> Would someone give me some suggestions? Any comments will be much |
102 |
> appreciated. |
103 |
> |
104 |
> Jing Huang. |
105 |
|
106 |
-- |
107 |
Best Regards, |
108 |
Alexey 'Alexxy' Shvetsov |
109 |
Petersburg Nuclear Physics Institute, Russia |
110 |
Department of Molecular and Radiation Biophysics |
111 |
Gentoo Team Ru |
112 |
Gentoo Linux Dev |
113 |
mailto:alexxyum@×××××.com |
114 |
mailto:alexxy@g.o |
115 |
mailto:alexxy@×××××××××××××.ru |