postmarketOS

nexus 5

nexu5 刷入最新固件、android系统

步骤0. 使用旧的 platform-tools_r27:

mkdir ~/nexus5; cd ~/nexus5;

#https://android.googlesource.com/platform/tools/google_prebuilts/studio/sdk/remote/+/a66136ae1bfeb1b08a42319158a7652938c648d3
#此页面有:dl.google.com/android/repository/platform-tools_r27.0.1-linux.zip, 此即旧platform-tools_r27下载地址,注意不是该文本的跳转链接

wget dl.google.com/android/repository/platform-tools_r27.0.1-linux.zip
unzip platform-tools_r27.0.1-linux.zip -d .
file `pwd`/platform-tools/fastboot 
#/home/z/nexus5/platform-tools/fastboot: ELF 64-bit LSB shared object
export PATH=`pwd`/platform-tools/:$PATH
which fastboot
#/home/z/nexus5/platform-tools//fastboot

步骤1. nexus5刷入最新固件、android系统 :

#https://zhuanlan.zhihu.com/p/529627165
wget https://dl.google.com/dl/android/aosp/hammerhead-m4b30z-factory-625c027b.zip
unzip  hammerhead-m4b30z-factory-625c027b.zip -d   .
cd hammerhead-m4b30z
pwd #/home/z/nexus5/hammerhead-m4b30z
./flash-all.sh

#注意不要使用ota包. 必须使用factory包

报错解决e1: flash-all.sh中刷android系统报错 Snapshot cancel …

报错详细:

#flash-all.sh中刷android系统步骤 “ fastboot -w update image-hammerhead-m4b30z.zip “ 报错如下:
#Snapshot cancel                                    FAILED (remote: 'unknown command')

解决办法: “步骤0. 使用旧的 platform-tools_r27”

其他说明

flash-all.sh中的内容

#flash-all.sh中的内容

#{刷入固件
fastboot flash bootloader bootloader-hammerhead-hhz20h.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.30.img
fastboot reboot-bootloader
#}

#{刷入android系统
sleep 5
fastboot -w update image-hammerhead-m4b30z.zip
#}

factory包内容


#wget https://dl.google.com/dl/android/aosp/hammerhead-m4b30z-factory-625c027b.zip
#unzip  hammerhead-m4b30z-factory-625c027b.zip -d   .
pwd #/home/z/nexus5/hammerhead-m4b30z

ls -lh 
总计 595M

#固件
-rw-r----- 1 z z 3.1M 128  2016 bootloader-hammerhead-hhz20h.img
-rw-r----- 1 z z  45M 128  2016 radio-hammerhead-m8974a-2.0.50.2.30.img

#android系统:
-rw-r----- 1 z z 548M 128  2016 image-hammerhead-m4b30z.zip

#脚本:
-rw-r----- 1 z z  974 128  2016 flash-all.bat
-rwxr-x--x 1 z z  845 128  2016 flash-all.sh
-rwxr-x--x 1 z z  798 128  2016 flash-base.sh

nexu5 刷入postmarketOS系统

报错解决

data too big 报错解决

报错data too big 在此步骤:pmbootstrap flasher flash_rootfs --partition userdata

解决: “nexu5 刷入最新固件、android系统”

空间没用上问题解决

userdata 32GB空间没用上 , 问题描述,
问题解决 : 参考本文的“pmaports代码仓库不同分支试错”

nexu5 刷入postmarketOS系统 主步骤

#以下全程插入usb线
fastboot devices 
fastboot getvar all
fastboot erase  userdata
fastboot erase  system
fastboot erase  cache

pmbootstrap init
pmbootstrap install

pmbootstrap flasher flash_rootfs --partition userdata
pmbootstrap flasher flash_kernel
fastboot reboot  #启动完最终停在postmarketOS界面不动,但实际上此时Linux已经正常启动了
ssh [email protected]  #usb线插好,即可ssh连接Linux

LG nexus 5 安装好 postmarketOS ,

  • htop命令输出:
    postmarketOS_第1张图片

  • uname输出

 uname -a
#Linux lg-hammerhead 6.3.0-postmarketos-qcom-msm8974 #1 SMP PREEMPT Wed May  3 14:38:30 UTC 2023 armv7l Linux

#LG nexus 5 的确是 armv7

连接wifi

sudo nmtui

其他

sudo apk add htop
sudo apk add curl

关闭防火墙

sudo rc-update del nftables
#sudo rc-update nftables stop
sudo reboot

docker安装

sudo apk upgrade
sudo apk update
sudo apk add docker
sudo addgroup z  docker
  • 文件 /etc/docker/daemon.json 内容如下:
{
  "iptables": false
}

sudo rc-update add docker boot
sudo service docker start
sudo service docker status 

lash参考

按这里 Modem 操作,居然说没有modem. 但是nexus5 声称sms是work的,TODO, 有可能是因为没有插手机SIM卡

补充

步骤"pmbootstrap init" 中 用户界面 user interface 选 fbkeyboard 很保险

参考:

  1. Home Assistant on old Smartphone (Nexus5) with PostmarketOS and Docker
  2. Alpine Linux 安装 Docker

oneplus 6

build img : 用v22.12 的 sxmo-de-sway

按住音量大,再按电源 进入fastboot

参考: https://wiki.postmarketos.org/wiki/OnePlus_6_(oneplus-enchilada)

#OnePlus 6 : enchilada
#OnePlus6T : fajita 
fastboot oem unlock
pmbootstrap init
pmbootstrap install

fastboot set_active b
fastboot erase dtbo
pmbootstrap flasher flash_rootfs --partition userdata
pmbootstrap flasher flash_kernel
fastboot reboot
ssh [email protected]

最终用的: 7e7224f4c16dc646b779271e6cd548840ab8c356(v22.12) 的 sxmo-de-sway

pmaports代码仓库不同分支试错

~/.local/var/pmbootstrap/cache_git/pmaports/.git/config : https://gitlab.com/postmarketOS/pmaports.git

  • f7e12b210dd6bba0f964a63db53afbc265a5384a : 磁盘空间45G, 貌似等一会儿crash了? 此提交在nexus5上好用?

  • 7c03891fab8f5be997038dcbe840624e3252f1a3 : 磁盘空间45G, 黑屏

  • eca86adbf38bea4f885222496375d1391f71e228 (master), 18c04de3f8d03f31332c5ea0e6ff123b0a59445f(v23.06) : 磁盘空间几百MB, 屏亮

  • 7e7224f4c16dc646b779271e6cd548840ab8c356(v22.12) : 磁盘空间45G, 屏亮

    fbkeyboard|console: 电源键不熄屏
    lxqt: 电源键不熄屏, GUI界面正常
    sxmo-de-sway: 电源键熄屏, GUI界面正常(触摸屏本身就坏了,不太确定)

  • cat /proc/cpuinfo : 确实是8核cpu

twrp

#https://eu.dl.twrp.me/enchilada/#google_vignette
wget https://eu.dl.twrp.me/enchilada/twrp-3.7.0_11-0-enchilada.img
fastboot getvar current-slot
#current-slot: a
fastboot flash boot_a twrp-3.7.0_11-0-enchilada.img  #失败,并没有进入twrp
fastboot boot  twrp-3.7.0_11-0-enchilada.img  #估计是自动进入了一加手机的自动恢复

重来 用现成img

##https://images.postmarketos.org/bpo/v23.06/oneplus-enchilada/gnome-mobile/20230821-2134/
##https://www.cnblogs.com/hupo376787/p/16461892.html
fastboot set_active b
fastboot erase dtbo
fastboot flash boot 20230821-2209-postmarketOS-v23.06-sxmo-de-sway-1.14.0-oneplus-enchilada-boot.img
fastboot flash userdata 20230821-2209-postmarketOS-v23.06-sxmo-de-sway-1.14.0-oneplus-enchilada.img
fastboot reboot
#ssh [email protected] #sshd默认关闭的 :  https://builds.sr.ht/~postmarketos/job/1045030

安装gcc

   sudo apk add gcc
   sudo apk add g++
   sudo apk add make
   sudo apk add gdb

gcc -dumpmachine
#aarch64-alpine-linux-musl
g++ -dumpmachine
#aarch64-alpine-linux-musl

安装numpy

注意: 直接安装 Miniconda3-py310_23.1.0-1-Linux-aarch64.sh 不成功, 说是有docker image可以用。但不想用docker,所以单独安装

sudo apk add python3-dev
pip install numpy
#  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a0/41  /8f53eff8e969dd8576ddfb45e7ed315407d27c7518ae49418be8ed532b07/numpy-1.25.2.tar.gz (10.8 MB)
#有需要编译的

安装jupyter

报错解决1. linux/version.h: No such file or directory

jupyter中的依赖psutil安装时报错: linux/version.h: No such file or directory, 解决:

sudo apk add linux-headers
#(1/1) Installing linux-headers (5.19.5-r0)

报错解决2. 报错 ffi.h: No such file or directory

报错 ffi.h: No such file or directory, 完整报错:

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -g -O2 -Os -g -O2 -Os -g -O2 -DTHREAD_STACK_SIZE=0x100000 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-aarch64-cpython-310/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include 
            |          ^~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1

解决:


sudo apk search libffi 
#libffi-3.4.4-r0
#libffi-doc-3.4.4-r0
#libffi-dbg-3.4.4-r0
#libffi-dev-3.4.4-r0

sudo apk add  libffi libffi-dev

安装jupyter

pip install jupyter

"""
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting jupyter
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting ipykernel
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ca/ca/1089ddd8dd3ba03ea593bf20cdc2f7fe02526dcd7d966b7da47aa105e65b/ipykernel-6.25.1-py3-none-any.whl (154 kB)
Collecting jupyter-console
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ca/77/71d78d58f15c22db16328a476426f7ac4a60d3a5a7ba3b9627ee2f7903d4/jupyter_console-6.6.3-py3-none-any.whl (24 kB)
Collecting qtconsole
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/18/3b/7bdbb99256d1406ae6c8904355222c6dc010640e6be158830f48b7097b32/qtconsole-5.4.3-py3-none-any.whl (121 kB)
Collecting ipywidgets
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b8/d4/ce436660098b2f456e2b8fdf76d4f33cbc3766c874c4aa2f772c7a5e943f/ipywidgets-8.1.0-py3-none-any.whl (139 kB)
Collecting nbconvert
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/80/ed/d883918ca3777f744f3373fc63d8af47b47237ca703450a451b3e885264a/nbconvert-7.7.4-py3-none-any.whl (254 kB)
Collecting notebook
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/85/76/51777158391e1784cc5a892ff355fd0a0b0b5189aeffce9baf51f514b9a2/notebook-7.0.2-py3-none-any.whl (4.0 MB)
Requirement already satisfied: tornado>=6.1 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (6.3.3)
Requirement already satisfied: comm>=0.1.1 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (0.1.4)
Requirement already satisfied: traitlets>=5.4.0 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (5.9.0)
Requirement already satisfied: nest-asyncio in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (1.5.7)
Collecting ipython>=7.23.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/52/d1/f70cdafba20030cbc1412d7a7d6a89c5035071835cc50e47fc5ed8da553c/ipython-8.14.0-py3-none-any.whl (798 kB)
Requirement already satisfied: debugpy>=1.6.5 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (1.6.7.post1)
Requirement already satisfied: psutil in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (5.9.5)
Requirement already satisfied: packaging in /usr/lib/python3.10/site-packages (from ipykernel->jupyter) (21.3)
Requirement already satisfied: matplotlib-inline>=0.1 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (0.1.6)
Requirement already satisfied: pyzmq>=20 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (25.1.1)
Collecting jupyter-client>=6.1.12
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/29/24/0491f7837cedf39ae0f96d9b3e4db2fae31cc4dd5eac00a98ab0db996c9b/jupyter_client-8.3.0-py3-none-any.whl (103 kB)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in ./.local/lib/python3.10/site-packages (from ipykernel->jupyter) (5.3.1)
Requirement already satisfied: widgetsnbextension~=4.0.7 in ./.local/lib/python3.10/site-packages (from ipywidgets->jupyter) (4.0.8)
Requirement already satisfied: jupyterlab-widgets~=3.0.7 in ./.local/lib/python3.10/site-packages (from ipywidgets->jupyter) (3.0.8)
Requirement already satisfied: prompt-toolkit>=3.0.30 in ./.local/lib/python3.10/site-packages (from jupyter-console->jupyter) (3.0.39)
Requirement already satisfied: pygments in ./.local/lib/python3.10/site-packages (from jupyter-console->jupyter) (2.16.1)
Collecting beautifulsoup4
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/57/f4/a69c20ee4f660081a7dedb1ac57f29be9378e04edfcb90c526b923d4bebc/beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
Requirement already satisfied: mistune<4,>=2.0.3 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (3.0.1)
Requirement already satisfied: jinja2>=3.0 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (3.1.2)
Requirement already satisfied: markupsafe>=2.0 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (2.1.3)
Requirement already satisfied: bleach!=5.0.0 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (6.0.0)
Requirement already satisfied: jupyterlab-pygments in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (0.2.2)
Collecting nbclient>=0.5.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ac/5a/d670ca51e6c3d98574b9647599821590efcd811d71f58e9c89fc59a17685/nbclient-0.8.0-py3-none-any.whl (73 kB)
Requirement already satisfied: pandocfilters>=1.4.1 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (1.5.0)
Collecting nbformat>=5.7
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f4/e7/ef30a90b70eba39e675689b9eaaa92530a71d7435ab8f9cae520814e0caf/nbformat-5.9.2-py3-none-any.whl (77 kB)
Requirement already satisfied: defusedxml in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (0.7.1)
Requirement already satisfied: tinycss2 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (1.2.1)
Collecting notebook-shim<0.3,>=0.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f4/79/73250372e5bbab63018b41b02d5cc6b395655ec6c1254e477ef7c913aada/notebook_shim-0.2.3-py3-none-any.whl (13 kB)
Collecting jupyter-server<3,>=2.4.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/28/d9/4bf2ab8410cdc37f54aadb6cae497b9bc8ae16720d97b762b9bfb7834022/jupyter_server-2.7.2-py3-none-any.whl (375 kB)
Collecting jupyterlab-server<3,>=2.22.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a7/0d/6d4eab0391bd4df1c43f308368d5e177b0fa8ac632267222a23b71317091/jupyterlab_server-2.24.0-py3-none-any.whl (57 kB)
Collecting jupyterlab<5,>=4.0.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/71/a3/38b9d6492a393dcfdae9e82021655432a9fd6e8f4c03c30a7b55036c0d70/jupyterlab-4.0.5-py3-none-any.whl (9.2 MB)
Requirement already satisfied: ipython-genutils in ./.local/lib/python3.10/site-packages (from qtconsole->jupyter) (0.2.0)
Requirement already satisfied: qtpy>=2.0.1 in ./.local/lib/python3.10/site-packages (from qtconsole->jupyter) (2.3.1)
Requirement already satisfied: webencodings in ./.local/lib/python3.10/site-packages (from bleach!=5.0.0->nbconvert->jupyter) (0.5.1)
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3.10/site-packages (from bleach!=5.0.0->nbconvert->jupyter) (1.16.0)
Requirement already satisfied: stack-data in ./.local/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->jupyter) (0.6.2)
Requirement already satisfied: jedi>=0.16 in ./.local/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->jupyter) (0.19.0)
Requirement already satisfied: pickleshare in ./.local/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->jupyter) (0.7.5)
Requirement already satisfied: pexpect>4.3 in ./.local/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->jupyter) (4.8.0)
Requirement already satisfied: decorator in ./.local/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->jupyter) (5.1.1)
Requirement already satisfied: backcall in ./.local/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->jupyter) (0.2.0)
Requirement already satisfied: python-dateutil>=2.8.2 in ./.local/lib/python3.10/site-packages (from jupyter-client>=6.1.12->ipykernel->jupyter) (2.8.2)
Requirement already satisfied: platformdirs>=2.5 in ./.local/lib/python3.10/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel->jupyter) (3.10.0)
Requirement already satisfied: send2trash>=1.8.2 in ./.local/lib/python3.10/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter) (1.8.2)
Collecting jupyter-server-terminals
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ea/7f/36db12bdb90f5237766dcbf59892198daab7260acbcf03fc75e2a2a82672/jupyter_server_terminals-0.4.4-py3-none-any.whl (13 kB)
Collecting jupyter-events>=0.6.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/15/0d/3c67f6c432d8085a3cee250e1e235f27b764be90cc2d16fdcc0b1cee9572/jupyter_events-0.7.0-py3-none-any.whl (18 kB)
Requirement already satisfied: overrides in ./.local/lib/python3.10/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter) (7.4.0)
Requirement already satisfied: prometheus-client in ./.local/lib/python3.10/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter) (0.17.1)
Requirement already satisfied: websocket-client in ./.local/lib/python3.10/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter) (1.6.2)
Requirement already satisfied: terminado>=0.8.3 in ./.local/lib/python3.10/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter) (0.17.1)
Collecting anyio>=3.1.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/19/24/44299477fe7dcc9cb58d0a57d5a7588d6af2ff403fdd2d47a246c91a3246/anyio-3.7.1-py3-none-any.whl (80 kB)
Collecting argon2-cffi
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a4/6a/e8a041599e78b6b3752da48000b14c8d1e8a04ded09c88c714ba047f34f5/argon2_cffi-23.1.0-py3-none-any.whl (15 kB)
Requirement already satisfied: tomli in ./.local/lib/python3.10/site-packages (from jupyterlab<5,>=4.0.2->notebook->jupyter) (2.0.1)
Collecting async-lru>=1.0.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fa/9f/3c3503693386c4b0f245eaf5ca6198e3b28879ca0a40bde6b0e319793453/async_lru-2.0.4-py3-none-any.whl (6.1 kB)
Collecting jupyter-lsp>=2.0.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8f/b6/a1571e48550855a79898f851f57e5858b00eb36b09ea3b1a8bb65c53a290/jupyter_lsp-2.2.0-py3-none-any.whl (65 kB)
Collecting jsonschema>=4.17.3
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2b/ff/af59fd34bc4d7ac3e6e0cd1f3c10317d329b6c1aee179e8b24ad9a79fbac/jsonschema-4.19.0-py3-none-any.whl (83 kB)
Requirement already satisfied: requests>=2.28 in ./.local/lib/python3.10/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter) (2.31.0)
Requirement already satisfied: babel>=2.10 in ./.local/lib/python3.10/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter) (2.12.1)
Requirement already satisfied: json5>=0.9.0 in ./.local/lib/python3.10/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter) (0.9.14)
Requirement already satisfied: fastjsonschema in ./.local/lib/python3.10/site-packages (from nbformat>=5.7->nbconvert->jupyter) (2.18.0)
Requirement already satisfied: wcwidth in ./.local/lib/python3.10/site-packages (from prompt-toolkit>=3.0.30->jupyter-console->jupyter) (0.2.6)
Requirement already satisfied: soupsieve>1.2 in ./.local/lib/python3.10/site-packages (from beautifulsoup4->nbconvert->jupyter) (2.4.1)
Requirement already satisfied: sniffio>=1.1 in ./.local/lib/python3.10/site-packages (from anyio>=3.1.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (1.3.0)
Requirement already satisfied: exceptiongroup in ./.local/lib/python3.10/site-packages (from anyio>=3.1.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (1.1.3)
Requirement already satisfied: idna>=2.8 in ./.local/lib/python3.10/site-packages (from anyio>=3.1.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (3.4)
Requirement already satisfied: typing-extensions>=4.0.0 in ./.local/lib/python3.10/site-packages (from async-lru>=1.0.0->jupyterlab<5,>=4.0.2->notebook->jupyter) (4.7.1)
Requirement already satisfied: parso<0.9.0,>=0.8.3 in ./.local/lib/python3.10/site-packages (from jedi>=0.16->ipython>=7.23.1->ipykernel->jupyter) (0.8.3)
Requirement already satisfied: rpds-py>=0.7.1 in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (0.9.2)
Collecting jsonschema-specifications>=2023.03.6
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1c/24/83349ac2189cc2435e84da3f69ba3c97314d3c0622628e55171c6798ed80/jsonschema_specifications-2023.7.1-py3-none-any.whl (17 kB)
Requirement already satisfied: referencing>=0.28.4 in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (0.30.2)
Requirement already satisfied: attrs>=22.2.0 in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (23.1.0)
Requirement already satisfied: rfc3986-validator>=0.1.1 in ./.local/lib/python3.10/site-packages (from jupyter-events>=0.6.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (0.1.1)
Requirement already satisfied: pyyaml>=5.3 in ./.local/lib/python3.10/site-packages (from jupyter-events>=0.6.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (6.0.1)
Requirement already satisfied: python-json-logger>=2.0.4 in ./.local/lib/python3.10/site-packages (from jupyter-events>=0.6.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (2.0.7)
Requirement already satisfied: rfc3339-validator in ./.local/lib/python3.10/site-packages (from jupyter-events>=0.6.0->jupyter-server<3,>=2.4.0->notebook->jupyter) (0.1.4)
Requirement already satisfied: ptyprocess>=0.5 in ./.local/lib/python3.10/site-packages (from pexpect>4.3->ipython>=7.23.1->ipykernel->jupyter) (0.7.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.10/site-packages (from requests>=2.28->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (2022.12.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./.local/lib/python3.10/site-packages (from requests>=2.28->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (2.0.4)
Requirement already satisfied: charset-normalizer<4,>=2 in ./.local/lib/python3.10/site-packages (from requests>=2.28->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (3.2.0)
Collecting argon2-cffi-bindings
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/74/2b/73d767bfdaab25484f7e7901379d5f8793cccbb86c6e0cbc4c1b96f63896/argon2_cffi_bindings-21.2.0-cp36-abi3-musllinux_1_1_aarch64.whl (83 kB)
Requirement already satisfied: asttokens>=2.1.0 in ./.local/lib/python3.10/site-packages (from stack-data->ipython>=7.23.1->ipykernel->jupyter) (2.2.1)
Requirement already satisfied: executing>=1.2.0 in ./.local/lib/python3.10/site-packages (from stack-data->ipython>=7.23.1->ipykernel->jupyter) (1.2.0)
Requirement already satisfied: pure-eval in ./.local/lib/python3.10/site-packages (from stack-data->ipython>=7.23.1->ipykernel->jupyter) (0.2.2)
Requirement already satisfied: jsonpointer>1.13 in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (2.4)
Collecting isoduration
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7b/55/e5326141505c5d5e34c5e0935d2908a74e4561eca44108fbfb9c13d2911a/isoduration-20.11.0-py3-none-any.whl (11 kB)
Requirement already satisfied: fqdn in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (1.5.1)
Requirement already satisfied: webcolors>=1.11 in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (1.13)
Requirement already satisfied: uri-template in ./.local/lib/python3.10/site-packages (from jsonschema>=4.17.3->jupyterlab-server<3,>=2.22.1->notebook->jupyter) (1.3.0)
Collecting cffi>=1.0.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2b/a8/050ab4f0c3d4c1b8aaa805f70e26e84d0e27004907c5b8ecc1d31815f92a/cffi-1.15.1.tar.gz (508 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pycparser in ./.local/lib/python3.10/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->jupyter-server<3,>=2.4.0->notebook->jupyter) (2.21)
Collecting arrow>=0.15.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/67/67/4bca5a595e2f89bff271724ddb1098e6c9e16f7f3d018d120255e3c30313/arrow-1.2.3-py3-none-any.whl (66 kB)
Installing collected packages: cffi, beautifulsoup4, async-lru, anyio, jupyter-server-terminals, jupyter-client, jsonschema-specifications, arrow, argon2-cffi-bindings, jsonschema, isoduration, ipython, argon2-cffi, nbformat, ipywidgets, ipykernel, qtconsole, nbclient, jupyter-events, jupyter-console, nbconvert, jupyter-server, notebook-shim, jupyterlab-server, jupyter-lsp, jupyterlab, notebook, jupyter
  DEPRECATION: cffi is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for cffi ... done
Successfully installed anyio-3.7.1 argon2-cffi-23.1.0 argon2-cffi-bindings-21.2.0 arrow-1.2.3 async-lru-2.0.4 beautifulsoup4-4.12.2 cffi-1.15.1 ipykernel-6.25.1 ipython-8.14.0 ipywidgets-8.1.0 isoduration-20.11.0 jsonschema-4.19.0 jsonschema-specifications-2023.7.1 jupyter-1.0.0 jupyter-client-8.3.0 jupyter-console-6.6.3 jupyter-events-0.7.0 jupyter-lsp-2.2.0 jupyter-server-2.7.2 jupyter-server-terminals-0.4.4 jupyterlab-4.0.5 jupyterlab-server-2.24.0 nbclient-0.8.0 nbconvert-7.7.4 nbformat-5.9.2 notebook-7.0.2 notebook-shim-0.2.3 qtconsole-5.4.3

"""

启动jupyter


jupyter-notebook --help-all   | grep -A 5 -B 5  -n localhost
820---ServerApp.ip=<Unicode>
821-    The IP address the Jupyter server will listen on.
822:    Default: 'localhost'

ip address
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 02:00:6f:c8:2a:61 brd ff:ff:ff:ff:ff:ff
    inet 10.0.4.102/24 




oneplus-enchilada:~$  mkdir jupyter_home ; cd jupyter_home/


jupyter-notebook --ServerApp.ip=0.0.0.0
#http://10.0.4.102:8888/tree?token=a64a4677d7fc685531f348599f0d460e0e33056279328623

!uname -a
#Linux oneplus-enchilada 6.3.2-sdm845 #1-postmarketos-qcom-sdm845 SMP PREEMPT Tue May 16 09:19:52 UTC  aarch64 GNU/Linux

import numpy
z=numpy.zeros_like((3,4))
type(z)
#numpy.ndarray


小米note顶配版

高通紧急模式刷机(9008模式): 最终失败

mi-note-pro-leo-china-fastboot-recovery-rom

参考1

qualcomm-hs-usb-qdloader-9008

  1. 按住 音量-, 再按 开机键, 进入fastboot模式,此时oem没有解锁

  2. 下载并安装 高通9008驱动 qualcomm-hs-usb-qdloader-9008/QDLoaderHS_USB_Driver_64bit_Setup.exe

  3. fastboot模式下 进入 高通9008模式fastboot oem edl

postmarketOS_第2张图片

  1. 下载、解压、运行XiaoMiFlash.exe: mi-note-pro-leo-china-fastboot-recovery-rom/MiFlash20220507.zip/XiaoMiFlash.exe

若 点击加载设备 后 报错 找不到路径*/log/*, 则在解压路径 E:\xiaomi_note_leo\MiFlash20220507下新建目录 log,再次打开XiaoMiFlash.exe 即可

9008刷机最终失败,报错:

COM6        System.Exception: configure failed!!!
在 XiaoMiFlash.code.bl.SerialPortDevice.ConfigureDDR(Int32 intSectorSize, Int32 buffer_sectors, String ddrType, Int32 m_iSkipStorageInit)

twrp卡刷:刷机成功

参考: 小米手机刷 TWRP 方法(解决卡米问题)

1. 小米bootload解锁

下载bootload解锁工具: miflash_unlock_7.6.727.43.zip
登录手机号(验证码或密码),以解锁。不要用其他方式登录,否则1004报错。

2. fastboot下刷入TWRP

音量- 、 电源 进入 fastboot, 刷入twrp: fastboot flash recovery TWRP-20171031-3.1.1.0-leo.img

小米note顶配版leo, twrp下载,搜索leo

fastboot reboot

3. twrp下刷入zip包

下载:

  • 下载miui_MINotePro_V9.2.3.0.NXHCNEK_1deef92a66_7.0.zip,

  • 下载Magisk

步骤:

  1. 音量+ 、 电源, 进入twrp,允许修改System分区

  2. 此时电脑上可以看到手机存库空间,

  3. 将Magisk .zip 复制到 手机存储卡根目录, twrp下 安装 该zip

此步骤剔除了小米启动时验证完整性,没有这一步 启动后 停在 “mi” 界面,俗称 “卡米”?

  1. 将刷机包miui_MINotePro_V9.2.3.0.NXHCNEK_1deef92a66_7.0.zip复制到手机存储卡根目录 , twrp 下 安装,选 该zip,…, 重启 , 漫长等待 后 进入android系统。

你可能感兴趣的:(postmarketOS,nexus5,oneplus6)