summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-discuss/2013-February/009229.html
blob: 2724b089f9fabfc03f2e8fbedb6cdb245d2f7fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Mageia-discuss] Testers needed/wished for to build Mageia in a chroot inside an Android-device from the written guide
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:mageia-discuss%40mageia.org?Subject=Re%3A%20%5BMageia-discuss%5D%20Testers%20needed/wished%20for%20to%20build%20Mageia%20in%20a%0A%20chroot%20inside%20an%20Android-device%20from%20the%20written%20guide&In-Reply-To=%3C512A1FF0.20501%40gmail.com%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="009228.html">
   <LINK REL="Next"  HREF="009231.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Mageia-discuss] Testers needed/wished for to build Mageia in a chroot inside an Android-device from the written guide</H1>
    <B>Kristoffer Grundstr&#246;m</B> 
    <A HREF="mailto:mageia-discuss%40mageia.org?Subject=Re%3A%20%5BMageia-discuss%5D%20Testers%20needed/wished%20for%20to%20build%20Mageia%20in%20a%0A%20chroot%20inside%20an%20Android-device%20from%20the%20written%20guide&In-Reply-To=%3C512A1FF0.20501%40gmail.com%3E"
       TITLE="[Mageia-discuss] Testers needed/wished for to build Mageia in a chroot inside an Android-device from the written guide">kristoffer.grundstrom1983 at gmail.com
       </A><BR>
    <I>Sun Feb 24 15:13:04 CET 2013</I>
    <P><UL>
        <LI>Previous message: <A HREF="009228.html">[Mageia-discuss] people.mageia.org and mgapeople
</A></li>
        <LI>Next message: <A HREF="009231.html">[Mageia-discuss] Testers needed/wished for to build Mageia in a	chroot inside an Android-device from the written guide
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#9229">[ date ]</a>
              <a href="thread.html#9229">[ thread ]</a>
              <a href="subject.html#9229">[ subject ]</a>
              <a href="author.html#9229">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Hi!

I'd like it if someone took the time to test my guide that I wrote for a 
Samsung device.

Feel free to give me constructive critisism.

The intention of this written guide is to make it foolproof (everyone 
should understand how it works &amp; what to do).

Let me know if you have managed to build without issues.

/Kristoffer
-------------- next part --------------
In order to fully compile &amp; install Mageia in an ARM-device made by Samsung, here's what you need to have:

An ARM-based device made by Samsung.
A desktop-PC/Laptop/Netbook with Mageia 2 or later installed &amp; fully updated.
USB-cable to the device.
ADB added to $PATH

-------------------------------------------------------------------------------------------------------------------------------------------
ROOT

To become root (which basically means that you get full access to the system in use). THIS IS RISKY &amp; IS ONLY RECOMMENDED TO THOOSE WHO UNDERSTAND WHEN IT'S NEEDED &amp; WHAT IT'S USED for!!!

Here's how you become root:

Press Power-button to start your device &amp; wait til you get to Home-screen.

Open Program -&gt; Settings -&gt; About phone and then remember its kernel-version &amp; baseband-version for later use.

Visit Google &amp; find a thread from xda-developers.com by typing name of your device + xda-developers.com + forum + unsecure + kernel + root that contains an unsecure kernel for rooting (it's usually written in bold letters) and then choose a kernel-tarball that matches your current existing device-kernel or the closest one available.

Now, unpack/tar the zImage from the downloaded tarball from the xda-developers.com thread &amp; put it on your desktop so you know where to find it when ADB is added to your $PATH &amp; when the Heimdall Flash Suite is installed.
-------------------------------------------------------------------------------------------------------------------------------------------
ADB

ADB means Android Debug Bridge and is used to communicate with your ARM-device through a shell.
It can also be used to push an APK (An Android installation package-file) &amp; a whole lot more.

How to setup ADB (Android Debug Bridge) in Mageia:

To get ADB added to console in Mageia 2 or later you have to do as theese instructions tell you: <A HREF="https://wiki.mageia.org/en/How_to_add_adb_to_console_in_Mageia">https://wiki.mageia.org/en/How_to_add_adb_to_console_in_Mageia</A>
-------------------------------------------------------------------------------------------------------------------------------------------
USB-DEBUGGING

Open Program-menu.
Click on Settings.
Click on Developeralternatives.
Tick the box for USB-debugging.
Press OK on the prompt (if you want to allow USB-debugging) and connect your USB-cable to the device &amp; then to the USB-slot of the computer.

Now, just as a precaution, confirm that ADB sees your device by typing in a terminal-window:

adb devices

If ADB sees it it should present your device like this for example:

[your <A HREF="https://www.mageia.org/mailman/listinfo/mageia-discuss">username at localhost</A> or name of machine ~]$ adb devices
List of devices attached 
XX000xxx00x00x	device

I changed the numbers &amp; letters for my device and replaced them with 0's and small x's.
-------------------------------------------------------------------------------------------------------------------------------------------
USING HEIMDALL FLASH SUITE TO FLASH AN UNSECURE KERNEL (zImage)

Heimdall is a cross-platform open-source tool suite used to flash firmware (also known as a ROM) onto Samsung Galaxy S devices.

For i586-arch

The RPM's of heimdall &amp; heimdall-frontend are located in the media called Core 32bit Release so make sure it's added to the mirrorlist &amp; enabled for updates.

For the x86_64-arch

The RPM's of heimdall &amp; heimdall-frontend are located in the media called Core Release so make sure it's added to the mirrorlist &amp; enabled for updates.

First way of installing Heimdall Flash Suite:

In Mageia, open Program -&gt;Tools -&gt;Systemtools -&gt;Mageia Control Center (type your given root-password from installation of Mageia on prompt-window &amp; press Enter/Return-button) and then click on Install/Remove programs.
Now make sure that the first dropdown-menu that says Packages with a GUI is changed to All &amp; type heimdall in the search-field followed by pressing Enter/Return-button.

That should give you heimdall and heimdall-frontend &amp; then tick the boxes for x86_64 if that's your main arch followed by Apply &amp; Yes. Wait til it's installed &amp; that the window is reloaded &amp; then click Exit-button.

Second way of installing Heimdall Flash Suite:

In Mageia, open Program -&gt; Tools -&gt; Terminal

In the Terminal-window type su - (press Enter/Return-button) and then type the given root-password from installation of Mageia on prompt-window.

You should now see either:

[<A HREF="https://www.mageia.org/mailman/listinfo/mageia-discuss">root at localhost</A> ~]#

or

[<A HREF="https://www.mageia.org/mailman/listinfo/mageia-discuss">root at name</A> of the machine]# (if you named your computer during the installation of Mageia)

Now type urpmi heimdall heimdall-frontend --auto (press Enter/Return-button and wait til you get a new root-prompt like the one described above).
------------------------------------------------------------------------------------------------------------------------------------------
FLASHING WITH HEIMDALL FLASH SUITE

You now have 2 ways to use Heimdall to flash the kernel:

1. Open Heimdall from Program -&gt; Development -&gt; Heimdall

Click the tab called Utilities &amp; press the Detect-button to see if Heimdall recognizes the device in order to flash it.

Output should then say:

Device detected

Choose the tab called Flash and then add your device PIT-file (which you can retrieve from www.samfirmware.com or by googleing Samsung + Galaxy + modelname + pit) to the field that states Options followed by the word PIT directly beneath.

Make sure that the box for Partition isn't checked/ticked.

Click the Browse-button &amp; choose the zImage that you put on your desktop &amp; choose KERNEL as Partition Name.

Press Add-button on the right.

Now click Start to begin the flash-process of the unsecure (rooted) kernel &amp; let the device fully reboot until you do anything else.
------------------------------------------------------------------------------------------------------------------------------------------
GETTING AND CONFIRMING ROOT

First way to confirm that you're using a rooted kernel is:

In the device:

1. Open Program-menu.
2. Open Google Play (also known as Store).
3. Search for 3 applications named Superuser &amp; Busybox &amp; Android Terminal Emulator.
4. Install Superuser &amp; Busybox &amp; Android Terminal Emulator.

Now, open Busybox &amp; press button to install Busybox to whatever dir that is suggested by default.

Exit Busybox.

Open Android Terminal Emulator.

Type su - and press Enter/Return-button (Now you should be prompted by Superuser to either Decline or Allow the su-command to be executed &amp; this is where you press Allow. A message will appear for a short time telling you &quot;Terminalemulator has been granted Superuser permissions&quot; and you'll also see prompt-change to [<A HREF="https://www.mageia.org/mailman/listinfo/mageia-discuss">root at android</A> ~]# and that means that you're now root &amp; can do whatever you want with the system. REMEMBER THAT IT'S VERY RISKY TO DO COMMANDS IN THE TERMINAL AND MIGHT BREAK YOUR SYSTEM IF YOU DON'T KNOW WHAT YOU'RE DOING!!!!!

Second way to confirm that you're using a rooted kernel is:

In the device:

1. Open Program-menu.
2. Click on Settings.
3. Click on Developer options.
4. Tick the box to allow apps to be installed from unknown sources. Just click OK on the prompt to confirm that it's OK to do so.
5. Open Program-menu.
6. Open Google Play (also known as Store).
7. Search for Superuser &amp; Busybox &amp; Android Terminal Emulator.
8. Install Superuser &amp; Busybox &amp; Android Terminal Emulator.
9. Open the webbrowser.
10. Go to <A HREF="http://download2us.softpedia.com/dl/1d85264627c2e57c4a7661d5894a9d4f/51284217/800110178/pda/System%20Utilities/Enhancements/z4root.1.3.0.apk">http://download2us.softpedia.com/dl/1d85264627c2e57c4a7661d5894a9d4f/51284217/800110178/pda/System%20Utilities/Enhancements/z4root.1.3.0.apk</A> &amp; go to Program -&gt;Downloads when download is finished &amp; press to install the apk followed by pressing OK-button on the question-prompt if you want to install this app.
Now press Finished.
If above link doesn't work go to <A HREF="http://www.softpedia.com/">http://www.softpedia.com/</A> &amp; then click Handheld -&gt; System Utilites -&gt; Enhancements &amp; then go through the list of apps until you find z4root or type z4root in the search-field (press Enter/Return-button).
11. Open Program-menu.
12. Click to open the z4root-app.
13. Press ROOT-button.
14. Click Allow when prompted by Superuser &amp; that's it.
You've now rooted your device!
Same thing applies as in the first way, you play with su on your own now.
I take no responsibility for your actions what so ever.
------------------------------------------------------------------------------------------------------------------------------------------
Now that you've rooted your device, you're free to flash any ROM you want.
------------------------------------------------------------------------------------------------------------------------------------------
CYANOGENMOD

To find if your device is supported by CM, please refer to <A HREF="http://wiki.cyanogenmod.org/w/Devices#vendor=;">http://wiki.cyanogenmod.org/w/Devices#vendor=;</A>

In the filter-field type the name of the devive that you've just rooted and see if it appears.

Click on the image of your device if it appears &amp; continue from there.

NOTE! It does matter if it's GSM-based or CDMA-based when you flash a ROM so please find out so you'll read the right instructions. !NOTE
------------------------------------------------------------------------------------------------------------------------------------------
CHROOT-build for Mageia

Things you need to build the Mageia CHROOT-environment:

* Root-privileges on your device.
* Desktop/Laptop/Netbook with Mageia 2 or later installed.
* ADB added to $PATH.
* Cyanogenmod 9.0.0 built &amp; flashed on your device.
* An SD-card for your device with more than 10 GB of space left &amp; formatted with the MBR scheme &amp; a single ext3-partition plus 15 sectors left over.
* The CPU-speed set to 710 mhz with an app for rooted devices (for example interactiveX governor, YMMV.
* SSHDroid installed &amp; sideloaded.

Then, on a workstation (any architecture), insert the &#181;SD card, and as root, type:

 debootstrap --arch=armel --variant=minbase --foreign  mageia  /media/PHONE\ CARD/mageia  <A HREF="http://http.mageia.org/mageia">http://http.mageia.org/mageia</A>

You might want to consider using --arch=armhf if your phone supports ARMv7.

If you have a local mirror, replace the URL above with your local mirror.

Then remove the &#181;SD-card and replace it in the phone, start SSHDroid (which provides the command chroot).
Then SSH to the phone and type:

  export SDCARD=/mnt/sdcard
  export ROOT=$SDCARD/mageia
  export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
  mount -o remount,exec,dev,suid $SDCARD
  chroot $ROOT /bin/bash -l
  debootstrap/debootstrap --second-stage

Then build up the Mageia-system as you normally would a minimal installation.

If you need to run binaries from inside the chroot outside the chroot, you can use ld.so:

export SDCARD=/mnt/sdcard
export ROOT=$SDCARD/mageia
export LD_LIBRARY_PATH=$ROOT/lib:$ROOT/lib/arm-linux-gnueabi:$ROOT/lib/arm-linux-gnueabihf:$ROOT/usr/lib:$ROOT/usr/lib/arm-linux-gnueabi:$ROOT/usr/lib/arm-linux-gnueabihf
cd $ROOT
./lib/ld-linux-*.so* bin/ls

Available memory

Android pre-loads applications ( in some case that the user has never started) when there is free memory. This reduces the memory available to applications in a chroot.

It looks like the *_MEM properties in /init.rc along with the /sys/module/lowmemorykiller/parameters/minfree could help.

Zygote starts SystemServer and SystemServer restarts zygote, so simply killing one of them won't work.
The Android-native way of getting rid of zygote and all that descends from it is to just use the 'stop' command (in a script or through a remote (root) shell), to restart the whole Android environment you'd use the 'start' command:

stop # to stop zygote
# now do whatever you want without Android getting in the way.
Once you're ready just type following to start zygote:
start #

The display is now blank and ready for SDL.
The input devices only partly work with SDL on the 8120 ( write your own code to read /dev/input/event*), but graphics work well.

AF_INET privelages

On Android, you will need to add at least one group 3003 aid_inet for those processes which require access to creating sockets (other security guarded systems particular to Android may need addressing for other applications, search for 3003 aid_inet on the web for more detail).

exim4 and mailman chroot on Android

As well as altering inet access, the Mageia-exim user will have to be added to group 3003.
Further, if you experience trouble in the exim mainlog for creating sockets during DNS, try dropping privelages by adding &quot;deliver_drop_privilege=true&quot; to the exim4.conf.template file.
For mailman, the standard setup is required, as per the README.Mageia file in /usr/share/doc.
However the user list must also be added to the group 3003 to allow it to send mail.
</PRE>



<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="009228.html">[Mageia-discuss] people.mageia.org and mgapeople
</A></li>
	<LI>Next message: <A HREF="009231.html">[Mageia-discuss] Testers needed/wished for to build Mageia in a	chroot inside an Android-device from the written guide
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#9229">[ date ]</a>
              <a href="thread.html#9229">[ thread ]</a>
              <a href="subject.html#9229">[ subject ]</a>
              <a href="author.html#9229">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-discuss">More information about the Mageia-discuss
mailing list</a><br>
</body></html>