yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] Robbie P:
Hi HypoTurtle, not sure I understand your last edit:o:)

I have been using this http://www.paragon-software.com/home/extfs-windows/ to access sdcard ext4 partitions from windows PC, works a treat most times. Thanks to MarkAtHome for the heads up on it.
[HD2 Android NAND Development] HypoTurtle:
Which part - the uploaded is a zip renamed as a .apk (xda zip limit is 8MB, apk is 20MB) you can right click and open it with 7zip as an archive or rename it to a zip (organise => folder and search options => view => untick hide extentions for known file types.

FYI. I've downloaded ext2fsd if needed to look at ext4 but haven't needed it yet.

[MENTION=3629322]Robbie P[/MENTION] if you have the chance can you try DalvikOnNand and post the dmesg - not sure why it's stalling (hopefully I just didn't wait long enough or just ran out of space) - Native/DirectSD- DalvikonNAND is also an option atm just not switched on changing NativeSD to Nativesd-dk at line 151 is all it needs.
[HD2 Android NAND Development] Robbie P:
I never tried dalvikonnand before. I can't see the point with an EU hd2 of having system and dalvik on nand, especially with 365mb system. I can see the point of NativeSD/DirectSD with dalvik on nand. Assuming I replace line 151 (is it Nativesd-dk or NativeSD-dk?), what nand partition label and size is used? I have nothing in nand ATM, so dalvic partition can be pretty big (400+mb)
[HD2 Android NAND Development] HypoTurtle:
userdata partition is used in this case for dalvik.

Just a heads up - I've got a corrupted f2fs partition - probably due to my messy set up... bad/sudden power off. error is reported by fsck.f2fs although not sure if the error reported is an issue with the fsck binary or the partition.

F2FS-tools: fsck.f2fs Ver: 1.3.0 (2014-02-06)
Info: sector size = 512
Info: total sectors = 1999304 (in 512bytes)
Assertion failed!
[fsck_chk_node_blk: 209] nid == le32_to_cpu(node_blk->footer.nid)
--> nid[0x3] blk_addr[0x339bd] footer.nid[0x2]

Time to reformat I guess.

Edit. Definitely not an issue with fsck - correct output is:

F2FS-tools: fsck.f2fs Ver: 1.3.0 (2014-02-06)

Info: sector size = 512
Info: total sectors = 1999304 (in 512bytes)

[FSCK] Unreachable nat entries [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking [Ok..]
[FSCK] Hard link checking for regular file [Ok..] [0x0]
[FSCK] valid_block_count matching with CP [Ok..] [0x1e8161]
[FSCK] valid_node_count matcing with CP (de lookup) [Ok..] [0x5e9]
[FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x5e9]
[FSCK] valid_inode_count matched with CP [Ok..] [0x58e]

Done.

The fsck.f2fs isn't as advanced as e2fsck, so can't do much to correct errors.
[HD2 Android NAND Development] Robbie P:
I reformatted my p2 ext4 with mintool (and formatted p3 to ext4 for now)

I flashed nand with this config

And have 420mb userdata

used the boot/ and meta-data/ folders from CM11_MAC_ramd

put 4a system in it (along with 4a clk nand ramdisk and kernel, but I am sure they were there already)

changed line 151 of ramdiskscript.sh to NativeSD-dk

Installed nativesd using 4ext sd recovery (no log produced, sorry)

It hangs on HTC screen

I get the attached dmesg, I am sure the kernel is correct, I checked md5sum of 4a with my zip.
[HD2 Android NAND Development] HypoTurtle:
Thanks; it seems to be a pixeldroid kernel (there was a boot.img left in CM11_MAC_ramd; sorry). v3 works just the same (v4 tomorrow once tested). You shouldn't need to reinstall system. Have you checked the swap file?
[HD2 Android NAND Development] Robbie P:
I didn't select swap yet. Does it need a partition? It seems to say it is a file.

How did I miss boot.img this time, that would explain pixelfreak kernel. I was scratching my head over that;)

will try again this evening.
[HD2 Android NAND Development] HypoTurtle:
It's a swap file added to /data.

Well to be exact - if you have a swap partition aroma will ask if you want to use the swap partition; if you don't it'll ask if you want to make and use a swap file.

For v4; I'm thinking some more conditional windows. i.e. which boot partition to use for cLK: any other suggestions to add.

Also testing to see if I can get a script redirect working (very short script added to boot folder and script with the functions added to /sdcard) - it should allow for things to be tweaked without touching the .zip folder.
[HD2 Android NAND Development] HypoTurtle:
v4 Added to signature awaiting reports - also download ramdiskscript functions and copy to /sdcard

Changes:

Removed need for ROM_NAME.prop - you can still use it but there's three defaults

(see aroma-config and rdsfuncts.sh)

cLK boot partition selection - boot/sboot/tboot.

Swap partition/file option only appears with a non-empty swap.txt file.​
[HD2 Android NAND Development] Robbie P:
tried v4 to get a working ramdisk for my previous install, almost dozed off when I saw the lovely waterfall pic:)

I added ROM_NAME.prop with the name I used before, and a kernel and ramdisk to boot. funcs to /sdcard.

It errors in aroma
[HD2 Android NAND Development] HypoTurtle:
My bad - fixed.

You can see/change the default Rom names in rdsfuncts at lines 153,156 and 159 as opposed to adding a .prop as well.

[MENTION=2800390]-pixelfreak-[/MENTION] done, thanks
[HD2 Android NAND Development] -pixelfreak-:
hypo you can delete in updater script:	package_extract_dir("wallpapers", "/sdcard"); or make a wallpaper folder in your installer...

pixelfreak
[HD2 Android NAND Development] Robbie P:
same setup, trying to modify ramdisk to boot nativesd dalvik on nand, with new v4, system and data not modified, no swap. ramdisk and zImage are both 0bytes. The aroma log is 0b too:confused:

I remembered that I didn't change line 151 to NativeSD-dk (which is now line165 of rdsfuncts.sh), so did that and tried again, still ramdisk, zImage and log 0bytes
[HD2 Android NAND Development] HypoTurtle:
To me that's a sdcard issue perhaps mounted ro or something; as I added the zero check for initrd.gz I thought in that scenario you might get a stalled install. Will try a full install with v4.1 and try and replicate.

Try rebooting / remove+reinsert sd card.
[HD2 Android NAND Development] Robbie P:
Ok I added cm11_mac /system to my last shell folder (4.1), added some apps in /data (and left the -dk bit in)

It boots:D, oddly it upgrades the apps (recreating dalvik?) then goes to CM startup app instead of going straight to cm app. I didn't delete the last install from /userdata or sd-ext, so maybe that was why.

This seems very fast, no lag at all between cm startup app screens

Have attached recovery log, and screen of df. dmesg was empty.

Edit; attached a dmesg from next boot, it does seem fast:)
[HD2 Android NAND Development] HypoTurtle:
Glad to here it - can you post a 'mount' to confirm.

Think I'll try it next time I wipe.

Thoughts for v5:

ROM_NAME taken from /sdcard/NativeSD/* == Partially working - ROM_NAME displays correctly in aroma, just not translating through - need to find the conflicts. Currently set to take names from the first three folders in NativeSD.

System and Data installed from /NativeSD/ROM_NAME/system.zip and data.zip (and already implemented initrd.gz and zImage taken from same folder)​

With those changes the shell.zip can sit (either with separate/incorporated rdsfuncts.sh), and remain unchanged, While maintaining backwards compatibility with the current 1 zip for all situation.
[HD2 Android NAND Development] Robbie P:
mount attached

Edit; I tried directsd, dataonf2fs, dalviconnand, swap-file on

it boots but it seems I can't access /data

no data persistence after reboot.

attached recovery log, dmesg and mount screen.
[HD2 Android NAND Development] HypoTurtle:
yea nothing mounted as /data can you check the contents of /DirectSD and /mountfs-DirectSD.sh it'll be an issue with one of those.

v5 added to sig will test thoroughly tomorrow. If trying rename /sdcard/NativeSD/$ROM_NAME_$TYPE folders to $ROM_NAME-$TYPE
[HD2 Android NAND Development] Robbie P:
There is no /DirectSD, only a /NativeSD, attached ls and cat screens

Edit; /DirectData is empty
[HD2 Android NAND Development] HypoTurtle:
Thanks, yea I meant /DirectData - any chance you were use a non-f2fs kerneled recovery? making those folders and rebooting should solve it regardless.

Could you however add this code to a file in /system/etc/init.d:

#!/system/bin/sh
if [ ! -f /DirectData/CM11_MACdsddalv ]; then
mkdir -p /DirectData/CM11_MACdsddalv/data
. /mountfs-DirectSD.sh
fi
rm ${0}

Just implemented the above in ramdisk functions for v5. If the above works for your installed ROM I'll add it to v4
[HD2 Android NAND Development] Robbie P:
v5, I didn't put rom_name.prop in,

selected rom1 in list, I have 2 folders in /sdcard/NativeSD (put- instead of _) neither names showed up in list

get aroma errors attached

Will try again with prop

Edit; did not see your last post before posting this, I used v5 from last nights download

Edit2; tried the latest fdsfuncts.sh v5, I put -dk bit in it. I put rom-name prop in. Chose rom 3, names not showing up again. get error from aroma again, attached

Edit3; added fi in line 611, I can see why script is on sdcard, makes editing much easier. get errors again, can't get a log though, it either doesn't save or is empty. I think the error is the same as the first log below
[HD2 Android NAND Development] HypoTurtle:
fixed - fi and then's added - wasn't expecting you to try v5 yet.
[HD2 Android NAND Development] Robbie P:
Sorry, had a really busy weekend.

I have been thinking about booting 3.0 kernels from haret, but instead of using kexec, we could use [MENTION=2598472]dan1j3l[/MENTION] hot bootloader app (apk attached) to boot it from a running NativeSD rom. The original thread http://xdaforums.com/showthread.php?t=1095726 bundled the apk with a debian distro which was in a file called linux.img, could we put the NativeSD ramdisk (I assume 6mb not needed) and 3.0 kernel into a boot.img and rename it linux.img?

There was an info file there as well with this in it;

(this is not the same as the readme file linked in the first post of that thread)
[HD2 Android NAND Development] HypoTurtle:
'fraid not, I believe that's a chrooted system:

It takes part of the base system (kernel, busybox etc.) mounts in an .img (essentially a system.img), an outputs the screen to be viewed via a vnc client.

Unless I'm completely mistaken.
[HD2 Android NAND Development] Robbie P:
tried v5-5, directSD, ext4 & f2fs, with a swap partition p4, new rom-name.prop (chose opt 4), gapps in gapps folder (not mods/gapps, it seemed to install ok), forgot to add -dk but remembered to add f2fs kernel;)

It doesn't boot, hangs on htc screen

See attached aroma log and dmesg
[HD2 Android NAND Development] HypoTurtle:
Yea. v5-5 isn't working yet. A few things from that log though:

This is confusing:

cat: can't open '/tmp/RMCM11_MACwithalltrimmings.prop': No such file or directory

Checking /tmp/ramdiskscript.sh with DirectSD args.​

From the script:

RMno=` cat /tmp/ROM_NAME.prop | cut -d "=" -f "2" `

if [ -f /tmp/RM1.prop ]; then

RMp=` cat /tmp/RM${RMno}.prop | cut -d "=" -f "2" `

RM=${RMp}​

else

RM=${RMno}​

fi

...​

i.e. when ROM_NAME=rOm (contents of /tmp/ROM_NAME.prop); RMno=rOm; then as there shouldn't be a /tmp/RM1.prop (aroma-config only makes one when there's no ROM_NAME.prop) RM=rOm which gets called as the name to be used for the ROM.

Or if selected.1=4 (contents of /tmp/ROM_NAME.prop); RMno=4; then as there should be a /tmp/RM1.prop; RMp=NEWROM (contents of RM4.prop after the =). RM=NEWROM and this called as the name of the ROM.

Can you try it again with a fresh reboot (wiped /tmp) and see if the same thing gets reported.

Also not sure why it can't pick up your boot partition - in recovery terminal can you type dump_image boot /tmp/boot.img and see what it reports.
[HD2 Android NAND Development] macs18max:
Sorry for deviating a bit and going off topic, but since it is related to updater-script I have posting it here.

Using the normal aroma installer (tytungs) i have update the updater_binary_installer to the one that is compiled with ROM which supports set_metadata.

So i have made changes to symlink and setmeta to all system files installed in the updaterscript.

However now error for

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

I tried to change it to

set_metadata("/tmp/mount_NativeSD.sh", "uid", 0, "gid", 0, "mode", 0777, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");

And the installer throws this as error

Installing to SD-EXT (NativeSD)...
Checking & Mounting SD-EXT Partition...
ApplyParsedPerms: lsetfilecon of /tmp/mount_NativeSD.sh to u:object_r:system_file:s0 failed: Operation not supported on transport endpoint
ApplyParsedPerms: removexattr of /tmp/mount_NativeSD.sh to 0 failed: Operation not supported on transport endpoint
script aborted: set_metadata: some changes failed
set_metadata: some changes failed

Can someone figure this out?

Attaching older updater script and newer once
[HD2 Android NAND Development] HypoTurtle:
After a search, it seems to be a recovery error - it needs to be updated (was a CWM recovery compiled along with the ROM?); highest TWRP I have is 2.7 - not sure what the highest CWM is. - or use a custom updater-binary.

Also make sure kernel has full SELINUX support.
[HD2 Android NAND Development] Robbie P:
I have no boot partition, just 1mb misc (felt I should leave this in nand, don't know why) the rest is userdata for dalvic (when i remember to add -dk ;))

I take it that if you select 4.newrom, it uses rom_name.prop if there? I have a folder /sdcard/NativeSD/4-DirectSD

Will try a fresh install soon.

sorry again, had no time for testing lately.
[HD2 Android NAND Development] HypoTurtle:
If you select 4 it should become NEWROM i.e /sdcard/NativeSD/NEWROM-DirectSD; that definately was working for me, not sure if my /tmp was dirty or not at the time. the 4 comes from selected.1=4 in ROM_NAME.prop which should make instruct the script to read RM4.prop which contains RM4=NEWROM.

Not sure what the best way of adding -dk to all this (another file like swap.txt?) - another aroma menu or automatic? Not sure... Once I get the sizes showing up properly for v6 - and the zip becomes completely (HD2) universal. I'll post a full write up.
[HD2 Android NAND Development] Robbie P:
dirty /tmp? surely it is the recovery /tmp that is dirty? Or perhaps this is just a clk thing. anyway, after a reboot into sd recovery with magldr, there is only recovery.log in /tmp.

I tried it again with -dk and the bootsize:-11 edit, get the attached aroma log and dmesg. hangs on htc screen.

Up to you with -dk, my feeling is with aroma, just as an option, with instruction that it will go to a suitably sized userdata partition.
[HD2 Android NAND Development] HypoTurtle:
V6 Added to sig. will post a full breakdown in due course.

Will need /sdcard/7za for it to work correctly (couldn't figure a way to have this done within the zip. might try hexdump > reverse hexdump when I've got the time). /sdcard/rdsfuncts.sh isn't needed (can still be used as an overwrite).

For swap/DalvikOnNAND options add any text to the mods/optional-* files.

If adding a ROM system to the file add a ROM_NAME.prop (or modify line 25 of rdsfuncts.sh) in mods folder with ROM_NAME equal to name of zip used. Haven't implemented any wildcard characters with this yet.

EDIT. Minor breakdown, using the following setup as an example

/sdcard/ROM_SHELLv6.zip

/sdcard/NativeSD/ROM1-NAND

/sdcard/NativeSD/ROM2-NativeSD

/sdcard/ROM1/system.zip/system

/sdcard/ROM1/data.zip/data

/sdcard/ROM1/zImage

/sdcard/ROM1/initrd.gz

/sdcard/ROM1/boot.img

/sdcard/ROM1/modules/*

/sdcard/ROM2.zip

updater-script

("ramd.sh", "NAND", "ROM1")

overrules aroma .prop files

Running ROM_Shellv6.zip will first ask you to chose a name for the ROM: as there is no ROM_NAME.prop included, the options will be ROM1; ROM2; the current default ROM 3 - Slimkat_MAC1 and NEWROM.

Let's say you choose ROM1; The sizes of system; data and gapps is taken from /sdcard/ROM1/system.zip (and data.zip and gapps.zip). And these files are installed instead of ROMShellv6.zip/system (and ../data and ../gapps).

During the boot.img/initrd.gz modification: /sdcard/ROM1/boot.img will take preference over /sdcard/ROM1/zImage and /sdcard/ROM1/zImage which takes preference over ROM_Shellv6.zip/boot/initrd.gz. If a zImage from outside the zip (from /sdcard/*) is used then /sdcard/ROM1/modules/* will take preference over the ones in the .zip

If you choose ROM2; the sizes will be taken from ROM2.zip; however system and data will be installed from ROM_Shellv6.zip
​

Any bugs/improvements let me know. I'm aware I need to tidy up the text in aroma a bit.

Anyone willing to try a pre-KK ROM and post a dmesg to confirm it's a permission issue feel free, I'll think of someway to auto-determine ROM version (probably using build.prop).
[HD2 Android NAND Development] Robbie P:
Tried v6 with tyween's latest (yesterday) cm7 rom, nativesd, dalvik on nand, swap

put data.zip, system.zip and gapps.zip (inside gapps folder is system folder with the stuff in there) into /sdcard/Typhoon/ along with initrd.gz and zImage

put text in ROMshellv6/optional-dalvikonnand and optional-swap

put ROM_NAME=Typhoon in ROM_NAME.prop

put 7za on sdcard, didn't use rdsfuncts.sh

re-zipped ROMshellv6, renamed it to Typhoon and flashed

Get attached aroma log

I get the exact same log if I put rdsfuncts.sh on /sdcard

Edit; Raphael is cool!
[HD2 Android NAND Development] HypoTurtle:
Raphael courtesy of [MENTION=2800390]-pixelfreak-[/MENTION] (I think it's a fair choice, Donnatello also being an option).

Yea zImage/initrd.gz in boot folder? Script got stopped early thus no sysdat.prop therefore error 7.

Will need to come up with a better way to show this in updater-script - probably going to have to be many nested ifs as I don't think you can exit early.

There was a minor change made (removed boot/optional-* files) shortly after you must've downloaded.

Edit. Sorry misread. Yea try redownloading, you may have caught the zip just before I fully implemented all that. Look in bootingred(){...} for the line:	if [ -f "/sdcard/${2}/zImage" ]; then if the one you have is missing the blue part then that was the problem here. Gapps won't install at the minute that way (currently it's data.zip>data; system.zip>system; gapps would be gapps.zip>system) , you could add the gapps to the shellv6.zip (Typhoon.zip). That should both install correctly and display the gapps size.
[HD2 Android NAND Development] Robbie P:
I have the "if [ -f "/sdcard/${2}/zImage" ]; then " line in bootingred
[HD2 Android NAND Development] Robbie P:
Just been trying -pixelfreak-'s LS KK which he kindly sent me to test, nativeSD

First I got unexpected } line 17 rdsfuncts, so deleted that

Then I get "/tmp/ramdiskscript.sh: line 5: testing: not found", can't see where testing is defined:confused:
[HD2 Android NAND Development] -pixelfreak-:
re

thanks robbie... i hope hypo can help ....

pixel
[HD2 Android NAND Development] HypoTurtle:
You will need the full rdsfuncts for that zip. i.e. from v5. NativeSD did boot for me - just about (shuts down straight away likely due to the way I'm powering it).

The only other thing I noticed that could be a problem is the ro remount of / that would explain why /dalvik isn't being made but wouldn't explain why it wouldn't work without the installer (i.e. /data/dalvik-cache used). As I mentioned before there is duplicate code:

mkdir /cache/dalvik-cache 0771 system system

chown system system /cache/dalvik-cache

chmod 0771 /cache/dalvik-cache​

in init.rc and init.liquid.rc, for simplicity sake you could remove either one of them.

I've added a line to comment the ro remount to the rdsfuncts in my sig. (and full ramdiskscript for v6). Will try and test now.
[HD2 Android NAND Development] Robbie P:
tried with new ramdiskscript in zip and new rdsfuncts on sdcard, it boots NativeSD (with working swap). had a few FCs on startup app and settings, wifi didn't connect, couldn't get a logcat first boot (it didn't save, from adb) will try to get one after reboot. Attached dmesg and install log.

It does seem quite fast. It did take a long time on first boot, especially on htc screen.

Edit; it took a long time on second boot too, maybe it is re-creating dalvic? Added a log and a second dmesg.
[HD2 Android NAND Development] HypoTurtle:
2 things to check Dalvik size (du /data/dalvik-cache) and perms of sh (ls -la /system/bin). Not sure what's calling it though perhaps swap init.d script?

You should be able to get an early logcat (adb logcat). Turn phone off, plug in, type adb logcat then boot. If it's rebuilding dalvik it should be pretty clear.
[HD2 Android NAND Development] Robbie P:
Couldn't see anything obvious in onscreen logcat, it did stay on htc screen for a couple of minutes with no log ouput.

Attached screens of those commands
[HD2 Android NAND Development] HypoTurtle:
That's 217MB - is that too much for a bare ROM?? - check ls -la /data/dalvik-cache (will give you a date of creation). Will need to check mksh/sh against a different rom just to make sure nothing's up.
[HD2 Android NAND Development] aazzam16661:
Logcat from init.rc

I know its off topic but you guys here seem to know about this

This there a way to get a logcat and send to sdcard using a command put in init.d or ramdisk?

i busted my usb port and can't get adb working

Its will help a lot with debugging lollipop

or anybody want to volunteer to get logs for me?
[HD2 Android NAND Development] -pixelfreak-:
re

have you enabled adb in your L build and kernel ?

pixelfreak

---------- Post added at 11:38 AM ---------- Previous post was at 10:47 AM ----------

if getvar("bootloader") == "cLK" then
zipexec("boot/ramdiskscript.sh", "clkbtsz", "boot");
zipexec("boot/ramdiskscript.sh", "clkbtsz", "sboot");
zipexec("boot/ramdiskscript.sh", "clkbtsz", "tboot");
setvar("boot", file_getprop("/tmp/bootsize.prop", "boot"));
[B]setvar("sboot", file_getprop/tmp/bootsize.prop", "sboot"));[/B]
setvar("tboot", file_getprop("/tmp/bootsize.prop", "tboot"));
selectbox(
#-- Title
"CLK Boot",

mistake ;)
[HD2 Android NAND Development] aazzam16661:
Yes i did, it worked before and i have tested on tytung's rom too
[HD2 Android NAND Development] mosi hd2:
i can get logcat, if you still want it
[HD2 Android NAND Development] HypoTurtle:
So I'm guessing that it's non booting L that needs to be debugged? Thus no adb over wifi.

This should work.

With v6 you could add a boot/mountfs-NAND.sh file:

#!/bin/busybox sh

mkdir /system

/bin/busybox mount -t yaffs2 -o rw mtd@system /system

/system/bin/logcat > /system/logcat.log

umount /system​

or add it as a function to /sdcard/rdsfuncts.sh

mkmountfs() {

echo "#!/bin/busybox sh

mkdir /system

/bin/busybox mount -t yaffs2 -o rw mtd@system /system

/system/bin/logcat > /system/logcat.log

umount /system" > /tmp/mountfs-"${1}".sh

}​

changing ${1} to NAND (or simply installing to NAND) for the above example.

Not 100% on the above code: so would be easiest to test with the function added to /sdcard/rdsfuncts.sh though. Perhaps umount /system shouldn't be there for example (unless all you need is an early logcat).
[HD2 Android NAND Development] aazzam16661:
I'm really sorry but i don't understand

The rom is a DirectSD rom
[HD2 Android NAND Development] HypoTurtle:
Which part?

If the ROM boots try enabling adb over network in developer settings (adb connect 192.168.1.*).

For a logcat you need access to /system/bin/logcat so the above was a simple (NAND) example of mounting system, running logcat and redirecting it's output to /system/logcat.log

The stackoverflow example is creating a service in init.*.rc and calling it after system is mounted.

In simple terms this script adds a .sh script into the initrd.gz and calls the script from init.rc, the sh made by the mkmountfs function in script can be overwritten by either changing/overwritting the mkmountfs(){} or by adding a custom mountfs-*.sh file into the boot folder (which is copied to /tmp). with * being NAND, DataOnExt, NativeSD or DirectSD.

you could add echo "/system/bin/logcat -d > /data/logcat.log" > mountfs-${1}.sh to line 428 it might also work. Might need to play around with logcat options