yashsingh1/xdaforums huggingface dataset:
[HD2 Android SD Development] giovanne:
@datagr,

first, thanks for your great app.

One question, I don't know if it is (already) possible and helpful. So only for discussion ;)

Maybe there is a possibility to implement a backup (restore) function in your app!?

Backup for one specific NativeSD Rom or maybe/additional for the hole ext4 partition?

Backup one specific NativeSD Rom maybe by zipping all the related content or only backup by rename/copy the NativeSD Folder to a different name (e.g. copy AOKP to AOKP_bck_16102012)

Restoring by renaming/copying back.

Maybe this gives the possiblility to backup the ROM before trying an Update (e.g. without switching the phone off and insert the microsd to the pc for doing a backup process)

If there is already a solution or it is nonsense, please let me know... :D
[HD2 Android SD Development] melando:
Advanced backup sd-ext in recovery
[HD2 Android SD Development] marco.palumbi:
New initrd mod for NativeSD

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

Here is an alternative idea on how to boot NativeSD.

It is simpler cleaner and should be more compatible with NAND roms.

In respect to NAND initrd, the only file modifyed is init.rc and busybox is added in /bin.(please note that busybox must be statically linked to libraries)

this is the diff from Tytung's ICS 2.7 NAND init.rc and my NativeSD init.rc:

diff /sdcard/NativeSD/init.rc* init.rc
--- /sdcard/NativeSD/init.rc.TytungOriginal
+++ init.rc
@@ -97,11 +97,28 @@
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
- mount yaffs2 mtd@system /system noatime nodiratime
+ #mount yaffs2 mtd@system /system noatime nodiratime
#mount yaffs2 mtd@system /system ro remount

# move cache to data -TYT
- mount yaffs2 mtd@userdata /data nosuid nodev noatime nodiratime
+ #mount yaffs2 mtd@userdata /data nosuid nodev noatime nodiratime
+
+ # wait for sdcard
+ wait /dev/block/mmcblk0p2
+ wait /dev/block/mmcblk0p2
+ # SD Card Speed Fix
+ write /sys/devices/virtual/bdi/179:0/read_ahead_kb 8192
+ # mount the 1st (NativeSD) SD-EXT partition
+ mkdir /NativeSD
+ mount ext4 /dev/block/mmcblk0p2 /NativeSD wait noatime nodiratime barrier=0
+ # mount the system data app dir
+ exec /bin/busybox mount --bind /NativeSD/NexusHD2-ICS/system /system
+ exec /bin/busybox mount --bind /NativeSD/NexusHD2-ICS/data /data
+ # cleanup
+ # delete /bin to free ram
+ rm /bin/busybox
+ rmdir /bin
+
mount yaffs2 mtd@cache /mnt/cache nosuid nodev

on post-fs

as you can see all the job is started from init.rc

there is no e2fsck at the moment, but please note that also in the init from Xylograph an Tytung the command cant be executed.

here is the lines in Tytung's init script:

/system/bin/e2fsck -p /dev/block/mmcblk0p2
if [[ $? -eq 2 ]]
then /system/bin/reboot
fi;

at the time that init is executed "/system/bin/e2fsck" doesn't exist because system is not mounted.

Further most of e2fsck binaries that I have seen around are not statically linked to libraries and so they need some shared libraries to execute.

Attached is an example initrd.gz for Tytung's NexusHD2-ICS-CM9-HWA_V2.7

@kcfong2

can please try this to see if it solves the issue with bluetooth mouse?

@every one using HaRET to boot:

can please report if it works?

@Xylograph

can please try this with marc1706 kernel?

-
[HD2 Android SD Development] tytung:
In my JB NativeSD v1.1, I have already replaced /system/bin/* to /bin/*

/init

# SD Card Speed Fix
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
/bin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi;

/bin/e2fsck -p /dev/block/mmcblk0p2
if [[ $? -eq 2 ]]; then
/bin/reboot
fi;

Now read_ahead_kb is set correctly.

I didn't check if e2fsck is executed or not.

However I like your method.

It's great to remove the init script in NativeSD initrd.gz if your method works well for everyone.

Thanks.
[HD2 Android SD Development] marco.palumbi:
the bigger improvement of this method is that ueventd runs correctly, may be solving some issue...

regarding e2fsck:

i tested the e2fsck binary on your ICS initrd.

it needs some shared libraries to execute and it core dumps with the whole system running.

if anyone can compile e2fsck statically fs check can be added to init.rc with this line

exec /bin/busybox sh -c "/bin/e2fsck -p /dev/block/mmcblk0p2 > /fsck.log"

other way could be to use the e2fsck binary that is located in /system/bin , add the needed shared libraries to initrd and delete them after the fs check in order to free ram.

-
[HD2 Android SD Development] Robbie P:
Doesn't boot I'm afraid, reboot after black htc screen. haret, nexushd2 ics 2.7
[HD2 Android SD Development] XenSA:
NativeSD Installation for cLK NAND Android users : (thanks clio94)

1. Copy the [URL="http://www.mediafire.com/?nhyausx0p5whu"]flash_bootv2.zip[/URL] to your sdcard.
2. Boot into cLK and make a sboot partition.Be aware that only clk from kokotas allows to make a sboot partition directly from device
3. Boot into recovery (4EXT recovery = recommended) and install rom by choosing sd-ext method
4. After installation finishes,dont reboot, but install flash_sbootv2.zip and then reboot to cLK
5. In cLK choose to boot from sboot and wait for the ROM to boot.
6. If you are stuck on the boot animation,try to wipe your ext partition and install the ROM again.

at the risk of getting flamed can some 1 help me with this please i do not get step 2.

i have the clk 1.4.1 installed

and have tried to use the tool to flash to clk 1.5x but it just says waiting for device....

thanks.
[HD2 Android SD Development] Robbie P:
I tried to get a logcat for the above but no joy.

Tried it from magldr and same, not booting. Got dmesg though. Hope it helps.

Edit; I have md5=aae81fb3d92a4804b066e2648cd4bea7 from 2 DLs, @marco.palumbi can you check pre-upload md5, @$&* happens sometimes.
[HD2 Android SD Development] marco.palumbi:
checksum is correct.

from dmesg I see that mmcblk0p2 fails to mount.

can you please perform a e2fsck on mmcblk0p2 from recovery?

is mmcblk0p2 formatted as ext4?
[HD2 Android SD Development] Robbie P:
sorry, backing up my ext4 first;) I have 3 nativesd roms there.

To confirm, use file system check in 4ext recovery?
[HD2 Android SD Development] marco.palumbi:
can you please supply a dmesg with original Tytung's initrd.gz?
[HD2 Android SD Development] Robbie P:
backup took ages

Will check fs now.

edit; fs has errors, fixing

edit2; after checking the fixit button the screen seemed to just hang. I left it for 15 mins or so and pressed red reset button. Now i cant boot nativesd.

will re-format ext4 and restore backup.

I know this is a modded recovery for SD (by Xylograph), would this cause fs check to think that ext4 has errors (the no cache error at the start for example). Is fs chk "nand stuff" in http://xdaforums.com/showpost.php?p=31666863&postcount=737
[HD2 Android SD Development] marco.palumbi:
please try this initrd.gz

I added some more wait before mount.

I also noticed that you are using an older kernel than mine...

please try this one (unzip it from zImage.zip)....dont mind for the /system/lib/modules for now, just to see if it boot....

please report with your kernel and this one.
[HD2 Android SD Development] Robbie P:
See my edit above, if backing up took ages, restore will take more;)

Make yourself some tea.
[HD2 Android SD Development] Robbie P:
Both rebooted after black htc screen.
[HD2 Android SD Development] Magic2010:
Really very close to be flamed...but...

Download the latest Black cLK from kokotas

Rename image to "lk.img"

Put it in root of sdcard

Reboot phone in the colorfull screen and let it install the cLK

After that you're done

I think I didn't forget any step.
[HD2 Android SD Development] Dunc001:
Actually for that method to work you need the leoimg.nbh in the root of your sd card. If you just have the lk.img file there you can open terminal on your phone and type:

su [enter]

flash_image lk lk.img [enter]

and it should flash from there.
[HD2 Android SD Development] Xylograph:
This was the first thing I've tried when NativeSD wasn't even released and pho3n!x released mount data on ext method, but unfortunately didn't work..

I think you can find the results of these tests in that thread..

I could never get it to boot that way until securecrt came with the 'old sd boot' init ;)

Have you tried your idea yourself ?

Like marc1706 suggested.. putting a wait command inside the NativeSD init script (i used 20 seconds) got it to boot.. Will test and finetune it some more when I have more time.. 5 seconds didn't work for me..
[HD2 Android SD Development] Magic2010:
You are correct, thanks.

I confused the 2 methods.
[HD2 Android SD Development] marco.palumbi:
for me it boot without any problem.

I am using magldr and Tytung's ICS 2.7

I think that Tytung too was able to boot with my initrd.

Robbie p have some problems and I am working with him to try to solve the issue

did you try my initrd with Tytung's ICS 2.7?

if you can, please give it a try.

which bootloader did you use on your tests?

how it is partitioned your NAND?

do you have an android rom on NAND or whatever?

I ask this becouse I have some idea on your issue
[HD2 Android SD Development] adell_:
Hi securecrt,

I'm using tytung's Jelly Bean ROM with DataOnEXT. Can I use a NativeSD ROM?
[HD2 Android SD Development] securecrt:
the answer is yes!
[HD2 Android SD Development] securecrt:
very glad to see you guys make improvements on NativeSD, I am very busy these days and have no time to test and dev on HD2.

I hope you guys can make some progress.
[HD2 Android SD Development] Robbie P:
Not sure if you got my last PM marco.palumbi, but I was able to boot marc1706's latest ics kernel in tytung's 2.7 using your ramdisk. WIFI doesn't seem to work ATM.

Well done mate

Edit; wifi works btw
[HD2 Android SD Development] kaiserlein:
Tried this initrd.gz with clk and tytungs rom but it didn't boot. Hangs on green htc logo. No log because no PC nearby, sorry.
[HD2 Android SD Development] marco.palumbi:
can you please restore your ROM, test that it is booting and then upload the initrd.gz that works for you?

I remaind to all that, while the method is general, the initrd.gz attached to my post is an example ONLY for original "NexusHD2-ICS-4.0.4-CM9-HWA V2.7 [NativeSD]" released from Tytung.

thank you for testing
[HD2 Android SD Development] Xylograph:
Great work marco.palumbi (and Robbie P) !

I hope to test it out soon.. this would be indeed a lot 'cleaner'

Thanks guys.
[HD2 Android SD Development] kaiserlein:
I did try this with Tytungs NexusHD2-ICS-4.0.4-CM9-HWA V2.7 [NativeSD].

The only thing that I changed is that I odexed the Rom. Could this be the problem?

This is the output of logcat:

- exec '/system/bin/sh' failed: No such file or directory (2) -

The initrd.gz that works is the original one.
[HD2 Android SD Development] marco.palumbi:
can please upload the initrd.gz that is working instead?
[HD2 Android SD Development] kaiserlein:
here it comes
[HD2 Android SD Development] marco.palumbi:
this initrd is not for Tytung's ICS. Inside the init script there is:

rom_name="NexusHD2-JellyBean"

that is for JellyBean version....

are you sure that you are on NexusHD2-ICS-4.0.4-CM9-HWA V2.7 [NativeSD].?

-
[HD2 Android SD Development] kaiserlein:
I feel like a complete idiot, you're right it's the JellyBean version. I somehow got completly mixed up and I didn't even drink :mad:
[HD2 Android SD Development] marco.palumbi:
It may be that to be excused you want to install ICS and test.....;)

Anyway thanks!
[HD2 Android SD Development] kaiserlein:
Tested with ics now and it's booting fine :)

Well done!

If you now could mod the jelybean initrd.gz i'm going to test this too :)
[HD2 Android SD Development] HypoTurtle:
Don't know if you've looked into making a universal modder but I think I have it more or less done. But just to check a few things as I can't test anything on the device myself at the moment but 1. would 'mount auto' instead of 'mount ext4' work just as well? and 2. would there be an issue using ROM_NAME and $ROM_NAME as with what's done with the original modifications to init?
[HD2 Android SD Development] marco.palumbi:
No, I will going to give only ideas if I have any...

the fstype parameter of init mount command is passed as is to mount systemcall.

mount(2) man page doosn't mention the "auto" parameter.

I suggest to give it a try.

something like this:

export ROM_NAME NexusHD2-ICS
exec /bin/busybox mount --bind /NativeSD/$ROM_NAME/system /system
exec /bin/busybox mount --bind /NativeSD/$ROM_NAME/data /data

EDIT: sorry, the above will not work because init doesnt parse any variable.

it may be this

export ROM_NAME NexusHD2-ICS
exec /bin/busybox sh -c "/bin/busybox mount --bind /NativeSD/$ROM_NAME/system /system"
exec /bin/busybox sh -c "/bin/busybox mount --bind /NativeSD/$ROM_NAME/data /data"

but I dont like it very much.

for me it would be better to use my original way and let the automatic modder take the job of emiting the correct lines.

-
[HD2 Android SD Development] HypoTurtle:
I'll give it a try when I get a chance (phone still needs a repair), it works fine within init just wondering if init.rc handles things differently.

well thinking of mirroring whats done with inits :D

rom_name="PA"
mount --bind /NativeSD/$rom_name/system /system
mount --bind /NativeSD/$rom_name/data /data

so I guess that can't be done then?

Had it set up yesterday to comment out the lines not used, add in your mount lines and comments (slightly modified) and add in a "rom_name=*" line, just need to add it to a initrd patcher and should be good to go, shouldn't be an issue to change it if using "rom_name=*" can't be used just need to think of the best way to do it.

Edit. Have attached what I have at the moment (untested on device) need to add the folder (NativeSD) from the zip to the root of a NativeSD rom zip and changing the updater script to look like the following

Devs if making a new NativeSD zip (and I haven't made any mistakes with my scripts) it would require the NativeSD folder and:

ui_print("@ Installing System");
package_extract_dir("kernel/boot[COLOR="Red"][STRIKE]sd[/STRIKE][/COLOR]", "/boot");
package_extract_dir("kernel/kernel", "/boot");
[COLOR="Red"][STRIKE]package_extract_dir("kernel/bootsd", "/boot_dir");[/STRIKE][/COLOR]
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system")
[COLOR="Blue"]package_extract_dir("NativeSD", "/tmp");
set_perm(0,0, 0777, "/tmp/ramdisk/nativesd.sh");
set_perm(0,0, 0777, "/tmp/ramdisk/romname.sh");
run_program("/tmp/ramdisk/nativesd.sh")[/COLOR];

some issues may be fixed (work being done with the help of Robbie P on this thread) and nativesd folder obtained from here
[HD2 Android SD Development] marco.palumbi:
as I told init doesnt parse variables so you can't use $ROM_NAME.

you can search and replace wit sed your "initrcmod" file for $ROM_NAME and substitute with the actual ron name.

then you can read it as are you doing.

if I read correctly you are searching for #on fs to find the point to insert the new lines.

why the sharp # ?

not clear to me what are you doing with nilfs2 and why.

-

take in account thet mount ext4 will mount all ex2, ext3 and ext4 ...
[HD2 Android SD Development] HypoTurtle:
In terms of $ROM_NAME yea that's what I was going to do, but want to find a way for it to be completely automatic by having a search run of build.prop for the rom name and for it to generate the romname file and then have the actual rom name replace $ROM_NAME or whaterever placeholder (if that's at all possible) read from this file (or directly from build.prop). And when you say init you mean init.rc? as variables seem to work fine with init (as per the original method)

No reason why for the #, does it matter? Edit: My mistake was working of a livecd and the first initrd.gz I could find yesterday, wouldn't be surprised if all nand ramdisk init.rc's don't have #

With nilfs2 added that for nilfs2 support (see sig.) haven't tested but if the mounted file system is nilfs2 it needs those lines as far as I know (works and haven't been told otherwise).

mount ext4 will work for ext partitions but not nilfs2 (and f2fs when/if it goes mainstream) and Xylo has moved to using mount auto.

This is a first pass, needs a tidy, and probably a few fixes i.e changing mount to ext4 and changing it if the partition is nilfs2/f2fs, just more interested if it works more or less as is, as it would be one step closer to a kinda portadroid for NativeSD.
[HD2 Android SD Development] marco.palumbi:
in most init.rc file simply there is not a line whit #on fs, but on fs only.
[HD2 Android SD Development] kcfong2:
Marco,

I just saw your post today (10.20.2012). I'll give it a try and let you know.

Thanks.
[HD2 Android SD Development] kcfong2:
Marco,

Sorry, I do not subscribe to this thread, so I never saw your message until I got your link from Tytung's JB v1.1 thread. BUT, I was able to test the initrd.gz file you posted there (don't know if that one is newer, but the message is dated 10/20 rather than 10/18 as here).

Anyway, SUCCESS!

The BT HID support is working for Tytung's JB v1.1 NativeSD install. So far, I've only run the rom for about an hour, but I have NOT noticed anything malfunctioning.

The low sound/low volume issue seems to be the only outstanding issue, but that may be a more general JB issue than it is with Tytung's ROM.

I've posted the success notification on Tytung's thread and "thanked" you there as well.
[HD2 Android SD Development] jjblaster3:
@Xylograph..

with thanks to marco.palumbi's post quoted below, have been able to boot the recoveries that would not boot before if one had wm/wp7 in nand..

just wanted to let you know so that if you get time you could modify and reupload the touch recoveries to your download repository
[HD2 Android SD Development] marco.palumbi:
please remember that you must always start from a NAND initrd.gz.

and dont forget busybox and e2fsck....I suggest to take the ones that I provided in my example, that are proven to work without shared libraries.

----

---------- Post added at 05:20 PM ---------- Previous post was at 04:50 PM ----------

thank you for testing.

at this point it seems that this method works and more important it solves some problems.

the major improvement is to have ueventd up and running. This concept could be applied to old sd roms too.

---
[HD2 Android SD Development] chimpsinties:
I came to change from my usual NAND install to a NativeSD JB ROM yesterday.

Boy did it take a long time. I was bashing my head against a brick wall for ages trying to follow the instructions. Turns out I could have done it in minutes.

I think it should be made clearer in the 1st post that once you've done the partitioning of SD card you can simply use ClockworkMod recovery to install the NativeSD JB zip and it's the ROM itself that gives you the option to install it totally on the SD card if you want to. I spent hours trying to install Ext4 Recovery thinking that I "needed" it when actually you don't. Yes it might be better but not totally necessary.

While I'm at it. Is there any extra advice on installing Ext4 Partition. I tried downloading the 2.2.7 NAND zip and installing it via CWM recovery but it didn't work, however it did stop CWM working on the next boot. MAGLDR was still there though.

Any chance someone could explain this from the first page a bit better. After going to the 4Ext,net website and downloading the updater, it thinks my phone is a Nexus so I'm worried about continuing that way.
[HD2 Android SD Development] mengfei:
try the links below, it might help :cowboy:
[HD2 Android SD Development] chimpsinties:
This was one of the guides I was trying to follow. It's a nice one but you talk about Touch and Recovery folders on your SD card but where do you get these from? I just want to be able to install 4Ext Recovery on my NAND.

I think it would help newbies (I'm no newbie by the way) to mention after doing the partitioning of the SD card via Windows MiniTool you can then just install the Native SD ROM via CWM Recovery as I did.
[HD2 Android SD Development] gade12:
Share apps

I dont know if this help or need somebody or even if somebody got it before but i go...

i have got to share user app between diferents NativeSD roms.

This can work with update-script at installation, with terminal...but i will explain with Root Explorer and 2 NativeSD installed

Be sure you can install apps, install one app and unistall it.

1. Go first rom without apps installed (to get this put file explorer with root access on system app)

2. Go /NativeSD/

3. Create folder name "app". It must look like: /NativeSD/app

4. Give permissions rwxrwxrwx to this folder.

5. Long click in "app" folder and select: "Link to this folder"

6. Go to /data/

7. Click in "Create link". It will ask if you want to merge bla bla...Yes :)

8. If you are using Root Explorer you will see rwxrwxrwx -> app in /data/app folder

9. Now you can test if applications can be installed...

Go second rom, test if you can install apps, unistall all user apps, file explorer with root access in system...

1. Go /NativeSD/

2. Long click in "app" folder and select: "Link to this folder"

3. Go to /data/

4. Click in "Create link". It will ask if you want to merge bla bla...Yes :)

5. Reboot

And you are done. Now you can go first rom, install app, go second rom and you will have it there.

But only app...data, settings...not shared with this method. To share data you will have to do this process with /data/data but this can be dangerous due to diferent roms, android versions, system data apps....
[HD2 Android SD Development] KyJelly69:
will your universal modder work for ROMs only or would it work or be adaptable to apps as well? for example justun bean's gapps aroma installer or other packages installed through recovery?
[HD2 Android SD Development] HypoTurtle:
The modder is more to give nativesd support to all roms (and devices), although currently only working on modifying nativesd zips (once done should be able to modify NAND builds then clk / boot.img users).

Have posted a zip on the softkey thread to do something similar (and the guys have started using nativesd aroma installers with there softkeys) but all you should need to do is pull a install.sh from any NativeSD zip, change the rom name to the one you want to modify, add it to the root of the zip you want to apply and add

package_extract_file("install.sh","/tmp/install.sh");

set_perm(0, 0, 0777, "/tmp/install.sh");

run_program("/tmp/install.sh");

towards the start of the updater-script
[HD2 Android SD Development] securecrt:
App share is easy but you can not share some apps between cm7 and cm9 or cm10.

The data share is not practical the main issue is the app-id, permissions need to be reset.
[HD2 Android SD Development] gade12:
Yes of course. This "trick" is for example you have: PA JB, tytung JB and MIUI JB. Even with merge of ICS and JB roms can work good.

This is easy and fast way, with some init.d scrip can work better...
[HD2 Android SD Development] pakure:
already informed to xylo long time back ( on sept 9th), but he preferred to use ext4 recovery
[HD2 Android SD Development] securecrt:
based on this idea I made a few changes in the init.rc file

I add a mountfs.sh script to handle the ext4 file system mount process.

now the init file is same as the nand version, I hope it can fix some bluetooth weird problems.

the attached file is for NexusHD2-ICS NativeSD version. Pls test and report,Thanks

View attachment initrd.gz
[HD2 Android SD Development] Robbie P:
I tried your initrd.gz on NexusHD2-ICS NativeSD with marc1706 kernel (it was working with marco.palumbi's initrd.gz) but it reboots after black htc screen.

Have attached dmesg. Couldn't get a logcat.

shall i try a fresh install with tytung kernel?