Mediatek YAFFS2 EXT4 mount, building kernel - General Questions and Answers

I built already kernel, forced printk.c never stop, added busybox to ramfs.
But Android doesnot come up. See attached log.
Question is that init.rc mounts to /system first mtd as yaffs2, then mounts [email protected] again as ext4 to /system. I do not understand this. I checked original kernel and there seems to be no yaffs support.
How it can mount it??
Look into log and search for busybox...
Why android doesnot start? Is the android_main not found a problem? Attached is also my init.rc modified with busybox calls

Related

Squashfs not automounting at init

Okay, so I'm most likely missing something stupidly obvious, but I'm pretty much banging my head against the wall here, so...
I'm trying to make squashfs work with my 32A kernel compile (from Cyanogen's sources - tried both regular and BFS), specifically the usual /system/modules/modules.sqf. Problem is, the file doesn't mount at startup. The kernel is compiled with squashfs support in kernel (=not as a module, obviously), loopback, loopcrypto and LZO compression support is also compiled in. The init.rc is pretty much the basic init.rc for any Hero ROM (specificaly we're talking about Qteknology ROM), which contains the usual
Code:
import /system/init.rc
trigger system
and the /system/init.rc contains just
Code:
on system
mount squashfs [email protected]/system/modules/modules.sqf /system/modules ro
There's also the corresponding line in fstab. Yet when the phone boots, /system/modules is not mounted. Strange thing is that when i enter mount /system/modules in terminal, it simply mounts without any problems. I thought this might have something to do with permissions, but I really can't track anything wrong with them. No obvious errors in logs as well. I've tried pretty much anything I could think of, spent countless hours trying to solve it, but I'm very much out of ideas. Anybody has any idea about what's going on here? Thanks for any suggestions.
mount -t sqaushfs?
I dont think mount supports specification of the FS without the -t flag.
If you mean adding the -t to the init.rc, then init.rc entries obviously follow somehow different mount syntax.
Ive got a thread regarding the init mount syntax aswell. You would think that with all of these ROM cookers and such around on the forum atleast someone would care to clarify this, as these certain people obviously detain more knowledge on this then we do, haha

Android init.rc Language

Hi XDA,
I havent found much on this topic on the forum. I wonder if anyone can elaborate or link me in the right direction regarding this issue.
Im working with Amon_Ra's latest 1.6.2 ROM. I unzipped it, took the boot.img, unpacked it, add a line in /etc/fstab and init.rc, repacked it, zipped the ROM, signed it, flashed it. But my changes dont seem to do the trick.
the following was added to init.rc
Code:
mount ext2 /dev/block/mmcblk0p2 /system/sd rw noatime nodiratime
and this was added to /etc/fstab
Code:
/dev/block/mmcblk0p2 /system/sd ext2 rw
Yes /system/sd exists, and Yes my microSD is partitioned correctly. I presume my line might be in wrong syntax? Or? Wiped before I flashed, didnt help.
If I've missed a thread on init.rc syntax I pardon that
Any help is appreciated!
altso tried,
Code:
mount ext2 [email protected] /system/sd
any suggestions at all?
bump, bump!
im running a motorola cliq, but i do know that the init.rc has the ability to start services.
You may want to try adding your lines into a script (shell script), and put that script into /system/bin
THEN add a command to open console and start that particular script, in init.rc
works for me with apps2sd for cliq.

Experiments with GB Kernel

I'm opening this thread to share information about experiments with the new GB kernel with other devs/contributors of M2 community.
Based on the idea of dual-booting I managed today to get my phone running using system directly from an image on /data.
The base system installed is boot/devtree/recovery from signed GB Leak with Mostly Blurless ROM. I created an image from this same system with dd if=/dev/block/system of=/data/blurless.img.
I then edited bootmenu 2nd-int init.rc to:
- comment lines that mount /data and /system
- added the following lines:
Code:
mount ext3 [email protected] /data nosuid nodev noatime nodiratime barrier=0
mount ext3 [email protected]/data/blurless.img /system noatime nodiratime barrier=1
In init.mapphone_umts.rc:
- commented lines that remounts /system
- added following line:
Code:
mount ext3 [email protected]/data/blurless-system.img /system ro noatime nodiratime remount
In /system/bootmenu/scripts/2nd-init.sh:
Code:
#!/sbin/sh
######## BootMenu Script v0.8.6
######## Execute [2nd-init] Menu
export PATH=/sbin:/system/xbin:/system/bin
######## Main Script
rm /*.rc
cp -r -f /system/bootmenu/2nd-init/* /
cp -fp /system/bootmenu/binary/2nd-init /sbin/
chmod 755 /*.rc
#chmod 755 /system/bootmenu/binary/2nd-init
chmod 755 /sbin/2nd-init
umount /acct
umount /mnt/asec
umount /dev/cpuctl
umount /dev/pts
umount /mnt/obb
## sbin cleanup
## move post_bootmenu.sh
#/system/bootmenu/binary/2nd-init
umount -l /system
/sbin/2nd-init
exit
Works fine and system is really mounted on loopback device after boot. Now I want to mount on init.rc /data as a bind fs. Does anyone know how to do that as a init.rc script command?
As a test I tried
mount ext3 [email protected]/data/system /mnt/data
but it didn't work
Ok. I found a way to do that mounting data first as /mnt/data then mounting loopback system. with system ready I can mount bind /data with the following command:
exec /system/xbin/busybox mount -obind /mnt/data/rom/blurless-data /data
I'd like better to mount this with a native init command if anybody knows how to, but for the moment this will do.
It doesn't work because bind is not supported by the original mount command ?
Anyway, may be you can do symlink with the data directory .
But good job allowing us to test img system without breaking existing one !
Trying now to boot MIUI on a second system image I get the following error:
08-26 21:06:40.773 2971 2979 E FramebufferNativeWindow: couldn't open framebuffer HAL (No such device)
I'm not sure if this error was caused by kernel incompatibility or by some special file libsurfaceflinger could not find. Doing strings | grep on libsurfaceflinger.so from miui I could find this references:
/dev/tty0
/sys/android_power/wait_for_fb_sleep
/sys/android_power/wait_for_fb_wake
/sys/class/graphics/fbcon
/sys/power/wait_for_fb_sleep
/sys/power/wait_for_fb_wake
Maybe we can map old devices to new devices (ln -s) at run time and make it work but I don't know exactly how to map them.
Edit: I am unable to create anything in /sys, even mounting it as RW. Does n1 know what I should do?
Yeah! You rule!
r2beta0 said:
Trying now to boot MIUI on a second system image I get the following error:
08-26 21:06:40.773 2971 2979 E FramebufferNativeWindow: couldn't open framebuffer HAL (No such device)
I'm not sure if this error was caused by kernel incompatibility or by some special file libsurfaceflinger could not find. Doing strings | grep on libsurfaceflinger.so from miui I could find this references:
/dev/tty0
/sys/android_power/wait_for_fb_sleep
/sys/android_power/wait_for_fb_wake
/sys/class/graphics/fbcon
/sys/power/wait_for_fb_sleep
/sys/power/wait_for_fb_wake
Maybe we can map old devices to new devices (ln -s) at run time and make it work but I don't know exactly how to map them.
Edit: I am unable to create anything in /sys, even mounting it as RW. Does n1 know what I should do?
Click to expand...
Click to collapse
Ok. for your system find all it needs, you have to "bind" (by anyway i think) /proc and /sys . Like a normal linux when you do a chroot. I don't know the exact order of execution of your script, but before anything else, you must have proper /proc , /sys ,/dev . For example, here it what we need in to do in linux,
#!/bin/bash
mount --bind /dev /répertoire-vers-votre-chroot/dev
mount --bind /dev/pts /répertoire-vers-votre-chroot/dev/pts
mount --bind /dev/shm /répertoire-vers-votre-chroot/dev/shm
mount -t proc none /répertoire-vers-votre-chroot/proc
mount -t sysfs none /répertoire-vers-votre-chroot/sys
As you can't bind them with mount, try the symlink , it might work (i dont see why not) . These directories are created by the kernel , maybe there are other in android , i don't know.
Try that and let me know , it should do the trick !
Edit: i read too fast! It couldnt be that, as you dont change / .
r2beta0 said:
Trying now to boot MIUI on a second system image I get the following error:
08-26 21:06:40.773 2971 2979 E FramebufferNativeWindow: couldn't open framebuffer HAL (No such device)
I'm not sure if this error was caused by kernel incompatibility or by some special file libsurfaceflinger could not find. Doing strings | grep on libsurfaceflinger.so from miui I could find this references:
/dev/tty0
/sys/android_power/wait_for_fb_sleep
/sys/android_power/wait_for_fb_wake
/sys/class/graphics/fbcon
/sys/power/wait_for_fb_sleep
/sys/power/wait_for_fb_wake
Maybe we can map old devices to new devices (ln -s) at run time and make it work but I don't know exactly how to map them.
Edit: I am unable to create anything in /sys, even mounting it as RW. Does n1 know what I should do?
Click to expand...
Click to collapse
Isn't MIUI and CM7 running on top of froyo kernel/dev tree?
I remember I got the same HAL issue when I tried to run unsigned GB on froyo kernel. I assume trying to run froyo based rom's on 2.3.4 kernel will show the same issues.
n3ptun3 said:
Isn't MIUI and CM7 running on top of froyo kernel/dev tree?
I remember I got the same HAL issue when I tried to run unsigned GB on froyo kernel. I assume trying to run froyo based rom's on 2.3.4 kernel will show the same issues.
Click to expand...
Click to collapse
Hm... maybe you're right. The new nightly CM from Defy should work with GB kernel I think.
Sent from my Milestone 2 XDA App
dangpzanco said:
Hm... maybe you're right. The new nightly CM from Defy should work with GB kernel I think.
Sent from my Milestone 2 XDA App
Click to expand...
Click to collapse
I wouldn't bet on it. 2nd-init might be GB ready, but Defy's CM7 is still built over a froyo base. If I have time this weekend I'll experiment on D2G CM7 with GB base.
Just let GB kernel boot CM7. ch-2.2 kernel suck in touch screen.
n3ptun3 said:
I wouldn't bet on it. 2nd-init might be GB ready, but Defy's CM7 is still built over a froyo base. If I have time this weekend I'll experiment on D2G CM7 with GB base.
Click to expand...
Click to collapse
I can't boot CM7 0826 nightly bulid with both ch-2.2.2/GB kernels. Anyone know why? The author has changed the 2nd-init?
Edit: I think I know why. The author delete 2nd-init in /binary. So we need to change the boot method to 2nd-boot. GB kernel isn't suported yet.
Endless7 said:
Edit: I think I know why. The author delete 2nd-init in /binary. So we need to change the boot method to 2nd-boot. GB kernel isn't suported yet.
Click to expand...
Click to collapse
That seems to be a mistake and was fixed in 3e3c820adecf812e3dfea872a184f5f428fd4fbc (Allow 2nd-init support with bootmenu, which is stored in system image). It was caused by heavy restructuring of the motorola common boot-code in the CM7 repository. Just copy my 2nd-init into the binary directory, and you should be fine.
pat972 said:
Ok. for your system find all it needs, you have to "bind" (by anyway i think) /proc and /sys . Like a normal linux when you do a chroot. I don't know the exact order of execution of your script, but before anything else, you must have proper /proc , /sys ,/dev . For example, here it what we need in to do in linux,
#!/bin/bash
mount --bind /dev /répertoire-vers-votre-chroot/dev
mount --bind /dev/pts /répertoire-vers-votre-chroot/dev/pts
mount --bind /dev/shm /répertoire-vers-votre-chroot/dev/shm
mount -t proc none /répertoire-vers-votre-chroot/proc
mount -t sysfs none /répertoire-vers-votre-chroot/sys
As you can't bind them with mount, try the symlink , it might work (i dont see why not) . These directories are created by the kernel , maybe there are other in android , i don't know.
Try that and let me know , it should do the trick !
Edit: i read too fast! It couldnt be that, as you dont change / .
Click to expand...
Click to collapse
It's a good idea, as I can bind filesystems using busybox mount. It needs just some engineering into 2nd-init script like copying busybox to /sbin and forcing umount of /dev /proc and /sys, but it can be done.
How do I clone /sys to some other folder like /data/sys? I tried with 'cp -a' but it doesn't work fine. As I see I have to clone /sys and make some symlinks on this clone. Then I bind it with original /sys on init.rc. Is that right?
r2beta0 said:
It's a good idea, as I can bind filesystems using busybox mount. It needs just some engineering into 2nd-init script like copying busybox to /sbin and forcing umount of /dev /proc and /sys, but it can be done.
How do I clone /sys to some other folder like /data/sys? I tried with 'cp -a' but it doesn't work fine. As I see I have to clone /sys and make some symlinks on this clone. Then I bind it with original /sys on init.rc. Is that right?
Click to expand...
Click to collapse
I would not unmount /dev /proc and /sys, they are closely related to kernel init, in linux desktop it the first thing rc.sysinit does.
I was thinking more to something like "ln -s /sys/ /data/sys" , and one other solution i've just tested, is to do a "mount -n -t sysfs sys /data/sys -o nosuid,noexec,nodev" ! The difference for me is that with the mount command you'll not be able to umount /data/sys until reboot ! With the symlink you can just rm it when you finish.
The bind option is usefull cause when you do a chroot, you don't have access the other part of the system , so i'm not sure the symlink method work in that case. i'll ask and tell you.
Edit : I confirm It's that well about bind and chroot. and it seems to me , you can't create file in /sys , the kernel create them and you can read/change values. If you create one, it will not be taken in account by the kernel.
Also can you light up my lantern, which script in /system is called after the 2nd-init to launch the MIUI ?
pat972 said:
I would not unmount /dev /proc and /sys, they are closely related to kernel init, in linux desktop it the first thing rc.sysinit does.
I was thinking more to something like "ln -s /sys/ /data/sys" , and one other solution i've just tested, is to do a "mount -n -t sysfs sys /data/sys -o nosuid,noexec,nodev" ! The difference for me is that with the mount command you'll not be able to umount /data/sys until reboot ! With the symlink you can just rm it when you finish.
The bind option is usefull cause when you do a chroot, you don't have access the other part of the system , so i'm not sure the symlink method work in that case. i'll ask and tell you.
Edit : I confirm It's that well about bind and chroot. and it seems to me , you can't create file in /sys , the kernel create them and you can read/change values. If you create one, it will not be taken in account by the kernel.
Also can you light up my lantern, which script in /system is called after the 2nd-init to launch the MIUI ?
Click to expand...
Click to collapse
When you use bootmenu to start 2nd-init it will run a script called /system/bootmenu/script/2nd-init.sh. The last line of this script is 2nd-init binary itself. When you call 2nd-init binary it forks init on top of itself causing something like a hot restart. So, what 2nd-init script does is remount / as RW and copy new init.rc, init.mpaphone_umts.rc and init binary to /. Then it calls 2nd-init binary in order to use your custom files instead of stock ones. You can do anything you like on init.rc, as I did to boot MIUI from a loopback device. Unfortunately MIUI was compiled for froyo kernel and can't find some devices it needs to work. Thats why I need to create symlinks inside /sys and I think I already found a way to do that. Will test and explain that later.
Ok thanks !
Even with the new symlinks the system is unable to boot. As I suspected it is far more complicated then just adding links to /sys, too bad. I think the only way we have to boot multi-systems with multi-kernels (like miui on froyo and stock on gb) will be using kexec hack. n1 know if some group already found a way to run kexec on milestone or milestone2?
You can't rebuilt miui over a generic 2.6.32 kernel ? Well i'm a total newb in rom dev, i assume the officiel ginger from google won't work, you must have some specific hardware stuff ! For kexec it seems they have some driver problem, but since you want to boot the moto kernel may be it'll be easier !
pat972 said:
You can't rebuilt miui over a generic 2.6.32 kernel ? Well i'm a total newb in rom dev, i assume the officiel ginger from google won't work, you must have some specific hardware stuff ! For kexec it seems they have some driver problem, but since you want to boot the moto kernel may be it'll be easier !
Click to expand...
Click to collapse
MIUI is closed source, so only team members are able to rebuilt it
Do you know how can I use kexec to boot moto kernel?
r2beta0 said:
MIUI is closed source, so only team members are able to rebuilt it
Click to expand...
Click to collapse
This is illegal - violation of GPL license. If they modified Linux kernel they should give users source code to those modifications.

Help mounting with R/W access

Hi, I cannot figure out what I need to write in terminal emulator to gain root access to install cwm. I was hoping someone could post the exact command needed, I would appreciate it alot. I have tried searching but the generic commands i found on a different site didnt work. Thanks!
Can you gain root from terminal emulator? First I have heard this. Why not just Odin one of the modded kernels?
Sent from my HTC Sensation Z710e using xda premium
andale927 said:
Hi, I cannot figure out what I need to write in terminal emulator to gain root access to install cwm. I was hoping someone could post the exact command needed, I would appreciate it alot. I have tried searching but the generic commands i found on a different site didnt work. Thanks!
Click to expand...
Click to collapse
If you're just looking for the command to mount /system as read/write, you'll have to figure out what "device" is used for the mount. From the terminal, type:
mount
That will show you a list of things that are currently mounted. You'll see something like (not exactly):
/dev/block/stl9 /system rfs rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime, uid=1000,gid=1015,fmask=0002,dm
ask=0002,allow_utime=0020,codepage=cp437,iocharset =iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
The part you're interested in is the part before "/system" and that is the block device used to mount your system partition. To mount it read/write, you type (based on this example's block device & based on the rfs vs. ext4 file system):
mount -o rw,remount -t rfs /dev/block/stl9 /system
The -o part tells mount "here come the options" which are read/write & remount. The -t tells it the filesystem type (rfs or ext4, depends on if you have voodoo enabled). The next argument tells it the block device, then what mount point to use.
As for root, what Exodian said. You'll either have to flash a root enabled kernel or use SuperOneClick v2.2.

[Q] KatKiss ROM 4.2.2 - Asus TF101 - Native CIFS?

Hi guys,
Yesterday, I just flashed the rom KatKiss-4.2.2_226.zip to my TF101. Everthing is working fine but I can't mount CIFS share like a local file system. First of all I was formating /system before flashing the rom and the gapps and after I made a Wipe cache/Dalvik... I think it's the usually way... Right? OK. The device work properly.
My next step was try to mount a CIFS share from my NAS. I want to mount something like //192.168.1.45/media to /sdcard/media in the local storage. Before to try in androd I tried it in Ubuntu and works with the user "guest" in read only:
# mount -t cifs //192.168.1.45/media /tmp/a -o username=guest
When I tried to do it in Andorid I found several errors. At the begin I was thinking in the cifs.ko/md4.ko and nsl_utf8.ko modules but I readed that the ROM have it in the kernel. Not like a module. When I try in the Android's command line I get error like "Key has Expired". I found that this error is allied by the multiuser feature of Android 4.2 and CIFS. Something about the user spaces in the storage.
And now the question: Is it a problem with the modules or a problem with the mounting of CIFS shares in Android 4.2?
Thanks in advances!!
Regards
abocaman said:
Hi guys,
Yesterday, I just flashed the rom KatKiss-4.2.2_226.zip to my TF101. Everthing is working fine but I can't mount CIFS share like a local file system. First of all I was formating /system before flashing the rom and the gapps and after I made a Wipe cache/Dalvik... I think it's the usually way... Right? OK. The device work properly.
My next step was try to mount a CIFS share from my NAS. I want to mount something like //192.168.1.45/media to /sdcard/media in the local storage. Before to try in androd I tried it in Ubuntu and works with the user "guest" in read only:
# mount -t cifs //192.168.1.45/media /tmp/a -o username=guest
When I tried to do it in Andorid I found several errors. At the begin I was thinking in the cifs.ko/md4.ko and nsl_utf8.ko modules but I readed that the ROM have it in the kernel. Not like a module. When I try in the Android's command line I get error like "Key has Expired". I found that this error is allied by the multiuser feature of Android 4.2 and CIFS. Something about the user spaces in the storage.
And now the question: Is it a problem with the modules or a problem with the mounting of CIFS shares in Android 4.2?
Thanks in advances!!
Regards
Click to expand...
Click to collapse
You need to mount it outside of /storage/* or /mnt/shell/*
timduru said:
You need to mount it outside of /storage/* or /mnt/shell/*
Click to expand...
Click to collapse
Hi timduru,
thanks for your cooked rom!! Is really brilliant!! Keep the good work. And thanks for the solution. Just now I'm trying and the cifs mount work very good. My fault was to try to mount the folder in the path. For exemple:
busybox mount -t cifs //192.168.1.69/media/Comics /storage/sdcard0/Comics -o username="user",pass="your password" <-- Not work
busybox mount -t cifs //192.168.1.69/media /data/media -o username="user",pass="your password" <-- Work
And then try in cifs manager and work perfectly!! Always mounting the share without folders in the path, and mounting it in the /data as a destination.
Thank you very much!!:good::good::good::laugh:

Categories

Resources