Porting to Samsung Galaxy Note 4 SM-N910P
doniks last edited by doniks
ok so I just played around with the system.img file, if I run "mka systemimage" and try to mount it, it fails saying invalid partition type,
I think the android system.img is some unusual image format. Read the halium-install script. There you see how they transform it into something else!
if I run the make_ext4fs command on it, i can then mount it, but it is empty, (kind of expected as make_ext4fs is a ext4 format tool)
Well, yeah. It is expected to be empty afterwards.
and trying it the way the script has it doesnt work either, so now I think I have it narrowed down to the system.img file being corrupted or not compiling right.
I could imagine that an incomplete, or corrupt, or even an absent system.img might all lead to a rebooting device. Do you know how far the boot process goes for you so far? Does it enter the rootfs. Do you have telnet access? ssh? Which ip? Can you watch the usb serial number? What values does it go through?
I can't make much sense of your kmesg above. Maybe it is only the "late" part of the boot process after it has switched to the rootfs. If that is the case you can check my thread for how to NOT start the lxc container with the system.img. just as a stepping stone in debugging problems in that container
@doniks was this the issue you were experiencing with TWRP 3.1.1? if so I might be SOL from here cause my device only has 3.1.0 or 3.1.1 according to the TWRP website.
No I don't think you need to worry here. You only need twrp to have ANY recovery that allows you to adb in. You can probably use any other recovery you can dig up on xda for your device. I think my problem was just that the other version wouldn't install or something.
tigerpro last edited by tigerpro
@doniks thanks for the advice, I have to figure out a way to pass the kernel options though cause my device doesnt have fastboot mode, it has download, recovery, and system (normal) and if I issue "adb reboot bootloader" it boots in download mode. I suppose I could just delete the rootfs.img file, but the error I keep getting is from the halium-install script, it copies the rootfs.img over, it fails with the system.img based on my understanding of the script with an error of "unable to write 217 (or 271, not sure) blocks, out of space?" I tried manually doing what the script was trying, it copies system.img to /data, I found an alternative script here:
This script based on my understanding, does everything on the local system, then copies it over to the device. I found this last night when I had some time to research so Ill try it and see what happens. Im hoping this script will work, otherwise I will have to dig deeper and see if theres something I miss when I do "mka systemimage", I see warnings and notes, but thats throughout the entire build process, I have yet to see perfect code compile without issue lol
#=== Edit ===#
I tried that alternative script, it didnt give me any errors, but it was rebooting still, seemed to take a little longer (2 to 3 seconds longer) so Im re downloading the source, re-compiling, and see if anything changes cause my gut is telling me something with the code (maybe something I changed?) Is what my current hurdle is. Ill let ya know the outcome of my efforts. On a side note, is the ubports rootfs still in a pre-alpha phase, if so whats the best rootfs to try once I get this working?
So I basically started over, after I deleted the code I had, I was getting errors with the repo sync cause the repo I am using had a couple changes that I had to chase down to get the repo sync to work. I get it to sync, it generates hybris-boot.img and system.img after i type "export use ninja false" (or something similar, not in front of PC atm" so now my device just reboots, not sure where to go from here cause the kmsg when I read through it said it was booting linux like before, and if I try "adb pull /proc/kmsg kmsg" it just sits there pulling data until I either cancel it or disconnect it. Ill post the kmsg when I get a chance, but I dont think it will be of much use. Im starting to feel like every step forward puts me 3 back, maybe deleting rootfs.img and see if it keeps rebooting? I really dont know what else I can do besides that. @doniks is there a working plasma rootfs? The script in your thread doesnt wanna work for me.
ok so I managed to get a working hybris-boot.img again, I can telnet in, but if I try to go anywhere from there, the screen goes blank, and it just kinda sits there. I have been unable to get a rootfs script to finish without an error (complains about missing packages even if I install them on the host system) so from here I dont really know what else i can try as so far once i telnet in and do the (echo "continue") command the screen just goes blank and the phone sits there, Ill leave it over night and see if anything changes, but im not holding my breath as I have been fighting with this port for awhile now. I can supply my images if anyone reading along has a sprint note 4 and wants to try it out and see if they get the same result or even wants to help make this port a fully working one, otherwise Ill just keep plugging away at it till I either give up or get somewhere with it.
doniks last edited by doniks
ok so I managed to get a working hybris-boot.img again, I can telnet in, but if I try to go anywhere from there, the screen goes blank, and it just kinda sits there.
it could mean that the system in the rootfs has started, but it's just deaf blind and mute
Reboot into recovery and check the last_kmsg.
Another test is to mount the rootfs in recovery, chroot into it and then
systemctl disable lxc@android systemctl mask lxc@android
If you reboot afterwards, maybe this helps with the usb networking.
@doniks here is a link to my last_kmsg, its too long for me to post on here, so its a google doc:
I tried to mount the rootfs.img, it gave me an error about invalid options, so im trying to re-make my rootfs now, see if that makes a difference.
again surrounded by QCOM_BSP
@tigerpro are you still working on this port? I was reminded of this conversation by this: https://docs.ubports.com/en/latest/porting/installing-16-04.html#choose-a-rootfs there they are talking about CAF (Code Aurora Forum) in relation to this flag QCOM_BSP, maybe that CAF stuff is a lead for you?!
@doniks I actual put this on hold during the holidays, right now I'm trying to get a better emploent situation, but after that I'll start this project again. I never received an email saying I had a reply (weird but I'll check my settings on that) when I last tried to port Halium 7 I was trying to see if I could get the kernel output on the screen as logging it to a file didn't seem to be working properly with where it was hanging up. I haven't tried the ubports code in awhile, I will have to look into that link and see if there's any useful info in it. I also got one XDA user trying to help, I have to generate another log for him, and in return I'm trying to help him get a port for his devises working. I should have an update in a couple days with any luck.
So update time: (sorry for double posting)
I had to start over due to a HDD crash, long story short I got Halium compiled again, since I managed to get it to compile, I figure might as well see if I can get it working before moving back to ubports 16 port, I installed Halium, go to boot it, and I seem to be having a boot failure with no telnet, the last_kmsg seems to indicate that Halium can't initialize /init, I'm wondering if my fixup_mountpoints script might be incorrect as I did "/dev/block/<partition>" instead of just the <partition>, as this time around when I followed the directions thats the output I got. I'll try switching the partition back to how I had it before, but I actually get the screen to blank itself now while trying to boot, something that did not happen prior to HDD crash. I am also helping a person create a Xiaomi land port of ubports, they have gotten quite far in their attempts so far. Has anyone successfully ported ubports 16 with their new porting guide?
Flohack last edited by
@tigerpro I got Samsung S3 Neo to boot UT 16.04, yes. As a workaround you can also add your partition as /dev/block/mmcblk0pxx in the system image´s fstab file. instead of the mentioned userdata partition entry there.
@flohack thank you for the response, I will try adding that to my fstab, I'll report back any success or failure when I try it. One question that I have is, is this done in addition to the fstab work in the ubports guide or is this strictly Halium?
Flohack last edited by
@tigerpro All porting efforts should be made with the Halium guide only now. Anything else you find might be outdated.
@flohack is this guide up to date for ubports? It does mention Halium as well as state to get Halium to compile first
Is the guide I'm referring to
UniSuperBox last edited by
That guide is correct.
Source: I wrote it.
@unisuperbox thank you for an updated guide, one question that I didn't see in the guide though, does Halium just have to compile, or does it have to boot as well?
@tigerpro the normal process is to get it running. However, keep in mind that porting is always a trial and error process. Nobody stops you from attempting UBports rootfs even though you might still have problems with halium rootfs. Equally well, nobody stops you from switching back and forth between the two
@doniks thank you doniks, I am currently trying to get it running, have an error with /init, haven't had a chance to try and fix it due to a recent family death, I'll keep ya posted
@tigerpro Sorry to hear. All the best!
@doniks thank you, I managed to get a test boot of my latest compile in, no change from the previous attempt, I think I have to modify my Mount points to get it working at this point. I'm going to redo that step and see if there's a change from this last attempt. I think if I can get a telnet or ssh interface I'm on the right track. I'm going to just mess with the data point for now to just speed up my attempts, once I get more successful results then I can apply it to the rest of the points.
@tigerpro solid plan! Yeah, telnet and ssh are important milestones and yes I think you need to do the fix mount points thing and yes I think the only partition you really need is the data partition.
NB: the guys are working on an alternative to hybris-boot named halium-boot and somehow that will not need the fix mount points stuff, but I'm not sure how it works or whether it is fully fleshed out. I am personally holding off with trying halium-boot because it seems that there are just too many changes happening at once now and I want to wait until that stabilizes a bit.