Can't flash kernel on HTC Desire
Created by: ghost
So i have an old htc desire 200 and decided heck, why not install postmarketos on it, so i followed the instructions from the wiki page: https://wiki.postmarketos.org/wiki/HTC_Desire_(htc-bravo) So i put the sdcard in the adaptor inserted it in my laptop and typed: ./pmbootstrap install --sdcard=/dev/mmcblk0 And it worked, or at least i think so, here is the output of that command used:
[18:26:59] *** (1/5) PREPARE NATIVE CHROOT ***
[18:27:02] (native) install alpine-base
[18:27:04] (native) install cryptsetup util-linux e2fsprogs parted
[18:27:05] *** (2/5) CREATE DEVICE ROOTFS ("htc-bravo") ***
[18:27:05] Update package index (9x)
[18:27:08] (native) install qemu-user-static-repack qemu-user-static-repack-binfmt
[18:27:09] Register qemu binfmt (arm)
[18:27:09] (rootfs_htc-bravo) install alpine-base
[18:27:14] (rootfs_htc-bravo) install postmarketos-base ttf-droid device-htc-bravo postmarketos-ui-xfce4
[18:28:24] (rootfs_htc-bravo) write /etc/os-release
[18:28:25] (rootfs_htc-bravo) mkinitfs htc-bravo
[18:28:29] *** SET LOGIN PASSWORD FOR: 'dan' ***
New password:
Retype new password:
passwd: password updated successfully
[18:28:41] NOTE: No valid keymap specified for device
[18:28:44] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***
[18:28:44] (native) mount /dev/install (host: /dev/mmcblk0)
[18:28:45] EVERYTHING ON /dev/mmcblk0 WILL BE ERASED! CONTINUE? (y/n) [n]: y
[18:28:48] (native) partition /dev/install (boot: 26M, root: the rest)
[18:28:49] WARNING: Full disk encryption is enabled!
[18:28:49] Make sure that osk-sdl has been properly configured for your device
[18:28:49] or else you will be unable to unlock the rootfs on boot!
[18:28:49] If you started a device port, it is recommended you disable
[18:28:49] FDE by re-running the install command with '--no-fde' until
[18:28:49] you have properly configured osk-sdl. More information:
[18:28:49] <https://postmarketos.org/osk-port>
[18:28:49] (native) format /dev/installp2 (root, luks), mount to /dev/mapper/pm_crypt
[18:28:49] *** TYPE IN THE FULL DISK ENCRYPTION PASSWORD (TWICE!) ***
Enter passphrase:
Enter passphrase for /dev/installp2:
[18:29:03] (native) format /dev/mapper/pm_crypt (ext4), mount to /mnt/install
[18:29:27] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot
[18:29:28] *** (4/5) FILL INSTALL BLOCKDEVICE ***
[18:29:28] (native) copy rootfs_htc-bravo to /mnt/install/
[18:29:29] NOTE: Public SSH keys not found. Since no SSH keys were copied, you will need to use SSH password authentication!
[18:31:06] *** (5/5) FLASHING TO DEVICE ***
[18:31:06] Run the following to flash your installation to the target device:
[18:31:06] * pmbootstrap flasher flash_kernel
[18:31:06] Flashes the kernel + initramfs to your device:
[18:31:06] /home/dan/.local/var/pmbootstrap/chroot_rootfs_htc-bravo/boot
[18:31:06] (NOTE: fastboot also supports booting the kernel/initramfs directly without flashing. Use 'pmbootstrap flasher boot' to do that.)
[18:31:06] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.
[18:31:06] Done
Then i got the micro sd card from the adapter and put it in the phone, and connected the phone to the laptop, after that i pressed the power button while holding the volume down button and got to a screen where i selected fastboot, and then i tried doing ./pmbootstrap flasher flash_kernel and got the following output:
[18:48:32] (rootfs_htc-bravo) mkinitfs htc-bravo
[18:48:36] (native) flash kernel htc-bravo
[18:48:37] (native) install android-tools
target didn't report max-download-size
sending 'boot' (2960 KB)...
FAILED (command write failed (Invalid argument))
finished. total time: 0.000s
[18:48:37] ERROR: Command failed: (native) % fastboot -i '' flash boot /mnt/rootfs_htc-bravo/boot/boot.img-htc-bravo
[18:48:37] Run 'pmbootstrap log' for details.
[18:48:37] See also: <https://postmarketos.org/troubleshooting>
And here is the log for reference:
(014584) [18:48:37] (native) % fastboot -i '' flash boot /mnt/rootfs_htc-bravo/boot/boot.img-htc-bravo
(014584) [18:48:37] *** output passed to pmbootstrap stdout, not to this log ***
(014584) [18:48:37] ERROR: Command failed: (native) % fastboot -i '' flash boot /mnt/rootfs_htc-bravo/boot/boot.img-htc-bravo
(014584) [18:48:37] Run 'pmbootstrap log' for details.
(014584) [18:48:37] See also: <https://postmarketos.org/troubleshooting>
(014584) [18:48:37] Traceback (most recent call last):
File "/home/dan/pmbootstrap/pmb/helpers/run.py", line 58, in core
subprocess.check_call(cmd)
File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '/usr/bin/sh', '-c', 'env -i CHARSET=UTF-8 PATH=/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin SHELL=/bin/ash HISTFILE=~/.ash_history /usr/bin/chroot /home/dan/.local/var/pmbootstrap/chroot_native sh -c \'cd /;fastboot -i \'"\'"\'\'"\'"\' flash boot /mnt/rootfs_htc-bravo/boot/boot.img-htc-bravo\'']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/dan/pmbootstrap/pmb/__init__.py", line 59, in main
getattr(frontend, args.action)(args)
File "/home/dan/pmbootstrap/pmb/helpers/frontend.py", line 205, in flasher
pmb.flasher.frontend(args)
File "/home/dan/pmbootstrap/pmb/flasher/frontend.py", line 122, in frontend
kernel(args)
File "/home/dan/pmbootstrap/pmb/flasher/frontend.py", line 47, in kernel
pmb.flasher.run(args, "flash_kernel", flavor)
File "/home/dan/pmbootstrap/pmb/flasher/run.py", line 50, in run
pmb.chroot.root(args, command, log=False)
File "/home/dan/pmbootstrap/pmb/chroot/root.py", line 86, in root
return_stdout, check)
File "/home/dan/pmbootstrap/pmb/helpers/run.py", line 66, in core
raise RuntimeError("Command failed: " + log_message) from exc
RuntimeError: Command failed: (native) % fastboot -i '' flash boot /mnt/rootfs_htc-bravo/boot/boot.img-htc-bravo
I have tried hacking the code to no success so i put this here , hoping that someone would know what's going on and fix it.
Oh BTW my main laptop runs linux, specifically arch linux and i thought maybe it is related to a package not being installed that the script needs to work but no i have all android packages that i need installed, or at least i think so, i have installed android-tools and android-udev, which should provide all stuff needed, but at this point i don't even know.