Ubuntu Touch Doesn't Boot - Ubuntu Touch Q&A, Help & Troubleshooting

I'm trying to port Ubuntu Touch to the Samsung Blaze (t769)
It seems the kernel is booting, but all I have is a blank screen, and nothing happens when I hit any of the buttons.
I am able to start abd with root privileges and read my last_kmsg
Blaze last_kmsg.log
The notable error:
Code:
initrd: Couldn't find data partition. Spawning adbd
And then:
Code:
sec_open_param PARAM OPEN FAIL
sec_switch_init_work error value = 3
param_sec_operation: filp_open failed. (-2)
I read in the guide that there could be issues with script/touch finding the data partition and could be hard coded in if that's the case. However, I cannot find the script "touch" anywhere in the source code, other than in the out directory.
Anybody have any insight in this?

Unpack the boot.img using the dsixda kitchen and you'll find that file in it, then repack it and you should be good
By the way I cannot get to boot the HOX with this new method by the Ubuntu Team
This is one of the last_kmsg i got

Every time I have tried to unpack/re-pack a boot.img, it fails to boot. I found the script in /usr/share/initram-tools/scripts/touch in the tarball that is in saucy-preinstalled-touch-armhf.zip. So I added data and DATA to the list of possible names in that script and replaced it. Flashed it and it has mounted the data partition (mmcblk0p25) but still no boot. I also looked at /scripts/touch, but it is still the default script as I had expected.
I updated the last_kmsg.log in the O.P.
I am thinking that it might be easier to change the data partition name with tune2fs to something that is already listed in the touch script as a potential name, i.e. userdata or DATAFS. Any thoughts?
So, I used tune2fs to change the label to DATAFS. Now I have a kernel panic... I'm not really sure if that's progress or regress...lol
I flashed everything over again then rebooted and got rid of the kernel panic. But now the last_kmsg is reporting the one posted above...

Did you disable the bootanimation ?

matt95 said:
Did you disable the bootanimation ?
Click to expand...
Click to collapse
No I did not, it doesn't even show it. But I tried it anyway, and still fails to boot... Same last_kmsg as posted in OP...
I think the problem is this:
Code:
EXT4-fs (mmcblk0p24): mounted filesystem with ordered data mode. Opts: (null)
SysRq : Emergency Remount R/O
EXT4-fs (mmcblk0p26): re-mounted. Opts: (null)
EXT4-fs (mmcblk0p24): re-mounted. Opts: (null)
Emergency Remount complete
(sec_debug_set_upload_magic) 0
set_dload_mode <0> ( C0175BA0 )
Because, after that is when it goes into shutdown...

Try also adding these lines into your init.rc and see if that makes any difference
Code:
service sensorservice /system/bin/sensorservice
class main
user system
group graphics audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
service ubuntuappmanager /system/bin/ubuntuappmanager
class main
service ubuntu_chroot /system/bin/ubuntu_chroot init
class main
oneshot
and blank out the bootanimation
Code:
#service bootanim /system/bin/bootanimation
# class main
# user graphics
# group graphics
# disabled
# oneshot

matt95 said:
Try also adding these lines into your init.rc and see if that makes any difference
Code:
service sensorservice /system/bin/sensorservice
class main
user system
group graphics audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
service ubuntuappmanager /system/bin/ubuntuappmanager
class main
service ubuntu_chroot /system/bin/ubuntu_chroot init
class main
oneshot
and blank out the bootanimation
Code:
#service bootanim /system/bin/bootanimation
# class main
# user graphics
# group graphics
# disabled
# oneshot
Click to expand...
Click to collapse
No change. No offense, but I think you are going in the wrong direction.

Got it, we have two different devices so they shouldn't have the same solutions... Let me know if you figure something out

matt95 said:
Got it, we have two different devices so they shouldn't have the same solutions... Let me know if you figure something out
Click to expand...
Click to collapse
Unfortunately no...lol
But at the same time, we should be using the same ubuntu image...
All-in-all, I think it's in my mount params for the system partition as that is what seems to be causing the emergency remount...
Thanks anyway for your help...

strange
Sent from my HUAWEI P6-U06 using Tapatalk 4

Related

[Q] MKFS.EXT4 Compiled for Android

I'm trying to make an auto install script within the initramfs. I've got everything working, including automatic fdisk, but I cannot get mkfs.ext4 to work on the Android kernel, and there is no version of Busybox with the ext4 applet. Does anyone have a mkfs.ext4 that runs successfully on Android? When I run it from a terminal the output is
Code:
mkfs.ext4: 1: Syntax error: word unexpected (expecting ")")
Here's my code if you want to see what I'm doing.
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk1p2 /tmp/tmproot
mkdir /tmp/tmproot/itworks
tar -xzvf /tmp/mnt/mysticfw.tar.gz -C /tmp/tmproot/
sync
#rm /tmp/mnt/mysticfw.tar.gz
umount /tmp/tmproot
fi
sync
umount /tmp/mnt
It automatically partitions the stock Android block and installs a tar.gz from the internal storage to simplify my unsquashed 2.1.4 filesystem install, and the only part I can't get working is mkfs.ext4.
Found one! It's 3 MBs though, so if anyone has a smaller one, it would be very nice.
msticninja said:
I'm trying to make an auto install script within the initramfs. I've got everything working, including automatic fdisk, but I cannot get mkfs.ext4 to work on the Android kernel, and there is no version of Busybox with the ext4 applet. Does anyone have a mkfs.ext4 that runs successfully on Android? When I run it from a terminal the output is
Code:
mkfs.ext4: 1: Syntax error: word unexpected (expecting ")")
Click to expand...
Click to collapse
Why do you don't use the mke2fs from Uruk for example (the easiest way) asking $auron if it's ok for him. His size is only 49KB.
Find it like the following on Uruk installation:
Code:
[COLOR="DarkRed"]
# mkfs.ext4 -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
# find / -name mke2fs | xargs ls -l
-rwxr-xr-x 1 root root 30584 Dec 15 03:46 /system/bin/mke2fs
[B]-rwxr-xr-x 5 root root 49248 4 Jan 15 13:14 /usr/local/sbin/mke2fs[/B]
#/usr/local/sbin/mke2fs -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
[/COLOR]
Here's my code if you want to see what I'm doing.
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk1p2 /tmp/tmproot
mkdir /tmp/tmproot/itworks
tar -xzvf /tmp/mnt/mysticfw.tar.gz -C /tmp/tmproot/
sync
#rm /tmp/mnt/mysticfw.tar.gz
umount /tmp/tmproot
fi
sync
umount /tmp/mnt
It automatically partitions the stock Android block and installs a tar.gz from the internal storage to simplify my unsquashed 2.1.4 filesystem install, and the only part I can't get working is mkfs.ext4.
Click to expand...
Click to collapse
and don't forget to add "-l" on FDISK command and change the device mmcblk0 with mmcblk1 on the lines:
Code:
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
Cheers,
shklifo said:
Why do you don't use the mke2fs from Uruk for example (the easiest way) asking $auron if it's ok for him. His size is only 49KB.
Find it like the following on Uruk installation:
Code:
[COLOR="DarkRed"]
# mkfs.ext4 -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
# find / -name mke2fs | xargs ls -l
-rwxr-xr-x 1 root root 30584 Dec 15 03:46 /system/bin/mke2fs
[B]-rwxr-xr-x 5 root root 49248 4 Jan 15 13:14 /usr/local/sbin/mke2fs[/B]
#/usr/local/sbin/mke2fs -V
mke2fs 1.41.3 (12-Oct-2008)
Using EXT2FS Library version 1.41.3
[/COLOR]
and don't forget to add "-l" on FDISK command and change the device mmcblk0 with mmcblk1 on the lines:
Code:
$FDISK /dev/mmcblk0 < /home/fdisk.input
$MKFS_EXT4 -O ^huge_file /dev/mmcblk0p2
Cheers,
Click to expand...
Click to collapse
Why didn't I think of that? Thanks.
But regarding mmcblk0/1, I'm replacing the stock Android, so the fdisk.input file contains the commands to delete mmcblk0p2 and p3, and make a new partition in the unused space. I hate using space on my Internal Storage, so I'm using Archos' space.
msticninja said:
Why didn't I think of that? Thanks.
But regarding mmcblk0/1, I'm replacing the stock Android, so the fdisk.input file contains the commands to delete mmcblk0p2 and p3, and make a new partition in the unused space. I hate using space on my Internal Storage, so I'm using Archos' space.
Click to expand...
Click to collapse
If you are using the mmcblk0p2 as rootfs as you say (and you are expanded tar archive on mmcblk1p2), than you have to change the line:
mount /dev/mmcblk1p2 /tmp/tmproot
Click to expand...
Click to collapse
with
mount /dev/mmcblk0p2 /tmp/tmproot
Click to expand...
Click to collapse
shklifo said:
If you are using the mmcblk0p2 as rootfs as you say (and you are expanded tar archive on mmcblk1p2), than you have to change the line:
with
Click to expand...
Click to collapse
I know, that's my current data partition, I'll change it once I'm done testing. The tar file just has a test file in it, so when I boot back into block1, I can see if the IF statement was executed by seeing if it was extracted to block1. I'll also have to change etc/mountpoints once testing is actually finished.
One more question since you're so quick. I think I have everything working, except it needs a reboot in between the fdisk and mke2fs commands to reload the partition table. I'm trying to use partprobe instead of rebooting, but it hasn't been cross compiled to work on Android, AFAIK. Have you seen a way to reload the MBR without rebooting?
msticninja said:
I know, that's my current data partition, I'll change it once I'm done testing. The tar file just has a test file in it, so when I boot back into block1, I can see if the IF statement was executed by seeing if it was extracted to block1. I'll also have to change etc/mountpoints once testing is actually finished.
One more question since you're so quick. I think I have everything working, except it needs a reboot in between the fdisk and mke2fs commands to reload the partition table. I'm trying to use partprobe instead of rebooting, but it hasn't been cross compiled to work on Android, AFAIK. Have you seen a way to reload the MBR without rebooting?
Click to expand...
Click to collapse
I'v been looking at the recovery_lib.sh in the recovery boot image and can't find anything special to re-read the partition table. And yes they also use fdisk to repartition. So I suspect the driver for the block device does not cache the MBR and you can just mke2fs after the partition table is created.
I can't remember from what firmware that recovery boot image was but I think it's from the 2.1.04 and they do some repartitioning there for the swap space.
I'll check it again and get back to you.
wdl1908 said:
I'v been looking at the recovery_lib.sh in the recovery boot image and can't find anything special to re-read the partition table. And yes they also use fdisk to repartition. So I suspect the driver for the block device does not cache the MBR and you can just mke2fs after the partition table is created.
I can't remember from what firmware that recovery boot image was but I think it's from the 2.1.04 and they do some repartitioning there for the swap space.
I'll check it again and get back to you.
Click to expand...
Click to collapse
I just checked the recovery image from 2.1.04 and after the fdisk commands there is nothing to re-read the MBR the next commands executed are mount commands to check if the fs is present I suggest you look at the /etc/scripts/recovery_lib.sh yourself it could give some clues on how to do things.
wdl1908 said:
I just checked the recovery image from 2.1.04 and after the fdisk commands there is nothing to re-read the MBR the next commands executed are mount commands to check if the fs is present I suggest you look at the /etc/scripts/recovery_lib.sh yourself it could give some clues on how to do things.
Click to expand...
Click to collapse
For me too, it have nothing to do with a reboot to load partitions table and access partition to format them with the choised filesystem.
You can delete any partition on linux (except rootfs one ), recreate them and directly format them as you like, reboot isn't necesary.
Thanks for all the replies, very helpful, but I'm stuck. Fdisk seems to use ioctl to reload the partition table, so you don't need a reboot if everything on the device is unmounted before writing the partition table, but I'm having very strange issues with mke2fs now. I've had the whole thing work twice now, but when I flash back to stock, then retry the script, it usually does everything except the formatting. Here's the code:
Code:
mount /dev/mmcblk1p1 /tmp/mnt
if [ -f /tmp/mnt/mysticfw.tar.gz ]; then
umount /dev/mmcblk0p1
umount /dev/mmcblk0p2
umount /dev/mmcblk0p3
umount /dev/mmcblk0p4
fdisk /dev/mmcblk0 < /home/fdisk.input
mv /tmp/mnt/mysticfw.tar.gz /tmp/mnt/mysticf.tar.gz
sync
umount /tmp/mnt
log_and_reboot
fi
if [ -f /tmp/mnt/mysticf.tar.gz ]; then
rm /etc/mtab
touch /etc/mtab
mke2fs -T ext4 -O ^huge_file /dev/mmcblk0p2
mount /dev/mmcblk0p2 /tmp/tmproot
tar -xzf /tmp/mnt/mysticf.tar.gz -C /tmp/tmproot/
sync
mv /tmp/mnt/mysticf.tar.gz /tmp/mnt/mysticdone.tar.gz
umount /tmp/tmproot
rm /etc/mtab
ln -s /proc/mounts /etc/mtab
fi
sync
umount /tmp/mnt
I have it reboot after the fdisk just in case, and the fdisk works perfectly, so the second IF/THEN is the issue. I had to retouch the mtab just to make sure it's empty, as mke2fs fails if mtab doesn't exist(at least in terminal), then I relink it to /proc/mounts as they do in the stock firmware. Here's my mke2fs.conf:
Code:
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
blocksize = 4096
inode_size = 256
inode_ratio = 16384
[fs_types]
ext3 = {
features = has_journal
}
ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
}
ext4dev = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
inode_size = 256
options = test_fs=1
}
small = {
blocksize = 1024
inode_size = 128
inode_ratio = 4096
}
floppy = {
blocksize = 1024
inode_size = 128
inode_ratio = 8192
}
news = {
inode_ratio = 4096
}
largefile = {
inode_ratio = 1048576
blocksize = -1
}
largefile4 = {
inode_ratio = 4194304
blocksize = -1
}
hurd = {
blocksize = 4096
inode_size = 128
}
Is there a way to echo the output from my script to a file like dontpanic so I can see what the error is?
msticninja said:
Is there a way to echo the output from my script to a file like dontpanic so I can see what the error is?
Click to expand...
Click to collapse
Simple append (">>") and "echo" doesn't work to a redirected logfile?
I've only learned what I've needed to learn over the years, usually with endless google searches and reading through man pages, so I've never tried to log outputs, because I could always see the output in a terminal or onscreen during boot. Android is the first time I haven't been able to actually see the boot process.
Once again, thanks for your help. I probably could've googled this, but I kind of asked as an afterthought. I didn't even think about redirecting. So if the mke2fs line is the one I want to log, I just add "2&>> /tmp/mnt/logfile" to the end of it, right?
Also, thanks for your original thread about booting from Internal Storage, I never got around to developing on Android until you posted that, and I realized just how similar Android is to L/unix(e.g. exactly the same).
msticninja said:
I didn't even think about redirecting. So if the mke2fs line is the one I want to log, I just add "2&>> /tmp/mnt/logfile" to the end of it, right?
Click to expand...
Click to collapse
ehm, no.
In your case must be like the following:
Code:
"your command" >> /tmp/mnt/logfile 2>&1
That means redirect all messages from STDERR (2 - standard error) to STDOUT (1 - standard output) and all messaged collected on STDOUT to the redirected log file /tmp/mnt/logfile, or more comprensible redirect all mesage including error ones to the log file.
I'm working in Unix environments and use them often
And a good practice in developing is to use "echo" to the same log file, so you know the exact place the script is running, like:
Code:
echo "I'm just before the formatting step of the ..." >> /tmp/mnt/logfile
shklifo said:
ehm, no.
In your case must be like the following:
Code:
"your command" >> /tmp/mnt/logfile 2>&1
That means redirect all messages from STDERR (2 - standard error) to STDOUT (1 - standard output) and all messaged collected on STDOUT to the redirected log file /tmp/mnt/logfile, or more comprensible redirect all mesage including error ones to the log file.
I'm working in Unix environments and use them often
And a good practice in developing is to use "echo" to the same log file, so you know the exact place the script is running, like:
Code:
echo "I'm just before the formatting step of the ..." >> /tmp/mnt/logfile
Click to expand...
Click to collapse
Strange. The google searching lead me to believe the "2>&1" was before the location, and replaced ">>". Once again, thanks for the help.
any chance of you getting this uploaded? iterested in this since I'm not that good with linux
TjaXanK said:
any chance of you getting this uploaded? iterested in this since I'm not that good with linux
Click to expand...
Click to collapse
I could probably finish it, but I'm waiting for a new version of Uruk first, as his install script already gets rid of the linux steps, it just doesn't give you the choice to install to the internal memory yet. Once he does that, I'll add my changes to make it install to the Archos partition. The latest Uruk is also a bit too big for the archos partition. I had to cut my data partition down to ~150 megs.
msticninja said:
I could probably finish it, but I'm waiting for a new version of Uruk first, as his install script already gets rid of the linux steps, it just doesn't give you the choice to install to the internal memory yet. Once he does that, I'll add my changes to make it install to the Archos partition. The latest Uruk is also a bit too big for the archos partition. I had to cut my data partition down to ~150 megs.
Click to expand...
Click to collapse
ok, I'm currently running urk with the new install system and it's brillant but it would be perfect if we could run it without cutting down on our storage space

[DEV] "Root easily your Gen8 device" (developers only thread!)

This thread is for discussing features and improvements of this rooting method
For questions and problems read the [HOWTO] thread
Project site online: archos-gen8-sde-rooting
wdl1908 said:
chulri what about creating a 1Gb file on the /mnt/storage and formatting that as ext3 copying all the original /data to it and then mounting that with a loop interface on /data.
Click to expand...
Click to collapse
That's what I tried previously (before the /data thing), but I had no luck and it's a big issue because android tries to unmount /mnt/storage when you connect your archos device to the computer but that's not possible because the lock of the mounted rw-file makes umounting of /mnt/storage impossible and I have to mount the rw-file before /mnt/storage gets mounted, that's another issue which must be resolved.
chulri said:
That's what I tried previously (before the /data thing), but I had no luck and it's a big issue because android tries to unmount /mnt/storage when you connect your archos device to the computer but that's not possible because the lock of the mounted rw-file makes umounting of /mnt/storage impossible and I have to mount the rw-file before /mnt/storage gets mounted, that's another issue which must be resolved.
Click to expand...
Click to collapse
Yeah I came to the same conclusion as you, that what I suggested would bork the usb mount option to the PC.
Another thing I realized is that the official firmware upgrades could probably update files on the data partition. So moving the whole partition is not an option as that would break the upgrade process.
I've been looking at splitting the storage partition in several parts with parted I found an arm binary at http://plugapps.com/arm/ maybe these can be included in the initramfs.
I've also been analyzing my data partition
Code:
# du -s /data/*
112003 app
70503 dalvik-cache
40084 data
4622 test
The test directory is the place where the google market is installed via arctools or gappsinstaller.
So if it's possible to split the storage partition in several part we could move these dirs to it's own partition. This would not be optimal a good solution would be to move the complete data partition over but this needs a bit of thinking how to handle upgrades.
wdl1908 said:
So if it's possible to split the storage partition in several part we could move these dirs to it's own partition. This would not be optimal a good solution would be to move the complete data partition over but this needs a bit of thinking how to handle upgrades.
Click to expand...
Click to collapse
We could shrink the internal storage and append partition(s) after it. I'll give it a try, as long as my usb port is broken I have more time to focus on this here
chulri said:
We could shrink the internal storage and append partition(s) after it. I'll give it a try, as long as my usb port is broken I have more time to focus on this here
Click to expand...
Click to collapse
I've been trying to cross compile e2fsprogs and parted but I can't seem to get it.
Code:
e2fsprogs-1.41.14$ cross ./configure --host=arm-linux-uclibcgnueabi --build=i686-linux
Completes without errors but the make does not complete.
Code:
gen_uuid.c:(.text+0x418): undefined reference to `__aeabi_read_tp'
../../lib/libuuid.a(gen_uuid.o):gen_uuid.c:(.text+0x788): more undefined references to `__aeabi_read_tp' follow
I've tried to use the pre-compiled packages but it seems they don't work or i'm missing something.
fdisk is already included in initramfs thus no need for a parted binary.
edit: but to minimize data loss we need a resize2fs binary to resize the fat/ext3 partition
mkfs.ext3 (for the rw partition) and fsck are included too in the initramfs by archos
chulri said:
fdisk is already included in initramfs thus no need for a parted binary.
edit: but to minimize data loss we need a resize2fs binary to resize the fat/ext3 partition
mkfs.ext3 (for the rw partition) and fsck are included too in the initramfs by archos
Click to expand...
Click to collapse
Yep resize2fs is part of e2fsprogs. I've been working on the packages in the buildroot there seems to be a lot of errors but I finally succeeded in building the e2fsprogs package. but riseze2fs is not included. I need to check the config for that package maybe there is an option missing.
To get the buildroot working properly you need to copy the file
Code:
cp local/g8_arm/g8_arm.config .config
remove the line
Code:
package/apdf/Config.in
from .config.cmd
remove the line
Code:
depends on BR2_EXT_UCLIBC_VERSION_0_9_30_1
from toolchain/uClibc/Config.in
then in the buildroot directory execute
Code:
make menuconfig
enable the e2fsprogs in Package selection -> Harware handling
also you have to remove the --disable-resizer from the e2fsprogs.mk file else the resizer is not build.
I can't believe this build package from archos is very up-to-date it seems very strange that all these bugs are in there how where they ever building a good firmware.
but that builds dynamic linked binaries, doesn't it? but we need a static build, don't we?
chulri said:
but that builds dynamic linked binaries, doesn't it? but we need a static build, don't we?
Click to expand...
Click to collapse
Yeah stupid me it needs to run in the initramfs and that does not contain any libraries. Let me check to see if it's possible to link it statically.
and because it has to be statically linked, maybe we better just take the newest e2fsprogs (btw.: does this support FAT resizing?!) and compile it without that buildroot stuff (except for the toolchain of course, we need that to crosscompile)
chulri said:
and because it has to be statically linked, maybe we better just take the newest e2fsprogs (btw.: does this support FAT resizing?!) and compile it without that buildroot stuff (except for the toolchain of course, we need that to crosscompile)
Click to expand...
Click to collapse
Well I tried that and failed. That's why I wanted to do it in the buildroot. I'll try again later need to create a clean environment and do some diffs after I fixed all the stuff that's wrong.
wdl1908 said:
Well I tried that and failed. That's why I wanted to do it in the buildroot. I'll try again later need to create a clean environment and do some diffs after I fixed all the stuff that's wrong.
Click to expand...
Click to collapse
I think I got it.
Add
Code:
export BOARD=g8_arm
To your .bashrc then in the buildroot directory do a make it will take a while as it needs to build everything. This is just a precaution as i think the statically linked resize2fs needs some linking with uclib libraries.
After that is finished do a
Code:
make e2fsprogs LDFLAGS=-static
in the buildroot directory. You should find the resize2fs binary in the directory buildroot/project_build_arm/uclibc/root/sbin
Code:
$ file resize2fs
resize2fs: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
resize2fs does not resize vfat so we probably need parted and some extra utils
How to compile parted with buildroot.
I found the attached files on some forum
e3fsprogs.mk is a replacement for the existing file.
Config.in parted.mk and parted-001-ui.cast.patch need to be placed in the directory buildroot/package/parted
then execute the following commands
Code:
make e2fsprogs LDFLAGS=-static
make e2fsprogs-libs
make parted LDFLAGS=-static
you can find the statically linked parted in buildroot/build_arm/parted-2.3/parted
and this is what i tried.
Code:
# [B]parted /dev/block/mmcblk1[/B]
GNU Parted 2.3
Using /dev/block/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) [B]print[/B]
print
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk1: 7466MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 8192B 7466MB 7466MB primary fat32 lba
(parted) [B]resize[/B]
resize
WARNING: you are attempting to use ./parted to operate on (resize) a file system.
./parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use ./parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Partition number? [B]1[/B]
1
Start? [8192B]?
End? [7466MB]? [B]6466MB[/B]
6466MB
(parted) [B]check[/B]
check
WARNING: you are attempting to use ./parted to operate on (check) a file system.
./parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use ./parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Partition number? [B]1[/B]
1
(parted) [B]quit[/B]
quit
Information: You may need to update /etc/fstab.
#[B]fdisk /dev/block/mmcblk1[/B]
The number of cylinders for this disk is set to 227840.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): [B]p[/B]
Disk /dev/block/mmcblk1: 7465 MB, 7465861120 bytes
4 heads, 16 sectors/track, 227840 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 1 197327 6314445+ c Win95 FAT32 (LBA)
Command (m for help): [B]n[/B]
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): [B]2[/B]
First cylinder (197327-227840, default 197327): Using default value 197327
Last cylinder or +size or +sizeM or +sizeK (197327-227840, default 227840): Using default value 227840
Command (m for help): [B]p[/B]
Disk /dev/block/mmcblk1: 7465 MB, 7465861120 bytes
4 heads, 16 sectors/track, 227840 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 1 197327 6314445+ c Win95 FAT32 (LBA)
/dev/block/mmcblk1p2 197327 227840 976426+ 83 Linux
Command (m for help): [B]w[/B]
The partition table has been altered!
Calling ioctl() to re-read partition table
# [B]mkfs.ext3 -v -I 128 /dev/block/mmcblk1p2[/B]
mke2fs 1.40.9 (27-Apr-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61184 inodes, 244106 blocks
12205 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=251658240
8 block groups
32768 blocks per group, 32768 fragments per group
7648 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# [B]tune2fs.static -c -1 -i 0 -m 1 /dev/block/mmcblk1p2[/B]
tune2fs 1.40.9 (27-Apr-2008)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Setting reserved blocks percentage to 1% (2441 blocks)
I leave the scripting to you but with these utils it should work perfectly to resize the partition and create the second partition.
I copied the mkfs.ext3, fdisk and tune2fs.static from the recovery initramfs
I started hacking around and I came to the conclusion that it would be better to change the initramfs to mount /data from mmcblk1p2 if that partition exists and not if it's not existing and move the whole partition resizing, partition creating, partition deleting (if you wan't to revert without dataloss) and again resizing into an app. so the user has more control over what he's doing and see's if something is failing and not just get's a bootloop or some fancy log file.
edit: /data is mounted by /init.rc script, all of the above can be done by an app, incl. modifying /init.rc script. no need for any special initramfs, yay!
everybody who has +rw rooting installed will be able to use that app. I'm starting development...
edit2: project page online: http://code.google.com/p/archos-gen8-sde-rooting/
stay tuned
First test app: http://code.google.com/p/archos-gen8-sde-rooting/downloads/detail?name=AppDataResizer_v0.1.apk
Release notes:
initial test version v0.1:
- parted binary added
- test button lists partitions of mmcblk1 device
Click to expand...
Click to collapse
note: 250 GB version of the A70 is currently not supported.
chulri said:
First test app: http://code.google.com/p/archos-gen8-sde-rooting/downloads/detail?name=AppDataResizer_v0.1.apk
Release notes:
note: 250 GB version of the A70 is currently not supported.
Click to expand...
Click to collapse
Nice. Yep I was thinking about the transition from standard to custom and also came to the conclusion it had to be done outside the boot process scripts.
Edit: Should this app be installable via the usual way or should it be a system app? (Copied to /system/app)
What I was thinking was split the process in 3 steps.
Step1: Resize storage partition, Add new-data partition and format.
Step2: Copy existing /data to /new-data
Step3: Enable/Disable new-data
Maybe a step2a: To run after upgrade of firmware to check things that have changed.
The step1 requires a reboot as the partitioning should be done in the initramfs if you do that when apps are running you're going to have a hell of a time getting the storage partition unmounted (I know I had the problem when testing the parted binary)
Step2 can be done without any problem when storage is mounted and Step3 requires a reboot after the init.rc is changed.
wdl1908 said:
Nice. Yep I was thinking about the transition from standard to custom and also came to the conclusion it had to be done outside the boot process scripts.
Edit: Should this app be installable via the usual way or should it be a system app? (Copied to /system/app)
Click to expand...
Click to collapse
usual way (download and install) (or maybe I include it in the initramfs (like the Superuser.apk) and copy it to /system/app, but I don't like modifying initramfs any further, no need for 100 different versions )
wdl1908 said:
What I was thinking was split the process in 3 steps.
Step1: Resize storage partition, Add new-data partition and format.
Step2: Copy existing /data to /new-data
Step3: Enable/Disable new-data
Maybe a step2a: To run after upgrade of firmware to check things that have changed.
Click to expand...
Click to collapse
great, that were my plans too.
wdl1908 said:
The step1 requires a reboot as the partitioning should be done in the initramfs if you do that when apps are running you're going to have a hell of a time getting the storage partition unmounted (I know I had the problem when testing the parted binary)
Click to expand...
Click to collapse
No API to unmount /sdcard/? I think I got one: IMountService it's not a public API but android.os.FileUtils isn't public either and it's working great. I think IMountService is the API that the popup, which pops up when you connect your android device to the computer, uses. I think, no need to worry because android handles everything pretty well when you connect your device to the computer, isn't it?
wdl1908 said:
Step2 can be done without any problem when storage is mounted and Step3 requires a reboot after the init.rc is changed.
Click to expand...
Click to collapse
agreed
chulri said:
usual way (download and install) (or maybe I include it in the initramfs (like the Superuser.apk) and copy it to /system/app, but I don't like modifying initramfs any further, no need for 100 different versions )
Click to expand...
Click to collapse
I tried to install it but it won't install. logcat gives something like
Pckage chrulri.gen8.AppDataResizer has no certificated at entry res/layout/main.xml
Yep I agree no need for different versions of the initramfs
chulri said:
No API to unmount /sdcard/?
Click to expand...
Click to collapse
The problem is not only the mount of /mnt/storage if the user has used move2sd there are a lot of other mounts present that also uses that partition.
maybe the API will do. Needs to be tested.
One other remark. Let the AppDataResizer check for the unionfs directory so that you can be sure you'r running on the correct initramfs.

[HOWTO] Install GNU/Linux on the Huawei S7 && Development thread (Kernel & GB)

[HOWTO] Install GNU/Linux on the Huawei S7 && Development thread (Kernel & GB)
Installing GNU/Linux on the Huawei IDEOS S7
( Using Debian or Ubuntu )
THIS GUIDE IS A WORK IN PROGRESS!
USE AT OWN RISK!​
Requirements:
Gnu/Linux experience! THIS IS NOT INTENDED FOR THE FAINTHEARTED!
Debian or Ubuntu.
The Google Android SDK Or at least adb and Fastboot
Busybox and a terminal emulator for Android.
A rooted device. See http://forum.xda-developers.com/showthread.php?p=14321729#post14321729 For how to root the Huawei S7 Android (2.2.2)
UPDATE:
New Image available.
Compatible and tested on :
-Huawei S7
-Huawei X5 / U8800(not quite done yet),
-RK2818 based devices,
-Samsung Galaxy s2.
Add "setprop ctl.stop bootanim" to the chroot command in "startnix-s7/other/rk.sh" on targets newer then gingerbread.
The image is using the MSM/QSD X11 driver for video,
ext3-4 modules for chroot on Android 2.2.2 stock image
xinput calibrator for screen calibration
Recompiled udev making that compatible.
And also a new sane kernel. which can be fastbooted with this image where ext3-4 are included and compiled-in. This kernel is necessary for enabling acceleration on the MSM/QSD X11 driver, using DRM. Swap and alsa(hopefully) are also enabled, ++, currently for _testing_only_!
Read post #11 for information - Merry Christmas and a Happy new year to you all!!
Setting up an image.
dd if=/dev/zero of=arm-linux.img bs=1024 count=2097152 to create a 2gb image.
mkfs.ext2,3 or 4 arm-linux.img , see post 10 for ext3 and 4 modules. as well as jbd and jbd2 which need to be insmodded.
Setting up a partition.
Plug it into your pc running Debian or Ubuntu, have usb storage selected on the device.
Back up everything on the 8GB Fat32 partition. I did this with a simple tar -cf android-back.tar /media/8gigandroidmountpoint. Verify that .android_secure is properly packed, but i also strongly suggest using titanium backup to backup application data and settings first then backup with a .tar. That cant fail.
Create a mountpoint and locate the special device of the S7.
Once you are absolutely sure you backed your partition, proceed with partitioning. Also be warned that ext2 is very prone to dataloss if not properly unmounted before rebooting, And by default, the s7 only supports ext2. So be sure and remember to have unmount any ext2 partition properly when done in Gnu/Linux, run sync as root before exiting, And have e2fsck handy. i have had to edit /etc/mtab back in due to corruption a dozen times when i was using ext2!
Code:
cfdisk -z /dev/sdx
I recommend at least 2Gb's. You can always increase the size of the partition later using tools such as gparted , but be aware, gparted might wreak havoc on your fat32 partition!
Now, create the first partition. It is very important that you make the first partition a Fat32 partition or the pad might go mad and operating systems with Multiple $clerosis wont see the partition! Choose "Type" and enter "0B" (FAT32). Create the second partition using the remaining space.
Select "Write" then Exit.
Now, do mkfs.vfat /dev/sdx1 and mkfs.ext2,3 or 4 /dev/sdx2.
Installing.
Once this is done we make ourselves a temporary directory, lets say mkdir /media/deb and loop mount the image or the partition there.
Instruct debootstrap to get the base packages for squeeze (Debian 6.0),
Squeeze is based on kernel 2.6.32 and is therefore safest to base our installation on, as Android 2.2 is designed with 2.6.32 in mind. The s7 is a armv7 so we could also use armhf, the drawbacks are its not quite done yet, and there is currently no video driver for our device available from me or the debian repo tested for armhf.
Code:
apt-get install debootstrap
# Adjust .nl. for your closest Debian mirror. Saves time and energy.
debootstrap --verbose --arch armel --foreign squeeze /media/deb [URL]ftp://ftp.nl.debian.org/debian[/URL]
Now using adb from the Google Android SDK and a usb cable, enter a shell and do the following.
(NOTE: I'm using /sdcard2 , which is the mountpoint to any external sdcard as the mountpoint, the reason for this is lazyness, creating a new folder on the s7's filesystem requires you run psneuter, remount the fs, then create your directory, see my rooting thread for that, you must change this if you are using an sdcard)
Code:
adb kill-server
adb start-server
adb shell
su
# For loopback image
mknod /dev/block/loop255 b 7 255
busybox losetup arm-linux.img /dev/block/loop255
mount -o rw -t ext2,3 or 4 /dev/block/loop255 /sdcard2
# For partition
mount -o rw -t ext2,3 or 4 /dev/block/vold/179:2 /sdcard2
export bin=/sdcard2/bin
export PATH=$bin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$PATH
export TERM=linux
export HOME=/root
cp -r /etc/firwmare/* /sdcard2/lib/firmware/
cp -r /etc/wifi/* /sdcard2/lib/firmware/
cp /sbin/adbd /sdcard2/sbin
cp -r /dev /sdcard2/
chroot /sdcard2 /debootstrap/debootstrap --second-stage
# Adjust .nl. for your closest Debian mirror.
echo 'deb [URL]ftp://ftp.nl.debian.org/debian[/URL] squeeze main' > /sdcard2/etc/apt/sources.list
Tell it what nameserver to use, probably your routers IP address.
In this case we'll just use Googles DNS that should work in any case.
Code:
echo 'nameserver 8.8.8.8' > /sdcard2/etc/resolv.conf
echo 'nameserver 8.8.4.4' >> /sdcard2/etc/resolv.conf
Lets drop by our new home and make it nice and comfy.
Code:
chroot /sdcard2 /bin/bash
Once in, we need to do a quick few mounts, a fast few mknodes and a little bit of linking to make things fully functional.
Code:
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
ln -s /proc/self/fd/0 /dev/stdin
ln -s /proc/self/fd/2 /dev/stderr
ln -s /proc/self/fd/1 /dev/stdout
mknod /dev/block/loop255 b 7 255 # Shouldn't really be needed as we just copied /dev
ln -s /dev/ptmx /dev/pts/ptmx
#mknod /dev/pts/ptmx c 5 2
# ln -s /dev/input/event0 /dev/event0
ln -s /dev/graphics/fb1 /dev/fb1
ln -s /dev/graphics/fb0 /dev/fb0
Creating the /etc/mtab file
The /etc/mtab file should look something like this.
Code:
/dev/block/vold/179:2 / ext2 rw,noatime 0 0
# or - You should have figured to adjust for ext 2 3 or 4 now?
/dev/block/loop255 / ext2 rw,noatime 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
The FS should always be mounted with the noatime option! This reduces load considerably and conserves sdcard!
mount -o rw,noatime -t ext2 /dev/block/vold/179:2 /sdcard2 for instance
/etc/fstab should look like this: (remember to adjust / )
Code:
/dev/block/loop255 / ext3 defaults,noatime 1 1
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
Setup a password for the root account.
For some reason i had to run dhclient to get online at first, even though ifconfig shows me as connected. Also be aware that when Android falls asleep it puts the wlan0 device to sleep, dropping the connection. Pinging something with -i 90 is a temporary workaround for this.
Setting up OpenSSH
Code:
apt-get update
apt-get install openssh
(OPTIONAL) To configure your locale settings to use a language other than English, install the locales support package and configure it.
Currently the use of UTF-8 locales are recommended.
Code:
apt-get install locales
dpkg-reconfigure locales
(OPTIONAL! ) The "tasksel install standard" command installs all packages marked as "standard" packages for the selected distribution. Running just tasksel will promote you with several choices. tasksel --initial will promote you with installing the base system.
For things like the touchscreen to work properly we need to populate /dev.
Code:
# NOT NEEDED ANYMORE , USING DIFFERENT APPROACH! - leaving for reference
#mknod /dev/kgsl-3d0 c 244 0
#mkdir /dev/input
#mknod /dev/input/input0 c 13 64
#mknod /dev/input/input1 c 13 65
#mknod /dev/input/input3 c 13 67
#mknod /dev/input/input4 c 13 68
#mknod /dev/i2c-0 c 89 0
#mknod /dev/i2c-1 c 89 1
Poking around i figured out the touchscreen and stuff.
input0 = Hid Ofn
input1 = Touchscreen
input2 = Sensor
input3 = Keypad
input4 = Handset
After the installation there will be a lot of downloaded packages in /var/cache/apt/archives/. You can free up some diskspace by running:
apt-get clean
I then created a small script to drop into GNU/Linux a bit easier, note the path of the modules.
Code:
su &
if test -e /mnt/sdcard/arm-linux/linux/bin/bash # or /sdcard2/bin/ if your using a partition
then
echo "Already mounted."
else
busybox insmod /mnt/sdcard/arm-linux/s7/jbd.ko
busybox insmod /mnt/sdcard/arm-linux/s7/ext3.ko
busybox insmod /mnt/sdcard/arm-linux/s7/jbd2.ko
busybox insmod /mnt/sdcard/arm-linux/s7/ext4.ko
# For loopback image
mknod /dev/block/loop255 b 7 255
busybox losetup arm-linux.img /dev/block/loop255
mount -o rw,noatime -t ext2,3 or 4 /dev/block/loop255 /sdcard2
# For partition
mount -o rw,noatime -t ext2,3 or 4 /dev/block/vold/179:2 /sdcard2
fi
export bin=/sdcard2/bin/ # or /mnt/sdcard/arm-linux/linux if your using an image
export PATH=$bin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$PATH
export TERM=linux
export HOME=/root
export SHELL=/bin/bash
# You can also do
#'setprop ctl.stop zygote & setprop ctl.stop media && chroot /sdcard2/ /bin/bash && setprop ctl.start zygote & setprop ctl.start media'
# This will kill the Android wm, start chroot, and once you quit return you to
# android, but that doens work in an android terminal, only via adb.
chroot /sdcard2 /bin/bash
This needs to be expanded with another script since you still need some mounts (sysfs devpts and proc), i just dropped them in the .bashrc file in /root for now.
Code:
if test -e /sys/class/graphics/fb0/uevent
then
echo "All sys mounts already mounted."
else
mount -a
#service hal start
hald --daemon=yes
service ssh start
fi
cd
For Xorg
I've compiled the MSM/QSD X11 drivers, which should provide "limited 3d acceleration, provided they works, here is the status of that so far:
http://threader.zapto.org/s7/dev/msm-drv/xf86-video-msm-6fd8528-gcc46-2-rgb-fix-accel-6.tar , Colour working, needs NoAccel on production kernel. With accel enabled on the production kernel, there are no errors shown when starting X as there were. But Lxde first appears, tjen the menu, taskbar, background, and the rest vanish in a puff of smoke, leaving only the pointer and which can be moved about corruption regions of the screen. This is because certain features were left out of the production kernel. Using the kernel provided in post #11, acceleration works!
You can always check http://threader.zapto.org/s7/dev/msm-drv/ and try out some of the others I've compiled and see if there are any speed issues, sources are also available.
Now to enter the X server, the first thing you really want to do is have your ssh server running and connect to it. You can start your xserver and have all resources devoted to it by having passed "setprop ctl.stop media & setprop ctl.stop zygote" to android in the ADB. Starting zygote again is merely a 'setprop ctl.start zygote & setprop ctl.start zygote'.
The HTC Dream is fairly similar to our device, similar as in its a QSD8x50 device, we should be able to borrow some of their work, this is probably optimized and should be fast, http://build.shr-project.org/shr-unstable/images/htcdream/ its good for reference anyway.
Some problems i ran into. # Outdated but leaving for reference.
When trying to ssh in, after a reboot, i got a rather nasty error.
PTY allocation request failed on channel 0
if present remove /dev/ptmx and do mknod /dev/ptmx c 5 2 then redo these mounts or make sure they are properly mounted.
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
TIPS:
Install localepurge! This will save a lot of space!
Install a vncserver and try setting up an X session your happy with, i would recommend the use of lxde and openbox to minimize the memory footprint and to conserve space and ram as the s7's kernel is compiled without swap enabled (o,0).
Configure xorg.conf in /etc/X11/xorg.conf with the config i posted in #3 http://forum.xda-developers.com/showpost.php?p=14594464&postcount=3
Be sure to properly unmount the ext partition before you reboot your device! Especially ext2 partitions are prone to dataloss!!!!! Use "sync" as root atleast before exiting!
install matchbox-keyboard ( an onscreen keyboard )
Starting X11 was an oddball first few attempts! As the fbdev driver isn't really compatible with the qsd8250 gpu, it blanks out the screen and doesnt know how to revert it. With android still running, I experimented with startx -- :1 and stuff the xorg.conf but ended up using just startx and found that repeatedly pressing the power button (quite frantically) (once the screen blanked out), low and behold, the x session miraculously appeared! This was before i had even "thunk" about compiling the qsd msm driver and before the xf86-video-msm driver in wheezy Debian.
Congratulations, you should now have a fully working Debian install on your Huawei S7!
-------------------------------------------------------------------------------
Clean booting into the Debian partition!
Configure /etc/fstab: # Outdated , needs updating, see arm-linux.img
Code:
# /etc/fstab: static file system information.
#
# file system mount point type options dump pass
/dev/block/mmcblk0p2 / ext2 defaults 1 1
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /media/sdcard vfat defaults 0 0
Add "/sbin/adbd &" to /etc/rc.local and make a symlink so adbd can find sh or bash. (NB, was unsuccessful in my attempts at this for unknown reasons, did not fight it to long.)
# mkdir -p /system/bin/
# ln -s /bin/bash /system/bin/sh
apt-get install wpasupplicant network-manager-gnome wireless-tools
mv /etc/init.d/udev /etc/init.d/dis for now, this is a showstopper.
Get fastboot http://developer.htc.com/adp.html
Grab the zImage
(s7 10x -- Self compiled kernel,with ext3-4,drm,alsa(hopefully,powermanagement etc. _TESTING_ONLY_ copy lib to / , System.map to /boot/ and add dhd.ko to /etc/modules run depmod somehow ) http://threader.zapto.org/s7/kernel/2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2
(s7 101 -- stock rom image ) http://threader.zapto.org/s7/rom/extracted/output-brazil/kern/zImage
(s7 other then 101 -- stock rom image ) http://threader.zapto.org/s7/rom/extracted/output/zImage
Configure the network:
To configure the network we need to copy a module from android dhd.ko from /lib/modules/ to /lib/modules/2.6.32.9-ideos/kernel/ and create an entry in /lib/modules/2.6.32.9-ideos/modules.dep kernel/dhd.ko: then run depmod -a from within Debian and add dhd to /etc/modules
Boot Debian:
Put the device into fastboot mode
$ adb reboot bootloader
The '-c' flag specifies arguments to pass to the kernel for boot.
This is probably the bare minimum.
Format is "fastboot -c 'kernelcmdline' boot zImage"
fastboot -c 'root=/dev/mmcblk0p2 rw rootfs=ext2 init=/sbin/init rootwait noinitrd' boot zImage
Please help feed my Linux addiction! Go to http://threader.zapto.org and click Donate!
TODO:
Clean boot from the Debian partition using fastboot.- DONE
Compile the codeaurora.org MSM/QSD X11 drv - DONE
Compile a sane kernel, with all the features you'd expect from a Linux kernel - DONE
Create a boot image with the new kernel compatible with the S7 101-105 possibly 201(slim) capable of booting Android and Linux, either from an early boot menu or using chroot. (WIP)
Hack up an existing rom, or compile 2.3.7 and make a complete solution. (TBA)
Stop playing Angry Birds, Dragon, FLY! XConstruct, Finger physics and Skies Of Glory when i should be doing this! - NEARLY ALMOST MOSTLY COMPLETELY DONE(ish) ;Þ
References & useful stuff! This would never have been possible in this short of a time if it weren't for these excellent posts. (Woaw, i sounded so optimistic in june 2011. The initial work was quick, over half a year later though im still not done! "Just gotta fix that last little ting before... Hey! i discover another little thing ...!
http://www.saurik.com/id/10
http://www.debian.org/releases/stable/i386/apds03.html
http://www.irregular-expression.com/?p=30
forum.xda-developers.com/archive/index.php/t-830077.html
http://forum.xda-developers.com/archive/index.php/t-830077.html
For development
git clone git://codeaurora.org/kernel/msm.git android-msm-2.6.32
https://www.codeaurora.org/gitweb/quic/xwin/
https://www.codeaurora.org/gitweb/quic/xwin/?p=xf86-video-msm.git;a=shortlog;h=refs/heads/chromium
http://gitorious.org/htc-msm-2-6-32...d65936b8bbc8708f352719/include/drm/kgsl_drm.h
https://github.com/tmzt/androix-xserver
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
/etc/X11/xorg.conf
Code:
Section "Device"
Identifier "msm"
# For MSM/QSD X11
Driver "msm"
Option "fb" "/dev/fb0"
# For fbdev
# Driver "fbdev"
# Option "ShadowFB" "on"
# Option "Rotate" "CW"
# for MSM/QSD X11
Option "NoAccel" "true"
# Option "SWBlit" "true"
EndSection
Section "Screen"
Identifier "Framebuffer"
# Device "fbdev"
Device "msm"
Monitor "Monitor"
# DefaultFbBpp 24
SubSection "Display"
# Depth 24
Modes "800x480"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Builtin Default Layout"
Screen "Framebuffer"
# InputDevice "Trackball" "CorePointer" # Reserved for buttons .
InputDevice "Touchscreen" "CorePointer"
InputDevice "Keyboard" "CoreKeyboard"
EndSection
Section "InputDevice"
Identifier "Touchscreen"
Driver "evdev"
Option "Device" "/dev/input/input1"
# Option "ScreenNumber" "0"
Option "ReportingMode" "Raw"
Option "ReportingMode" "Scaled"
Option "ButtonNumber" "1"
Option "SendCoreEvents"
EndSection
Section "InputDevice"
Identifier "Keyboard"
Driver "kbd"
# Option "XkbLayout" "en_US"
EndSection
This is Debian running cleanly from without the chroot environment
After doing some debugging from within chroot and Android, without the /etc/xorg.conf doing a startx -- :1 and repeatedly pressing the power button (quite frantically) (once the screen blanked out) the x session miraculously appeared! But i couldn't use it since it didn't know of a pointer device.
I managed today to configure the touchsreen correctly, i can now use xfce and x11 from within chroot in android ,but ironically enough im unable to get it up (phun intended) in a clean boot at all, here im using matchbox-keyboard
zImage
Hello,
the links about zImage
Grab the zImage link(s7 101) link (s7 other then 101 dont know why this is 2 megs! and the other 1.4)
are broken.
Can you share zImage again?
Best regards and thanx for great work
Hi!
I've extract kernel using guide: HOWTO: Unpack, Edit, and Re-Pack Boot Images on android-dls.com/wiki/.
but at the end, i've have problems in dhd module. Can't modprobe without error at linux boot.
Now trying to run ubuntu 11.04. Installing "ubuntu-desktop" packages in chroot
santiagax99 said:
Hi!
I've extract kernel using guide: HOWTO: Unpack, Edit, and Re-Pack Boot Images on android-dls.com/wiki/.
but at the end, i've have problems in dhd module. Can't modprobe without error at linux boot.
Now trying to run ubuntu 11.04. Installing "ubuntu-desktop" packages in chroot
Click to expand...
Click to collapse
Hey, good stuff, use whatever kernel from whatever rom absolutely works on your droid.
It's also dawned on me there most probably might be an issue with the port of the x11 driver, thankfully i still have everything.
http://threader.zapto.org/ - im guessing everything i used is there, if i find more i'll put it up, if its down try again later. I also added a donate button to help feed my Linux addiction =)
The dhd.ko is here - http://threader.zapto.org/s7/rom/extracted/output/sys/lib/modules/dhd.ko
Also Ubuntu is a memory hungry beast, i would recommend Debian 6.0x/squeeze lxde+xfce.
Hi, how it's going with TODO:
Stop playing angrybirds, xconstruct and skies of glory when i should be doing this!
?
=)
installing Ubuntu fails because of my lazy =(
now i get some free time and trying to get working debian queeze on my S7.
I'll report back after finish.
---------- Post added at 03:22 PM ---------- Previous post was at 03:20 PM ----------
Also i think it's good idea to share complete image of partition with linux. Installing all packages on S7 takes much time =)
Hey,
Quite time consuming yes, and fiddly.
I was planning on sharing an image, but i had planned on having it a bit more complete and polished first. That just didn't happen however. But today i cleaned up http://threader.zapto.org and added an image of the partition. And got a fresh breath of motivation.
The image is 2.1 GB. If you write it to a partition, it needs to be equal to or greater then the image you write or you risk trashing the next partition or just failing to complete the write, i guess.
However, you can use a loop device Use the last available loop device, mknod /dev/block/loop255 b 7 255 to avoid conflict, and to mount the image using losetup /dev/block/loop255 s7-linux.img && mount -o noatime -t ext2 /dev/block/loop255 /sdcard2 . Do sync as root before rebooting.
http://threader.zapto.org/s7
http://shell.consolegfx.net/s7-linux.img.bz2 # Outdated - see post #11 or http://threader.zapto.org/arm-linux.tar.bz2
md5sum s7-linux.img
275b2fe0bbe0172910933e583835164c s7-linux.img
-rw-r--r-- 1 root root 2169503744 Nov 19 17:49 s7-linux.img
Password for root is root .
Now, i wont be working too much more on the fastboot approach, carrying around a pc to boot linux on the tablet just isnt practical at all. And i really need to have usb host confirmed and working. I have made progress on starting X11 cleanly. My current method of "setprop ctl.stop media & setprop ctl.stop zygote && chroot /mnt/sdcard/linux/ /bin/bash && setprop ctl.start media & setprop ctl.start zygote" works great from adb, but will fail in an android terminal emulator instantly restarting zygote as it quits the terminal app.
I also compiled some kernel modules and put up, mainly ext3 & 4, fuse, msdos, ntfs, but eventually some other goodies. Check http://threader.zapto.org/s7/modules/. None of these are included currently, and wont be until i upload a future version. That will be ext3, which hopefully wont be too far off, and i can already tell you it will include some substantial changes. It should also be infinently more usable, even for those that havent spent some 10+ years on linux. It would definitively be cool if i could releasing something with Digital video usb dongle support, wouldn't it?
Cheers!
-Mike
Btw. here's the next image running on the s7, as you can see there were some problems with the x11 driver, but i managed to fix that a bit so this is now working, but still Option "NoAccel". I can also report that even firefox 3.5 is running surprisingly smoothly. Over the next few days i will be working on the x11 driver and then internal gsm modem and bluetooth.
Driver working with Red and Blue switched:
Tada! Fixed driver!
Thanks where thanks are due must be given to Visor and Hydro for helping with hosting "o'huge ass image file" and such! Thanks!
KERNEL 'UPDATE!: :
--------------------------
I managed to find time to fix and compile the kernel! The new kernel boasts plenty of improvements over the stock kernel, most noticeably ext3-4 built in, drm, alsa, swap, some experimental features enabled like a new scheduler for the usb, and switch to the no-op scheduler, also a feature that could let us change kernels "mid flight", hopefully, with kexec. Added some fpu related optimizations. I was unable to get it booting with a newer compiler for now though, so its still soft-float. This kernel is half the size, or even less as debug symbols are disabled. The old kernel crawled to 7mb's , this is 3.3.
http://threader.zapto.org/s7/kernel/2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2
Usage:
Take the tools folder from the tar.bz2 and copy it somewhere, preferably your home directory (as google sdk binaries are picky little pricks) extract the above archive and put zimage into the tools directory:
adb reboot fastboot
Kernel with modules, http://threader.zapto.org/s7/kernel/2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2
Ramdisk extracted from stock bootrom: http://threader.zapto.org/s7/kernel/boot.img-ramdisk.gz
Extract 2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2 somewhere on your machine, zImage is inside there.
Dont extract boot.img-ramdisk.gz
For booting Android:
Code:
fastboot -c 'console=ttyMSM2,115200n8 androidboot.hardware=qsd8k_s7' boot /path/to/2.6.32.9-ideos-fs-snd-drm-sane-5/zImage /path/to/boot.img-ramdisk.gz
For booting into linux (mmcblk0p2 is the device node for the second partition created on the 8gb internal sdcard, use mmcblk1p1 or 1p2 for external sdcard):
Code:
fastboot -c 'root=/dev/mmcblk0p2 rw rootfs=ext3 init=/sbin/init rootwait noinitrd' boot zImage
Thanks where thanks are due must be given to -ZEROsignal-. Visor and Hydro, for helping with hosting "o'huge ass image file" and such! Thanks!
Aosp 2.3.7 available for modders and powerusers!
Code:
experimental/aosp2.3/s7/README
Experimetnal build of gingerbread for the s7
Notes:
The build is 2G split, (vmsplit 2g), so given that a given library is compatible
these can be exchanged from 2.2 .
Its still software rendering via pixelflinger.
OpenGL works.
Notes on Wifi and Bluetooth, bcm4329 chipset.
An updated kernel driver, is included in /system/modules (bcm4329.ko).
I have however not come as far as to implement it properly, as i am currently fo
cused on the graphics bit.
Notes on graphics, gralloc-qsd8k has been fixed. Which meant updating the kernel
pmem driver a bit to accomodate this change.
renderscript (libRS and librs_ something ) crashes. Probably due to pixelflinger
Im sure a rom modder could have this rom running smoothly using the huawei 2.2 l
ibraries and such, and dhd.ko. Also delete /system/app/Provision.apk as this prevents booting!
Notes on boot.img:
The ramdisk content might be wrong! I might have copieid the wrong boot.img befo
re i left! This will get fixed.
And so it has, boot.img-dead is the old dead one, boot.img is the working one.
Directory structure named after build date
Cheers
-mike aka threader
Also arm-linux0.7 is shaping up, this is still an early version where i change a lot in preparation for a more general solution to publish on the google.code page.
Were now using freedreno x11 driver, which works well in chroot but doesnt work if you boot linux normally, the old msm-x11 driver works for this purpose.
I improved rendering alot, but still pixelflinger....it also appears that i introduced some rendering artefacts, these are however minimal.
http://code.google.com/p/lrfa/downloads/detail?name=system.img.bz2&can=2&q=
boot.img still on http://threader.zapto.org/experimental .
.
Hi! how's it going? what's new? long time no updates. Is there any success in running Linux? I would like to move to Linux as the primary operating system.
Hey.
Not much, still occasionally working to port the Codeaura Adreno GPU driver to the huawei kernel, which is a **** because of the version screweup which is the huawei kernel. Other then that there has been no news on the Android Gingerbread front since i last published http://threader.zapto.org/experimental/aosp2.3/s7/021212/ , which fixed audio and found a bug in the MDP which resulted in less glitching when fixed.
New kernel up on http://threader.zapto.org/experimental/s7/kernels/
Incomplete change list off the top of my head:
Patched from 2.6.32.9 to 2.6.32.60
Asturals msm kgsl with the following changes
- fixed kgsl_drm_init(null) which caused a kernel panic in older kgsl.
- patched exploit in kgsl
gcc 4.7 compatible - updated assembly.
clock code taken from 2.6.38.
AVS from 2.6.38
DRM from 2.6.38
Added memblock. Genalloc. Genlock.
Redone board file. (use board-qsd8x50-s7.c-full for full functionality)
msm-fb updated. Lcdc. Etc.
Retouched msm_battery-s7
and probably lots more.
Known bugs:
TBA ( TO BE ANSWERED )
Source : http://threader.zapto.org/experimental/s7/kernels/source/kernel-ideos-experimental-2.6.32.60.tar.bz2
Binary: http://threader.zapto.org/experimen...l-ideos-experimental-2.6.32.60/zimage-2gsplit
Happy hacking!
Hi threader, great work, will try and tell you how it goes.
One question have you tryied to move to 2.6.38 ?
cant we patch the 2.6.38 kernel with files we may need from 2.6.32 ?
hal_2000
Hey Hal.
Likewise
Still fixing some minor bugs, re-worked the board-qsd8x50-s7 file again to make dhd happy, and found a hw def that makes anything we compile think its a 8250. Tell me, is it the 103 or 20x that uses the 8250? I think that code should be moved to the board file.
I've been trying to move to 2.6.38, but i cant get it booting for some reason, i've actually got two 2.6.38 kernels i've been working on, neither give as much as a bleep. The one up in s7/experimental/ has everything it needs to boot, i think. I backported the board-qsd8x50.c file to the 2.6.32 kernel trying to rule that out, and thats whats in use there.. But its pretty hard to debug when i have no frame of reference (console output or anything).
Cheers
-Mike
hal_2000 said:
Hi threader, great work, will try and tell you how it goes.
One question have you tryied to move to 2.6.38 ?
cant we patch the 2.6.38 kernel with files we may need from 2.6.32 ?
hal_2000
Click to expand...
Click to collapse
Hi, i pick up the zimage file and make a boot.img file, it boot up the rom fusion but touch screen did not work and menu and home key also did not work.
Then used your kernel sources to try to compile a kernel for cm9 and it did not work, it hang at boot, i have a s7 model 105.
If you need more tests let me know.
as far i know que s7-10x uses a qsd8k board type and a cpu qualcomm snapdragon qsd8250 at 998Mhz, the 20x uses a diferent cpu. That why it uses diferent kernels, and i think there is more diference in hardware.
hal_2000

[Q] My code doesn't run in init.rc

how can I solve that problem?
I write the code in init.rc:
Code:
mv /com.anddoes.launcher_preferences.xml /data/data/com.anddoes.launcher/shared_prefs/
it returns such error:
<3>[ 0.640121] init: /init.rc: 351: invalid command 'mv'​
I tried both to write a script and to move toolbox with mv to the system root, but it returns the same error.
All the necessary folders exist
MaxiManBW said:
how can I solve that problem?
I write the code in init.rc:
Code:
mv /com.anddoes.launcher_preferences.xml /data/data/com.anddoes.launcher/shared_prefs/
it returns such error:
<3>[ 0.640121] init: /init.rc: 351: invalid command 'mv'​
I tried both to write a script and to move toolbox with mv to the system root, but it returns the same error.
All the necessary folders exist
Click to expand...
Click to collapse
init.rc is not a shell script, but a command language for the init process. Use can use the "exec" command to execute the mv command, see the docs below. Remember to use full paths.
Code:
Android Init Language
---------------------
The Android Init Language consists of four broad classes of statements,
which are Actions, Commands, Services, and Options.
All of these are line-oriented, consisting of tokens separated by
whitespace. The c-style backslash escapes may be used to insert
whitespace into a token. Double quotes may also be used to prevent
whitespace from breaking text into multiple tokens. The backslash,
when it is the last character on a line, may be used for line-folding.
Lines which start with a # (leading whitespace allowed) are comments.
Actions and Services implicitly declare a new section. All commands
or options belong to the section most recently declared. Commands
or options before the first section are ignored.
Actions and Services have unique names. If a second Action or Service
is declared with the same name as an existing one, it is ignored as
an error. (??? should we override instead)
Actions
-------
Actions are named sequences of commands. Actions have a trigger which
is used to determine when the action should occur. When an event
occurs which matches an action's trigger, that action is added to
the tail of a to-be-executed queue (unless it is already on the
queue).
Each action in the queue is dequeued in sequence and each command in
that action is executed in sequence. Init handles other activities
(device creation/destruction, property setting, process restarting)
"between" the execution of the commands in activities.
Actions take the form of:
on <trigger>
<command>
<command>
<command>
Services
--------
Services are programs which init launches and (optionally) restarts
when they exit. Services take the form of:
service <name> <pathname> [ <argument> ]*
<option>
<option>
...
Options
-------
Options are modifiers to services. They affect how and when init
runs the service.
critical
This is a device-critical service. If it exits more than four times in
four minutes, the device will reboot into recovery mode.
disabled
This service will not automatically start with its class.
It must be explicitly started by name.
setenv <name> <value>
Set the environment variable <name> to <value> in the launched process.
socket <name> <type> <perm> [ <user> [ <group> ] ]
Create a unix domain socket named /dev/socket/<name> and pass
its fd to the launched process. <type> must be "dgram", "stream" or "seqpacket".
User and group default to 0.
user <username>
Change to username before exec'ing this service.
Currently defaults to root. (??? probably should default to nobody)
Currently, if your process requires linux capabilities then you cannot use
this command. You must instead request the capabilities in-process while
still root, and then drop to your desired uid.
group <groupname> [ <groupname> ]*
Change to groupname before exec'ing this service. Additional
groupnames beyond the (required) first one are used to set the
supplemental groups of the process (via setgroups()).
Currently defaults to root. (??? probably should default to nobody)
oneshot
Do not restart the service when it exits.
class <name>
Specify a class name for the service. All services in a
named class may be started or stopped together. A service
is in the class "default" if one is not specified via the
class option.
onrestart
Execute a Command (see below) when service restarts.
Triggers
--------
Triggers are strings which can be used to match certain kinds
of events and used to cause an action to occur.
boot
This is the first trigger that will occur when init starts
(after /init.conf is loaded)
<name>=<value>
Triggers of this form occur when the property <name> is set
to the specific value <value>.
device-added-<path>
device-removed-<path>
Triggers of these forms occur when a device node is added
or removed.
service-exited-<name>
Triggers of this form occur when the specified service exits.
Commands
--------
exec <path> [ <argument> ]*
Fork and execute a program (<path>). This will block until
the program completes execution. It is best to avoid exec
as unlike the builtin commands, it runs the risk of getting
init "stuck". (??? maybe there should be a timeout?)
export <name> <value>
Set the environment variable <name> equal to <value> in the
global environment (which will be inherited by all processes
started after this command is executed)
ifup <interface>
Bring the network interface <interface> online.
import <filename>
Parse an init config file, extending the current configuration.
hostname <name>
Set the host name.
chdir <directory>
Change working directory.
chmod <octal-mode> <path>
Change file access permissions.
chown <owner> <group> <path>
Change file owner and group.
chroot <directory>
Change process root directory.
class_start <serviceclass>
Start all services of the specified class if they are
not already running.
class_stop <serviceclass>
Stop all services of the specified class if they are
currently running.
domainname <name>
Set the domain name.
insmod <path>
Install the module at <path>
mkdir <path> [mode] [owner] [group]
Create a directory at <path>, optionally with the given mode, owner, and
group. If not provided, the directory is created with permissions 755 and
owned by the root user and root group.
mount <type> <device> <dir> [ <mountoption> ]*
Attempt to mount the named device at the directory <dir>
<device> may be of the form [email protected] to specify a mtd block
device by name.
<mountoption>s include "ro", "rw", "remount", "noatime", ...
setkey
TBD
setprop <name> <value>
Set system property <name> to <value>.
setrlimit <resource> <cur> <max>
Set the rlimit for a resource.
start <service>
Start a service running if it is not already running.
stop <service>
Stop a service from running if it is currently running.
symlink <target> <path>
Create a symbolic link at <path> with the value <target>
sysclktz <mins_west_of_gmt>
Set the system clock base (0 if system clock ticks in GMT)
trigger <event>
Trigger an event. Used to queue an action from another
action.
write <path> <string> [ <string> ]*
Open the file at <path> and write one or more strings
to it with write(2)
Properties
----------
Init updates some system properties to provide some insight into
what it's doing:
init.action
Equal to the name of the action currently being executed or "" if none
init.command
Equal to the command being executed or "" if none.
init.svc.<name>
State of a named service ("stopped", "running", "restarting")
Example init.conf
-----------------
# not complete -- just providing some examples of usage
#
on boot
export PATH /sbin:/system/sbin:/system/bin
export LD_LIBRARY_PATH /system/lib
mkdir /dev
mkdir /proc
mkdir /sys
mount tmpfs tmpfs /dev
mkdir /dev/pts
mkdir /dev/socket
mount devpts devpts /dev/pts
mount proc proc /proc
mount sysfs sysfs /sys
write /proc/cpu/alignment 4
ifup lo
hostname localhost
domainname localhost
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /data
import /system/etc/init.conf
class_start default
service adbd /sbin/adbd
user adb
group adb
service usbd /system/bin/usbd -r
user usbd
group usbd
socket usbd 666
service zygote /system/bin/app_process -Xzygote /system/bin --zygote
socket zygote 666
service runtime /system/bin/runtime
user system
group system
on device-added-/dev/compass
start akmd
on device-removed-/dev/compass
stop akmd
service akmd /sbin/akmd
disabled
user akmd
group akmd
Debugging notes
---------------
By default, programs executed by init will drop stdout and stderr into
/dev/null. To help with debugging, you can execute your program via the
Andoird program logwrapper. This will redirect stdout/stderr into the
Android logging system (accessed via logcat).
For example
service akmd /system/bin/logwrapper /sbin/akmd
kuisma said:
init.rc is not a shell script, but a command language for the init process. Use can use the "exec" command to execute the mv command, see the docs below. Remember to use full paths.
Code:
Android Init Language
---------------------
The Android Init Language consists of four broad classes of statements,
which are Actions, Commands, Services, and Options.
All of these are line-oriented, consisting of tokens separated by
whitespace. The c-style backslash escapes may be used to insert
...........................................
Click to expand...
Click to collapse
I created script and put it to /system folder
Then call it with:
Code:
service my_script /system/my_script.sh
class main
oneshot
and again received an error: <3>[ 61.921627] init: cannot find '/system/my_script.sh', disabling 'my_script'
MaxiManBW said:
I created script and put it to /system folder
Then call it with:
Code:
service my_script /system/my_script.sh
class main
oneshot
and again received an error: <3>[ 61.921627] init: cannot find '/system/my_script.sh', disabling 'my_script'
Click to expand...
Click to collapse
Is you script executable and begins with the line "#!/system/bin/sh"?
kuisma said:
Is you script executable and begins with the line "#!/system/bin/sh"?
Click to expand...
Click to collapse
Yes!
just in case, I used chmod 777 and first line begins with the line "#!/system/bin/sh".
Error no longer appears, but script doesn't work:
Code:
#!/system/bin/sh
if [-a /com.anddoes.launcher_preferences.xml]
cp /com.anddoes.launcher_preferences.xml /data/data/com.anddoes.launcher/shared_prefs/
rm /com.anddoes.launcher_preferences.xml
fi
I may be wrong calling service?
Code:
service my_script /system/my_script.sh
class main
oneshot
MaxiManBW said:
Yes!
just in case, I used chmod 777 and first line begins with the line "#!/system/bin/sh".
Error no longer appears, but script doesn't work:
Code:
#!/system/bin/sh
if [-a /com.anddoes.launcher_preferences.xml]
cp /com.anddoes.launcher_preferences.xml /data/data/com.anddoes.launcher/shared_prefs/
rm /com.anddoes.launcher_preferences.xml
fi
I may be wrong calling service?
Code:
service my_script /system/my_script.sh
class main
oneshot
Click to expand...
Click to collapse
I guess cp works, but not rm? Root is remounted read-only quite early in init.rc
Edit: Also, I've told you to use full paths. And that if-syntax...? It's sure not standard shell test syntax.
MaxiManBW said:
how can I solve that problem?
I write the code in init.rc:
Code:
mv /com.anddoes.launcher_preferences.xml /data/data/com.anddoes.launcher/shared_prefs/
it returns such error:
<3>[ 0.640121] init: /init.rc: 351: invalid command 'mv'​
I tried both to write a script and to move toolbox with mv to the system root, but it returns the same error.
All the necessary folders exist
Click to expand...
Click to collapse
Did it work?
I think init.rc only understands absolute paths... I mean, replacing mv with the below might work.
/system/bin/mv XXX YYY
-pradeep.
---------- Post added at 03:41 PM ---------- Previous post was at 03:16 PM ----------
kuisma said:
I guess cp works, but not rm? Root is remounted read-only quite early in init.rc
Edit: Also, I've told you to use full paths. And that if-syntax...? It's sure not standard shell test syntax.
Click to expand...
Click to collapse
I have a similar question regarding init.rc.
I am trying to run a native application (which downloads the wifi firmware to dongle). I need this to be done before the wifi driver module is insmod'ed. Accordingly, I have an entry in init.rc with 'exec' command to run it -- at the end of "on init" section.
exec /system/bin/downloader -n /system/etc/wifi/xyz.nvm /system/etc/wifi/fake.trx
This command doesn't seem to run although I don't see any errors in the boot log.
I also tried a combination of 'service' commands like:
service downloader /system/bin/downloader -n /system/etc/wifi/xyz.nvm /system/etc/wifi/fake.trx
disabled
oneshot
Same result: no error in the bootlog but firmware not downloaded.
Any idea what might be wrong with the commands here? I am on JB-MR1.
-pradeep.
Gurumath said:
Did it work?
I think init.rc only understands absolute paths... I mean, replacing mv with the below might work.
/system/bin/mv XXX YYY
-pradeep.
---------- Post added at 03:41 PM ---------- Previous post was at 03:16 PM ----------
I have a similar question regarding init.rc.
I am trying to run a native application (which downloads the wifi firmware to dongle). I need this to be done before the wifi driver module is insmod'ed. Accordingly, I have an entry in init.rc with 'exec' command to run it -- at the end of "on init" section.
exec /system/bin/downloader -n /system/etc/wifi/xyz.nvm /system/etc/wifi/fake.trx
This command doesn't seem to run although I don't see any errors in the boot log.
I also tried a combination of 'service' commands like:
service downloader /system/bin/downloader -n /system/etc/wifi/xyz.nvm /system/etc/wifi/fake.trx
disabled
oneshot
Same result: no error in the bootlog but firmware not downloaded.
Any idea what might be wrong with the commands here? I am on JB-MR1.
-pradeep.
Click to expand...
Click to collapse
So here is the thing I read somewhere that exec are just added for show and they don't actually work
I am not entirely sure of the above statement, but what I am sure of is that you can write a script and add it to the init.rc to get your work done
---------- Post added at 10:26 AM ---------- Previous post was at 10:16 AM ----------
kuisma said:
I guess cp works, but not rm? Root is remounted read-only quite early in init.rc
Edit: Also, I've told you to use full paths. And that if-syntax...? It's sure not standard shell test syntax.
Click to expand...
Click to collapse
It is not about the wrong service being called.
It is the fact that the service has been defined but you need to call the service at some instant by adding the command
'start yourServiceName'
That is if you want to start your service at boot time, you will need to add the following lines
on property:sys.boot_completed=1
start my_script
Here is a full version of a script that I wrote, this was to toggle wifi at regular interval of time
My Shell Script - init.custom.sh
#!/system/bin/sh
while true; do
svc wifi disable
sleep 10
svc wifi enable
sleep 60
done
My Code inside init.rc
service custom /system/bin/init.custom.sh
user root
oneshot
on property:sys.boot_completed=1
write /sys/block/mmcblk0/queue/scheduler cfq ## This was already present
start custom
I know this is a very late reply, but I started exploring these things recently.
Hope this helps someone.

fstab and init.rc roles in boot process

Hi, I'd like to ask a general question about fstab and init.rc. I'd like to select an alternative fstab from the boot partition, between two different fstab files, one of these with emmc partitions and the other with partitions on external sdcard, in order to boot either emmc or sdcard, alternatively.
I've read the init documentation at: https://android.googlesource.com/platform/system/core/+/master/init/readme.txt about init.rc configuration file.
Reading my init.rc file a doubt has been emerging: if the init executable looks at fstab (via mount_all) by default, why does init.rc contain mount commands related mounting /system, /data, and /cache partitions, if they are already defined in fstab file? Not enough the fstab existence in order to mount partitions, or do I need always to operate mounts in init.rc?
Any ideas?
cristian_c said:
Hi, I'd like to ask a general question about fstab and init.rc. I'd like to select an alternative fstab from the boot partition, between two different fstab files, one of these with emmc partitions and the other with partitions on external sdcard, in order to boot either emmc or sdcard, alternatively.
I've read the init documentation at: https://android.googlesource.com/platform/system/core/+/master/init/readme.txt about init.rc configuration file.
Reading my init.rc file a doubt has been emerging: if the init executable looks at fstab (via mount_all) by default, why does init.rc contain mount commands related mounting /system, /data, and /cache partitions, if they are already defined in fstab file? Not enough the fstab existence in order to mount partitions, or do I need always to operate mounts in init.rc?
Any ideas?
Click to expand...
Click to collapse
The fstab file is just a reference..
The init.rc is actually mounting them
The fstab file is just a reference..
The init.rc is actually mounting them
Click to expand...
Click to collapse
Thanks for the help! I'll try to work with this stuff
Romeotamizh said:
The fstab file is just a reference..
The init.rc is actually mounting them
Click to expand...
Click to collapse
I have a problem related to this and i can't figure it out. Basically my rom is stuck in a plash screen and i have narrowed it down to this:
Code:
<11>[ 3.142415] fs_mgr: Cannot open file /fstab.qcom
<11>[ 3.142425] init: unable to read fstab /fstab.qcom: No such file or directory
so it looks like init.rc is sending fs_mgr to look for fstab in the root directory /,
but it is actually in /etc, i can't understand why is this happening, I think it may have to do with other previous errors that occur a few lines before
Code:
<11>[ 2.887007] init: /init.rc: 11: invalid command 'setcon'
<11>[ 2.887037] init: /init.rc: 57: invalid command 'load_all_props'
<11>[ 2.887088] init: could not import file '/init.recovery.logd.rc' from '/init.rc'
<13>[ 2.887160] init: (Parsing /init.recovery.usb.rc took 0.00s.)
<11>[ 2.887177] init: could not import file '/init.recovery.qcom.rc' from '/init.rc'
<13>[ 2.887186] init: (Parsing /init.rc took 0.00s.)
heres my code: https://github.com/edTheGuy00/android_device_zuk_z2pro
any help would be appreciated.
Maybe you should paste your init.rc here in order to spot the issue.
Solved
I've found a way to select alternative partitions during boot process. It's possible to use busybox ln commands inside a shell script (placing busybox binary and shell script into ramdisk root directory of boot.img) and run the script by busybox ash command from init.rc. The commands inside shell script should look like as the following:
Code:
/busybox ln -sf /dev/block/mmcblk1p2 /[email protected]
/busybox ln -sf /dev/block/mmcblk1p3 /[email protected]
/busybox ln -sf /dev/block/mmcblk1p4 /[email protected]
These commands should be put into an if...then block inside the shell script. The conditional statement should looks like this:
Code:
if [ -b /dev/block/mmcblk1 ]
That way, if external sdcard is detected, shell script will change targets of [email protected] symbolic links from internal emmc partitions to external sdcard ones. So, init will use /system, /data and /cache mountpoints with the latter in place of the default ones during mount.

Categories

Resources