【每周学习摘要15(23/12/30-24/01/05)】

ubuntu-base 不能获取串口的原因

卡在serial getty’
原因:没有安装udev
source

mplayer 播放

mplayer -vo fbdev2:/dev/fb1 -vf scale=240:135 -geometry 0:50 -fps 30 -ao alsa:device=hw=0.0 badapple.mp4
alsa那里 hw=0.0 可以用aplay -l 查看card:device
如果是用drm产生的fb需要用fbdev2:/dev/fb0,其他比如fbtft的就用fbdev:/dev/fb0

mpg123使用

mpg123 -o alsa:hw:0,0 mican*\ -\ Deadline.mp3
同理

ubuntu-base移植libmali

参考仓库mirror
其中我看到官方rk的buildroot镜像里面,libEGL,libgbm的大小都是一样的里面有libmali_hook.so.1的调用关系
现在知道libmali_hook怎么生成(在刚才那个仓库的hook文件夹下),
然后libegl,libgbm什么的大小竟然都一样

(base) ➜  lib ls -l libgbm.so.1 libEGL.so.1 libGLESv1_CM.so.1 libGLESv2.so.2 
-rwxr-xr-x 1 root root 5784  9月 14 17:01 libEGL.so.1
-rwxr-xr-x 1 root root 5784  9月 14 17:01 libgbm.so.1
-rwxr-xr-x 1 root root 5784  9月 14 17:01 libGLESv1_CM.so.1
-rwxr-xr-x 1 root root 5784  9月 14 17:01 libGLESv2.so.2
(base) ➜  

补充:这些libegl,libgbm什么的都是一些wrapper库,具体创建过程在这个脚本里
meson.build
我到时候解读一下然后换成用普通命令创建,不用meson

【每周学习摘要14(23/12/23-23/12/29)】

手动编译最新版本的rockchip bsp linux

CrossCompile Toolchain

首先交叉编译工具链可以从linaro下载,这个无所谓

boot.img

boot.img是rockchip专有镜像格式 ,需要使用他们kernel仓库的Makefile里面的命令进行打包,具体原理暂时不清楚。
先把泰山派的设备树拷贝到kernel/arch/arm64/dts/rockchip/下面

export PATH="$PATH:/home/ztn/Embedded/Allwinner/Allwinner-H616/toolchains/bin"
ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- make tspi-rk3566-user-v10-linux.img -j32

然后可以得到boot.img,这个文件里面包含了内核镜像文件和设备树tspi-rk3566-user-v10-linux.dtb

u-boot.itb

这个文件是一个复合体
需要py2环境
然后利用rkdeveloptool,先加载bootloader到内存,然后烧录,然后再烧录boot.img,u-boot.itb

ZYNQ EBAZ4205

为什么正点原子的镜像启动不了,我猜是启动参数(比如DDR配置不一样)所以说开不起来。已经改了电阻了也不行。
别慌,明天自己编译一遍

【每周学习摘要13(23/12/16-23/12/22)】

RK3566 Drm Panel 驱动配置

1.dt-binding解读-2022-03-24 RK3566 MIPI屏 调试记录,panel-init-sequence 命令格式介绍
2.配置生成工具-original_mipi_init_sequence-to-rk_dts_panel_init_sequence-convert Public
panel节点是挂载在dsi0节点下面,如果对应spi屏幕的drm驱动,则是将panel节点挂载在spi0节点下面,参考嵌入式Linux使用TFT屏幕:使用树莓派4B的MIPI-DSI接口点亮ST7701S屏幕

关于怎么解读屏幕参数和时序,然后填写dts,参考RK3588-MIPI屏幕调试笔记:RK3588-MIPI-DSI之屏参配置
再具体的话,可以参考rockchip官方bsp仓库-drivers/gpu/drm/panel/panel-simple.c
arch/arm64/boot/dts/rockchip

eDP屏幕相关

RK3568 EDP接口调试

RockChip编译教程

其实可以单独下载github上rockchip-linux的官方bsp linux,u-boot仓库单独编译
也可以设置上次那个H616里面的工具链
但是在make.sh的第273行需要把none加进去
然后需要clone rkbin到同级目录

CROSS_COMPILE_ARM64=$(cd `dirname ${CROSS_COMPILE_ARM64}`; pwd)"/aarch64-none-linux-gnu-"

具体操作可以看toybrick的仓库里面的make.sh,也可以使用官方推荐的
比如
软件开发/U-Boot

具体编译

Rockchip-linux kernel-5.10

git clone https://github.com/rockchip-linux/kernel.git -b develop-5.10 --depth 1
cd kernel
ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- make rockchip_linux_defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- make -j32

Rockchip-linux uboot

直接根据toybrick的进行编译,clone 他们自己的编译工具链后然后照做

./make.sh rk3566

rkdevelop-tool

需要切换到gcc-7/g++-7编译
具体操作自己看rkdeveloptool

在rk3566上编译taisei-v1.3

没什么好说的,甚至可以用自带的SDL
之前我以为自带的SDL有bug,其实是因为可能在mingw上面编译的缘故,编译完了有些东西针对mingw平台的没开,然后就启动不了窗口,只能通过pacman安装
想不到1G内存+tf卡这种丐版配置都能编译SDL2+taiseiv1.3
但是taisei和extreme-tux-tracer这两个游戏,以及glxinfo监测的时候都只察觉到了llvmpipe 这个软件渲染器。
但是glmark2-es2就可以完美利用GLES2
后来我才知道原来GLES2 API不一定需要EGL作为后端,也可以在GLX上面使用,然后glmark2-es2就是在X11上面通过GLX使用了GLES2的API
taisei和etr估计在链接的时候就用的是gl的API,所以fallback了到llvmpipe上面的api(mesa库提供的)
然后他们在运行的时候会显示

libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip

但是跑glmark2-es2就不会出现这些
根据那个Richardn2002兄弟的在stm32MP157上的源码STM32MP157F-DK2/blob/main/src/gl-test.c
可以知道,程序链接时需要链接GLESv2库而非GL,然后gl头文件需要用GLES2/gl2.h而非GL/gl.h
看SDL2的做法好像是用他们自己的头文件套了一层?这个有待研究。先准备math241 mid3先
然后找到的Xorg加载GLX的流程:Firefly3568-libGL error: failed to load driver: rockchip
3588上运行qt报错,请指教
GPU/Driver/libGL error on Rock 4C plus on Debian

GL4ES

将gl call 转换成gles call,且自己创建一个context。
用的时候把编译产生的libGL.so.1放到LD_LIBRARY_PATH就行。
然后只能运行gles2.0
然后可以玩etr但是很鬼畜,玩不了taisei

查看GPU使用率

RK查看gpu占用率方法

cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/load

转接板

st7701的屏幕:(0.5mm pitch),fl7703np(0.3mm pitch)

fl7703np转接板

排线 31pin 0.3mm 3块钱一根
31pin 0.3mm 排座 0.3一个,要两个
然后是3.3V转1.8V点LDO芯片,芯片准备用ME6206A18XG,输出电压1.8V,那个屏幕没说需要多大电流,然后SOT23-3封装最大功率300mW,所以没关系的。主要这个也便宜
这个转接板成本加起来可能就5块钱,所以还好
注意转接板要连接
泰山派上面的屏幕背光驱动芯片是SY7201,电流计算公式是I=0.2V/R
所以说驱动st7701s 20mA需要200mV/20mA=10Ohm作为反馈电阻,可以买两个20欧的电阻并联或者直接一个10欧电阻

【每周学习摘要12(23/12/09-23/12/15)】

STM32

STM32F334

官方HAL库如果用gdb调试则会卡在时钟设置,
但是用ChibiOS 的HAL/RT则没有任何问题。
尝试探索原因才发现,RCC->CR和RCC->CFGR并非上电后自动变成0,比如CFGR里面的SW一开始就是选择PLL的,但是官方HAL库没有进行检查
因此ChibiOS的启动文件里面手动对寄存器进行了清零
下面是ChibiOS里面的STM32F3xx/hal_lld.c的初始化函数,
HSI是默认开启的,因为手册里写RCC->CR resetval=0x0000 XX83
这里做了一次检查保证HSI先开起来。
总流程大概是

  • 1.先检查HSI开启
  • 2.配置CFGR,切换时钟源为HSI
  • 3.清空CFGR和CR(为初始值)
    HSI校正是自动的,

    CFGR2(HSEPrescale)不能写入

    要提前将SW切换到HSI


void stm32_clock_init(void) {

#if !STM32_NO_INIT
  /* HSI setup, it enforces the reset situation in order to handle possible
     problems with JTAG probes and re-initializations.*/
  RCC->CR |= RCC_CR_HSION;                  /* Make sure HSI is ON.         */
  while (!(RCC->CR & RCC_CR_HSIRDY))
    ;                                       /* Wait until HSI is stable.    */

  /* HSI is selected as new source without touching the other fields in
     CFGR. Clearing the register has to be postponed after HSI is the
     new source.*/
  RCC->CFGR &= ~RCC_CFGR_SW;                /* Reset SW, selecting HSI.     */
  while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_HSI)
    ;                                       /* Wait until HSI is selected.  */

  /* Registers finally cleared to reset values.*/
  RCC->CR &= RCC_CR_HSITRIM | RCC_CR_HSION; /* CR Reset value.              */
  RCC->CFGR = 0;                            /* CFGR reset value.            */

然后在STM32官方HAL库的HAL_RCC_OscConfig函数最前面加上清零

HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef  *RCC_OscInitStruct)
{
  uint32_t tickstart;
  uint32_t pll_config;
#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV)
  uint32_t pll_config2;
#endif /* RCC_CFGR_PLLSRC_HSI_PREDIV */
  // Added by TonyZhang, following ChibiOS's startup file
    RCC->CFGR &= ~RCC_CFGR_SW;                /* Reset SW, selecting HSI.     */
    while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_HSI)
        ;                                       /* Wait until HSI is selected.  */
    RCC->CR &= RCC_CR_HSITRIM | RCC_CR_HSION; /* CR Reset value.              */
    RCC->CFGR = 0;

对于什么是HSE Bypass

寄存器里可以配置HSE(告诉外部晶振)是否bypass,
如果选择bypass, 则接收外部时钟信号(有源晶振)
如果关闭bypass,则外部为无源晶振+陶瓷电容组成的振荡器,内部会开启反相器构成皮尔斯振荡器进行震荡

【每周学习摘要09(23/11/18-23/11/24)】

全志A33

核心板

经典核心板
1.锐尔威视A33-VSTAR
2.芯灵思SINLinx-SinA33
其中第二个有主线支持

开发包下载

1.一牛网
https://pan.baidu.com/s/13tXGCSaP4LRRM9uD5VqEiQ 9cpd
2.BSP开发包下载链接: https://pan.baidu.com/s/1jIvJiOu 密码: p6w7
source

编译教程

1.全志A33编译环境搭建
2.SINA33-V1.0 android系统的编译过程
3.whycan
241加油,先不弄了

在主线运行Mali GPU驱动(A33 Utgard)

sunxi的page发现的,一个是在bsp kernel加载ARM驱动(已经过时),还有一个是在主线加载驱动
当运行ARM闭源驱动的时候,运行eglinfo时看到Vendor就不是panfrost/lima而是ARM,但是不支持GLX,只支持EGL,但是可以用OpenVG,OpenCL等API(如果有)
参考bootlin的文章
这个r9p0是DDK的版本,一个DDK分为内核部分和用户空间部分
内核部分按照GPLv2开源
用户空间驱动由rk,全志,Amlogic这种签了协议的编译发布二进制blob

Xorg/GPU/APIs

术语表
EXA: Acceleration architecture with no well-defined acronym. Based on the kdrive acceleration architecture (KAA) but with some additional features and cleanups, and designed to be used within the xfree86 DDX.
DDX: Device Dependent X. The part of X that interacts with the hardware. There have been many of these over the years:xfree86, kdrive, xwin (for Windows), darwin (for OS X), xgl, vfb, xnest, and so forth. In the X server code, each directory under hw corresponds to one DDX. One DDX may have one or more device drivers. In the xfree86 DDX, each driver is a separate loadable module; in most of the other DDXes, each driver is compiled to its own server binary. Contrast: DIX.
EGL可以理解为一个API,然后通过EGL与X11的API,可以与XOrg交互。具体源码SimpleGL_example,也可以看A33主线Linux跑起OpenGL/ES
然后EGL底层有GBM/EGLStream等实现显存管理的方法,也可以是fbdev这种最基础的,见Fbdev的局限性-ARM
Wayland只是上层建筑,它可以基于GBM/EGLStream/fbdev(deprecated)这些backend...,详见Wayland-ArchWiki

瑞芯微

瑞芯微启动过程

https://opensource.rock-chips.com/wiki_Boot_option
不像全志,瑞芯微有两套启动方案,一套是闭源的二进制miniloader,还有一套是开源的u-boot TPL/SPL方案
原厂u-boot

生成ddr配置

在rkbin/tools里面有ddrbin_tool
可以用来生成ddr配置

11:29:23 ztn@DESKTOP-9D7T4FN rkbin ±|master ✗|→ ddrbin_tool -g gen_param.txt rv1126_ddr_784MHz_v1.09.bin
ddrbin_tool -g gen_param.txt rv1126_ddr_784MHz_v1.09.bin
version v1.15 20230530

【每周学习摘要08(23/11/11-23/11/17)】

软件

安装Latex于Ubuntu

source

探究为什么暑假七月份在Ubuntu23.04上制作根文件系统不能被内核识别

内核提示 e2fsck has unsupported feature(s): FEATURE_C12
这是因为ubuntu23.04的e2fsck添加了个新的特性orphan_file(就是FEATURE_C12,只不过老的内核不认识这个叫orphan_file)并且默认开启了
但是好像在ubuntu23.10中不会默认开启,具体细节可以看/etc/mke2fs.conf
source1

According to release notes, the feature added in version 1.47.0 is orphan_file. And it was also added to the list of default features for e2fsck.
So if a filesystem was created with e2fsck 1.47.0 then it will have this feature enabled by default.

解决方法

tune2fs -O ^orphan_file /dev/mydevice
e2fsck -f /dev/mydevice

第二个命令是为了移除相关inode,-O是指定feature, ^相当于not
source2
source3
source4
tune2fs -l 查看文件系统属性

 tune2fs -l /dev/sda2 

V3s录音,以及之后需要的语音识别

V3s codec实现了录音驱动,但是默认dts没开,需要手动设置成okay.
source
之后可以用alsa的api采集pcm数据,然后通过阿里云的语音识别api(他们有C++ SDK)
智能语音交互-阿里云

关于ChatGPT集成可参考树莓派Linux实现ChatGPT语音交互(语音识别,TTS)
到时候比如人物角色识别可以用到阿里云的热词功能热词

车万云音乐

接口

帮助:音乐资料API
目前工作内容:

【分类组】无蛋黄 1:17:34
我想要一个网易云歌单与wiki曲库定期进行同步的小工具
【分类组】无蛋黄 1:18:57
还要一个在wiki曲目列表上播放网易云相关曲目链接的小播放按钮
【分类组】无蛋黄 1:19:15
之前狮子做过一个,现在不知道怎么用了

仓库地址
车万云

MacOS

处理未签名应用无法执行的问题
cant-execute-binary-on-macos-catalina
mac_procs_unsigned.html
如果binary叫foo

spctl --add foo
xattr -d com.apple.quarantine foo

嵌入式

低成本WCH DapLink方案

WCH Link,采用51内核CH549G方案
简介:成本4元的wchlink/daplink,使用ch549g

Computer Vision

关于学习的一些指导
source
作为目前在华为美国研究所实习的博士生。拿计算机视觉领域,重要的不是看,而是 做 和 写。跟进自己领域的文章,重点是看一些自己领域的活跃的大牛的文章(重点是开源代码的文章),而且要去看代码和跑代码。看其他顶会的文章,不能说没用,但是,效率极低,他们不会开源代码、不会告诉你细节,可能你看的例如CVPR文章是编的。新手入门大概就看本领域SOTA 模型 且带代码的跑出来,3-4篇搞定即可,顶会实验对照也是找3-4个模型比较,搞定后才知道这些模型的不足。再去看最前沿的技术,比如目前的语言模型 和 diffusion ,同样实践很重要,看如何加入自己领域的模型做改进。写文章更重要,很多人做一堆实验却不想写,白白浪费时间和浪费顶会投稿的机会(投就有25%到50%的录取机会,录取率看分支领域,你投稿时即使被拒,审稿人都会写一堆审稿意见的,你改进后,投下一个会议的命中率会大大提升)。

Ubuntu KDE

解决单击打开Dolphin文件的问题

System SettingsWorkspace Behavior中的Clicking files or folders改成Selects them
source

解决sddm开屏键盘问题

vim /etc/sddm.conf

输入

InputMethod=

source

miniconda3 无法被zsh找到安装的文件

.zshrc中添加~/miniconda3/bin路径
source

sddm 添加主题

我个人喜欢breeze,比较好看
先安装

sudo apt install sddm-theme-maya
sddm-greeter --test-mode --theme /usr/share/sddm/themes/maya
sudo apt install sddm-theme-breeze
sddm-greeter --test-mode --theme /usr/share/sddm/themes/breeze

一个是测试一个是安装
然后在/etc/sddm.conf中添加

[Theme]
Current=breeze

即可

【每周学习摘要06(23/10/27-23/11/10)】

Allegro/PCB

调整历史编辑的buffer大小

source [OrCAD PCB] Undo history constantly disappears
source2 Only 100 undo-levels / 500MB for undo? Any way to increase that further?
搜索Undo_depth设置并将其设置为100,将max_undo_memory设置成500
"Specify the maximum memory (in MB) for storing undo history. Default is 20 MegaBytes. Range is 0 to 500."

"Specify the maximum number of commands for Undo history. More undo history takes more memory. Default is 10 commands. Range is 0 to 100 commands. The actual number of commands in the undo buffer is dynamically determined based upon this value and the undo memory consumed to undo each command, the total of which must not exceed max_undo_memory."

关于全志H3双DDR T型走线

首先,我是菜鸟,默认线宽4mil(太粗了走起来要去世,或者只能牺牲线距,这样综合起来还不如线宽4mil,然后减少串扰,因为同样是4mil,Yuzuki大佬能跑到DDR3 1866,也就是936MHz稳定24小时source,然而如果严格按照阻抗线宽只能到336Mhz CLK)
先拉通全部,先拉SDQ/SDQM/SDQS(差分信号)
再等长T到DDR(20mil),然后再等长Soc到T(30mil,ODTx/CSx/CKEx;600mil Other CMD/Address)
最后布电源,放置电容
具体请参考RK3568的PCB Layout手册(这是通用的)

代办:改天画一画六层板的单DDR,或者四层板TDDR

电控

STM32F334无法用OpenOCD0.12.0烧录

提示错误

** Programming Started **
Info : device id = 0x10016438
Info : flash size = 64 KiB
Warn : Adding extra erase range, 0x08005ebc .. 0x08005fff
Error: error writing to flash at address 0x08000000 at offset 0x00000000
embedded:startup.tcl:1467: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1532
at file "embedded:startup.tcl", line 1467

解决方法:切换OpenOCD版本为0.11或者0.10

软件

VM Ware 虚拟机在windows11下卡顿

用管理员权限运行VMWare Workstation

How to install multiple GCC versions under Ubuntu

gcc in ppa:ubuntu-toolchain-r/rest

source
first add ppa of host toolchains

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

Then you can install gcc-7 for example

sudo apt-get install gcc-7
sudo apt-get install g++-7

also you can install gcc-8,gcc-9
After that, use update-alternatives to manage different gcc versions

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 130
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130

after that, use sudo update-alternatives --config gcc to switch between gcc versions
for example,

➜  u-boot-v2020.04-rc1 sudo update-alternatives --config gcc
There are 7 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-13    130       auto mode
  1            /usr/bin/gcc-12    100       manual mode
  2            /usr/bin/gcc-13    130       manual mode
  3            /usr/bin/gcc-4.8   48        manual mode
* 4            /usr/bin/gcc-6     60        manual mode
  5            /usr/bin/gcc-7     70        manual mode
  6            /usr/bin/gcc-8     80        manual mode
  7            /usr/bin/gcc-9     90        manual mode

Press <enter> to keep the current choice[*], or type selection number: 4 
➜  u-boot-v2020.04-rc1 gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.5.0-2ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.5.0 20181026 (Ubuntu 6.5.0-2ubuntu1~18.04)

Then you can use an old gcc version to compile some old codebases(e.g. u-boot-v2020.04), which may have errors like

/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here

I have tested gcc version 6,7,8,9 compatible with u-boot-v2020-04(i.e. the version used in Allwinner A33)

very old gcc

As for very old gcc versions, you can install them manually by downloading each deb package and install them using apt install ./*.deb

gcc-4.8

source

wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/g++-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/libstdc++-4.8-dev_4.8.5-4ubuntu8_amd64.deb 
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8-base_4.8.5-4ubuntu8_amd64.deb 
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/libgcc-4.8-dev_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/cpp-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-4.8/libasan0_4.8.5-4ubuntu8_amd64.deb
gcc-6
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/g++-6_6.5.0-2ubuntu1~18.04_amd64.deb 
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/libstdc++-6-dev_6.5.0-2ubuntu1~18.04_amd64.deb 
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/gcc-6-base_6.5.0-2ubuntu1~18.04_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/gcc-6_6.5.0-2ubuntu1~18.04_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/libgcc-6-dev_6.5.0-2ubuntu1~18.04_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/cpp-6_6.5.0-2ubuntu1~18.04_amd64.deb
wget http://mirrors.aliyun.com/ubuntu/pool/universe/g/gcc-6/libasan3_6.5.0-2ubuntu1~18.04_amd64.deb
wget https://mirrors.aliyun.com/oldubuntu-releases/ubuntu/pool/main/i/isl/libisl19_0.20-2_amd64.deb

后来发现上述方法,不是很好,要一个一个自己找包

第二个办法:
我想通过将apt的source改成zesty(ubuntu16)来下载gcc-6的deb系统包(省的自己一个一个下载)
通过将/etc/apt/source.list 修改为

deb http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty restricted main multiverse
deb-src http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty restricted main multiverse
deb http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-security restricted main multiverse
deb-src http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-security restricted main multiverse
deb http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-updates restricted main multiverse
deb-src http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-updates restricted main multiverse
deb http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-proposed restricted main multiverse
deb-src http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-proposed restricted main multiverse
deb http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-backports restricted main multiverse
deb-src http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ zesty-backports restricted main multiverse

在运行sudo apt update后出现

08:27:40 root@ztn-virtual-machine apt → sudo apt update
Get:1 http://mirrors.aliyun.com/oldubuntu-releases/ubuntu zesty InRelease [243 kB]
Err:1 http://mirrors.aliyun.com/oldubuntu-releases/ubuntu zesty InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32

提示缺少PUBKEY,不知道什么原因,但是找到了个解决办法
然后通过source

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \<PUBKEY>
然后运行 sudo apt-get update
PUBKEY是之前错误里提到的3B4FE6ACC0B21F32

然后就可以update了
只下载不安装(避免一股脑安装,污染环境,因为宿主机的版本比较高,万一安装后直接冲突了)
source
最后用 sudo apt install --download-only gcc-6
然后需要的deb包在/var/cache/apt/archives下面
经确认后没有卸载重要的东西,就可以直接install

关于有些key就算添加后也不行

请在deb 后加[trusted=yes]
比如Ubuntu14.04(precise)的source
source

deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-security restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-security restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-updates restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-updates restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-proposed restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-proposed restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-backports restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ precise-backports restricted main multiverse

一些有趣的

ubuntu的最老版本是warty,然后可以通过它安装gcc-3.3,乐
只要把source.list改成

deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-security restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-security restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-updates restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-updates restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-proposed restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-proposed restricted main multiverse
deb [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-backports restricted main multiverse
deb-src [trusted=yes] http://mirrors.aliyun.com/oldubuntu-releases/ubuntu/ warty-backports restricted main multiverse

Ubuntu-Base无法启动

制作过程:TODO
启动的时候发现
linux内核找不到init (在/sbin,/bin,/etc下分别都找不到),于是将sh作为init,最后返回了0,最终kernel panic
我一开始还以为是sh的问题,其实不是

[    1.218696] Freeing unused kernel image (initmem) memory: 1024K
[    1.224899] Run /sbin/init as init process
[    1.245210] Run /etc/init as init process
[    1.257686] Run /bin/init as init process
[    1.264066] Run /bin/sh as init process
/bin/sh: 0: [    1.357755] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200
[    1.366350] CPU: 0 PID: 1 Comm: sh Not tainted 6.4.0-rc4-licheepi-zero+ #3

于是chroot进入rootfs_ubuntubase
安装init程序:systemd
后来才发现不是安装了就能启动的,要手动链接init到systemd
后来不小心链接错了链接成了一个文件夹/usr/lib/systemd而不是可执行文件/usr/bin/systemd(这个sb错误是因为我whereis systemd的时候打印出来多个路径,但不全是可执行文件的路径,例如前者,可能只是配置文件的目录),于是便出来这样一句话 Starting init: /sbin/init exists but couldn't execute it (error -13)

[    1.250665] Starting init: /sbin/init exists but couldn't execute it (error -13)
[    1.258103] Run /etc/init as init process
[    1.270511] Run /bin/init as init process
[    1.276655] Run /bin/sh as init process
[    1.299521] Starting init: /bin/sh exists but couldn't execute it (error -5)

修改完后又出现了

[    1.229850] Run /sbin/init as init process
[    1.254215] Starting init: /sbin/init exists but couldn't execute it (error -8)
[    1.261680] Run /etc/init as init process
[    1.273782] Run /bin/init as init process
[    1.278326] Run /bin/sh as init process

真是要让我所有坑都踩一遍的节奏啊
一查发现error -8 是程序的架构不一样?
好像也不是,有可能是ubuntubase太新了?
切换为ubuntubase16.04,然后就能启动了
成功配置一番后,启动时发现

[  OK  ] Started Getty on tty5.
[ TIME ] Timed out waiting for device dev-ttyS0.device.
[DEPEND] Dependency failed for Serial Getty on ttyS0.

参考source
修好后又发现一个jb问题。。。弄不动了,还是简单buildroot吧

/usr/bin/lesspipe: 295: [: =: unexpected operator

回马枪:后来才发现,原来是自己往sd卡里拷贝根文件系统,然后cp -r . /mnt 完了,以为结束了命令,sd卡就全部考好了,然后发现无法umount /mnt,没有等待就直接把sd卡拔了,才会出现这个295的问题。
后来发现这个同样是之前/sbin/init 出现-8的原因。

现在重新基于ubuntu-base 22.04制作根文件系统

制作的宿主机:Ubuntu2310

先拷贝qemu-arm-static,修改/etc/resolve.conf域名服务器

sudo cp /usr/bin/qemu-arm-static ./usr/bin/
sudo echo "nameserver 114.114.114.114"  > ./etc/resolv.conf

然后将/etc/apt/source.list中port.ubuntu.com改成source.aliyun.com
然后用chroot进入根文件系统

sudo chroot rootfs_ub2204

然后运行apt update 出现签名错误

Reading package lists... Done
W: GPG error: http://mirrors.aliyun.com/ubuntu-ports jammy InRelease: Couldn't create temporary file /tmp/apt.conf.OUHf2E for passing config to apt-key
E: The repository 'http://mirrors.aliyun.com/ubuntu-ports jammy InRelease' is not signed.

并加上[trusted=yes]防止签名错误,或者是chmod 777 /tmp

deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy main restricted
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates main restricted
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy universe
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates universe
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy multiverse
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates multiverse
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-security main restricted
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-security universe
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-security multiverse

之后就可以apt update了
然后安装systemd,和一些基本包

apt install vim sudo kmod net-tools ethtool ifupdown language-pack-en-base rsyslog htop iputils-ping -y
apt install systemd

然后修改root密码

passwd root

然后修改ttyS0不能启用getty服务的问题

cp /lib/systemd/system/serial-getty@.service /lib/systemd/system/serial-getty@ttyS0.service
ln -s /lib/systemd/system/serial-getty@ttyS0.service /etc/systemd/system/getty.target.wants/

再修改/lib/systemd/system/serial-getty@ttyS0.service把里面的“dev-%i.device”改为“dev-%i”
最后创建/sbin/init软连接(这个在ubuntu-base16.04是自带的,所以说要多这么一步,自己安装并链接systemd)

sudo ln -s /lib/systemd/systemd /sbin/init

最后拷贝kernel modules

➜  rootfs_ub2204 cp -r  ~/linux/out/lib/modules ./lib/
➜  rootfs_ub2204 ls lib/modules/6.4.0-rc4-licheepi-zero+/
build          modules.alias.bin          modules.builtin.bin      modules.dep.bin  modules.softdep      source
kernel         modules.builtin            modules.builtin.modinfo  modules.devname  modules.symbols
modules.alias  modules.builtin.alias.bin  modules.dep              modules.order    modules.symbols.bin

注意 ~/linux 是我编译的主线Linux6.4的路径,具体编译命令为

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j32 INSTALL_MOD_PATH=out modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j32 INSTALL_MOD_PATH=out modules_install

最后拷贝根文件系统(u-boot和第一分区已经提前弄好了)

➜  rootfs_ub2204 sudo mount /dev/sda2 /mnt 
➜  rootfs_ub2204 sudo rm -rf /mnt/*
➜  rootfs_ub2204 sudo cp -r . /mnt 

最后激动人心的时候来了

U-Boot SPL 2023.10-rc4-g25259221 (Sep 16 2023 - 13:45:23 +0800)
DRAM: 64 MiB
Trying to boot from MMC1

U-Boot 2023.10-rc4-g25259221 (Sep 16 2023 - 13:45:23 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
Core:  31 devices, 14 uclasses, devicetree: separate
WDT:   Not starting watchdog@1c20ca0
MMC:   mmc@1c0f000: 0
Loading Environment from FAT... OK
In:    serial@1c28000
Out:   serial@1c28000
Err:   serial@1c28000
Hit any key to stop autoboot:  0 
4926688 bytes read in 207 ms (22.7 MiB/s)
11445 bytes read in 4 ms (2.7 MiB/s)
Kernel image @ 0x41000000 [ 0x000000 - 0x4b2ce0 ]
## Flattened Device Tree blob at 42000000
   Booting using the fdt blob at 0x42000000
Working FDT set to 42000000
   Loading Device Tree to 42d64000, end 42d69cb4 ... OK
Working FDT set to 42d64000

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 6.4.0-rc4-licheepi-zero+ (ztn@ztn-Legion-Y9000P-IRX8) (arm-linux-gnueabihf-gcc (Linaro GCC 7.53
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 12 pages/cpu s16724 r8192 d24236 u49152
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 earlyprintk rw
[    0.000000] Unknown kernel command line parameters "earlyprintk", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 52548K/65536K available (7168K kernel code, 722K rwdata, 2020K rodata, 1024K init, 290K bss, 12988K )
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000002] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000018] Switching to timer-based delay loop, resolution 41ns
[    0.000221] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000616] Console: colour dummy device 80x30
[    0.000692] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000715] pid_max: default: 32768 minimum: 301
[    0.000938] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000964] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001784] CPU: Testing write buffer coherency: ok
[    0.002339] /cpus/cpu@0 missing clock-frequency property
[    0.002386] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.004172] Setting up static identity map for 0x40100000 - 0x40100060
[    0.004499] rcu: Hierarchical SRCU implementation.
[    0.004513] rcu:     Max phase no-delay instances is 1000.
[    0.005384] smp: Bringing up secondary CPUs ...
[    0.005406] smp: Brought up 1 node, 1 CPU
[    0.005419] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.005429] CPU: All CPU(s) started in HYP mode.
[    0.005432] CPU: Virtualization extensions available.
[    0.006221] devtmpfs: initialized
[    0.009999] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.010346] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.010387] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.010645] pinctrl core: initialized pinctrl subsystem
[    0.012116] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.013029] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.014328] thermal_sys: Registered thermal governor 'step_wise'
[    0.014604] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.014626] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.024858] SCSI subsystem initialized
[    0.025002] usbcore: registered new interface driver usbfs
[    0.025048] usbcore: registered new interface driver hub
[    0.025107] usbcore: registered new device driver usb
[    0.025403] mc: Linux media interface: v0.10
[    0.025448] videodev: Linux video capture interface: v2.00
[    0.025677] Advanced Linux Sound Architecture Driver Initialized.
[    0.028822] clocksource: Switched to clocksource arch_sys_counter
[    0.043593] NET: Registered PF_INET protocol family
[    0.043930] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.044913] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.044965] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.044988] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.045011] TCP bind hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.045076] TCP: Hash tables configured (established 1024 bind 1024)
[    0.045226] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.045285] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.045626] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.047074] Initialise system trusted keyrings
[    0.048226] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.147778] Key type asymmetric registered
[    0.147807] Asymmetric key parser 'x509' registered
[    0.147959] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.147976] io scheduler mq-deadline registered
[    0.147985] io scheduler kyber registered
[    0.246913] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.254358] usbcore: registered new interface driver usb-storage
[    0.256416] sun6i-rtc 1c20400.rtc: registered as rtc0
[    0.256502] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:00:03 UTC (3)
[    0.256708] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.256900] i2c_dev: i2c /dev entries driver
[    0.257927] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.259286] sun4i-ss 1c15000.crypto: Die ID 7
[    0.260287] usbcore: registered new interface driver usbhid
[    0.260305] usbhid: USB HID core driver
[    0.262969] Initializing XFRM netlink socket
[    0.263055] NET: Registered PF_PACKET protocol family
[    0.263589] Registering SWP/SWPB emulation handler
[    0.270696] Loading compiled-in X.509 certificates
[    0.283566] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    0.286316] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.287096] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pb not found, using dummy regulator
[    0.289085] printk: console [ttyS0] disabled
[    0.309438] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 99, base_baud = 1500000) is a U6_16550A
[    0.309545] printk: console [ttyS0] enabled
[    0.987848] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pg not found, using dummy regulator
[    0.998229] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pf not found, using dummy regulator
[    1.008563] usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for exclusive requests
[    1.018952] musb-hdrc musb-hdrc.2.auto: MUSB HDRC host driver
[    1.024758] musb-hdrc musb-hdrc.2.auto: new USB bus registered, assigned bus number 1
[    1.037302] hub 1-0:1.0: USB hub found
[    1.041342] hub 1-0:1.0: 1 port detected
[    1.046989] clk: Disabling unused clocks
[    1.051191] ALSA device list:
[    1.054177]   No soundcards found.
[    1.068886] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.076241] Waiting for root device /dev/mmcblk0p2...
[    1.115308] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.125297] mmc0: new high speed SDHC card at address 0001
[    1.132354] mmcblk0: mmc0:0001 Y2212 29.4 GiB 
[    1.140085]  mmcblk0: p1 p2
[    1.187563] EXT4-fs (mmcblk0p2): mounted filesystem 7899e2fa-1cd0-43c1-910b-7a09abd1d1cb r/w with ordered data mode. Quo.
[    1.200290] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.214422] devtmpfs: mounted
[    1.218573] Freeing unused kernel image (initmem) memory: 1024K
[    1.224776] Run /sbin/init as init process
[    1.706094] systemd[1]: System time before build time, advancing clock.
[    1.743600] systemd[1]: Failed to find module 'autofs4'
[    1.772645] systemd[1]: systemd 249.11-0ubuntu3.11 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +S)
[    1.804908] systemd[1]: Detected architecture arm.

Welcome to Ubuntu 22.04.3 LTS!

[    1.840577] systemd[1]: Hostname set to <localhost.localdomain>.
[    2.955391] systemd[1]: /lib/systemd/system/serial-getty@ttyS0.service:14: Failed to add dependency on dev-ttyS0, ignorit
[    2.968511] systemd[1]: /lib/systemd/system/serial-getty@ttyS0.service:15: Failed to add dependency on dev-ttyS0, ignorit
[    3.040950] systemd[1]: Queued start job for default target Graphical Interface.
[    5.608802] random: crng init done
[    5.614751] systemd[1]: Created slice Slice /system/getty.
[  OK  ] Created slice Slice /system/getty.
[    5.650933] systemd[1]: Created slice Slice /system/modprobe.
[  OK  ] Created slice Slice /system/modprobe.
[    5.691913] systemd[1]: Created slice Slice /system/serial-getty.
[  OK  ] Created slice Slice /system/serial-getty.
[    5.730402] systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
[    5.769800] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[    5.809756] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[    5.849597] systemd[1]: Condition check resulted in Arbitrary Executable File Formats File System Automount Point being .
[    5.861682] systemd[1]: Reached target Local Encrypted Volumes.
[  OK  ] Reached target Local Encrypted Volumes.
[    5.899565] systemd[1]: Reached target Path Units.
[  OK  ] Reached target Path Units.
[    5.939297] systemd[1]: Reached target Remote File Systems.
[  OK  ] Reached target Remote File Systems.
[    5.979229] systemd[1]: Reached target Slice Units.
[  OK  ] Reached target Slice Units.
[    6.019353] systemd[1]: Reached target Swaps.
[  OK  ] Reached target Swaps.
[    6.059448] systemd[1]: Reached target Local Verity Protected Volumes.
[  OK  ] Reached target Local Verity Protected Volumes.
[    6.100335] systemd[1]: Listening on Syslog Socket.
[  OK  ] Listening on Syslog Socket.
[    6.139827] systemd[1]: Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[    6.200576] systemd[1]: Condition check resulted in Journal Audit Socket being skipped.
[    6.210404] systemd[1]: Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket (/dev/log).
[    6.250532] systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
[    6.289319] systemd[1]: Reached target Socket Units.
[  OK  ] Reached target Socket Units.
[    6.330202] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[    6.339434] systemd[1]: Condition check resulted in POSIX Message Queue File System being skipped.
[    6.379315] systemd[1]: Mounting Kernel Debug File System...
         Mounting Kernel Debug File System...
[    6.420391] systemd[1]: Condition check resulted in Kernel Trace File System being skipped.
[    6.431333] systemd[1]: systemd-journald.service: unit configures an IP firewall, but the local system does not support .
[    6.445072] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[    6.490248] systemd[1]: Starting Journal Service...
         Starting Journal Service...
[    6.525250] systemd[1]: Starting Helper to synchronize boot up for ifupdown...
         Starting Helper to synchronize boot up for ifupdown...
[    6.579629] systemd[1]: Condition check resulted in Create List of Static Device Nodes being skipped.
[    6.649964] systemd[1]: Starting Load Kernel Module configfs...
         Starting Load Kernel Module configfs...
[    6.690075] systemd[1]: Starting Load Kernel Module drm...
         Starting Load Kernel Module drm...
[    6.720344] systemd[1]: Starting Load Kernel Module efi_pstore...
         Starting Load Kernel Module efi_pstore...
[    6.759575] systemd[1]: Starting Load Kernel Module fuse...
         Starting Load Kernel Module fuse...
[    6.797271] systemd[1]: Starting Load Kernel Modules...
         Starting Load Kernel Modules...
[    6.840111] systemd[1]: Starting Remount Root and Kernel File Systems...
         Starting Remount Root and Kernel File Systems...
[    6.888692] systemd[1]: Started Journal Service.
[  OK  ] Started Journal Service.
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Finished Helper to synchronize boot up for ifupdown.
[  OK  ] Finished Load Kernel Module configfs.
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Finished Load Kernel Module efi_pstore.
[  OK  ] Finished Load Kernel Module fuse.
[  OK  ] Finished Load Kernel Modules.
[  OK  ] Finished Remount Root and Kernel File Systems.
         Mounting Kernel Configuration File System...
         Starting Flush Journal to Persistent Storage...
         Starting Load/Save Random Seed...
         Starting Apply Kernel Variables...[    7.398315] systemd-journald[52]: Received client request to flush runtime jo.

         Starting Create System Users...
[  OK  ] Mounted Kernel Configuration File System.
[  OK  ] Finished Load/Save Random Seed.
[  OK  ] Finished Apply Kernel Variables.
[  OK  ] Finished Flush Journal to Persistent Storage.
[  OK  ] Finished Create System Users.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Finished Create Static Device Nodes in /dev.
[  OK  ] Reached target Preparation for Local File Systems.
[  OK  ] Reached target Local File Systems.
         Starting Raise network interfaces...
         Starting Create Volatile Files and Directories...
[  OK  ] Finished Create Volatile Files and Directories.
         Starting Network Name Resolution...
         Starting Network Time Synchronization...
         Starting Record System Boot/Shutdown in UTMP...
[  OK  ] Finished Record System Boot/Shutdown in UTMP.
[  OK  ] Finished Raise network interfaces.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Basic System.
[  OK  ] Reached target System Time Set.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Started Daily dpkg database backup timer.
[  OK  ] Started Periodic ext4 Onli…ata Check for All Filesystems.
[  OK  ] Started Discard unused blocks once a week.
[  OK  ] Started Daily rotation of log files.
[  OK  ] Started Message of the Day.
[  OK  ] Reached target Timer Units.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Started Regular background program processing daemon.
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Save initial kernel messages after boot.
         Starting Remove Stale Onli…t4 Metadata Check Snapshots...
         Starting System Logging Service...
         Starting User Login Management...
[  OK  ] Started Network Name Resolution.
[  OK  ] Reached target Network.
[  OK  ] Reached target Host and Network Name Lookups.
         Starting Permit User Sessions...
[  OK  ] Started System Logging Service.
[  OK  ] Finished Permit User Sessions.
[  OK  ] Started Getty on tty1.
[  OK  ] Started Serial Getty on ttyS0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started User Login Management.
[  OK  ] Finished Remove Stale Onli…ext4 Metadata Check Snapshots.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Record Runlevel Change in UTMP...
[  OK  ] Finished Record Runlevel Change in UTMP.

Ubuntu 22.04.3 LTS localhost.localdomain ttyS0

localhost login: root
Password: 
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 6.4.0-rc4-licheepi-zero+ armv7l)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

root@localhost:~# uname -a
Linux localhost.localdomain 6.4.0-rc4-licheepi-zero+ #3 SMP Thu Nov  9 18:26:44 CST 2023 armv7l armv7l armv7l GNU/Linux
root@localhost:~# 

还有,我参考的v3s bootargs和bootcmd是来自这篇文章source

Something in the END

If you have any apt install problem with kernel dkms module compilation
check which gcc you have in global environment by /usr/bin/gcc -v

zsh关闭git插件

source

git config --global oh-my-zsh.hide-info 1   # git_prompt_info
git config --global oh-my-zsh.hide-status 1 # git_prompt_status
git config --global oh-my-zsh.hide-dirty 1  # parse_git_dirty

其实别开dirty就行了,卡的主要是dirty,每次新开一行都要检测dirty

Linux

安装Wine微信

source