Lenovo ThinkSmart View ROM/OS Development

Can do same stuff with that one basically just less internal memory

does anybody use fully kiosk browser with this device? i have motion from an fp2 set to tun the screen on and on and once it goes off i struggle to get it back on most of the time requiring a reboot to get it back on. is there a trick to it?

Iā€™ve created a minimal build for the device using postmarketOS. But the device fails to boot, even if the kernel image is written to the boot partition using EDL. Unlocking the bootloader allows me to flash things but yields the known inability to boot beyond the Qualcomm recovery mode.

So for now Iā€™m stuck at that. I may look into it more sometime in the future.

Kernel image is signed?
Did you relook the boot loader?

Fastboot oem lock-go

The device wonā€™t boot its own firmware with the boot loader unlocked.

Can share your repo?

So I think the kernel image I built is actually booting after signing it and flashing it to the boot partition, it just doesnā€™t show anything on the screen yet.
What isnā€™t working is the lk2nd second stage bootloader that would be needed to get rid of the funkiness of the first stage lk bootloader. I will investigate.

Meanwhile Iā€™ll work on putting up those repositories as well for other people to check out.

2 Likes

:partying_face: nice work @FelixKa

Canā€™t wait to dig in!!!

No warranty for this repository! Incorrect power regulator configuration set in the kernel could damage your device.

Technically you should be able to add that branch with a new remote to an existing pmaports checkout in your pmbootstrap environment. E.g.:

$ cd ~/.local/var/pmbootstrap/cache_git/pmaports
$ git remote add kaechele https://gitlab.com/kaechele/pmaports.git
$ git fetch kaechele
$ git checkout kaechele/lenovo-cd-18781y

As mentioned, there currently isnā€™t any output on the screen. I also havenā€™t found a way to flash the rootfs to userdata yet. Flashing it using EDL doesnā€™t work for me somehow. The transfer takes less than a second, which canā€™t be with the rootfs being about 185MB. Flashing with fastboot doesnā€™t work, obviously, as userdata gets wiped when we lock the bootloader.
Currently I havenā€™t implemented signing of the images yet, so that needs to happen manually. But pmbootstrap install will tell you where it puts the images once itā€™s done.

My immediate next step would be to build a TWRP recovery with a kernel that has CONFIG_PSTORE enabled so I can read what the postmarketOS mainline kernel is trying to tell me without cracking open the device to find the UART. I gave it a go with the GPL sources kernel but the resulting image is too large for the recovery partition.

As I have a busy week ahead Iā€™ll probably get back to this next weekend.

2 Likes

Nice work! I was messing around with pmos this weekend so Iā€™m a little more familiar with the toolchain now. I built and flashed your version and got to the same place with no screen output. This seems slightly better than where I ended up with it stuck at fastboot. For the rootfs, I was able to flash it after removing the deviceinfo_flash_sparse option. They make a weird subpartition with another /boot and / inside it, so the sparse format may cause some problems there.

Iā€™m curious about lk2nd now, from my understanding we have 2 potential paths here:

  1. The original method of (signed) boot.img ā†’ /boot, or:
  2. lk2nd ā†’ /boot, then boot to lk2nd to fastboot flash boot.img with an offset

I havenā€™t had any luck getting lk2nd to boot yet either and always end up back in 900e mode. Their readme does mention waiting a bit to skip the stock bootloader so Iā€™ll try that out. Iā€™m also assuming theyā€™re handling the signing, although a magiskboot verify seems unsure about it:

unexpected ASN.1 DER tag: expected SEQUENCE, got APPLICATION [19] (primitive)

1 Like

My wild guesses around lk2nd are that maybe the original lk based bootloader refuses to load a non-signed lk2nd.

I spoke to some of the people in the msm8953-mainline channel on Matrix and the consensus was that lk2nd is only required if we need to work around quirks introduced by the original bootloader.
This generally seems to be the case for this board as it sets up video output (including the type of panel used) in a kernel parameter: mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_boyift8201_800p_video:1:none:cfg:single_dsi.
For many boards supported by lk2nd use it for exactly that reason, to correctly prime the mainline kernel with the correct panel selection.

FYI, my lk2nd branch is here: GitHub - kaechele/msm8953-mainline-lk2nd at lenovo-cd-18781y

+1
While this will for sure be primarily a Home Assistant dashboard for me, the ability to simply pull up other things (Youtube, Spotify, etc) as Android apps will help household acceptance factors.

2 Likes

Linux has all that stuff too thoughā€¦

Sure, you can do almost anything with a web browser. But Android apps tend to be better optimized for touchscreen usage, and running a dedicated app is a better UX, especially for less technically inclined members of a household.

Yup! Iā€™m happy for any potential improvements, but things like the companion app provide useful sensors, Android IP Camera app is nice for the one that happens to be pointed at an entry door, etc.

The real kicker with linux is the potential for including voice assistant features - local wake word, etc. No reason not to pursue both options though. Then youā€™d have the choice to install whatever works best for you.

2 Likes

https://xdaforums.com/t/guide-root-unlocking-and-improving-your-lenovo-thinksmart-view-cd-18781y.4584033/page-2#post-89303829

Pasting this link here for those who hadnā€™t seen it in the other thread, apparently AOSP images can be flashed up to android v11. Hadnā€™t had any luck myself so far, but Iā€™m not super tech savvy, maybe someone smarter than me can duplicate it and tell me what Iā€™m doing wrong lol.

The process for flashing the AOSP GSI images is:

  1. enter fastboot vol-
  2. fastboot oem unlock-go
  3. power cycle, enter fastboot vol-
  4. fastboot flash system system-roar-arm-aonly-vanilla.img
  5. fastboot flash vendor kingston_wifi_vendor.img
  6. fastboot flashing lock

Again, havenā€™t gotten this to work as I canā€™t connect to adb with the device in recovery or rebooted to the bootloader. ADB & fastboot work fine when the device is powered on though. Iā€™m thinking itā€™s a driver issue on my PC but havenā€™t been able to solve it. Might just be a USB cable issue, Iā€™ll have to try it some usb-c to usb-c cables. So I canā€™t flash the image since ADB wonā€™t recognize that itā€™s connected.

Nice work so far, I went through the kernel diff and split things apart and described them to make it easier to see the changes. The main branch is just what I needed to make it compile and boot on android. The LA.UM.6.6.3.r1-01300-8x53 branch contains the Qualcomm history and then the Lenovo changes split into commits.

2 Likes

Great stuff man would like to encourage you and Matt to continue work on Lin full speed ahead looking great as we currently have several devs already working on android would be more fruitful for your time if you guys continued down the Linux path :pray:t4:

Just a quick word of warning: My DTS file for the Mainline Kernel is an educated guess, so far.
As I am learning more about the platform I realized that it does mess with power regulators (basically: how much volt to send where), which I know are not set up correctly in that file. And while the config I have in my repo right now doesnā€™t fry my device at this point it doesnā€™t mean it couldnā€™t fry yours. So I take no responsibility if that happens.

Meanwhile I managed to use a simple framebuffer to get a blinking cursor from the mainline kernel, but unfortunately not more so far.
I have also since learned that correctly setting up the power regulators is going to be tricky as we donā€™t have schematics for the device and some information the mainline kernel needs (specifically, the sources that supply power to certain regulators) are not found in the downstream DTS files.
I was given this helpful link: Regulators (SPMI/SMD) ā€“ A guide to mainlining android phones

Nice. Most of the changes can actually be found in Qualcommā€™s codebase on CodeLinaro, so they seem to be general updates to the reference design. Hereā€™s a few samples:

1 Like

Quick update to this, and a huge thank you to Deadman96385 for his help.

In my case I was only able to successfully boot a GSI image when starting from the diagnostic/debug ROM which deadman posted in his original XDA thread here: CD-18781Y (Lenovo ThinkSmart View) Bootloader, Firmware, Zoom/Teams Conversion, Normal Android | XDA Forums

So far I havenā€™t been able to get wifi working on either of the GSI roms Iā€™ve booted, which has made it difficult to do anything interesting with them. Still, encouraging to actually get a (mostly) working install of Android 11 on this thing!

1 Like