yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] Robbie P:
How about mtype? we know that the .35 kernel was originally from desire. is it possible that it still has mtype set to 2215 somewhere? i tried setting it to this in startup.txt but same.

Edit; might have found haret source code https://code.google.com/p/android-kaiser/downloads/detail?name=haret.tar.gz&can=2&q=
[HD2 Android NAND Development] HypoTurtle:
[MENTION=3907492]gilbert32[/MENTION] [MENTION=3629322]Robbie P[/MENTION]

Just for reference: haretlog from 2.x

Built virtual to physical page mapping

Allocated 3124 pages (tags=5C000000/16368000 kernel=5C001000/16369000 initrd=5C2BB000/2c161000 index=5CC2D000/2b7ef000)

Built kernel tags area

Built page index

Tags will be at offset 0x00000100 (0xf00)

Kernel will be at offset 0x00008000 (0x2b9800) [2.72MB]

Initrd will be at offset 0x00a00000 (0x971ad6)

Video buffer at 49739000 sx=480 sy=800 mx=120 my=133

Video Phys FB=03839000 Fonts=2b7ea0e4

preload=3152@5CC33000/2b7e9000 sj=5CC33278 stack=5CC31000/2b7eb000 data=5CC32000/2b7ea000 exec=2b7e93a0

Reading 2856960 bytes...

Read complete

Reading 9902806 bytes...

Read complete

Launching to physical address 2b7e9288 [695.91MB]

Trampoline setup (tram=136@00028F68/10028f68/1323ff68) [256.16MB][306.25MB]

MMU setup: mmu=A04C0000/11cc0000

Go Go Go...​

and from 3.x

Built virtual to physical page mapping

Allocated 3308 pages (tags=5C900000/163e0000 kernel=5C901000/1649a000 initrd=5CC73000/16294000 index=5D5E5000/2b87c000)

Built kernel tags area

Built page index

Tags will be at offset 0x00000100 (0xf00)

Kernel will be at offset 0x00008000 (0x3715b0) [3.44MB]

Initrd will be at offset 0x00a00000 (0x971ad6)

Video buffer at 49739000 sx=480 sy=800 mx=120 my=133

Video Phys FB=03839000 Fonts=2b8770e4

preload=3152@5D5EB000/2b876000 sj=5D5EB278 stack=5D5E9000/2b878000 data=5D5EA000/2b877000 exec=2b8763a0

Reading 3610032 bytes...

Read complete

Reading 9902806 bytes...

Read complete

Launching to physical address 2b876288 [696.46MB]

Trampoline setup (tram=136@00028F68/1a028f68/12ca6f68) [416.16MB][300.65MB]

MMU setup: mmu=A04C0000/11cc0000

Go Go Go...
​

There's probably nothing there of any help. Physical address is changed by about 1.5MB?? 160MB in trampoline == graphics??
[HD2 Android NAND Development] HypoTurtle:
Double post
[HD2 Android NAND Development] Robbie P:
how about booting a 2.6.32 kernel from haret and then using kexec to change to 3.0 kernel in running rom?
[HD2 Android NAND Development] macs18max:
[MENTION=4056517]HypoTurtle[/MENTION] [MENTION=3907492]gilbert32[/MENTION] [MENTION=3629322]Robbie P[/MENTION]

How do I get this logs from haret. I have just install win6.1. Could someone guide me?
[HD2 Android NAND Development] HypoTurtle:
Just add a file called earlyharetlog.txt to the same folder as the haret/startup.txt; this makes it redirect it's output to a haretlog.txt file.

And FYI those logs were from booting TWRP, not a ROM. With it booting with both kernels with cLK and just booting with the 2.x with haret (as expected).
[HD2 Android NAND Development] macs18max:
[MENTION=4056517]HypoTurtle[/MENTION]

Could you please help me create a aroma installer for cm11 ROM that I have build. The ROM I have build has very smooth whenever I use it, but unfortunately very few user manage to actually boot and use the rom and see its how great it is.

This may be due to the installer or initrd.gz and it is way beyond my understanding to fix it. No boot thingy is happens with me too. Sometimes without any changes ROM, kernel or installer it will boot and sometimes it won't. In cLK mostly it reboot on green logo htc. And in magldr it stuck with go go go or reboot on HTC green screen.

I've almost given up. As I have spent days trying to figure out the issue. Hopefully you could help me with this.
[HD2 Android NAND Development] Robbie P:
I remember when trying mac4 nativeSD, that I did a full wipe in installer, but I still had /data/app stuff. I manually deleted ext4 files before trying 4a and it installed correctly.

Can test if you want. Not had a lot of time lately, busy time of year for a plumber;)
[HD2 Android NAND Development] HypoTurtle:
[MENTION=2906641]robbiep[/MENTION] I can imagine, I can feel my feet slowly turning into bricks (Raynaud's)

Reupped with the things I forgot from previous post, I'll be pleasantly surprised if this works straight of, and don't think I have the time (or patience) to debug it blind.

[MENTION=2473151]macs18max[/MENTION] No problem - I have 1.5 HD2's (2 broken ones with parts going back and forth as different things break) - might be able to bodge together something that boots later (parts permitting), to at least test the zip. - no usb though so not ideal.
[HD2 Android NAND Development] Robbie P:
It is late now for me, but I have time tomorrow, will give it a go :fingers-crossed::D

PS don't mention bricks;)
[HD2 Android NAND Development] macs18max:
Currently I'm also offshore for a week, once I'm back I will test the script and report back, thanks HypoTurtle / RobbieP

My apologize I assumed you had a hd2. It is very hard to debug and without actually having a device.

---------- Post added at 07:09 AM ---------- Previous post was at 06:56 AM ----------

Robbie mac4 was total release version was definitely my fault as I usually replace cm's keyboard (46mb) with googlekeyboard. Mac4 I added googlekeyboard but didn't remove cm' keyboard so nand and data2ext would definitely boot loops. But even after I delete the apk I still had boot problem, finally I used tytungs installer with minimal modification. And uploaded.
[HD2 Android NAND Development] Robbie P:
1st try, magldr, nand data0next, 4ext nand recovery, flash.cfg;

misc ya 1M
recovery rrecov|ro|nospr filesize recovery_leo.img
boot rboot|ro 15M
system ya 390M
cache ya 5M
userdata ya|asize|hr allsize

I get invalid boot header, 4ext did not save the log.

So I put dataonext initrd.gz and zImage into /sdcard/NativeSD and booted ad/sd, it hangs on htc screen, attached dmesg. looks to me like /system isn't mounted.

will try with f2fs ext twrp, I know I can get a log with that, do you want the boot dump too?
[HD2 Android NAND Development] HypoTurtle:
Thanks, yea either system not mounted or not installed properly. In recovery [ mount /system => cd /system => ls ] to check.

as long as the boot dump is there that's fine (should be 15MB in size). If you could run [ du -sh /tmp/bootpart.img | cut -d 'M' -f "1" ] just to check it gives you 15M.

Yeah the log should help here just to make sure it's going through the whole script.

Found a issue with dataonext

### Modifying ramdisk to not use yaffs, and use sd partitions instead. ###
if [ "${4}" -gt '2' ]; then
busybox sed -i '/mtd@misc/s/^/#/' /tmp/work/ueventd.*.rc
busybox sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' /tmp/work/*.rc
fi

Which is the code for commenting out the yaffs lines for Native and Direct, leaving them for NAND and DataonExt, meaning that data is still mounted to the yaffs partition, overriding/conflicting with the ext4 mount by the mountfs script.

### Modifying ramdisk to not use yaffs, and use sd partitions instead. ###
if [ "${4}" -gt '2' ]; then
busybox sed -i '/mtd@misc/s/^/#/' /tmp/work/ueventd.*.rc
busybox sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' /tmp/work/*.rc
fi
if [ "${1}" = DataOnExt ]; then
busybox sed -i '/mount yaffs2 mtd@userdata/s/^/#/' /tmp/work/*.rc
fi

sorts that out.
[HD2 Android NAND Development] Robbie P:
ok will try that.

been having probs with different versions of sd twrp rebooting when installing.

Managed to get nand twrp (2.7.0.0)to work eventually and got invalid boot header, have attached recovery log, seems scripts are not called. Don't think it is related just to data not being mounted, as in your last edit.

Edit; only lost+found in /system and in /data from recovery, so nothing installed

Edit2; I noticed "cm11mac" is sent to ramdiskscr.sh (not ramdiskscript.sh as in chmod) but it is named "CM11_MAC" in ROM_NAME.prop, is this a conflict?

Edt3; changed package_extract_file to package_extract_dir("boot"...) in updater script. I got a reboot from recovery when installing, tried again and it hangs on 75% got a screen shot of end of dmesg from adb whilst it hangs, with df and free. Seems we have filled up the ram.
[HD2 Android NAND Development] HypoTurtle:
yea i don't think the data thing is an issue, it might cause a stall or it might just revert a dataonext to a nand install.

Yes on the two issues with updater script package_extract_dir(... and ramdiskscript.sh. ROM_NAME.prop is just used by aroma to display the ROM name so no conflicts there.

Try ls -la from / and /tmp. Most likely system isn't mounted prior to install == system dumped to ram. Any recovery/dmesg after the updater-script changes?

I'm thinking the script is run and at least gets to the umountstuff part (and exited before things are remounted) - not sure if that's really needed - possibly for DirectSD, but not sure. -, commenting out [umountstuff "$@"] at the bottom, should hopefully stop the RAM dump from happening

EDIT. got it - was looking for it yesterday but must've missed it - the [umountstuff "$@"] at the end of runn needs to be removed. reupping with the fixes from this post.
[HD2 Android NAND Development] Robbie P:
This is with the updater script changes. it is still hanging on 75%, I haven't pulled battery yet. have attached 2 ls screens

Edit; found 2 umountstuff "$@"s, one at the end of runn line 477 and other at line 481, have hashed both, trying now...
[HD2 Android NAND Development] HypoTurtle:
Just to confirm what I'm thinking regarding system (as posted above), call mount (I'm expecting system not to be mounted, and cd /system and ls -la. That'll confirm system ==> RAM.

The contents of /tmp seem to show that the script is run the whole way through. Can you check it's empty if you're going to try it again... cleanup should clear it but just to be sure.
[HD2 Android NAND Development] Robbie P:
it installed (didn't hang or reboot) ok after hashing those two lines. But doesn't boot (invalid boot image header). have attached recovery log

Edit; In updater-script, if nativeSD or nand-with-dataonext, and if full wipe is selected in aroma, am I right in thinking it will wipe nand userdata, not /data? Surely /data needs to be left mounted from before, and then just delete_recursive("/data")
[HD2 Android NAND Development] HypoTurtle:
Yea your right I just moved that stuff from where it was initially (again only of use to NAND installs), changing to delete recursive should work for all, need to get the boot stuff sorted first though.

Just an fyi make sure you don't have any zImage or initrd.gz on the root of the sdcard (as that will take precedence). On that note has anyone booted this with an earlier 2.x kernel? (install rom with /sdcard/zImage - and /sdcard/modules/).

Yea I'm starting to think that the boot partition not being mounted is the issue, a few things to check, in recovery (while on the mount page) unmount system/data etc. and then run mount system; mount userdata; mount boot. and see if those mount (it might be mount /system not sure).
[HD2 Android NAND Development] Robbie P:
afaik nand magldr uses kernel and ramdisk separately (not in boot.img) in /boot partition (not sure of the order they are in there, if that matters). That is why it can be booted from a folder on sdcard using boot ad-sd.

This is an ion rom which needs an ion kernel, don't think there is an ion 2.6.* kernel. BTW, there is no kernel or ramdisk on root of my sdcard.

Edit; have attached screen of those mount commands from adb after starting twrp, before installing rom.
[HD2 Android NAND Development] HypoTurtle:
Yea that's how I saw the magldr set-up, just wasn't sure why I don't recall seeing a boot partition being mounted in updater prior to the zImage/ramdisk being copied thus relying on the recovery to automount it I suppose. (its userdata in the ROMs fstab)

Uploading to dropbox (devhost kept crashing).

Only other thing I can think of is permissions do the initrd and zImage of this ROM have the same permissions as those from other ROMs?
[HD2 Android NAND Development] Robbie P:
i don't have Linux on pc ATM to check perms, I looked at perms in /sdcard/NativeSD/Nexus-HD2/ they were rwxrwx--- for both (magldr NSD ramdisk). I extracted the ramdisk and kernel from your rom.zip on phone and the perms were the same

Edit; DLing from dropbox, eta 20 mins. :)
[HD2 Android NAND Development] HypoTurtle:
screen two shows 755 rwxr-xr-x as opposed to 777 (can you tell I'm grasping at straws here - really don't want to have to try and understand the boot header).

And I see you actually beat me to the umountstuff (having one there is fine, just the one at the end is/was the problem).

If you can post the initrd.gz - might as well compare it to the original (does it boot btw?).
[HD2 Android NAND Development] Robbie P:
Still DLing, had to start again:mad::)....@ 80%...

Edit; it seemed to install ok, but didn't boot (invalid boot image header), I also tried to boot from /sdcard/NativeSD via ad-sd in case the ramdisk and kernel were put there, but it stuck on gogogo (have attached dmesg, ignore if those files weren't put there by script). Have attached recovery.log (says 2.x kernel) and I copied /tmp to /sdcard/temp and zipped it and attached it.
[HD2 Android NAND Development] HypoTurtle:
Any invalid boot header with the NativeSD boot??

What I noticed is you have boot as rboot (as opposed to yboot), afaik rboot is raw boot and is flashed like cLK (without the 6MB). Something like that would explain the image header issue.

The 2.x that's nothing (leftovers from the previous hexdump numbers).

Looking though that stuff now, thanks.

Yea I had /system being unmounted prior to the symlinks being made. Reupped with two minor changes:

[COLOR="Red"]umountstuff "$@"[/COLOR]
if [ "$1" != "addtoprop" ]; then
[COLOR="Blue"]umountstuff "$@"[/COLOR]
testing "$@"
echo ${type} > /tmp/type.prop
else
[COLOR="Gray"]and the kernel check line 387[/COLOR]
if grep -q [COLOR="Red"]00003f80[/COLOR] [COLOR="Blue"]00004210[/COLOR] /tmp/zI.txt; then

Edit. That tmp folder (and empty zI.txt) shows that the 6MB wasn't actually made (looked to me like it was in a previous screenshot), can you check the hexdump (I only checked it with HxD) [hexdump /tmp/zImage | grep '1f 8b 08'].
[HD2 Android NAND Development] Robbie P:
new flash.cfg;

misc ya 1M
recovery rrecov|ro|nospr filesize+5M recovery_leo.img
boot yboot|ro 15M
system ya 385M
cache ya 5M
userdata ya|asize|hr allsize

this is for 4ext recovery image, I then flash twrp 2.7.0.0 (hence +5M)

It doesn't boot from nand, just hangs on gogogo, dmesg attached, but at least there was no boot image header message:good:

Edit; this was without your re-upped version, will check hexdump, still tempted to say "if zImagesize>3mb => it is 3.0 kernel ;)"
[HD2 Android NAND Development] HypoTurtle:
Yea, 6MB should hopefully fix that in dmesg, might as well do the size, I'm sure the hex was consistent for 2.x so could do if not a 2.x then but don't have a group of kernels to check...

To use 3MB instead:

in initrdcp[COLOR="blue"] [ if [ -f /tmp/zImage ]; then
kernsize=`du -sh /tmp/zImage | cut -d '.' -f "1"`
if [ "${kernsize}" = "3" ]; then
dd if=/dev/zero of=/tmp/6MB bs=1M count=6
fi
fi ][/COLOR]
and
[COLOR="Blue"][ showresult() {
### Result output to user ###
busybox printf "Ramdisk successfully modified for ${ROM_NAME} running as ${type}\non ${mt1:-f2fs} with data on ${mt2:-f2fs}\nThe install folder is ${2}_${1}\n"
if [ -f /tmp/zImage ]; then
if [ "${kernsize}" = "3" ]; then
busybox printf "%b\n" "Kernel is a 3.0.x kernel"
else
busybox printf "%b\n" "Kernel is a 2.x kernel"
fi
fi
if [ -f /sdcard/${2}_${1}.zip ]; then
busybox printf "%b\n" "Please flash ${2}_${1}.zip in recovery"
fi
} ][/COLOR]

Mark6
[HD2 Android NAND Development] Robbie P:
I have added those 2 edits to mark5 and am trying it now, do I have to DL mark6 too?:eek::D perhaps just the edited files upped? ;)

Edit; hangs on gogogo

have attached dmesg, recovery log and ramdiskscr.sh renamed to .txt

Edit2; seems 6mb not added, see screen
[HD2 Android NAND Development] HypoTurtle:
no need to re-dl just edit the script (all I'm doing is dropping the modified script into the zip and renaming it, new zips uploaded in seconds - compared to hours with d-h), still no 6MB I take it - change those "3"'s to "2"'s (or the -gt to =).
[HD2 Android NAND Development] Robbie P:
ok, tried -gt '3' same

-gt 3 same

then pulled initrd.gz and just added 6mb manually with hxd and pushed to /boot (attached screen), it hangs on htc screen, dmesg attached

seem to get odd exec failed messages in both attachments

Edit; [= "3"] is the trick, should have done what you said:o

I now get a 7.22mb initrd.gz in /boot, but it still don't boot, hangs on htc screen. perms in /boot/initrd.gz are rw-rw-rw-, if I chmod 777 it still hangs on htc screen, exec errors still, attached dmesg2
[HD2 Android NAND Development] HypoTurtle:
Yea I meant changing the 3 to a 2 (as it's greater than 2 (I think there's also -ge, which would have worked), looking at the permissions of the .rc files it looks like they're different again all 644 rather than inits being 750 (power is still 750 not sure if thats right though).

[ #chmod 0750 /tmp/work/init*.rc

#chmod 0644 /tmp/work/ueventd.*.rc

chmod 0644 /tmp/work/*.rc ]

Mark7
[HD2 Android NAND Development] Robbie P:
Mark7, error from recov log

so deleted fi in line 443. it still hangs on htc screen, attached dmesg1 and recovery log. initrd.gz in /boot is 7.22mb and perms -rw-rw-rw-, if I chmod777 I get the same, attached dmesg2 and initrd.gz

I meant that you upping just the edited files saves me bandwidth and time (20 mins for a full rom);):)
[HD2 Android NAND Development] HypoTurtle:
Sure, the edits are just what I've stated. I'll keep my working copy of the script in my dropbox folder, so you can just drag/drop into the zip.

That initrd.gz is coming back as broken (after removing the zeroes) for me, probably just a bad upload as it was opened fine according to dmesg.

(Might have to revert to adding the mountfs stuff into the init.rc rather than a redirect - exec stuff I think needs to be in the nit binary and perhaps that's missing - will take a look and upload later... )
[HD2 Android NAND Development] Robbie P:
I have attached the 6mb-stripped initrd.gz from before,

seems it got corrupted when I cp'd it to /sdcard before uploading
[HD2 Android NAND Development] HypoTurtle:
Mark 8 & script set up to create initrd's identical (practically) to the originals - have tested with cLK (dataonext), but can't confirm boot/ can't debug w/out dmesg.

ROM_NAME is set to CM11_MAC (the original), feel free to change it (updater-script).

All I can tell from clk is - stuck on HTC screen == bad initrd (bad command etc.)

Stuck on cyanogen boot logo == bad data mount ??? my system booted without data being mounted at all (not sure how) - boot logo stall could be a wait issue I suppose (you can add more on line 275).
[HD2 Android NAND Development] Robbie P:
ok I tried mark 8 and got same exec error messages. Then I thought to mount /boot and manually deleted ramdisk and kernel, unmounted /boot and installed again. No ramdisk or zImage was put into /boot. Not sure when this started happening. Can't see anything amiss in recovery.log (attached)
[HD2 Android NAND Development] HypoTurtle:
I had /boot mount commented for some reason (you should have a copy of initrd and zImage copied into the NativeSD folder as well.), script changed so the busybox call (exec /bin/busybox sh -c "/bin/e2fsck -p /dev/block/mmcblk0p2 > /fsck.log") is commented.
[HD2 Android NAND Development] Robbie P:
tried mark8 with last script and it hangs on htc screen. /boot was populated ok.

have attached logs, dmesg and the ramdisk from /sdcard/nativeSD
[HD2 Android NAND Development] HypoTurtle:
Thanks, RobbieP. A few ideas to try and see where the issue is. Can you:

1. Try and boot with the original dataonext ramdisk (from 4a).

2. Install from macs ROM (4a), check it runs first, then try and boot with the initrd you have in NativeSD folder.

There's nothing calling /system/sh in the ramdisk at this part, it can't be a system mount error - as that would be clear from the dmesg, so not sure what's going on - could you try pulling the sdcard/booting to recovery then booting the ROM, it's probably nothing but NativeSD/DirectSD aren't unmounted in updater-scripts atm, a forced unmount could perhaps be an issue.

I'll compare ramdisk now and see if I spot anything else.
[HD2 Android NAND Development] Robbie P:
it doesn't boot with orig 4a ramdisk (booted from ad sd), hangs on htc screen, attached dmesg

not much time this evening will test a bit later.

Edit; the original 4a rom boots ok from nand (attached dmesgmac4a.txt), and the ramdisk I posted last boots with the original rom (from ad sd, attached dmesgmac4aNewRamdisk)
[HD2 Android NAND Development] HypoTurtle:
MMU pages might be something [MENTION=2473151]macs18max[/MENTION] might want to look at.

Found the problem - system wasn't wiped for DataOnExt (I want to go back to the script redirect now - it'll be more useful I feel).

Script

Script_script

Updater-script

Mark9

[MENTION=2473151]macs18max[/MENTION] DIff from original zip is:

updater-script

boot folder (reduced down to just clk nand kernel)

mods folder (no need for set_build_prop - included in ramdiskscr.sh)

I've attached a zipped copy of boot folder so you don't have to download the whole zip.

Anyone up for dataonf2fs? -(I see there are some f2fs binaries in /system by default so pulled mine from the boot folder).

Edit - added ROM_Shell.zip waiting for Rom files.

Edit. Added script with rudimentary update mechanism
[HD2 Android NAND Development] Robbie P:
Mark 9 boots nand dataonext, wifi works:highfive: attached dmesg, recovery and aroma logs, and ramdisk if you want to have a look.

I did notice that zImage and ramdisk are not copied to the newly created/sdcard/NativeSD/CM11_MAC_DataOnExt folder

Will try NativeSD install now, should be no need to rename the folders:)

Does X13 have f2fs support?

Can we have directSD added to aroma options?

Great job again HypoTurtle:good::good::good:

Edit; NativeSD boots, but upgrades android, so it must use the same rom-name. No biggie really, but I quite like the idea of the rom-name having the install method appended to it eg CM11_MAC_NativeSD, but I suppose it can be easily changed in updater script.
[HD2 Android NAND Development] Robbie P:
Ok I added the lines

"DirectSD (Everything on 2 partitions on the SD card",
"system@ 1st EXT4, data@ 2nd EXT4, boot@FAT32\nFor high speed read/write SD Card", 0 #-- selected.1 = 4

to aroma config, since updater script was already edited for DirectSD

I used f2fs sd recovery to format sd-ext2 to f2fs, and installed mark9 DirectSD, install took ages for some reason, but did complete.

And it boots:D

it seems very fast, no lag at all:D:D:D:D

have attached dmesg and aroma log, aroma log shows sd-ext2 as ext4, perhaps the f2fs format did not work, can't see any f2fs lines in dmesg. Will try again later this evening with manual format of sd-ext2 from terminal in recovery. At least DirectSD works:)
[HD2 Android NAND Development] HypoTurtle:
Yea, Just a change in updater-script needed. (I'll make change to shell).

ROM_shell.zip - just need to replace the placeholders in updater-script and boot folder.

Partition check is:

blkid /dev/block/mmcblk0p2

As far as I recall check the p2 isn't mounted as /sd-ext for example before the f2fs format if you want to try it again. There are a few bugs in the script (i.e. recovery log will report all kernels as 2.x for clk users as kernel isn't checked for clk), but the ext4's in the report at the end aren't one.
[HD2 Android NAND Development] Robbie P:
i just did mount from (edit) recovery terminal and sd-ext2 is mounted as f2fs, so kernel must support it for direct sd to work surely.

How does rom-shell work? edit2- oops it is pretty self-explanatory, will it extract a boot.img if one is in the rom zip? I am thinking of walter79's roms, they are for clk on the whole.