diff --git a/README.md b/README.md index 5d85deb..2fd12f3 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,11 @@ If you want to develop it together, or maybe you have a working port, please wri - [x] Kernel compiling - [x] Kernel booting -- [x] Debug shell (see Debugging section) -- [x] Display + logo -- [ ] PMOS booting +- [x] Debug shell +- [x] Framebuffer + boot logo +- [x] PMOS booting +- [x] SSH (use `ssh 172.16.41.1`) +- [ ] UI loading - [ ] ... ## How to install @@ -35,6 +37,9 @@ Enter fastboot mode (hold vol- and pwr buttons while turned off), and run this c cd prebuild && ./flash.sh ``` +Password: 1234 +UI: surprise + ### Flash manually 1. Build images @@ -60,15 +65,20 @@ pmbootstrap flasher flash_kernel ```bash fastboot reboot fastboot # enter fastbootd mode -fastboot delete-logical-partition product # make system partition bigger pmbootstrap flasher flash_rootfs # flash system ``` +4. Reboot + +```bash +fastboot reboot +``` + ## How to flash stock firmware It is recommended to flash stock firmware before doing anything. -[Download Firmware](https://xmfirmwareupdater.com/miui/angelican/stable/V12.0.16.0.QCSMIXM/) and unpack it +[Download Firmware](https://xmfirmwareupdater.com/miui/angelican/stable/V12.0.16.0.QCSMIXM/) (MIUI v12.0.16.0) and unpack it ### Windows @@ -108,24 +118,10 @@ pip -r install requirements.txt git clone https://github.com/coloredmarble/redmi_9a_mtkclient cp redmi_9a_mtkclient/* . python mtk.py da seccfg unlock --preload preloader_k62v1_64_bsp.bin --loader n.bin -# power off phone, hold vol+ and vol- at same time and connect usb cable +# power off the phone, hold vol+ and vol- at same time and connect usb cable # i did it with test point, but it isnt required ``` -## Debugging - -Initramfs inspecting works! Run this script: - -```bash -./debug-shell.sh -# or -picocom -b 115200 /dev/ttyACM0 -# or -telnet 172.16.42.1 -``` - -[More about that](https://wiki.postmarketos.org/wiki/Initramfs/Inspecting#Using_the_debug_shell) - ## See also - [xiaomi angelican wiki](https://wiki.postmarketos.org/wiki/Xiaomi_Redmi_9C_NFC_(xiaomi-angelican)) diff --git a/debug-shell.sh b/debug-shell.sh deleted file mode 100755 index 98ea781..0000000 --- a/debug-shell.sh +++ /dev/null @@ -1 +0,0 @@ -telnet 172.16.42.1 diff --git a/device-xiaomi-angelican/APKBUILD b/device-xiaomi-angelican/APKBUILD index 2255341..172ec0e 100644 --- a/device-xiaomi-angelican/APKBUILD +++ b/device-xiaomi-angelican/APKBUILD @@ -33,7 +33,7 @@ package() { } sha512sums=" -1508fda77236dd7ac8802edb5bb764b8df286beb432d805d8bcb778eace16c90de8ff5d1aad2e1325262dd2ea30b3397e6142614d0fb348239ab230eaf7af1f4 deviceinfo +c41058c297f0202e358cbc198cb62b159479ef5d31733b77cd1276b281095b8262e6a42f2a0e54ca46a87d799bf07db1f80aad7baaa739c764df74e493cb9e9a deviceinfo 87a1e3b1f31a7a2717992621eaad272d8ad7e2dca7346e7fcd583e70eb73d817bcfc32b51c322e19ccf575fa0ef3ea7f6279e3176abc4db0c5d49336b9971d05 BT_FW.cfg 3f973f1ae3f24dd9aa087976cc5965aad41c4a0065f69b3e20c1ebe44e34ee2821312f9610b0c8db6b7b6782cb196afca557f86819514e3873d0be468c588ef4 Himax_firmware.bin 43bea79d5af5ada68eb96b5947c88f385f15d7691c6868bf54dcc31ca7175b037422d7e19065b2e24a511de6d60082b11676b7e8e0b3dccbc66a09c1d64e1f1d Himax_mpfw.bin diff --git a/device-xiaomi-angelican/deviceinfo b/device-xiaomi-angelican/deviceinfo index 1bf72c9..532a958 100644 --- a/device-xiaomi-angelican/deviceinfo +++ b/device-xiaomi-angelican/deviceinfo @@ -48,4 +48,4 @@ deviceinfo_bootimg_dtb_second="false" deviceinfo_usb_network_function="rndis.usb0" # enable debug-shell -deviceinfo_kernel_cmdline_append="pmos.debug-shell" +# deviceinfo_kernel_cmdline_append="pmos.debug-shell" diff --git a/linux-xiaomi-angelican/APKBUILD b/linux-xiaomi-angelican/APKBUILD index b6b985f..08ccd14 100644 --- a/linux-xiaomi-angelican/APKBUILD +++ b/linux-xiaomi-angelican/APKBUILD @@ -64,7 +64,7 @@ package() { sha512sums=" beeaa1b5b5d3e6f635508c6f421051080f7fdc296909db7448e4c706b6a54755badc2ea0c1316dbf0a1d394dbea15266a84dfa36d9818c8df99747484c9175b6 linux-xiaomi-angelican-5b52fedbe4d7c6809b5040f7486a8b72812f3fba.tar.gz -f1c3466db48e816e1b7c278704521b10ffa908ddcde868e3af66bb6ef749befcd3515ec42abdb796143451ef2e3598f945225689fc4973d3eb1b01cd1d614af5 config-xiaomi-angelican.aarch64 +b2043d32f5e0902d32663d622c6454ac39742cd3c11c61eaae5b68d01580b92f2abd1139fcc5d5dca404fbb44c47f19d73f0a4938f8757beb60f671f8b700f39 config-xiaomi-angelican.aarch64 3fc36011ab030382f6b74e3821dcc75a236e12fe38bf18639fededc6c49a8c809d9ca1af5a9f2ed83f5f412a383918db14b4af48eda7087ec5997ca00e018152 001-touchscreen-firmware-loading-time.patch 2ed25978e3c91addf7e568b68ccb6036aa581da0981ec75527e25d15d0ee7dfed97100376e58ce6a6c07ef8a96210a30c0ad91b3cea29528aa89fc59980691bf 002-battery-percentage.patch c33fad9de627e72f12e61e728fa1ec53ef15259c7790392a997cc7269e60e45da9534d58851c3b348a1729aaa134d1df305e33546e8a1f3654462f2c3c1d9563 003-fix-check-lxdialog-makefile.patch diff --git a/linux-xiaomi-angelican/config-xiaomi-angelican.aarch64 b/linux-xiaomi-angelican/config-xiaomi-angelican.aarch64 index 9b668ca..ccc6c70 100644 --- a/linux-xiaomi-angelican/config-xiaomi-angelican.aarch64 +++ b/linux-xiaomi-angelican/config-xiaomi-angelican.aarch64 @@ -46,7 +46,7 @@ CONFIG_THREAD_INFO_IN_TASK=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="aarch64-linux-gnu-" # CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="-ubuntu-touch" +CONFIG_LOCALVERSION="-postmarketos" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SWAP=y @@ -511,7 +511,7 @@ CONFIG_IMG_GZ_DTB=y # CONFIG_IMG_DTB is not set CONFIG_BUILD_ARM64_APPENDED_KERNEL_IMAGE_NAME="Image.gz-dtb" CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES="mediatek/mt6765" -CONFIG_BUILD_ARM64_DTB_OVERLAY_IMAGE_NAMES="mediatek/angelica" +CONFIG_BUILD_ARM64_DTB_OVERLAY_IMAGE_NAMES="mediatek/angelican" # # Userspace binary formats @@ -1320,7 +1320,7 @@ CONFIG_SIMTRAY_STATUS=y CONFIG_MEDIATEK_SOLUTION=y CONFIG_BACKLIGHT_SUPPORT_2047_FEATURE=y CONFIG_MTK_PLATFORM="mt6765" -CONFIG_ARCH_MTK_PROJECT="angelica" +CONFIG_ARCH_MTK_PROJECT="angelican" # CONFIG_MTK_HAVE_EXTERNAL_VENDOR_PATH is not set # CONFIG_FPGA_EARLY_PORTING is not set CONFIG_MTK_LM_MODE=y diff --git a/prebuilt/boot.img b/prebuilt/boot.img index d75ed60..36ce063 100644 --- a/prebuilt/boot.img +++ b/prebuilt/boot.img @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3473752ada977968bab883d67971511be586c1b9f7bb1006931ac4ee228abab +oid sha256:71309266cca377bd6b0058e2d084aa690d731d7e4908ec14532486c0f6c334f5 size 21757952 diff --git a/prebuilt/dtbo.img b/prebuilt/dtbo.img index da5c14e..e69de29 100644 --- a/prebuilt/dtbo.img +++ b/prebuilt/dtbo.img @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be00165af25e1420d9827ef3a247e98eb290a2b7230e62b130a1ad8c08b18280 -size 216513 diff --git a/prebuilt/flash.sh b/prebuilt/flash.sh index f7b7074..ddf31b9 100755 --- a/prebuilt/flash.sh +++ b/prebuilt/flash.sh @@ -3,10 +3,10 @@ fastboot flash vbmeta vbmeta_disabled.img fastboot flash vbmeta_system vbmeta_disabled.img fastboot flash vbmeta_vendor vbmeta_disabled.img -fastboot flash boot boot.img fastboot flash dtbo dtbo.img +fastboot flash boot boot.img # kernel fastboot reboot fastboot # fastbootd mode -fastboot delete-logical-partition product -fastboot flash system system.img +# fastboot delete-logical-partition product +fastboot flash userdata system.img # rootfs fastboot reboot diff --git a/prebuilt/system.img b/prebuilt/system.img index 179774b..ae5f896 100644 --- a/prebuilt/system.img +++ b/prebuilt/system.img @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:43d064e5ab487702fd296201983c41292c4d52d53d6d1de10a8fa700a0361cab -size 428867584 +oid sha256:75a93cfd7ea94fe42645c4e62812a4009eaafe4468f6bb92fdddc962b3911150 +size 586879684 diff --git a/prebuilt/update.sh b/prebuilt/update.sh new file mode 100755 index 0000000..ebece76 --- /dev/null +++ b/prebuilt/update.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +pmbootstrap export +cp /tmp/postmarketOS-export/boot.img boot.img +cp /tmp/postmarketOS-export/xiaomi-angelican.img system.img diff --git a/reinit-pmbootstrap-work.sh b/reinit-pmbootstrap-work.sh deleted file mode 100755 index 5e02f6a..0000000 --- a/reinit-pmbootstrap-work.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -source extract-paths.sh -pmbootstrap -y zap -pmbootstrap shutdown -sudo rm -rf $PMWORK - -python3 - <<'EOF' -import subprocess, time, os - -proc = subprocess.Popen( - ["pmbootstrap", "init"], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - text=True, - bufsize=1 -) - -def skip_question(wait_for=""): - while wait_for not in proc.stdout.readline(): - time.sleep(0.1) - proc.stdin.write("\n") - proc.stdin.flush() - -skip_question() - -os.system(f"git clone https://gitlab.postmarketos.org/postmarketOS/pmaports.git {os.environ['PMAPORTS']}") - -skip_question() - -os.system(f"ln -s {os.environ['PWD']}/linux-xiaomi-angelican {os.environ['PMAPORTS']}/device/testing") -os.system(f"ln -s {os.environ['PWD']}/device-xiaomi-angelican {os.environ['PMAPORTS']}/device/testing") - -skip_question("Channel") - -for _ in range(4): - skip_question() - -skip_question("User interface") - -for _ in range(9): - skip_question() - -proc.wait() -EOF diff --git a/shell.nix b/shell.nix index 5a3efaa..7f21758 100644 --- a/shell.nix +++ b/shell.nix @@ -12,13 +12,6 @@ pkgs.mkShell { ]; shellHook = '' -# export PMWORK=$PWD/.pmbootstrap -# export PMAPORTS=$PMWORK/cache_git/pmaports -# mkdir -p $PMWORK -# if [ ! -d $PMAPORTS ]; then -# mkdir -p $PMWORK/cache_git -# git clone https://gitlab.postmarketos.org/postmarketOS/pmaports.git $PMAPORTS -# fi source extract-paths.sh if [ ! -L $PMAPORTS/device/testing/linux-xiaomi-angelican ]; then ln -s $PWD/linux-xiaomi-angelican $PMAPORTS/device/testing @@ -26,25 +19,5 @@ pkgs.mkShell { if [ ! -L $PMAPORTS/device/testing/device-xiaomi-angelican ]; then ln -s $PWD/device-xiaomi-angelican $PMAPORTS/device/testing fi -# if [ ! -f $PMWORK/pmbootstrap.conf ]; then -# cat > $PMWORK/pmbootstrap.conf < $PMWORK/version -# fi -# alias pmbootstrap="\ -# \pmbootstrap \ -# --aports $PMAPORTS \ -# --work $PMWORK \ -# " ''; }