|
本帖最后由 Andy201 于 2024-11-27 16:36 编辑
Cubieboard2 经典永不过时,装了个主线6.0 + u-boot2020,终于可以告别全志万年不变的 linux3.4 了,全部上最新配置。
本帖记录 CB2-uboot2020+linux6-卡启动篇,将数据都写进 SD卡里,将 SD卡插入 CB2 板上启动。
硬件要求:
- CubieBoard2 板子 x1
- 读卡器和容量大于 4G 的 micro SD 卡 x1 (也叫 TF 卡),建设使用闪迪或金士顿的 Class 10 卡
- 主机一台
- TTL 串口线或者使用显示器及鼠标键盘进入系统控制台
软件要求:
- 主机操作系统:请使用 Ubuntu16.04 64 位操作系统(或更往上版本)
- 安装交叉编译环境:gcc version 7.5.0 (Linaro GCC 7.5-2019.12)
- qemu
- debootstrap
卡启动流程:
上电——启动bootloader——启动内核——加载rootfs
卡启动所需文件:
- u-boot-sunxi-with-spl.bin
- sun7i-a20-cubieboard2.dtb
- zImage
- rootfs
- boot.scr
u-boot-sunxi-with-spl.bin 生成过程:
- 下载 u-boot 源码
- 切换分支到 v2020.01 (自行选择,在这里我用的是这个分支)
- 无需修改代码,直接编译
- # u-boot 源码也提供两个仓库地址,任选一个即可
- # github 仓库
- git clone https://github.com/u-boot/u-boot.git
- # gitee 镜像仓库
- git clone https://gitee.com/mirrors/u-boot.git
复制代码 注意:编译期间缺失的工具,工具报错打印提示自行安装。
至此,u-boot-sunxi-with-spl.bin 已生成。
sun7i-a20-cubieboard2.dtb 和 zImage 生成过程:
- 下载主线内核源码
- 切换分支至 v6.1-rc8
- 无需修改代码,直接编译
- # linux 源码仓库在 gitlab、github 上由 Linus Torvalds 维护
- git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
- git clone https://github.com/torvalds/linux.git
- # 由于 github 连接不稳定等原因,我们可以通过其它方式获取源码 —— 由 Gitee 官方
- # 提供的 Linux 源码的镜像仓库,每天同步一次。
- git clone https://gitee.com/mirrors/Linux.git
- # 目前(2024.9.13)最新的 v6.1 版本为 v6.1-rc8,所以这里选择 v6.1-rc8 版本。
- # 查看内核版本分支
- git branch -a # 查看所有分支
- git fetch --tags # 获取最新标签
- git tag | grep v6 # 查看并筛选标签名
- # 根据标签创建分支
- git checkout tags/v6.1-rc8
复制代码- #在 arch/arm/configs/ 目录下有许多开发板的预定义配置文件,这里我们选择 Allwinner Cubieboard2 的 sunxi_defconfig
- #以 sunxi_defconfig 为基础,生成 .config 配置文件
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
- ......
- #
- # configuration written to .config
- #
复制代码- #编译菜单项配置(这是一个需要不断调试的枯燥工作)
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
复制代码- #开始编译
- make -j$(nproc) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs
- ......
- OBJCOPY arch/arm/boot/zImage
- Kernel: arch/arm/boot/zImage is ready
复制代码
注意:kernel 可能会编译报错,记录如下问题
至此,zImage 和 sun7i-a20-cubieboard2.dts 已生成。
根文件系统 rootfs 生成过程:
- 下载根文件系统包
- 配置根文件系统 rootfs
- 备份打包 rootfs
- ## man debootstrap :
- # --no-check-gpg :Disables checking gpg signatures of retrieved Release files.
- #
- # 从 man 的示例 “debootstrap stretch ./stretch-chroot http://deb.debian.org/debian” 可知:
- # 这里允许自定义下载源,官方的地址已经不支持 wheezy 版本,这里通过指定阿里源来指定 debian 版本为 fullseye 或 bookworm
- #
- debootstrap --foreign --no-check-gpg --arch armhf bullseye . http://mirrors.aliyun.com/debian/
- # 如果要制作 ubuntu 根文件系统,则需要指定 ubuntu 的源
- debootstrap --foreign --no-check-gpg --arch armhf jammy . https://mirrors.aliyun.com/ubuntu-ports/
- cp /usr/bin/qemu-arm-static usr/bin/
- LC_ALL=C LANGUAGE=C LANG=C chroot . /debootstrap/debootstrap --second-stage
复制代码 注意:可能需要用到 sudo
- #下载不易,先行保存一份备用
- andy@andy:/work3/test/a20/rootfs$
- andy@andy:/work3/test/a20/rootfs$ ls
- bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
- andy@andy:/work3/test/a20/rootfs$ cd ../
- andy@andy:/work3/test/a20$ ls
- boot.cmd boot.cmd_2 chroot-armhf-bullseye-20241024_160515.tar.gz Linux-v6.1.tar.gz u-boot uImage
- boot.cmd_1 boot.scr Linux rootfs u-boot-2024.tar.gz
- andy@andy:/work3/test/a20$ sudo tar -czvf chroot-armhf_bullseye_cb2_`date +%Y%m%d_%H%M%S`.tar.gz rootfs/
复制代码- #配置根文件系统
- sudo chroot . passwd
- sudo chroot .
- echo "Cubieboard2" > etc/hostname && cat etc/hostname
- echo "127.0.0.1 Cubieboard2" >> etc/hosts && cat etc/hosts
- echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> etc/inittab && cat etc/inittab
- apt-get update
- apt-get install openssh-server locales wireless-tools wpasupplicant vim lrzsz net-tools ntpdate memtester
- echo "export LC_ALL="zh_CN.UTF-8""
- echo "en_US.UTF-8 UTF-8" > etc/locale.gen
- echo "zh_CN.UTF-8 UTF-8" >> etc/locale.gen
- exit
复制代码- #完整配置过程
- andy@andy:/work3/test/a20/rootfs$ sudo chroot . passwd
- qemu: Unsupported syscall: 403
- New password:
- Retype new password:
- qemu: Unsupported syscall: 384
- qemu: Unsupported syscall: 384
- qemu: Unsupported syscall: 384
- passwd: password updated successfully
- andy@andy:/work3/test/a20/rootfs$ sudo chroot .
- qemu: Unsupported syscall: 403
- root@andy:/# echo "Cubieboard2" > etc/hostname && cat etc/hostname
- Cubieboard2
- root@andy:/# echo "127.0.0.1 Cubieboard2" >> etc/hosts && cat etc/hosts
- 127.0.0.1 localhost
- ::1 localhost ip6-localhost ip6-loopback
- ff02::1 ip6-allnodes
- ff02::2 ip6-allrouters
- 127.0.0.1 Cubieboard2
- root@andy:/#
- root@andy:/#
- root@andy:/# echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> etc/inittab && cat etc/inittab
- T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100
- root@andy:/# apt-get update
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 384
- qemu: Unsupported syscall: 384
- 0% [Working]qemu: Unsupported syscall: 403
- Hit:1 http://httpredir.debian.org/debian bullseye InRelease
- 0% [Working]qemu: Unsupported syscall: 403
- Get:2 http://httpredir.debian.org/debian bullseye/main Translation-en [6235 kB]
- 95% [2 Translation-en store 0 B] 62.8 kB/s 0sqemu: Unsupported syscall: 403
- Fetched 6235 kB in 1min 17s (81.5 kB/s)
- Reading package lists... Done
- root@andy:/# apt-get upgrade
- qemu: Unsupported syscall: 403
- Reading package lists... Done
- Building dependency tree... Done
- Calculating upgrade... Done
- 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
- root@andy:/# apt-get install openssh-server locales wireless-tools wpasupplicant vim lrzsz net-tools ntpdate memtester
- qemu: Unsupported syscall: 403
- Reading package lists... Done
- Building dependency tree... Done
- The following additional packages will be installed:
- dbus libc-l10n libcbor0 libdbus-1-3 libexpat1 libfido2-1 libgpm2 libiw30 libnl-3-200 libnl-genl-3-200 libnl-route-3-200 libpam-systemd
- libpcsclite1 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 ncurses-term openssh-client openssh-sftp-server
- runit-helper ucf vim-runtime xauth
- Suggested packages:
- default-dbus-session-bus | dbus-session-bus gpm pcscd minicom keychain libpam-ssh monkeysphere ssh-askpass molly-guard ufw ctags vim-doc
- vim-scripts wpagui libengine-pkcs11-openssl
- qemu: Unsupported syscall: 384
- The following NEW packages will be installed:
- dbus libc-l10n libcbor0 libdbus-1-3 libexpat1 libfido2-1 libgpm2 libiw30 libnl-3-200 libnl-genl-3-200 libnl-route-3-200 libpam-systemd
- libpcsclite1 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 locales lrzsz memtester ncurses-term net-tools
- ntpdate openssh-client openssh-server openssh-sftp-server runit-helper ucf vim vim-runtime wireless-tools wpasupplicant xauth
- 0 upgraded, 37 newly installed, 0 to remove and 0 not upgraded.
- Need to get 18.5 MB of archives.
- After this operation, 75.4 MB of additional disk space will be used.
- Do you want to continue? [Y/n] y
- qemu: Unsupported syscall: 384
- 0% [Working]qemu: Unsupported syscall: 403
- Get:1 http://httpredir.debian.org/debian bullseye/main armhf libdbus-1-3 armhf 1.12.28-0+deb11u1 [200 kB]
- Get:2 http://httpredir.debian.org/debian bullseye/main armhf libexpat1 armhf 2.2.10-2+deb11u5 [78.4 kB]
- Get:3 http://httpredir.debian.org/debian bullseye/main armhf dbus armhf 1.12.28-0+deb11u1 [227 kB]
- Get:4 http://httpredir.debian.org/debian bullseye/main armhf libc-l10n all 2.31-13+deb11u11 [864 kB]
- Get:5 http://httpredir.debian.org/debian bullseye/main armhf libpam-systemd armhf 247.3-7+deb11u5 [263 kB]
- Get:6 http://httpredir.debian.org/debian bullseye/main armhf locales all 2.31-13+deb11u11 [4087 kB]
- Get:7 http://httpredir.debian.org/debian bullseye/main armhf ncurses-term all 6.2+20201114-2+deb11u2 [505 kB]
- Get:8 http://httpredir.debian.org/debian bullseye/main armhf libcbor0 armhf 0.5.0+dfsg-2 [19.6 kB]
- Get:9 http://httpredir.debian.org/debian bullseye/main armhf libfido2-1 armhf 1.6.0-2 [48.0 kB]
- Get:10 http://httpredir.debian.org/debian bullseye/main armhf openssh-client armhf 1:8.4p1-5+deb11u3 [845 kB]
- Get:11 http://httpredir.debian.org/debian bullseye/main armhf ucf all 3.0043 [74.0 kB]
- Get:12 http://httpredir.debian.org/debian bullseye/main armhf libgpm2 armhf 1.20.7-8 [34.8 kB]
- Get:13 http://httpredir.debian.org/debian bullseye/main armhf libiw30 armhf 30~pre9-13.1 [19.2 kB]
- Get:14 http://httpredir.debian.org/debian bullseye/main armhf libnl-3-200 armhf 3.4.0-1+b1 [55.5 kB]
- Get:15 http://httpredir.debian.org/debian bullseye/main armhf libnl-genl-3-200 armhf 3.4.0-1+b1 [19.4 kB]
- Get:16 http://httpredir.debian.org/debian bullseye/main armhf libnl-route-3-200 armhf 3.4.0-1+b1 [136 kB]
- Get:17 http://httpredir.debian.org/debian bullseye/main armhf libpcsclite1 armhf 1.9.1-1 [57.2 kB]
- Get:18 http://httpredir.debian.org/debian bullseye/main armhf libwrap0 armhf 7.6.q-31 [56.5 kB]
- Get:19 http://httpredir.debian.org/debian bullseye/main armhf libxau6 armhf 1:1.0.9-1 [19.0 kB]
- Get:20 http://httpredir.debian.org/debian bullseye/main armhf libxdmcp6 armhf 1:1.1.2-3 [24.9 kB]
- Get:21 http://httpredir.debian.org/debian bullseye/main armhf libxcb1 armhf 1.14-3 [136 kB]
- Get:22 http://httpredir.debian.org/debian bullseye/main armhf libx11-data all 2:1.7.2-1+deb11u2 [311 kB]
- Get:23 http://httpredir.debian.org/debian bullseye/main armhf libx11-6 armhf 2:1.7.2-1+deb11u2 [713 kB]
- Get:24 http://httpredir.debian.org/debian bullseye/main armhf libxext6 armhf 2:1.3.3-1.1 [47.8 kB]
- Get:25 http://httpredir.debian.org/debian bullseye/main armhf libxmuu1 armhf 2:1.1.2-2+b3 [23.3 kB]
- Get:26 http://httpredir.debian.org/debian bullseye/main armhf lrzsz armhf 0.12.21-10 [85.0 kB]
- Get:27 http://httpredir.debian.org/debian bullseye/main armhf memtester armhf 4.5.0-1 [19.0 kB]
- Get:28 http://httpredir.debian.org/debian bullseye/main armhf net-tools armhf 1.60+git20181103.0eebece-1+deb11u1 [236 kB]
- Get:29 http://httpredir.debian.org/debian bullseye/main armhf ntpdate armhf 1:4.2.8p15+dfsg-1 [152 kB]
- Get:30 http://httpredir.debian.org/debian bullseye/main armhf openssh-sftp-server armhf 1:8.4p1-5+deb11u3 [45.8 kB]
- Get:31 http://httpredir.debian.org/debian bullseye/main armhf runit-helper all 2.10.3 [7808 B]
- Get:32 http://httpredir.debian.org/debian bullseye/main armhf openssh-server armhf 1:8.4p1-5+deb11u3 [349 kB]
- Get:33 http://httpredir.debian.org/debian bullseye/main armhf vim-runtime all 2:8.2.2434-3+deb11u1 [6226 kB]
- Get:34 http://httpredir.debian.org/debian bullseye/main armhf vim armhf 2:8.2.2434-3+deb11u1 [1309 kB]
- Get:35 http://httpredir.debian.org/debian bullseye/main armhf wireless-tools armhf 30~pre9-13.1 [109 kB]
- Get:36 http://httpredir.debian.org/debian bullseye/main armhf wpasupplicant armhf 2:2.9.0-21+deb11u2 [1107 kB]
- Get:37 http://httpredir.debian.org/debian bullseye/main armhf xauth armhf 1:1.1-1 [37.7 kB]
- Fetched 18.5 MB in 19s (987 kB/s)
- perl: warning: Setting locale failed.
- perl: warning: Please check that your locale settings:
- LANGUAGE = "en_US",
- LC_ALL = (unset),
- LC_PAPER = "zh_CN.UTF-8",
- LC_NUMERIC = "zh_CN.UTF-8",
- LC_IDENTIFICATION = "zh_CN.UTF-8",
- LC_MEASUREMENT = "zh_CN.UTF-8",
- LC_NAME = "zh_CN.UTF-8",
- LC_TELEPHONE = "zh_CN.UTF-8",
- LC_ADDRESS = "zh_CN.UTF-8",
- LC_MONETARY = "zh_CN.UTF-8",
- LC_TIME = "zh_CN.UTF-8",
- LANG = "en_US.UTF-8"
- are supported and installed on your system.
- perl: warning: Falling back to the standard locale ("C").
- qemu: Unsupported syscall: 403
- /usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
- qemu: Unsupported syscall: 403
- Extracting templates from packages: 81%qemu: Unsupported syscall: 403
- Extracting templates from packages: 100%
- Preconfiguring packages ...
- qemu: Unsupported syscall: 403
- E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libdbus-1-3:armhf.
- (Reading database ... 9215 files and directories currently installed.)
- Preparing to unpack .../00-libdbus-1-3_1.12.28-0+deb11u1_armhf.deb ...
- Unpacking libdbus-1-3:armhf (1.12.28-0+deb11u1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libexpat1:armhf.
- Preparing to unpack .../01-libexpat1_2.2.10-2+deb11u5_armhf.deb ...
- Unpacking libexpat1:armhf (2.2.10-2+deb11u5) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package dbus.
- Preparing to unpack .../02-dbus_1.12.28-0+deb11u1_armhf.deb ...
- Unpacking dbus (1.12.28-0+deb11u1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libc-l10n.
- Preparing to unpack .../03-libc-l10n_2.31-13+deb11u11_all.deb ...
- Unpacking libc-l10n (2.31-13+deb11u11) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libpam-systemd:armhf.
- Preparing to unpack .../04-libpam-systemd_247.3-7+deb11u5_armhf.deb ...
- Unpacking libpam-systemd:armhf (247.3-7+deb11u5) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package locales.
- Preparing to unpack .../05-locales_2.31-13+deb11u11_all.deb ...
- Unpacking locales (2.31-13+deb11u11) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package ncurses-term.
- Preparing to unpack .../06-ncurses-term_6.2+20201114-2+deb11u2_all.deb ...
- Unpacking ncurses-term (6.2+20201114-2+deb11u2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libcbor0:armhf.
- Preparing to unpack .../07-libcbor0_0.5.0+dfsg-2_armhf.deb ...
- Unpacking libcbor0:armhf (0.5.0+dfsg-2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libfido2-1:armhf.
- Preparing to unpack .../08-libfido2-1_1.6.0-2_armhf.deb ...
- Unpacking libfido2-1:armhf (1.6.0-2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package openssh-client.
- Preparing to unpack .../09-openssh-client_1%3a8.4p1-5+deb11u3_armhf.deb ...
- Unpacking openssh-client (1:8.4p1-5+deb11u3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package ucf.
- Preparing to unpack .../10-ucf_3.0043_all.deb ...
- Moving old data out of the way
- Unpacking ucf (3.0043) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libgpm2:armhf.
- Preparing to unpack .../11-libgpm2_1.20.7-8_armhf.deb ...
- Unpacking libgpm2:armhf (1.20.7-8) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libiw30:armhf.
- Preparing to unpack .../12-libiw30_30~pre9-13.1_armhf.deb ...
- Unpacking libiw30:armhf (30~pre9-13.1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libnl-3-200:armhf.
- Preparing to unpack .../13-libnl-3-200_3.4.0-1+b1_armhf.deb ...
- Unpacking libnl-3-200:armhf (3.4.0-1+b1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libnl-genl-3-200:armhf.
- Preparing to unpack .../14-libnl-genl-3-200_3.4.0-1+b1_armhf.deb ...
- Unpacking libnl-genl-3-200:armhf (3.4.0-1+b1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libnl-route-3-200:armhf.
- Preparing to unpack .../15-libnl-route-3-200_3.4.0-1+b1_armhf.deb ...
- Unpacking libnl-route-3-200:armhf (3.4.0-1+b1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libpcsclite1:armhf.
- Preparing to unpack .../16-libpcsclite1_1.9.1-1_armhf.deb ...
- Unpacking libpcsclite1:armhf (1.9.1-1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libwrap0:armhf.
- Preparing to unpack .../17-libwrap0_7.6.q-31_armhf.deb ...
- Unpacking libwrap0:armhf (7.6.q-31) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libxau6:armhf.
- Preparing to unpack .../18-libxau6_1%3a1.0.9-1_armhf.deb ...
- Unpacking libxau6:armhf (1:1.0.9-1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libxdmcp6:armhf.
- Preparing to unpack .../19-libxdmcp6_1%3a1.1.2-3_armhf.deb ...
- Unpacking libxdmcp6:armhf (1:1.1.2-3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libxcb1:armhf.
- Preparing to unpack .../20-libxcb1_1.14-3_armhf.deb ...
- Unpacking libxcb1:armhf (1.14-3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libx11-data.
- Preparing to unpack .../21-libx11-data_2%3a1.7.2-1+deb11u2_all.deb ...
- Unpacking libx11-data (2:1.7.2-1+deb11u2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libx11-6:armhf.
- Preparing to unpack .../22-libx11-6_2%3a1.7.2-1+deb11u2_armhf.deb ...
- Unpacking libx11-6:armhf (2:1.7.2-1+deb11u2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libxext6:armhf.
- Preparing to unpack .../23-libxext6_2%3a1.3.3-1.1_armhf.deb ...
- Unpacking libxext6:armhf (2:1.3.3-1.1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package libxmuu1:armhf.
- Preparing to unpack .../24-libxmuu1_2%3a1.1.2-2+b3_armhf.deb ...
- Unpacking libxmuu1:armhf (2:1.1.2-2+b3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package lrzsz.
- Preparing to unpack .../25-lrzsz_0.12.21-10_armhf.deb ...
- Unpacking lrzsz (0.12.21-10) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package memtester.
- Preparing to unpack .../26-memtester_4.5.0-1_armhf.deb ...
- Unpacking memtester (4.5.0-1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package net-tools.
- Preparing to unpack .../27-net-tools_1.60+git20181103.0eebece-1+deb11u1_armhf.deb ...
- Unpacking net-tools (1.60+git20181103.0eebece-1+deb11u1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package ntpdate.
- Preparing to unpack .../28-ntpdate_1%3a4.2.8p15+dfsg-1_armhf.deb ...
- Unpacking ntpdate (1:4.2.8p15+dfsg-1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package openssh-sftp-server.
- Preparing to unpack .../29-openssh-sftp-server_1%3a8.4p1-5+deb11u3_armhf.deb ...
- Unpacking openssh-sftp-server (1:8.4p1-5+deb11u3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package runit-helper.
- Preparing to unpack .../30-runit-helper_2.10.3_all.deb ...
- Unpacking runit-helper (2.10.3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package openssh-server.
- Preparing to unpack .../31-openssh-server_1%3a8.4p1-5+deb11u3_armhf.deb ...
- Unpacking openssh-server (1:8.4p1-5+deb11u3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package vim-runtime.
- Preparing to unpack .../32-vim-runtime_2%3a8.2.2434-3+deb11u1_all.deb ...
- Adding \'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime\'
- Adding \'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime\'
- Unpacking vim-runtime (2:8.2.2434-3+deb11u1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package vim.
- Preparing to unpack .../33-vim_2%3a8.2.2434-3+deb11u1_armhf.deb ...
- Unpacking vim (2:8.2.2434-3+deb11u1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package wireless-tools.
- Preparing to unpack .../34-wireless-tools_30~pre9-13.1_armhf.deb ...
- Unpacking wireless-tools (30~pre9-13.1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package wpasupplicant.
- Preparing to unpack .../35-wpasupplicant_2%3a2.9.0-21+deb11u2_armhf.deb ...
- Unpacking wpasupplicant (2:2.9.0-21+deb11u2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Selecting previously unselected package xauth.
- Preparing to unpack .../36-xauth_1%3a1.1-1_armhf.deb ...
- Unpacking xauth (1:1.1-1) ...
- qemu: Unsupported syscall: 403
- Setting up libexpat1:armhf (2.2.10-2+deb11u5) ...
- Setting up runit-helper (2.10.3) ...
- Setting up libxau6:armhf (1:1.0.9-1) ...
- Setting up net-tools (1.60+git20181103.0eebece-1+deb11u1) ...
- Setting up libxdmcp6:armhf (1:1.1.2-3) ...
- Setting up libc-l10n (2.31-13+deb11u11) ...
- Setting up libxcb1:armhf (1.14-3) ...
- Setting up libgpm2:armhf (1.20.7-8) ...
- Setting up libcbor0:armhf (0.5.0+dfsg-2) ...
- Setting up locales (2.31-13+deb11u11) ...
- qemu: Unsupported syscall: 403
- /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- Generating locales (this might take a while)...
- Generation complete.
- qemu: Unsupported syscall: 403
- Setting up ntpdate (1:4.2.8p15+dfsg-1) ...
- Setting up libwrap0:armhf (7.6.q-31) ...
- Setting up libx11-data (2:1.7.2-1+deb11u2) ...
- Setting up libdbus-1-3:armhf (1.12.28-0+deb11u1) ...
- Setting up dbus (1.12.28-0+deb11u1) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- invoke-rc.d: could not determine current runlevel
- Setting up libpcsclite1:armhf (1.9.1-1) ...
- Setting up ucf (3.0043) ...
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 403
- /usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- Setting up memtester (4.5.0-1) ...
- Setting up libnl-3-200:armhf (3.4.0-1+b1) ...
- Setting up libpam-systemd:armhf (247.3-7+deb11u5) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- /usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
- qemu: Unsupported syscall: 403
- Setting up libx11-6:armhf (2:1.7.2-1+deb11u2) ...
- Setting up vim-runtime (2:8.2.2434-3+deb11u1) ...
- qemu: Unsupported syscall: 403
- Setting up libfido2-1:armhf (1.6.0-2) ...
- Setting up lrzsz (0.12.21-10) ...
- Setting up libxmuu1:armhf (2:1.1.2-2+b3) ...
- Setting up libiw30:armhf (30~pre9-13.1) ...
- Setting up ncurses-term (6.2+20201114-2+deb11u2) ...
- Setting up vim (2:8.2.2434-3+deb11u1) ...
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
- qemu: Unsupported syscall: 403
- update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
- qemu: Unsupported syscall: 403
- Setting up openssh-client (1:8.4p1-5+deb11u3) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- Setting up wireless-tools (30~pre9-13.1) ...
- Setting up libxext6:armhf (2:1.3.3-1.1) ...
- Setting up libnl-route-3-200:armhf (3.4.0-1+b1) ...
- Setting up xauth (1:1.1-1) ...
- Setting up libnl-genl-3-200:armhf (3.4.0-1+b1) ...
- Setting up openssh-sftp-server (1:8.4p1-5+deb11u3) ...
- Setting up openssh-server (1:8.4p1-5+deb11u3) ...
- qemu: Unsupported syscall: 403
- /usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
- /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- Creating config file /etc/ssh/sshd_config with new version
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 382
- qemu: Unsupported syscall: 397
- qemu: Unsupported syscall: 412
- qemu: Unsupported syscall: 382
- qemu: Unsupported syscall: 403
- Creating SSH2 RSA key; this may take some time ...qemu: Unsupported syscall: 384
- qemu: Unsupported syscall: 384
- PRNG is not seeded
- dpkg: error processing package openssh-server (--configure):
- installed openssh-server package post-installation script subprocess returned error exit status 255
- Setting up wpasupplicant (2:2.9.0-21+deb11u2) ...
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 403
- qemu: Unsupported syscall: 384
- Created symlink /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service → /lib/systemd/system/wpa_supplicant.service.
- Created symlink /etc/systemd/system/multi-user.target.wants/wpa_supplicant.service → /lib/systemd/system/wpa_supplicant.service.
- Processing triggers for libc-bin (2.31-13+deb11u11) ...
- Processing triggers for dbus (1.12.28-0+deb11u1) ...
- Errors were encountered while processing:
- openssh-server
- E: Sub-process /usr/bin/dpkg returned an error code (1)
- root@andy:/# memtester ^C
- root@andy:/# echo "export LC_ALL="zh_CN.UTF-8""
- export LC_ALL="zh_CN.UTF-8"
- root@andy:/# echo "en_US.UTF-8 UTF-8" > etc/locale.gen
- root@andy:/# echo "zh_CN.UTF-8 UTF-8" >> etc/locale.gen
- root@andy:/# locale-gen
- Generating locales (this might take a while)...
- en_US.UTF-8...qemu: Unsupported syscall: 403
- done
- zh_CN.UTF-8... done
- Generation complete.
- root@andy:/# exit
- exit
- andy@andy:/work3/test/a20/rootfs$
复制代码- # 备份 rootfs
- andy@andy:/work3/test/a20/rootfs$ cd ../ && tar -czvf chroot-armhf-bullseye-`date +%Y%m%d_%H%M%S`.tar.gz chroot-armhf-bullseye/
- andy@andy:/work3/test/a20$ ll
- total 6634160
- drwxrwxr-x 5 andy andy 4096 10月 31 17:13 ./
- drwxrwxr-x 5 andy andy 4096 10月 25 10:05 ../
- -rw-r--r-- 1 root root 134843391 10月 26 11:36 chroot-armhf_bullseye_cb2_20241026_113614.tar.gz
- andy@andy:/work3/test/a20$
- andy@andy:/work3/test/a20$
复制代码 至此,根文件系统 chroot-armhf_bullseye_cb2_20241026_113614.tar.gz 已生成
boot.scr 生成过程:
- 这个文件有些参数需要根据 u-boot-sunxi-with-spl.bin 来修改,在此先行一步,将参数设置好,后续自行验证
- 创建 boot.cmd 文件并编辑
- 使用 mkimage 工具将 boot.cmd 转换为 boot.scr
- # boot.cmd 内容如下
- setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
- load mmc 0:1 0x43000000 sun7i-a20-cubieboard2.dtb || load mmc 0:1 0x43000000 boot/sun7i-a20-cubieboard2.dtb
- load mmc 0:1 0x42000000 zImage || load mmc 0:1 0x42000000 boot/zImage
- bootz 0x42000000 - 0x43000000
复制代码- # 将 boot.cmd 转换为 boot.scr
- mkimage -C none -A arm -T script -d boot.cmd boot.scr
复制代码
来源: 【升级】CB2-uboot2020+linux6-卡启动篇
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|