Rpi64开发日志stage1

command list

1
sudo resize.f2fs /dev/sdX

概览:

0. Environment &linux kernel & gcc toolchain

host

1
2
3
4
sudo apt install build-essential bison make
sudo apt install axel cmake cmake-curses-gui
sudo apt install kpartx util-linux f2fs-tools
sudo apt install libncurses5-dev libssl-dev

rpi64

  • rpi: RaspberryPi 3b+

  • OS: debian buster

  • kernel: https://github.com/raspberrypi/linux 4.19.76

1. build linux kernel

1
2
make bcmrpi3_defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
make menuconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
  • CONFIG_LOCALVERSION=”-ARMv8_GuzalAida@rpi3b”
  • CONFIG_DEFAULT_HOSTNAME=”GuzalAida”
  • 打开Control Group support
  • 打开Checkpoint/restore support
  • 打开Virtualization支持
  • 启用文件系统f2fs的F2FS Security Labels
  • 修改Boot options里的kernel command line中的rootfstype为rootfstype=f2fs
  • ARMv8.2 architectural features —>
1
2
make -j9 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- 
#make -j9 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- 6847.39s user 586.46s system 711% cpu 17:24.68 total

2. create img

1
dd bs=1M count=4096 if=/dev/zero of=rpi64-v4.19.80.img

分区请看后续步骤:

分区表 : dos

Device Boot Start End Sectors Size Id Type

bootfs分区

1
2
3
4
5
6
7
8
>>  rpi64-v4.19.76.img1       *      2048     718847     716800     350M     b W95 FAT32       
┌────────────────────────────────────────────────────────────┐
│ Partition type: W95 FAT32 (b) │
│ Attributes: 80 │
│ Filesystem UUID: 83C0-51BA │
│Filesystem LABEL: bootfs │
│ Filesystem: vfat │
└────────────────────────────────────────────────────────────┘

rootfs分区

1
2
3
4
5
6
7
>>  rpi64-v4.19.76.img2            718848    8388607    7669760     3.7G    83 Linux           
┌───────────────────────────────────────────────────────────┐
│ Partition type: Linux (83) │
│ Filesystem UUID: 4a1a7d18-c62f-4abb-84be-4bbc41d12f75 │
│Filesystem LABEL: rootfs │
│ Filesystem: f2fs │
└───────────────────────────────────────────────────────────┘

3. Partition format & copy base kernel file

kpartx

1
2
3
sudo kpartx -av rpi64-v4.19.76.img
add map loop0p1 (253:0): 0 716800 linear 7:0 2048
add map loop0p2 (253:1): 0 7669760 linear 7:0 718848

format

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(base) 
┌─[mardan@Mardan-ArchLabs] - [~/workspace/EmbeddedDevelopment/rpi64@GuzalAida/rpi64os] - [Fri Oct 11, 10:01]
└─[$] <> sudo mkfs.vfat /dev/mapper/loop0p1 -n bootfs
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
(base)
┌─[mardan@Mardan-ArchLabs] - [~/workspace/EmbeddedDevelopment/rpi64@GuzalAida/rpi64os] - [Fri Oct 11, 10:02]
└─[$] <> sudo mkfs.f2fs /dev/mapper/loop0p2 -l rootfs

F2FS-tools: mkfs.f2fs Ver: 1.11.0 (2018-07-10)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Label = rootfs
Info: Trim is enabled
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 7669760 (3745 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
"Linux version 4.15.0-65-generic (buildd@lgw01-amd64-006) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019"
Info: [/dev/mapper/loop0p2] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: Discarded 3745 MB
Info: Overprovision ratio = 3.290%
Info: Overprovision segments = 126 (GC reserved = 68)
Info: format successful

mount

1
2
sudo mount /dev/mapper/loop0p1 bootfs
sudo mount /dev/mapper/loop0p2 rootfs

df -hT

1
2
3
4
5
6
7
8
9
10
11
Filesystem          Type      Size  Used Avail Use% Mounted on
udev devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 787M 1.7M 785M 1% /run
/dev/sda3 ext4 118G 59G 54G 53% /
tmpfs tmpfs 3.9G 17M 3.9G 1% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sdb2 vfat 96M 31M 66M 33% /boot/efi
tmpfs tmpfs 787M 32K 787M 1% /run/user/1000
/dev/mapper/loop0p1 vfat 350M 0 350M 0% /home/mardan/workspace/EmbeddedDevelopment/rpi64@GuzalAida/rpi64os/bootfs
/dev/mapper/loop0p2 f2fs 3.7G 38M 3.4G 2% /home/mardan/workspace/EmbeddedDevelopment/rpi64@GuzalAida/rpi64os/rootfs

copy kernel base

1
2
3
4
5
6
7
sudo cp -v arch/arm64/boot/Image ../../rpi64os/bootfs/kernel8.img
sudo cp -v arch/arm64/boot/Image.gz ../../rpi64os/bootfs/
sudo cp -v arch/arm64/boot/dts/broadcom/bcm2*3-b-plus.dtb ../../rpi64os/bootfs/
sudo mkdir ../../rpi64os/bootfs/overlays
sudo cp -vr arch/arm64/boot/dts/overlays/*.dtbo ../../rpi64os/bootfs/overlays
sudo su
make modules_install INSTALL_MOD_PATH=../../rpi64os/rootfs/ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

DEPMOD 4.19.80-ARMv8_GuzalAida@rpi3b+

bootfs

1
2
3
4
bcm2710-rpi-3-b-plus.dtb  config.txt     fixup_db.dat  kernel8.img       start_db.elf
bcm2837-rpi-3-b-plus.dtb COPYING.linux fixup_x.dat LICENCE.broadcom start.elf
bootcode.bin fixup_cd.dat Image.gz overlays start_x.elf
cmdline.txt fixup.dat issue.txt start_cd.elf

rootfs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(base) 
┌─[mardan@Mardan-ArchLabs] - [~/workspace/EmbeddedDevelopment/rpi64@GuzalAida/rpi64os/rootfs] - [Wed Oct 09, 18:58]
└─[$] <> tree -L 3
.
└── lib
├── firmware
│   ├── 3com
│   ├── a300_pfp.fw -> qcom/a300_pfp.fw
│   ├── a300_pm4.fw -> qcom/a300_pm4.fw
│   ├── acenic
│   ├── adaptec
│   ├── advansys
│   ├── agere_ap_fw.bin
│   ├── agere_sta_fw.bin
│   ├── amdgpu
│   ├── amd-ucode
│   ├── ar3k
│   ├── ar5523.bin
│   ├── ar7010_1_1.fw
│   ├── ar7010.fw
│   ├── ar9271.fw
│   ├── as102_data1_st.hex
│   ├── as102_data2_st.hex
│   ├── ath10k
│   ├── ath3k-1.fw
│   ├── ath6k
│   ├── ath9k_htc
│   ├── atmel
│   ├── atusb
│   ├── av7110
│   ├── BCM2033-FW.bin
│   ├── BCM2033-MD.hex
│   ├── bnx2
│   ├── bnx2x
│   ├── brcm
--more--
│   ├── v4l-cx231xx-avcore-01.fw
│   ├── v4l-cx23418-apu.fw
│   ├── v4l-cx23418-cpu.fw
│   ├── v4l-cx23418-dig.fw
│   ├── v4l-cx23885-avcore-01.fw
│   ├── v4l-cx25840.fw
│   ├── vicam
│   ├── vntwusb.fw
│   ├── vpu_d.bin
│   ├── vpu_p.bin
│   ├── vxge
│   ├── WHENCE
│   ├── wil6210.brd
│   ├── wil6210.fw
│   ├── yam
│   └── yamaha
└── modules
└── 4.19.76-ARMv8_GuzalAida@rpi3b+

umount

1
2
3
4
sync   # 同步写入
sudo umount bootfs rootfs
sudo kpartx -dv /dev/loop0
sudo losetup -d /dev/loop0

4. install rootfs

注意!!! 从现在开始在aarch64设备上进行

tools:

1
2
3
4
sudo apt install build-essential bison make -y
sudo apt install axel cmake -y
sudo apt install kpartx util-linux f2fs-tools -y
sudo apt install debootstrap -y

上传镜像至树莓派

1
2
3
4
5
(base) ┌─[mardan@mardan-ArchLabs] - [~/workSpace/rpi64@GuzalAida/rpi64os] - [Sun Sep 15, 16:08]
└─[$] <> time scp rpi64-v4.19.71.img guzal@192.168.1.129:~/
guzal@192.168.1.129's password:
rpi64-v4.19.71.img 100% 4096MB 13.1MB/s 05:13
scp rpi64-v4.19.71.img guzal@192.168.1.129:~/ 33.68s user 41.45s system 23% cpu 5:19.11 total

rpi64 dir

1
2
guzal@GuzalAida:~$ ls
bootfs rootfs rpi64-v4.19.71.img

df -hT

1
2
3
4
5
6
7
8
9
10
11
12
guzal@GuzalAida:~$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/root f2fs 30G 6.3G 24G 22% /
devtmpfs devtmpfs 454M 0 454M 0% /dev
tmpfs tmpfs 459M 0 459M 0% /dev/shm
tmpfs tmpfs 459M 14M 446M 3% /run
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs tmpfs 459M 0 459M 0% /sys/fs/cgroup
/dev/mmcblk0p1 vfat 120M 32M 89M 27% /boot
tmpfs tmpfs 92M 0 92M 0% /run/user/1000
/dev/mapper/loop0p1 vfat 200M 32M 169M 16% /home/guzal/bootfs
/dev/mapper/loop0p2 f2fs 3.9G 386M 3.5G 10% /home/guzal/rootfs

安装文件系统

1
sudo debootstrap --arch=arm64 buster rootfs/ https://mirrors.tuna.tsinghua.edu.cn/debian
sudo debootstrap --arch=arm64 buster rootfs/ 输出

guzal@GuzalAida:~$ sudo debootstrap --arch=arm64 buster rootfs/
I: Target architecture can be executed
I: Retrieving InRelease 
I: Checking Release signature
I: Valid Release signature (key id 6D33866EDD8FFA41C0143AEDDCC9EFBF77E11517)
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://deb.debian.org/debian...
I: Retrieving libacl1 2.2.53-4
I: Validating libacl1 2.2.53-4
I: Retrieving adduser 3.118
I: Validating adduser 3.118
I: Retrieving libapparmor1 2.13.2-10
I: Validating libapparmor1 2.13.2-10
I: Retrieving apt 1.8.2
I: Validating apt 1.8.2
I: Retrieving apt-utils 1.8.2
I: Validating apt-utils 1.8.2
I: Retrieving libapt-inst2.0 1.8.2
I: Validating libapt-inst2.0 1.8.2
I: Retrieving libapt-pkg5.0 1.8.2
I: Validating libapt-pkg5.0 1.8.2
I: Retrieving libargon2-1 0~20171227-0.2
I: Validating libargon2-1 0~20171227-0.2
I: Retrieving libattr1 1:2.4.48-4
I: Validating libattr1 1:2.4.48-4
I: Retrieving libaudit-common 1:2.8.4-3
I: Validating libaudit-common 1:2.8.4-3
I: Retrieving libaudit1 1:2.8.4-3
I: Validating libaudit1 1:2.8.4-3
I: Retrieving base-files 10.3+deb10u1
I: Validating base-files 10.3+deb10u1
I: Retrieving base-passwd 3.5.46
I: Validating base-passwd 3.5.46
I: Retrieving bash 5.0-4
I: Validating bash 5.0-4
I: Retrieving libdns-export1104 1:9.11.5.P4+dfsg-5.1
I: Validating libdns-export1104 1:9.11.5.P4+dfsg-5.1
I: Retrieving libisc-export1100 1:9.11.5.P4+dfsg-5.1
I: Validating libisc-export1100 1:9.11.5.P4+dfsg-5.1
I: Retrieving bsdmainutils 11.1.2+b1
I: Validating bsdmainutils 11.1.2+b1
I: Retrieving libbz2-1.0 1.0.6-9.2~deb10u1
I: Validating libbz2-1.0 1.0.6-9.2~deb10u1
I: Retrieving libdebconfclient0 0.249
I: Validating libdebconfclient0 0.249
I: Retrieving coreutils 8.30-3
I: Validating coreutils 8.30-3
I: Retrieving cpio 2.12+dfsg-9
I: Validating cpio 2.12+dfsg-9
I: Retrieving cron 3.0pl1-134
I: Validating cron 3.0pl1-134
I: Retrieving libcryptsetup12 2:2.1.0-5+deb10u2
I: Validating libcryptsetup12 2:2.1.0-5+deb10u2
I: Retrieving dash 0.5.10.2-5
I: Validating dash 0.5.10.2-5
I: Retrieving libdb5.3 5.3.28+dfsg1-0.5
I: Validating libdb5.3 5.3.28+dfsg1-0.5
I: Retrieving debconf 1.5.71
I: Validating debconf 1.5.71
I: Retrieving debconf-i18n 1.5.71
I: Validating debconf-i18n 1.5.71
I: Retrieving debian-archive-keyring 2019.1
I: Validating debian-archive-keyring 2019.1
I: Retrieving debianutils 4.8.6.1
I: Validating debianutils 4.8.6.1
I: Retrieving diffutils 1:3.7-3
I: Validating diffutils 1:3.7-3
I: Retrieving dmidecode 3.2-1
I: Validating dmidecode 3.2-1
I: Retrieving dpkg 1.19.7
I: Validating dpkg 1.19.7
I: Retrieving e2fsprogs 1.44.5-1+deb10u1
I: Validating e2fsprogs 1.44.5-1+deb10u1
I: Retrieving libcom-err2 1.44.5-1+deb10u1
I: Validating libcom-err2 1.44.5-1+deb10u1
I: Retrieving libext2fs2 1.44.5-1+deb10u1
I: Validating libext2fs2 1.44.5-1+deb10u1
I: Retrieving libss2 1.44.5-1+deb10u1
I: Validating libss2 1.44.5-1+deb10u1
I: Retrieving libelf1 0.176-1.1
I: Validating libelf1 0.176-1.1
I: Retrieving findutils 4.6.0+git+20190209-2
I: Validating findutils 4.6.0+git+20190209-2
I: Retrieving gcc-8-base 8.3.0-6
I: Validating gcc-8-base 8.3.0-6
I: Retrieving libgcc1 1:8.3.0-6
I: Validating libgcc1 1:8.3.0-6
I: Retrieving libstdc++6 8.3.0-6
I: Validating libstdc++6 8.3.0-6
I: Retrieving gdbm-l10n 1.18.1-4
I: Validating gdbm-l10n 1.18.1-4
I: Retrieving libc-bin 2.28-10
I: Validating libc-bin 2.28-10
I: Retrieving libc6 2.28-10
I: Validating libc6 2.28-10
I: Retrieving libgmp10 2:6.1.2+dfsg-4
I: Validating libgmp10 2:6.1.2+dfsg-4
I: Retrieving gpgv 2.2.12-1+deb10u1
I: Validating gpgv 2.2.12-1+deb10u1
I: Retrieving libgnutls30 3.6.7-4
I: Validating libgnutls30 3.6.7-4
I: Retrieving grep 3.3-1
I: Validating grep 3.3-1
I: Retrieving gzip 1.9-3
I: Validating gzip 1.9-3
I: Retrieving hostname 3.21
I: Validating hostname 3.21
I: Retrieving ifupdown 0.8.35
I: Validating ifupdown 0.8.35
I: Retrieving init 1.56+nmu1
I: Validating init 1.56+nmu1
I: Retrieving init-system-helpers 1.56+nmu1
I: Validating init-system-helpers 1.56+nmu1
I: Retrieving iproute2 4.20.0-2
I: Validating iproute2 4.20.0-2
I: Retrieving iptables 1.8.2-4
I: Validating iptables 1.8.2-4
I: Retrieving libip4tc0 1.8.2-4
I: Validating libip4tc0 1.8.2-4
I: Retrieving libip6tc0 1.8.2-4
I: Validating libip6tc0 1.8.2-4
I: Retrieving libiptc0 1.8.2-4
I: Validating libiptc0 1.8.2-4
I: Retrieving libxtables12 1.8.2-4
I: Validating libxtables12 1.8.2-4
I: Retrieving iputils-ping 3:20180629-2
I: Validating iputils-ping 3:20180629-2
I: Retrieving isc-dhcp-client 4.4.1-2
I: Validating isc-dhcp-client 4.4.1-2
I: Retrieving isc-dhcp-common 4.4.1-2
I: Validating isc-dhcp-common 4.4.1-2
I: Retrieving libjson-c3 0.12.1+ds-2
I: Validating libjson-c3 0.12.1+ds-2
I: Retrieving kmod 26-1
I: Validating kmod 26-1
I: Retrieving libkmod2 26-1
I: Validating libkmod2 26-1
I: Retrieving less 487-0.1+b1
I: Validating less 487-0.1+b1
I: Retrieving libbsd0 0.9.1-2
I: Validating libbsd0 0.9.1-2
I: Retrieving libcap-ng0 0.7.9-2
I: Validating libcap-ng0 0.7.9-2
I: Retrieving libcap2 1:2.25-2
I: Validating libcap2 1:2.25-2
I: Retrieving libcap2-bin 1:2.25-2
I: Validating libcap2-bin 1:2.25-2
I: Retrieving libestr0 0.1.10-2.1
I: Validating libestr0 0.1.10-2.1
I: Retrieving libfastjson4 0.99.8-2
I: Validating libfastjson4 0.99.8-2
I: Retrieving libffi6 3.2.1-9
I: Validating libffi6 3.2.1-9
I: Retrieving libgcrypt20 1.8.4-5
I: Validating libgcrypt20 1.8.4-5
I: Retrieving libgpg-error0 1.35-1
I: Validating libgpg-error0 1.35-1
I: Retrieving libidn11 1.33-2.2
I: Validating libidn11 1.33-2.2
I: Retrieving libidn2-0 2.0.5-1
I: Validating libidn2-0 2.0.5-1
I: Retrieving liblocale-gettext-perl 1.07-3+b4
I: Validating liblocale-gettext-perl 1.07-3+b4
I: Retrieving liblognorm5 2.0.5-1
I: Validating liblognorm5 2.0.5-1
I: Retrieving libmnl0 1.0.4-2
I: Validating libmnl0 1.0.4-2
I: Retrieving libnetfilter-conntrack3 1.0.7-1
I: Validating libnetfilter-conntrack3 1.0.7-1
I: Retrieving libnfnetlink0 1.0.1-3+b1
I: Validating libnfnetlink0 1.0.1-3+b1
I: Retrieving libnftnl11 1.1.2-2
I: Validating libnftnl11 1.1.2-2
I: Retrieving libseccomp2 2.3.3-4
I: Validating libseccomp2 2.3.3-4
I: Retrieving libselinux1 2.8-1+b1
I: Validating libselinux1 2.8-1+b1
I: Retrieving libsemanage-common 2.8-2
I: Validating libsemanage-common 2.8-2
I: Retrieving libsemanage1 2.8-2
I: Validating libsemanage1 2.8-2
I: Retrieving libsepol1 2.8-1
I: Validating libsepol1 2.8-1
I: Retrieving libtasn1-6 4.13-3
I: Validating libtasn1-6 4.13-3
I: Retrieving libtext-charwidth-perl 0.04-7.1+b1
I: Validating libtext-charwidth-perl 0.04-7.1+b1
I: Retrieving libtext-iconv-perl 1.7-5+b6
I: Validating libtext-iconv-perl 1.7-5+b6
I: Retrieving libtext-wrapi18n-perl 0.06-7.1
I: Validating libtext-wrapi18n-perl 0.06-7.1
I: Retrieving libunistring2 0.9.10-1
I: Validating libunistring2 0.9.10-1
I: Retrieving libzstd1 1.3.8+dfsg-3
I: Validating libzstd1 1.3.8+dfsg-3
I: Retrieving logrotate 3.14.0-4
I: Validating logrotate 3.14.0-4
I: Retrieving lsb-base 10.2019051400
I: Validating lsb-base 10.2019051400
I: Retrieving dmsetup 2:1.02.155-3
I: Validating dmsetup 2:1.02.155-3
I: Retrieving libdevmapper1.02.1 2:1.02.155-3
I: Validating libdevmapper1.02.1 2:1.02.155-3
I: Retrieving liblz4-1 1.8.3-1
I: Validating liblz4-1 1.8.3-1
I: Retrieving mawk 1.3.3-17+b3
I: Validating mawk 1.3.3-17+b3
I: Retrieving nano 3.2-3
I: Validating nano 3.2-3
I: Retrieving libncurses6 6.1+20181013-2+deb10u1
I: Validating libncurses6 6.1+20181013-2+deb10u1
I: Retrieving libncursesw6 6.1+20181013-2+deb10u1
I: Validating libncursesw6 6.1+20181013-2+deb10u1
I: Retrieving libtinfo6 6.1+20181013-2+deb10u1
I: Validating libtinfo6 6.1+20181013-2+deb10u1
I: Retrieving ncurses-base 6.1+20181013-2+deb10u1
I: Validating ncurses-base 6.1+20181013-2+deb10u1
I: Retrieving ncurses-bin 6.1+20181013-2+deb10u1
I: Validating ncurses-bin 6.1+20181013-2+deb10u1
I: Retrieving netbase 5.6
I: Validating netbase 5.6
I: Retrieving libhogweed4 3.4.1-1
I: Validating libhogweed4 3.4.1-1
I: Retrieving libnettle6 3.4.1-1
I: Validating libnettle6 3.4.1-1
I: Retrieving libnewt0.52 0.52.20-8
I: Validating libnewt0.52 0.52.20-8
I: Retrieving whiptail 0.52.20-8
I: Validating whiptail 0.52.20-8
I: Retrieving libssl1.1 1.1.1c-1
I: Validating libssl1.1 1.1.1c-1
I: Retrieving libp11-kit0 0.23.15-2
I: Validating libp11-kit0 0.23.15-2
I: Retrieving libpam-modules 1.3.1-5
I: Validating libpam-modules 1.3.1-5
I: Retrieving libpam-modules-bin 1.3.1-5
I: Validating libpam-modules-bin 1.3.1-5
I: Retrieving libpam-runtime 1.3.1-5
I: Validating libpam-runtime 1.3.1-5
I: Retrieving libpam0g 1.3.1-5
I: Validating libpam0g 1.3.1-5
I: Retrieving libpcre3 2:8.39-12
I: Validating libpcre3 2:8.39-12
I: Retrieving perl-base 5.28.1-6
I: Validating perl-base 5.28.1-6
I: Retrieving libpopt0 1.16-12
I: Validating libpopt0 1.16-12
I: Retrieving libprocps7 2:3.3.15-2
I: Validating libprocps7 2:3.3.15-2
I: Retrieving procps 2:3.3.15-2
I: Validating procps 2:3.3.15-2
I: Retrieving readline-common 7.0-5
I: Validating readline-common 7.0-5
I: Retrieving rsyslog 8.1901.0-1
I: Validating rsyslog 8.1901.0-1
I: Retrieving sed 4.7-1
I: Validating sed 4.7-1
I: Retrieving sensible-utils 0.0.12
I: Validating sensible-utils 0.0.12
I: Retrieving login 1:4.5-1.1
I: Validating login 1:4.5-1.1
I: Retrieving passwd 1:4.5-1.1
I: Validating passwd 1:4.5-1.1
I: Retrieving libslang2 2.3.2-2
I: Validating libslang2 2.3.2-2
I: Retrieving libsystemd0 241-7~deb10u1
I: Validating libsystemd0 241-7~deb10u1
I: Retrieving libudev1 241-7~deb10u1
I: Validating libudev1 241-7~deb10u1
I: Retrieving systemd 241-7~deb10u1
I: Validating systemd 241-7~deb10u1
I: Retrieving systemd-sysv 241-7~deb10u1
I: Validating systemd-sysv 241-7~deb10u1
I: Retrieving udev 241-7~deb10u1
I: Validating udev 241-7~deb10u1
I: Retrieving sysvinit-utils 2.93-8
I: Validating sysvinit-utils 2.93-8
I: Retrieving tar 1.30+dfsg-6
I: Validating tar 1.30+dfsg-6
I: Retrieving tasksel 3.53
I: Validating tasksel 3.53
I: Retrieving tasksel-data 3.53
I: Validating tasksel-data 3.53
I: Retrieving tzdata 2019b-0+deb10u1
I: Validating tzdata 2019b-0+deb10u1
I: Retrieving bsdutils 1:2.33.1-0.1
I: Validating bsdutils 1:2.33.1-0.1
I: Retrieving fdisk 2.33.1-0.1
I: Validating fdisk 2.33.1-0.1
I: Retrieving libblkid1 2.33.1-0.1
I: Validating libblkid1 2.33.1-0.1
I: Retrieving libfdisk1 2.33.1-0.1
I: Validating libfdisk1 2.33.1-0.1
I: Retrieving libmount1 2.33.1-0.1
I: Validating libmount1 2.33.1-0.1
I: Retrieving libsmartcols1 2.33.1-0.1
I: Validating libsmartcols1 2.33.1-0.1
I: Retrieving libuuid1 2.33.1-0.1
I: Validating libuuid1 2.33.1-0.1
I: Retrieving mount 2.33.1-0.1
I: Validating mount 2.33.1-0.1
I: Retrieving util-linux 2.33.1-0.1
I: Validating util-linux 2.33.1-0.1
I: Retrieving vim-common 2:8.1.0875-5
I: Validating vim-common 2:8.1.0875-5
I: Retrieving vim-tiny 2:8.1.0875-5
I: Validating vim-tiny 2:8.1.0875-5
I: Retrieving xxd 2:8.1.0875-5
I: Validating xxd 2:8.1.0875-5
I: Retrieving liblzma5 5.2.4-1
I: Validating liblzma5 5.2.4-1
I: Retrieving zlib1g 1:1.2.11.dfsg-1
I: Validating zlib1g 1:1.2.11.dfsg-1
I: Chosen extractor for .deb packages: dpkg-deb
I: Extracting libacl1...
I: Extracting adduser...
I: Extracting apt...
I: Extracting libapt-pkg5.0...
I: Extracting libattr1...
I: Extracting libaudit-common...
I: Extracting libaudit1...
I: Extracting base-files...
I: Extracting base-passwd...
I: Extracting bash...
I: Extracting libbz2-1.0...
I: Extracting libdebconfclient0...
I: Extracting coreutils...
I: Extracting dash...
I: Extracting libdb5.3...
I: Extracting debconf...
I: Extracting debian-archive-keyring...
I: Extracting debianutils...
I: Extracting diffutils...
I: Extracting dpkg...
I: Extracting e2fsprogs...
I: Extracting libcom-err2...
I: Extracting libext2fs2...
I: Extracting libss2...
I: Extracting findutils...
I: Extracting gcc-8-base...
I: Extracting libgcc1...
I: Extracting libstdc++6...
I: Extracting libc-bin...
I: Extracting libc6...
I: Extracting libgmp10...
I: Extracting gpgv...
I: Extracting libgnutls30...
I: Extracting grep...
I: Extracting gzip...
I: Extracting hostname...
I: Extracting init-system-helpers...
I: Extracting libcap-ng0...
I: Extracting libffi6...
I: Extracting libgcrypt20...
I: Extracting libgpg-error0...
I: Extracting libidn2-0...
I: Extracting libseccomp2...
I: Extracting libselinux1...
I: Extracting libsemanage-common...
I: Extracting libsemanage1...
I: Extracting libsepol1...
I: Extracting libtasn1-6...
I: Extracting libunistring2...
I: Extracting libzstd1...
I: Extracting liblz4-1...
I: Extracting mawk...
I: Extracting libncursesw6...
I: Extracting libtinfo6...
I: Extracting ncurses-base...
I: Extracting ncurses-bin...
I: Extracting libhogweed4...
I: Extracting libnettle6...
I: Extracting libp11-kit0...
I: Extracting libpam-modules...
I: Extracting libpam-modules-bin...
I: Extracting libpam-runtime...
I: Extracting libpam0g...
I: Extracting libpcre3...
I: Extracting perl-base...
I: Extracting sed...
I: Extracting login...
I: Extracting passwd...
I: Extracting libsystemd0...
I: Extracting libudev1...
I: Extracting sysvinit-utils...
I: Extracting tar...
I: Extracting tzdata...
I: Extracting bsdutils...
I: Extracting fdisk...
I: Extracting libblkid1...
I: Extracting libfdisk1...
I: Extracting libmount1...
I: Extracting libsmartcols1...
I: Extracting libuuid1...
I: Extracting mount...
I: Extracting util-linux...
I: Extracting liblzma5...
I: Extracting zlib1g...
I: Installing core packages...
I: Unpacking required packages...
I: Unpacking libacl1:arm64...
I: Unpacking adduser...
I: Unpacking apt...
I: Unpacking libapt-pkg5.0:arm64...
I: Unpacking libattr1:arm64...
I: Unpacking libaudit-common...
I: Unpacking libaudit1:arm64...
I: Unpacking base-files...
I: Unpacking base-passwd...
I: Unpacking bash...
I: Unpacking libbz2-1.0:arm64...
I: Unpacking libdebconfclient0:arm64...
I: Unpacking coreutils...
I: Unpacking dash...
I: Unpacking libdb5.3:arm64...
I: Unpacking debconf...
I: Unpacking debian-archive-keyring...
I: Unpacking debianutils...
I: Unpacking diffutils...
I: Unpacking dpkg...
I: Unpacking e2fsprogs...
I: Unpacking libcom-err2:arm64...
I: Unpacking libext2fs2:arm64...
I: Unpacking libss2:arm64...
I: Unpacking findutils...
I: Unpacking gcc-8-base:arm64...
I: Unpacking libgcc1:arm64...
I: Unpacking libstdc++6:arm64...
I: Unpacking libc-bin...
I: Unpacking libc6:arm64...
I: Unpacking libgmp10:arm64...
I: Unpacking gpgv...
I: Unpacking libgnutls30:arm64...
I: Unpacking grep...
I: Unpacking gzip...
I: Unpacking hostname...
I: Unpacking init-system-helpers...
I: Unpacking libcap-ng0:arm64...
I: Unpacking libffi6:arm64...
I: Unpacking libgcrypt20:arm64...
I: Unpacking libgpg-error0:arm64...
I: Unpacking libidn2-0:arm64...
I: Unpacking libseccomp2:arm64...
I: Unpacking libselinux1:arm64...
I: Unpacking libsemanage-common...
I: Unpacking libsemanage1:arm64...
I: Unpacking libsepol1:arm64...
I: Unpacking libtasn1-6:arm64...
I: Unpacking libunistring2:arm64...
I: Unpacking libzstd1:arm64...
I: Unpacking liblz4-1:arm64...
I: Unpacking mawk...
I: Unpacking libncursesw6:arm64...
I: Unpacking libtinfo6:arm64...
I: Unpacking ncurses-base...
I: Unpacking ncurses-bin...
I: Unpacking libhogweed4:arm64...
I: Unpacking libnettle6:arm64...
I: Unpacking libp11-kit0:arm64...
I: Unpacking libpam-modules:arm64...
I: Unpacking libpam-modules-bin...
I: Unpacking libpam-runtime...
I: Unpacking libpam0g:arm64...
I: Unpacking libpcre3:arm64...
I: Unpacking perl-base...
I: Unpacking sed...
I: Unpacking login...
I: Unpacking passwd...
I: Unpacking libsystemd0:arm64...
I: Unpacking libudev1:arm64...
I: Unpacking sysvinit-utils...
I: Unpacking tar...
I: Unpacking tzdata...
I: Unpacking bsdutils...
I: Unpacking fdisk...
I: Unpacking libblkid1:arm64...
I: Unpacking libfdisk1:arm64...
I: Unpacking libmount1:arm64...
I: Unpacking libsmartcols1:arm64...
I: Unpacking libuuid1:arm64...
I: Unpacking mount...
I: Unpacking util-linux...
I: Unpacking liblzma5:arm64...
I: Unpacking zlib1g:arm64...
I: Configuring required packages...
I: Configuring debian-archive-keyring...
I: Configuring libaudit-common...
I: Configuring libsemanage-common...
I: Configuring ncurses-base...
I: Configuring gcc-8-base:arm64...
I: Configuring libc6:arm64...
I: Configuring libudev1:arm64...
I: Configuring libsepol1:arm64...
I: Configuring libattr1:arm64...
I: Configuring libtasn1-6:arm64...
I: Configuring debianutils...
I: Configuring mawk...
I: Configuring libdebconfclient0:arm64...
I: Configuring base-files...
I: Configuring libbz2-1.0:arm64...
I: Configuring base-passwd...
I: Configuring libdb5.3:arm64...
I: Configuring libtinfo6:arm64...
I: Configuring bash...
I: Configuring libzstd1:arm64...
I: Configuring liblzma5:arm64...
I: Configuring libgpg-error0:arm64...
I: Configuring libgcc1:arm64...
I: Configuring liblz4-1:arm64...
I: Configuring libc-bin...
I: Configuring ncurses-bin...
I: Configuring libacl1:arm64...
I: Configuring libunistring2:arm64...
I: Configuring libsmartcols1:arm64...
I: Configuring libgcrypt20:arm64...
I: Configuring zlib1g:arm64...
I: Configuring libffi6:arm64...
I: Configuring libidn2-0:arm64...
I: Configuring libcom-err2:arm64...
I: Configuring diffutils...
I: Configuring libseccomp2:arm64...
I: Configuring libsystemd0:arm64...
I: Configuring hostname...
I: Configuring libpcre3:arm64...
I: Configuring libcap-ng0:arm64...
I: Configuring libext2fs2:arm64...
I: Configuring libgmp10:arm64...
I: Configuring libp11-kit0:arm64...
I: Configuring libaudit1:arm64...
I: Configuring libuuid1:arm64...
I: Configuring libss2:arm64...
I: Configuring libncursesw6:arm64...
I: Configuring libnettle6:arm64...
I: Configuring gpgv...
I: Configuring libblkid1:arm64...
I: Configuring libstdc++6:arm64...
I: Configuring bsdutils...
I: Configuring libhogweed4:arm64...
I: Configuring e2fsprogs...
I: Configuring libselinux1:arm64...
I: Configuring libgnutls30:arm64...
I: Configuring sed...
I: Configuring libfdisk1:arm64...
I: Configuring findutils...
I: Configuring libmount1:arm64...
I: Configuring libapt-pkg5.0:arm64...
I: Configuring libsemanage1:arm64...
I: Configuring tar...
I: Configuring coreutils...
I: Configuring fdisk...
I: Configuring dpkg...
I: Configuring grep...
I: Configuring perl-base...
I: Configuring init-system-helpers...
I: Configuring gzip...
I: Configuring debconf...
I: Configuring tzdata...
I: Configuring libpam0g:arm64...
I: Configuring dash...
I: Configuring libpam-modules-bin...
I: Configuring libpam-modules:arm64...
I: Configuring passwd...
I: Configuring libpam-runtime...
I: Configuring login...
I: Configuring adduser...
I: Configuring apt...
I: Configuring util-linux...
I: Configuring mount...
I: Configuring sysvinit-utils...
I: Configuring libc-bin...
I: Unpacking the base system...
I: Unpacking apt-utils...
I: Unpacking libapt-inst2.0:arm64...
I: Unpacking libdns-export1104...
I: Unpacking libisc-export1100:arm64...
I: Unpacking bsdmainutils...
I: Unpacking cpio...
I: Unpacking cron...
I: Unpacking debconf-i18n...
I: Unpacking dmidecode...
I: Unpacking libelf1:arm64...
I: Unpacking gdbm-l10n...
I: Unpacking ifupdown...
I: Unpacking init...
I: Unpacking iproute2...
I: Unpacking iptables...
I: Unpacking libip6tc0:arm64...
I: Unpacking libiptc0:arm64...
I: Unpacking libxtables12:arm64...
I: Unpacking iputils-ping...
I: Unpacking isc-dhcp-client...
I: Unpacking isc-dhcp-common...
I: Unpacking kmod...
I: Unpacking less...
I: Unpacking libbsd0:arm64...
I: Unpacking libcap2-bin...
I: Unpacking libestr0:arm64...
I: Unpacking libfastjson4:arm64...
I: Unpacking liblocale-gettext-perl...
I: Unpacking liblognorm5:arm64...
I: Unpacking libmnl0:arm64...
I: Unpacking libnetfilter-conntrack3:arm64...
I: Unpacking libnfnetlink0:arm64...
I: Unpacking libnftnl11:arm64...
I: Unpacking libtext-charwidth-perl...
I: Unpacking libtext-iconv-perl...
I: Unpacking libtext-wrapi18n-perl...
I: Unpacking logrotate...
I: Unpacking lsb-base...
I: Unpacking nano...
I: Unpacking libncurses6:arm64...
I: Unpacking netbase...
I: Unpacking libnewt0.52:arm64...
I: Unpacking whiptail...
I: Unpacking libpopt0:arm64...
I: Unpacking libprocps7:arm64...
I: Unpacking procps...
I: Unpacking readline-common...
I: Unpacking rsyslog...
I: Unpacking sensible-utils...
I: Unpacking libslang2:arm64...
I: Unpacking udev...
I: Unpacking tasksel...
I: Unpacking tasksel-data...
I: Unpacking vim-common...
I: Unpacking vim-tiny...
I: Unpacking xxd...
I: Configuring the base system...
I: Configuring cpio...
I: Configuring libtext-iconv-perl...
I: Configuring libtext-charwidth-perl...
I: Configuring lsb-base...
I: Configuring libip6tc0:arm64...
I: Configuring init...
I: Configuring libestr0:arm64...
I: Configuring libfastjson4:arm64...
I: Configuring libprocps7:arm64...
I: Configuring less...
I: Configuring kmod...
I: Configuring libapt-inst2.0:arm64...
I: Configuring libtext-wrapi18n-perl...
I: Configuring xxd...
I: Configuring libcap2-bin...
I: Configuring vim-common...
I: Configuring libslang2:arm64...
I: Configuring libiptc0:arm64...
I: Configuring libncurses6:arm64...
I: Configuring libmnl0:arm64...
I: Configuring udev...
I: Configuring libxtables12:arm64...
I: Configuring gdbm-l10n...
I: Configuring libisc-export1100:arm64...
I: Configuring liblognorm5:arm64...
I: Configuring nano...
I: Configuring sensible-utils...
I: Configuring libnfnetlink0:arm64...
I: Configuring procps...
I: Configuring netbase...
I: Configuring isc-dhcp-common...
I: Configuring dmidecode...
I: Configuring libbsd0:arm64...
I: Configuring libelf1:arm64...
I: Configuring libdns-export1104...
I: Configuring iputils-ping...
I: Configuring readline-common...
I: Configuring liblocale-gettext-perl...
I: Configuring libpopt0:arm64...
I: Configuring logrotate...
I: Configuring libnewt0.52:arm64...
I: Configuring apt-utils...
I: Configuring iproute2...
I: Configuring cron...
I: Configuring rsyslog...
I: Configuring isc-dhcp-client...
I: Configuring debconf-i18n...
I: Configuring libnftnl11:arm64...
I: Configuring vim-tiny...
I: Configuring ifupdown...
I: Configuring bsdmainutils...
I: Configuring whiptail...
I: Configuring libnetfilter-conntrack3:arm64...
I: Configuring iptables...
I: Configuring tasksel-data...
I: Configuring tasksel...
I: Configuring libc-bin...
I: Configuring systemd...
I: Base system installed successfully.

5. rootfs configutre

1
2
3
4
5
6
7
guzal@GuzalAida:~$
cd rootfs
sudo mount -o bind /dev/ dev
sudo mount -o bind /dev/pts dev/pts
sudo mount -o bind /proc proc
sudo mount -o bind /sys sys
sudo chroot ./

create user

1
2
adduser guzal
passwd guzal

update mirrors

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification.

1
2
3
apt update
apt install locales locales-all
apt install ca-certificates

换源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#上海交通大学 SJTUG软件源镜像服务
deb https://mirrors.sjtug.sjtu.edu.cn/debian buster main contrib non-free
# deb-src https://mirrors.sjtug.sjtu.edu.cn/debian buster main contrib non-free
deb https://mirrors.sjtug.sjtu.edu.cn/debian buster-updates main contrib non-free
# deb-src https://mirrors.sjtug.sjtu.edu.cn/debian buster-updates main contrib non-free
deb https://mirrors.sjtug.sjtu.edu.cn/debian buster-backports main contrib non-free
# deb-src https://mirrors.sjtug.sjtu.edu.cn/debian buster-backports main contrib non-free
deb https://mirrors.sjtug.sjtu.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.sjtug.sjtu.edu.cn/debian-security buster/updates main contrib non-free

# 清华源 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free


#deb https://mirrors.tuna.tsinghua.edu.cn/debian/ sid main
#deb https://mirrors.tuna.tsinghua.edu.cn/debian/ experimental main

# 中科大源
deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster main contrib non-free
deb http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free

deb http://mirrors.ustc.edu.cn/debian buster-proposed-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster-proposed-updates main contrib non-free

deb http://mirrors.ustc.edu.cn/debian-security/ buster/updates main non-free contrib
# deb-src http://mirrors.ustc.edu.cn/debian-security/ buster/updates main non-free contrib

# 本源
deb http://deb.debian.org/debian buster main

/etc/hosts添加

1
2
3
4
5
6
127.0.0.1	localhost
127.0.0.1 GuzalAida

::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

更新缓存

1
apt update

安装

1
2
3
apt install sudo f2fs-tools
apt install net-tools alsa-utils bash-completion ethtool wireless-tools ifupdown network-manager iputils-ping rsyslog locate ttf-wqy-zenhei wget
apt install

启用Debian源安装最新版本软件sidapt upgrade

1
2
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ sid main
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ experimental main

APT::Default-Release "stable";>>/etc/apt/apt.conf.d/71distro

使用命令: apt -t experimental install openssh-server

添加用户到/etc/sudoers

1
guzal	ALL=(ALL:ALL)	ALL

修改/etc/resolv.conf

1
2
3
4
root@GuzalAida:~# cat /etc/resolv.conf 
# Generated by NetworkManager
search localdomain
nameserver 192.168.1.1

修改fstsb

1
2
3
# UNCONFIGURED FSTAB FOR BASE SYSTEM
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / f2fs defaults,noatime 0 1

ssh登录凭证

1
2
su guzal -
ssh-keygen -t rsa -b 4096 -C "GuzalInspire@hotmail.com"

额外软件

1
sudo apt install screenfetch

时区 tzdate

1
sudo dpkg-reconfigure tzdata #选择时区

添加/etc/rpi-issue

1
So sorry,this image not rpi-issue.

umount

先退出chroot

卸载文件系统

1
2
3
4
sudo umount dev/pts
sudo umount dev
sudo umount proc
sudo umount sys

卸载镜像

1
2
3
sudo umount bootfs rootfs
sudo kpartx -dv /dev/loop0
sudo losetup -d /dev/loop0
------ 文章已经结束,谢谢你的阅读 ------
------ article has ended,thank you for reading ------
Thanks support Me

---------------- The End ----------------