Skip to content
This repository has been archived by the owner. It is now read-only.

HTC Wildfire status report #1203

Closed
feinerer opened this issue Feb 3, 2018 · 14 comments

Comments

Projects
None yet
3 participants
@feinerer
Copy link

commented Feb 3, 2018

I made some initial efforts to port HTC Wildfire (aka as Buzz) and would like to document it (not ready for a PR as booting is not working): https://github.com/feinerer/pmbootstrap/commit/a966d8472daeded6b583a1990903b5841d20ecda

Kernel configuration

Kernel is from the 2.6.35 series. Changes in the kernel configuration compared to the original buzz_defconfig are:

  • CONFIG_SYSVIPC enabled
  • CONFIG_ANDROID_PARANOID_NETWORK disabled
  • CONFIG_DEVTMPFS enabled (with CONFIG_DEVTMPFS_MOUNT disabled)
  • CONFIG_VGA_CONSOLE disabled (to avoid PCIMEM_BASE undefined)

There is also the LineageOS Device repository for HTC Buzz but I could not extract relevant information out of it.

Patches

  • timeconst_fix.patch as known from other devices
  • msleep_MKDEV_fix.patch is only needed if CONFIG_USB_ETH is set

In APKBUILD's prepare() function I added grep -lr 'uninitialized_var' . | xargs sed -i 's/uninitialized_var//g' for removing uninitialized_var() which is no longer supported. The grep could of course be precomputed (as the file list never changes giving a static kernel source) to make it faster but for the moment was easier and shorter this way.

Boot image offsets

pmbootstrap bootimg_analyze yields both from a CyanogenMod and an official HTC boot image the same offsets:

deviceinfo_kernel_cmdline="no_console_suspend=1 console=null"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x02e00000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

Status

pmbootstrap build linux-htc-buzz and pmbootstrap install --no-fde --sdcard=/dev/sdb
work but pmbootstrap flasher boot shows after upload only a HTC Logo. fastboot devices still sees the phone at this stage and nothing changes (consequently no IP address assigned etc.). This is the same as reported in the first sentence of #99 (comment).

I tried to use CONFIG_USB_ETH without success. It seems the initramfs/kernel cannot boot already at a very early stage (identical behaviour as before).

Flashing the kernel and system image do not work at the moment (remote: image update error). I guess that the files are just too big. But that should not matter for sdcard installation in combination with pmbootstrap flasher boot at the moment.

Bootlocker

Latest hboot (HTC bootloader) and unlock applied from https://www.htcdev.com/bootloader. The device is also S-OFF so signed binaries are not enforced if I am correct.

Modify boot image

I also tried to modify an existing working CyanogenMod boot image as described here: #99 (comment)

abootimg -u boot.img -k zImage -r initrd.img -c "bootsize=3092480"

Increasing the bootsize was necessary as the pmOS initramfs is huge compared to the original one (i.e., more than 1 MB difference). Using this new boot image shows the the same symptoms as described above.

Any ideas or pointer are highly appreciated. Thank you!

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 3, 2018

Welcome to postmarketOS and thanks for all the work you have put into both porting the device and for the detailed write-up here!

What happens, when you try to run the known working kernel with the postmarketOS initramfs, does that at least give you a network device?

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 3, 2018

Also, just to make sure:

  • What does lsusb call the device in fastboot mode and after booting?
  • Do you get a network device after booting?

EDIT: I just wrote a troubleshooting:boot page, hope this helps 👍

@ollieparanoid ollieparanoid added the device label Feb 3, 2018

@feinerer

This comment has been minimized.

Copy link
Author

commented Feb 4, 2018

What happens, when you try to run the known working kernel with the postmarketOS initramfs, does that at least give you a network device?

I merged a CyanogenMod 7.2 kernel with the postmarketOS initramfs as follows:
abootimg -u boot.img -f cm72/bootimg.cfg -k cm72/zImage -r pm/initrd.img -c "bootsize=2910208"

Now the device is not stuck any more but reboots after a few seconds (and then boots into the installed Android).

What does lsusb call the device in fastboot mode and after booting?

Bus 001 Device 004: ID 0bb4:0fff (both in fastboot mode and after initiating the boot). 0bb4 stands for HTC and 0fff is the fastboot identifier.

Do you get a network device after booting?

No (never so far for all investigated combinations).

Maybe another interesting data point: Based on http://tjworld.net/wiki/Android/HTC/Vision/HackingNotes I managed to set up serial-over-USB which shows some boot messages from hboot. Unfortunately, this has been of no benefit so far, as pmbootstrap flasher boot requires fastboot mode where attaching usbserial and operating it at the same time does not work.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 5, 2018

Some more ideas:

  • Does fastboot boot work with the known working Android/TWRP boot.img file at all?

    • If that does not work, I guess fastboot boot does not work with your device in general. Then I would try the recovery installer to install postmarketOS. Instead of sideload you can also put the installation image manually on the SD card (see pmbootstrap export) and select it from the recovery OS.
  • I think we could verify whether the kernel by postmarketOS is working or not by combining and testing if it successfully boots Android/TWRP:

    • postmarketOS kernel
    • Android/TWRP initramfs
@feinerer

This comment has been minimized.

Copy link
Author

commented Feb 6, 2018

Does fastboot boot work with the known working Android/TWRP boot.img file at all?

Yes, that works fine.

I think we could verify whether the kernel by postmarketOS is working or not by combining and testing if it successfully boots Android/TWRP: postmarketOS kernel, Android/TWRP initramfs.

I used

abootimg -u boot.img -k zImage

where boot.img is from the working installed HTC ROM and zImage is the postmarketOS kernel. This combination shows the same symptoms as originally described (i.e., system appears to be hung, no network interface, USB still seen in fastboot mode but cannot be interacted with). Seems the kernel does not work work/boot at all?

IMHO, there are not many alternatives left as https://github.com/arco/htc-kernel-msm7225 seems the be the only useful kernel source. There are several forks (https://github.com/arco/htc-kernel-msm7225/network/members) but these are more or less the same codebase. For completeness, I tried to build https://github.com/ErwinP/htc-kernel-msm7225 but it makes no difference.

Just to exclude all edge cases I wanted to mention the two following warnings (with pmbootstrap build) (in case they indicate some problems to you):

/usr/bin/abuild: line 2554: git: not found
WARNING: linux-htc-buzz*: No arch specific binaries found so arch should probably be set to "noarch"

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 6, 2018

/usr/bin/abuild: line 2554: git: not found
WARNING: linux-htc-buzz*: No arch specific binaries found so arch should probably be set to "noarch"

Thanks for reporting those, but these messages appear with all other kernels as well, so they should not cause any problems.

Seems the kernel does not work work/boot at all?

Yes, it really sounds like the kernel is broken.

Based on http://tjworld.net/wiki/Android/HTC/Vision/HackingNotes I managed to set up serial-over-USB which shows some boot messages from hboot. Unfortunately, this has been of no benefit so far, as pmbootstrap flasher boot requires fastboot mode where attaching usbserial and operating it at the same time does not work.

If I understand this right, then you should get some useful output, when you flash one of the boot.img files to the device (pmbootstrap flasher flash_kernel, then get the serial debugging, and then let hboot boot the kernel). When that is the case, I would try to flash the following combinations and check what the serial port says to each of them:

  • pmOS (postmarketOS) boot.img file
  • CM (CyanogenMOD) boot.img file with pmOS kernel, CM initramfs
  • CM (CyanogenMOD) boot.img file with CM kernel, pmOS initramfs

My guess is, that by following this approach hboot could tell us what is wrong with the boot.img files / with the kernel inside of them. We might even get log messages from the kernel that way, possibly with adjusting the kernel command line.

Thanks for collecting all the data so far, this is very useful!

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 6, 2018

After asking @drebrez, who successfully ported the HTC desire, we have some new information:
https://wiki.postmarketos.org/wiki/Troubleshooting:boot#Note_about_HTC_devices

@feinerer

This comment has been minimized.

Copy link
Author

commented Feb 16, 2018

The output of hboot does not seem to be really useful (to me):

hboot>boot
setup_tag addr=0xBC900100 cmdline add=0x9C066FD4
TAG:Ramdisk OK
TAG:smi ok, size = 0
TAG:hwid 0x1
TAG:skuid 0x24910
TAG:hero panel = 0x0
TAG:engineerid = 0x0
MCP dual-die
MCP dual-die
TAG:mono-die = 0x0
Device CID is super CID
CID is super CID
Backup CID is 11111111
setting->cid::11111111
serial number: ...
commandline from head: no_console_suspend=1 console=null
command line length =483
active commandline: board_buzz.disable_uart3=0 board_buzz.usb_h2w_sw=0 board_buzz.disable_sdcard=0 diag.enabled=0 board_buzz.debug_uart=0 smisize=0 userdata_l
aARM_Partion[0].name=misc
aARM_Partion[1].name=recovery
aARM_Partion[2].name=boot
aARM_Partion[3].name=system
aARM_Partion[4].name=cache
aARM_Partion[5].name=userdata
partition number=6
Valid partition num=6

I tried a different kernel (https://github.com/kylon/Buzz-kernel) which seems to be similar/identical to the kernel from an official HTC Froyo image: no success, same behaviour. I wrote an init hook for blinking the green LED; although installed it does not work. The same script in a CyanogenMod works and the green LED blinks (in a loop).

I am going to close this issue soon. Guess I am out of luck; I have no further ideas for this device.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 17, 2018

Could you also post the hboot output you get when booting a stock CyanogenMOD boot.img file, that is known to work? Maybe there's a difference in there. Thanks for everything you have tried out!

@feinerer

This comment has been minimized.

Copy link
Author

commented Feb 17, 2018

Could you also post the hboot output you get when booting a stock CyanogenMOD boot.img file, that is known to work?

Sure. Stock CM 7.2 boot.img that works fine:

hboot>boot
setup_tag addr=0xBC900100 cmdline add=0x9C066FD4
TAG:Ramdisk OK
TAG:smi ok, size = 0
TAG:hwid 0x1
TAG:skuid 0x24910
TAG:hero panel = 0x0
TAG:engineerid = 0x0
MCP dual-die
MCP dual-die
TAG:mono-die = 0x0
Device CID is super CID
CID is super CID
Backup CID is 11111111
setting->cid::11111111
serial number: ...
commandline from head: no_console_suspend=1 console=null
command line length =483
active commandline: board_buzz.disable_uart3=0 board_buzz.usb_h2w_sw=0 board_buzz.disable_sdcard=0 diag.enabled=0 board_buzz.debug_uart=0 smisize=0 userdata_sel=0 androidboot.emmc=false  androidboot.baseband=3.35.20.10 androidboot.cid=11111111 androidboot.batt_poweron=good_battery androidboot.carrier=ALL androidboot.mid=PC49***** androidboot.keycaps=qwerty androidboot.mode=normal androidboot.serialno=... androidboot.bootloader=1.02.0000 zygote_oneshot=off no_console_suspend=1 console=null
aARM_Partion[0].name=misc
aARM_Partion[1].name=recovery
aARM_Partion[2].name=boot
aARM_Partion[3].name=system
aARM_Partion[4].name=cache
aARM_Partion[5].name=userdata
partition number=6
Valid partition num=6

The boot log is identical to the one posted in #1203 (comment) (the active commandline was just cut by my terminal apparently but I verified it is the same), which was CM boot.img file with pmOS kernel and CM initramfs.

Unfortunately I am not able to test the two combinations:

  • pmOS (postmarketOS) boot.img file
  • CM (CyanogenMOD) boot.img file with CM kernel, pmOS initramfs

as the generated boot images are too big for flashing (the pmOS initramfs is about 1 MB whereas the CM initramfs is just about 150 KB). The observed limit for the boot.img seems to be around 2.8 MB. Just booting them is not limited by size constraints but lacks the ability to use the hboot serial console.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 17, 2018

Unfortunately I'm also out of ideas for now.

@drebrez: when you have time, any clue?

@feinerer: Anyhow, you have provided lots of useful data points here, and it wouldn't be the first time that someone started a port and another person came later and finished it based on that initial work. So we might see a port eventually 👍

@feinerer

This comment has been minimized.

Copy link
Author

commented Feb 22, 2018

I think I have found out why the device does not (and cannot) boot:

The architecture armhf in pmOS is ARMv6 but has a strict requirement on an FPU (i.e., requires VFP). However, as it appears, the HTC Wildfire (with its MSM7225 SoC) does not have an FPU despite having an ARM11 (= ARMv6) processor.

So it looks like due to the lack of a matching architecture (in Alpine and pmOS) this device cannot be supported.

@ollieparanoid

This comment has been minimized.

Copy link
Member

commented Feb 22, 2018

Oh, that sounds logical.

The only way to support that device would be bootstrapping a new architecture on Alpine. That is possible (run the bootstrap script from Alpine's aports folder, then compile all packages from scratch), but not feasible for us at this point, maybe this makes sense in the far future.

Thanks for reporting back and all the effort you have put into this port!

Just in case you want to try out postmarketOS on another device, but don't have one available, it could be possible that someone sends you their device.

@mirh

This comment has been minimized.

Copy link

commented Apr 8, 2018

Just for the records, hoping nobody is bothered by advertising of other free software, I think Arch/Debian/Slackware should all still retain support for armel (not sure if soft or softfp though).

Then from there, I guess like if one wants to specifically tinker with this phone (say, for mainlining), everything should still be doable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.