yashsingh1/xdaforums huggingface dataset:
[HD2 Android SD Development] marco.palumbi:
@securecrt

I gave a quick review to your init related stuff. here some comments:

- 1 - most important - you forgot to comment out "mtd@misc 0460 radio diag" from ueventd.htcleo.rc. If you dont comment it out, there is no luck for HaRET and WP7 users to boot.

- 2 - if you create with mknod the devices /dev/block/mmcblk0 /dev/block/mmcblk0p01 etc. , it is sure that the command

# wait for sdcard
while [ ! -b /dev/block/mmcblk0 ]; do
echo "Waiting for SD Card"
sleep 1
done
sleep 2

will find /dev/block/mmcblk0. All the above statements will end in two seconds uncondition delay that it might be not sufficient in most cases.

You must leave the kernel to create the device on devfs and wait for it.

- 3 - if you wait for /dev/block/mmcblk0 it may take some more time for /dev/block/mmcblk0p2 to show up. best to wait for /dev/block/mmcblk0p2

- 4 - why do you want to substitute with a script what is well done by init? I sugget to leve things as I made.

---
[HD2 Android SD Development] HypoTurtle:
@marco.palumbi

Have attached initrd.gz for NexusHD2-ICS made on the fly during installation from the nand ramdisk, from what I can see it mirrors yours but won't boot. Is there anything I may have overlooked?
[HD2 Android SD Development] Robbie P:
The attachment;)
[HD2 Android SD Development] marco.palumbi:
does my init.gz works if substituted to yours now?

try to diff all my files with yours.

the only difference I noticed at a quick review is the presence of more spaces at the beginning of the line that you inserted. I dont know if it may make any difference to init....

--
[HD2 Android SD Development] HypoTurtle:
Switching works, so the problem is with the ramdisk. Have ran diff between the two and can't see anything that shouldn't be there, have attached my script thats run at the moment: but to summarise: open ramdisk, make bin folder; copy in busybox and e2fsck binaries, add patch to init.rc , change patch according to romname and partition type, comment out misc in ueventd.htcleo.rc , change permissions of busybox, e2fsck, init.rc and ueventd.htcleo.rc, zip up ramdisk, change permissions of initrd.gz, copy to NativeSD.
[HD2 Android SD Development] marco.palumbi:
try to remove the extra space in front of the commands you inserted in itnit.rc

---------- Post added at 04:07 PM ---------- Previous post was at 03:46 PM ----------

I got the problem

mkdir -p /NativeSD

-p is a bash switch to mkdir. here you have the syntax of init.: NO -p

---
[HD2 Android SD Development] securecrt:
Thanks!

in fact if the mountfs.sh can work we can also use the mountfs.sh in the nand version (mount the yaffs2 to system & data).
[HD2 Android SD Development] HypoTurtle:
Thanks, added that as a placeholder and didn't think twice about it, will use a comment instead, trying it now.

Edit yea thats done it. Attached current NativeSD.zip, think it's now time for this to get it's own thread

Just add to root of zip, change rom name at top of NativeSD.zip and modify the updater-script adding

package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");

after the ramdisk is copied to /boot (and /boot_dir)

and changing bootsd (or similar) to boot
[HD2 Android SD Development] securecrt:
I think I have fixed the problem.

this version can use marc1706's kernel I tried it on NexusHD2 ICS v2.7 NativeSD ROM. Pls test and report.

View attachment initrd.gz
[HD2 Android SD Development] Robbie P:
It boots, bt track forward/backward works:good:
[HD2 Android SD Development] securecrt:
thanks @marco.palumbi . I changed the mountfs.sh as follow:

# make devices
echo "Making devices"
mkdir -m 0777 /dev/block
mknod -m 0666 /dev/block/mmcblk0 b 179 0
#mknod -m 0666 /dev/block/mmcblk0p1 b 179 1
#mknod -m 0666 /dev/block/mmcblk0p2 b 179 2
#mknod -m 0666 /dev/block/mmcblk0p3 b 179 3
#mknod -m 0666 /dev/block/mmcblk0p4 b 179 4

# wait for ext4 partition ready
while [ ! -b /dev/block/mmcblk0p2 ]; do
echo "Waiting for ext4 partition on SD Card"
sleep 1
done
sleep 2

# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2
if [[ $? -eq 2 ]]; then
/bin/reboot
fi;
[HD2 Android SD Development] HypoTurtle:
Made a patcher version with your code as well. (untested)

Have a couple of observations for you both, just curious but you both have added two spaces after "mount ext4" any reason why?

and with "mount yaffs mtd@cache /mnt/cache nosuid nodev" should it be commented out or not (marco.palumbi didn't , securecrt did) probably doesn't matter anyway, and can / should we remap misc? could that be the cause of the muted sound perhaps?

(I don't think enough reports are in as to confirm what this method fixes over sd ramdisk)
[HD2 Android SD Development] o82239:
if somebody need an WinMobile-NativeSD-Starter for all your installed Android-ROMs, test my new tool:

http://xdaforums.com/showthread.php?p=33174747

If you want new features, post your wish in the thread.

@securecrt and all NativeSD-ROM-Devs: It would be great, if you link my thread in your first post.
[HD2 Android SD Development] datagr:
nativeSDMultiBoot version7

Please download version 8 with latest fixes.

Here is the link :

http://xdaforums.com/showpost.php?p=33364171&postcount=1317
[HD2 Android SD Development] securecrt:
thanks. I will test it.
[HD2 Android SD Development] securecrt:
where is the rom_name.txt you read? I updated to v7 and can not find the delete button anymore.
[HD2 Android SD Development] vicm:
I believe the file rom_name.txt is located in sdcard\NativeSD and it gets created/updated when we switch ROM with the application.

In my case I tried the v7 in NAND (PACman 1.1) that was loaded through AD SD (there is respective sdcard\NativeSD\NAND folder and I can switch/load NAND as well as any installed NativeSD rom using the NativeSDMultiBoot app). On the fist run I did not see Tool/Delete buttons. However, they where Ok after I reselected and rebooted the ROM (NAND, in particular).

Thanks for update, datagr (the thanks button clicked as well :) ).
[HD2 Android SD Development] datagr:
As vicm said, this file is automatically created in sdcard/nativeSD folder and keeps the rom name from the latest selected rom in [Switch rom] menu.

If this rom name matches with the name that exists in line5, character 12 and after, in /proc/self/mountinfo file, it will appear both [Delete rom] and [Tools] buttons. :)

I hope we helped you securecrt because we really own you alot! :D
[HD2 Android SD Development] securecrt:
I think you should use some linux shell command to find out the ROM name from /proc/self/mountinfo

here is my mountinfo

1 1 0:1 / / rw - rootfs rootfs rw
10 1 0:10 / /dev rw,nosuid,relatime - tmpfs tmpfs rw,mode=755
11 10 0:9 / /dev/pts rw,relatime - devpts devpts rw,mode=600
12 1 0:3 / /proc rw,relatime - proc proc rw
13 1 0:0 / /sys rw,relatime - sysfs sysfs rw
14 1 0:11 / /acct rw,relatime - cgroup none rw,cpuacct
15 1 0:12 / /mnt/asec rw,relatime - tmpfs tmpfs rw,mode=755,gid=1000
16 1 0:13 / /mnt/obb rw,relatime - tmpfs tmpfs rw,mode=755,gid=1000
17 10 0:14 / /dev/cpuctl rw,relatime - cgroup none rw,cpu
18 1 179:2 / /NativeSD rw,noatime,nodiratime - ext4 /dev/block/mmcblk0p2 rw,barrier=0,stripe=512,data=writeback
19 1 179:2 /NexusHD2/system /system rw,noatime,nodiratime - ext4 /dev/block/mmcblk0p2 rw,barrier=0,stripe=512,data=writeback
20 1 179:2 /NexusHD2/data /data rw,noatime,nodiratime - ext4 /dev/block/mmcblk0p2 rw,barrier=0,stripe=512,data=writeback
21 20 179:2 /app /data/app rw,noatime,nodiratime - ext4 /dev/block/mmcblk0p2 rw,barrier=0,stripe=512,data=writeback
22 1 179:1 / /mnt/sdcard rw,nosuid,nodev,noexec,relatime - vfat /dev/block/vold/179:1 rw,dirsync,uid=1000,gid=1015,fmask=0702,dmask=
0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
23 1 179:1 /.android_secure /mnt/secure/asec rw,nosuid,nodev,noexec,relatime - vfat /dev/block/vold/179:1 rw,dirsync,uid=1000,gid=10
15,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
24 22 0:15 / /mnt/sdcard/.android_secure ro,relatime - tmpfs tmpfs ro,size=0k,mode=000
[HD2 Android SD Development] o82239:
Now I've released the version V2...

Thanks to Szczepanik for the feedback and the idea to sort the list.

Cheers

Klaus
[HD2 Android SD Development] Szczepanik:
Thanks datagr, particularly for support of more ROMs that I had asked for. Sorry for making suggestions just after a new release but I know you appreciate feedback.

Can you sort ROMs alphabetically?

Shouldn't there be a back (or Get me out of here!) button on the delete page?

If you know the current ROM name, could it be highlighted?

Should the Settings Menu show something?

Cheers

Tom
[HD2 Android SD Development] jjblaster3:
hi, just wanted to report that using this initrd the apps found in ext4 in nativesd/nexushd2-ics/data/app are not loaded or read or recognized as installed..

and if i install an app, it goes to the ext4 in nativesd/app

going back to marco.palumbi's initrd or the original (not similar to nand) nativesd initrd brings things back to normal
[HD2 Android SD Development] famewolf:
Are there any tools to convert a nand .zip to a nativesd .zip? Specifically the pimp my rom .zip from this thread: http://xdaforums.com/showthread.php?t=1908269
[HD2 Android SD Development] Szczepanik:
How to port NAND to NativeSD

c1C10n thread: [REF] How to port NAND to NativeSD | Step-by-Step

Cheers

Tom
[HD2 Android SD Development] famewolf:
The pimp my rom .zip is not a rom therefore the "how to port a nand rom to nativesd" isn't going to help which is why I'm asking if there are any other tools to install things like justin's inverted gapps, pimp my rom etc which all have threads here on xda but are designed to be "flashed" from recovery to a nand rom. Many use either a custom installer or aroma.
[HD2 Android SD Development] datagr:
nativeSDMultiBoot version8

Hello all,

Firstly, thanks to Szczepanik for the ideas for the new version 8.

Please download version 9 with fixed bugs.

Thank you!

Here is the link :

http://xdaforums.com/showpost.php?p=33416847&postcount=1335
[HD2 Android SD Development] poyensa:
Hi datagr, i cannot find tool and delete button. Installed on new qiss JB

sent from my time-machine-HD2 qissSea_JB nativeSD
[HD2 Android SD Development] datagr:
Click QSEA_JB in Switch rom section (because that's how it should be since you are running QSEA_JB) and then you will see those buttons.

This is done for make sure that the user will not make any false deletions or modifications.
[HD2 Android SD Development] Szczepanik:
Thanks for the update and acknowledgement . Hope you do not mind if I point out a small spacing inconsistency I see in the list of ROMs between row 4 & 5. I know I have to many ROMs!

Cheers

Tom
[HD2 Android SD Development] securecrt:
I still can't find the Delete & Tool Buttons :crying:
[HD2 Android SD Development] poyensa:
Switch rom>select your rom> back, and you should see tools and delete buttons

sent from my time-machine-HD2 rom JB PAC nativeSD
[HD2 Android SD Development] securecrt:
No, I can't find the Delete & Tools buttons after did that

I guess the problem is datagr assume that the ROM name in /proc/self/mountinfo 's postion is at the line5, character 12.

@datagr Please use the following linux shell command to find out the running ROM name from the /proc/self/mountinfo

cat /proc/self/mountinfo |grep system |sed 's/\/system.*//' |sed 's/.*\///'

and another suggestion the Cyan color seems not good for the button's back color. Maybe you can select Blue Color it is same as your app's icon color.
[HD2 Android SD Development] tytung:
I can't find the Delete & Tools buttons either after did that.

I think rom_name.txt is not needed since we can use the command that securecrt mentioned.
[HD2 Android SD Development] c1cl0n:
+1 Checked and confirm

So, why app can't detect currently runing rom without user switch?

... as I know this app did it perfectly on v5 v6 and v7

And what is the "CLK" button in switch rom menu? I'm magldr user and do not have cLK loader

:silly:
[HD2 Android SD Development] g.andy:
Dagatar Sorry, but I just can not understand. I use clk 1.5.1.0 and exchange rom each time thanks to multiboot menu of the same clk, selecting from time to time which the partition (nand, sboot or tboot) . Your application, users do not need to change clk rom, but only for the fix permissions, update kernel, wipe cache and Dalvik cache, and delete a rom in nativesd. Is it correct what I say?

Inviato dal mio multiboot HD2
[HD2 Android SD Development] datagr:
Please download version 9 with fixed bugs.

Here is the link :

http://xdaforums.com/showpost.php?p=33416847&postcount=1335
[HD2 Android SD Development] Robbie P:
Hi datagr, the app stops on opening for me. Tried fix_permissions and checked md5 of two DLs were the same (46823a7ddfd550d74f869ff6ec337b37). It seems the permissions are ---RWXR-X and can't be changed.

Thanks for your work BTW:)

Edit; Suggestion-New thread for app in Themes and Apps;) I would subscribe if you post a link here and also post any updates here. :)
[HD2 Android SD Development] Szczepanik:
Datagr,

I get "Unfortunately NativeSDboot has stopped".

I have not had these problems with version 8. If the name in the text file matches then I can delete etc. If it does not because I loaded a new ROM via Recovery, then I "change" to the new ROM and, as the name in the text file now matches, I can now see delete etc. Works as intended.

I agree that a darker shade of Blue would be preferable to cyan.

Thanks again for this great app. Deleting ROMs would be much harder without it.

Cheers

Tom
[HD2 Android SD Development] securecrt:
+1
[HD2 Android SD Development] rooter2000bka:
+1 for me

Please check!

Thank!
[HD2 Android SD Development] g.andy:
Sorry if quote my post, I just want to know if what I wrote is correct

Inviato dal mio multiboot HD2
[HD2 Android SD Development] marco.palumbi:
Hi Securecrt,

I was busy and only now get time to review your script.

here is the script after some changes:

#!/bin/busybox sh

# wait for ext4 partition ready
while [ ! -b /dev/block/mmcblk0p2 ]; do
#echo "Waiting for ext4 partition on SD Card"
/bin/busybox sleep 5
done
/bin/busybox sleep 2

# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2
if [[ $? -eq 2 ]]; then
/bin/busybox reboot -f
fi;

# set the name of the rom to boot
rom_name="NexusHD2-ICS"

# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /NativeSD
/bin/busybox mount -t ext4 -o rw,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD

# mount the system data app dir
/bin/busybox mount --bind /NativeSD/$rom_name/system /system
/bin/busybox mount --bind /NativeSD/$rom_name/data /data
# create app data/app dir
#/bin/busybox mkdir -p /NativeSD/app
#/bin/busybox mkdir -p /data/app
#/bin/busybox mount --bind /NativeSD/app /data/app

# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
#/system/bin/ln -s /system/bin /bin

here the comments:

- 1 - (these are only cosmetic changes) I made all the path explicit in order to avoid setting the PATH variable. I also used "busybox <command>" in order to avoid to make all the busybox links in /bin (you know that you can call any busybox appletin this way "busybox applet_name"). In this way you can use the script having only busybox and e2fsck in /bin.

- 2 - I removed the mounting of "proc" and "sys" and creating of /dev/block/mmcblk0. You definitely don't need them.

- 3 - Reboot after failed check. Please note that at this point you only have the reboot applet implemented in busybox. It needs the "-f" parameter in order to reboot. Anyway, in my opinion, as I already discussed with ph03n!x in his "DataOnEXT" thread, it is better to avoid it. It will lead to continuous reboots if the filesystem-check fails. In my opinion it is better to log the result and may be to manage it with an applet after.

- 4 - I commented out the "bind mount" of /data/app. Tytung doesn't do it in his original NativeSD ROM. This will fix the problem got by jjblaster3 here http://xdaforums.com/showpost.php?p=33274319&postcount=1313

- 5 - I commented out "/system/bin/ln -s /system/bin /bin". This make things more close to NAND ROM.

All said, in my opinion, there is no advantage in using a script insted of init.rc commands. Developers and automatic modders will always have to modify the init.rc. They will also have to mantain two different scripts insted of two differents init.rc. I suggest to present in your first post both the script solution and a link to my solution so anyone can chose what suits his needs.

-
[HD2 Android SD Development] HypoTurtle:
I had only done number 4, after the problem was reported. Have mirrored your changes (see attached) and will update patcher when I get time to test it.
[HD2 Android SD Development] datagr:
nativeSDMultiBoot Version 9

Hello all,

Please download version 10 with latest updates. :)

Here is the link :

http://xdaforums.com/showpost.php?p=33815218&postcount=1392
[HD2 Android SD Development] marco.palumbi:
please note:

- first line - if you don't use

#!/bin/busybox sh

you won't be able to remove all links to busybox.

- all echo will never be displayed

- reboot needs -f. I want once more say that this will bring to boot loops when the check fails. I suggest to remove reboot and redirect output to file.

- you forgot to add /bin/busybox to last rm.

---
[HD2 Android SD Development] securecrt:
after pressed any of the buttons.

Unfortunately, NativeSDBoot has stopped.
[HD2 Android SD Development] securecrt:
Thanks for your comments.

For me I am just want to make the mountfs.sh isolate from the init.rc , I think it is easy to modify it and make it support for other file systems (nilfs2, f2fs, yaffs2 ...).
[HD2 Android SD Development] HypoTurtle:
Not sure what you are saying with #!/bin/busybox sh as I already added that, echo I know,

Outputting to file but to where? If e2fsck reports errors is it safe to and will the system mount properly.

Any problems with the attached, I take it the file can be written to / before system / data are mounted?

Patcher wise it's about the same, marco's way requires a file to be slotted in (I've called it initrcmod) to init.rc, and your way requires the exec line added to init.rc and the inclusion of the script, either way is easily modified, f2fs from what i've seen should mount the same as ext4 thus if you use auto instead of ext4 in init.rc mountfs.sh then it should work for both filesystems, nilfs2 requires two additional lines and haven't managed to get the filesystem autodetect working yet for the addition of these lines to be automated.
[HD2 Android SD Development] melando:
@datagr - an error message flashes up whenever I run fix permissions (in previous versions as well as the latest)... is this working for anyone else?
[HD2 Android SD Development] datagr:
Sorry for the inconvenience!

Please download again version 9, it should be fixed this small bug. :)

---------- Post added at 05:15 PM ---------- Previous post was at 05:02 PM ----------

Please download again version 9 and test it.

I have made some changes.

Actually on my HD2 the app is working perfect, but this means nothing if it's not working to anyone else.

I am using PACman rom and HYPER rom for tests.
[HD2 Android SD Development] marco.palumbi:
regarding #!/bin/busybox sh you are right, I should have read from a wrong file while commenting.

your last script should work.

just suggest to change the check with:

/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log

so you can log what was the error.

--
[HD2 Android SD Development] securecrt:
stop work after press any buttons
[HD2 Android SD Development] datagr:
Please download version 9 and post your feedback. :)
[HD2 Android SD Development] kaiserlein:
I had the same problem like securecrt with this testversion the switch rom button is working! :good:

The blue color in the current running rom is there too :good:
[HD2 Android SD Development] securecrt:
ok I see the blue color :)
[HD2 Android SD Development] datagr:
Post of version 9 updated with working (hopefully) version. :)

Please download and post your feedback.

Here is the direct link :

http://xdaforums.com/showpost.php?p=33416847&postcount=1335
[HD2 Android SD Development] vicm:
Hi datagr. Thanks for your effort.

The latest version works with roms installed as NativeSD. However, in my case, I have also my NAND rom (PACman 1.1) booted through AD SD (there is NAND folder on sdcard\NativeSD). The app seems does not identify the current rom correctly if I booted into NAND. There is no highlighting in Switch rom section (NAND button is visible) and NAND button is visible for deleting in Delete rom section.

Hope that helps :) . Thanks again.
[HD2 Android SD Development] datagr:
When you are in Tools section, what rom does it say?
[HD2 Android SD Development] vicm:
It is empty.
[HD2 Android SD Development] Szczepanik:
Version 9 updated

Datagr thanks seems to work fine although a little slower. Minor comments: you may want to consider putting the words "Blue colour" in the blue colour (if you follow me). Also I am still seeing a strange line in delete screen between rows 4 & 5. The automatic recognition of the current ROM is great. Good job by all.

Cheers

Tom
[HD2 Android SD Development] vicm:
A short note related the UI in 240 dpi mode. It seems there is not enough space for delete warning message.
[HD2 Android SD Development] datagr:
I am going to add tabs, so we will have plenty of space for buttons and texts, even pictures. :)

Send from my PACman Jelly Bean
[HD2 Android SD Development] securecrt:
@marco.palumbi

Can you post an working initrd.gz based on your idea for NexusHD2-ICS , then I can add a link to the first page.
[HD2 Android SD Development] marco.palumbi:
you can link to this post:

http://xdaforums.com/showpost.php?p=32966037&postcount=1259

it is quite clear and the initrd.gz has been tested.
[HD2 Android SD Development] 2alive:
Working fine. Thanks.
[HD2 Android SD Development] Magic2010:
Version 9 running great here, just one problem, after reboot the app goes back to version 6...

Any ideas?
[HD2 Android SD Development] LinChina:
Delete first the old version before installing the newest update, I expierenced the same, I used ROM Toolbox to be sure it's deleted.

Cheers.....LinChina
[HD2 Android SD Development] g.andy:
Put into system /app, setting the permissions and reboot.

Inviato dal mio multiboot HD2
[HD2 Android SD Development] JMG01:
Noob question...

nativeSDMultiBoot

Not sure what to do with this... I have a rom installed on NativeSD. If I want a second rom on Native SD, do I start the first rom and then run the APK?

It sounds odd to me, but is that the process? And if so, what then?

Sorry to ask...
[HD2 Android SD Development] poyensa:
Nop. Just go to 4EXTrecovery and install the second rom, then boot as usual. With multiboot apk you can switch roms once installed.

sent from my time-machine-HD2 JB-PACman-nativeSD rom
[HD2 Android SD Development] cieslakpawel1:
I've been trying to change the kernel Dori 7.3 instead of Dori 7.2 using tools but it didn't work with MultiBoot. I've used ver. no9 without success. any ideas?
[HD2 Android SD Development] gtbluesky:
Hi @marco.palumbi,I tested your method for ICS&JB,they work well,but GB seems cannot be supported(cannot be booted),can you give us a template for GB(2.3),THX!
[HD2 Android SD Development] marco.palumbi:
wich rom did you try?

can please explain how did you the port?

is it working with old methd?

can pleaseattach the working initrd.gz if any?
[HD2 Android SD Development] gtbluesky:
@marco.palumbi,I tested tytung's NexusHD2 JB & QISS_ME4.1,they all work well.miui2.3's initrd.gz cannot be supportted,but old method supports.You konw,GB NativeSD"s initrd/bin isn't the same as JB&ICS.I attached QISS_ME4.1'NativeSD initrd.gz with your method.View attachment initrd.gz
[HD2 Android SD Development] JMG01:
What can resize the Ext4 from phone or from Windows?

I maid the Ext4 1GB, but want to increase it (32GB card) so I can try more roms!

I tried MiniTool but it just moves it and does not resize. I also tried Paragon, but no luck.

Any ideas?

----

Edit... OOOOpppps... tried GParted, but I got errors, so have started from scratch! Minor setback!