1. Configuration

Raspberry Pi 5 Hailo AI + M.2 SSD Connection With M.2 Extention Board
Raspberry Pi 5 + Hailo AI + M.2 SSD Raspberry Pi 5 M.2 Connection

Since I personally do NOT like to Hailo-8L on Ubuntu 24.04 using Docker, I just struggled to have everything directly run without docker:

HailoRT 4.19.0

2. libcamera

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
➜  ./libcamera-hello 
[6:35:36.989225191] [42303] INFO Camera camera_manager.cpp:325 libcamera v0.3.2+27-7330f29b
[6:35:36.997513009] [42308] INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 29-08-2024 (16:33:32)
[6:35:37.101510511] [42308] INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/imx708@1a to CFE device /dev/media2 and ISP device /dev/media0 using PiSP variant BCM2712_C0
Preview window unavailable
Mode selection for 2304:1296:12:P
SRGGB10_CSI2P,1536x864/0 - Score: 3400
SRGGB10_CSI2P,2304x1296/0 - Score: 1000
SRGGB10_CSI2P,4608x2592/0 - Score: 1900
Stream configuration adjusted
[6:35:37.104412746] [42303] INFO Camera camera.cpp:1197 configuring streams: (0) 2304x1296-YUV420 (1) 2304x1296-BGGR_PISP_COMP1
[6:35:37.104513987] [42308] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected CFE format: 2304x1296-PC1B
#0 (0.00 fps) exp 32680.00 ag 5.89 dg 1.37
#1 (30.01 fps) exp 32680.00 ag 5.92 dg 1.37
#2 (30.01 fps) exp 32680.00 ag 6.40 dg 1.26
#3 (30.01 fps) exp 32680.00 ag 6.40 dg 1.26
#4 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#5 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#6 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#7 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#8 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#9 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#10 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#11 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#12 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#13 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#14 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#15 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#16 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#17 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#18 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#19 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#20 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#21 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#22 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#23 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#24 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#25 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#26 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#27 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#28 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#29 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#30 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#31 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#32 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#33 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#34 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#35 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#36 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#37 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#38 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#39 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#40 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#41 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#42 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#43 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#44 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#45 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#46 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#47 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#48 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#49 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#50 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#51 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#52 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#53 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#54 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#55 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#56 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#57 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#58 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#59 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#60 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#61 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#62 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#63 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#64 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#65 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#66 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#67 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#68 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#69 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#70 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#71 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#72 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#73 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#74 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#75 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#76 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#77 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#78 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#79 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#80 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#81 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#82 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#83 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#84 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#85 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#86 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#87 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#88 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#89 (30.01 fps) exp 32680.00 ag 6.36 dg 1.27
#90 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#91 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#92 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#93 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#94 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#95 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#96 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#97 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#98 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#99 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#100 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#101 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#102 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#103 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#104 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#105 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#106 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#107 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#108 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#109 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#110 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#111 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#112 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#113 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#114 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#115 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#116 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#117 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#118 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#119 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#120 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#121 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#122 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#123 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#124 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#125 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#126 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#127 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#128 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#129 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#130 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#131 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#132 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#133 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#134 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#135 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#136 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#137 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#138 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#139 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#140 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#141 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
#142 (30.01 fps) exp 32680.00 ag 6.32 dg 1.28
➜ bin

3. Hailo Model Zoo

hailomz

4. Demonstration

1. Prepare For BeagleV-Fire Ubuntu

Based on my previous blog BeagleV-Fire-1.md, we firstly checkout BeagleV-Fire Ubuntu, and do the following updates.

1.1 01_git_sync.sh

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash

GIT_DEPTH="20"
GCC_VERSION="14.2.0"

HSS_BRANCH="v2024.09"
HSS_REPO="https://github.com/polarfire-soc/hart-software-services.git"

#UBOOT_BRANCH="mpfs-uboot-2022.01"
UBOOT_BRANCH="linux4microchip+fpga-2024.09"
UBOOT_REPO="https://github.com/linux4microchip/u-boot-mchp.git"
#UBOOT_BRANCH="v2023.02-BeagleV-Fire"
#UBOOT_REPO="https://openbeagle.org/beaglev-fire/beaglev-fire-u-boot.git"
#UBOOT_REPO="git@openbeagle.org:beaglev-fire/beaglev-fire-u-boot.git"

DT_BRANCH="v6.6.x-Beagle"
DT_REPO="https://openbeagle.org/beagleboard/BeagleBoard-DeviceTrees.git"
#DT_REPO="git@openbeagle.org:beagleboard/BeagleBoard-DeviceTrees.git"

LINUX_BRANCH="linux4microchip+fpga-2024.09.1"
LINUX_REPO="https://github.com/linux4microchip/linux.git"
#LINUX_REPO="https://openbeagle.org/beaglev-fire/beaglev-fire-linux.git"
#LINUX_REPO="git@openbeagle.org:beaglev-fire/beaglev-fire-linux.git"

#LINUX_BRANCH="master"
#LINUX_REPO="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"

if [ ! -f ./mirror/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz ] ; then
echo "wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/${GCC_VERSION}/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz"
wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/${GCC_VERSION}/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz
fi

if [ ! -f ./riscv-toolchain/bin/riscv64-linux-gcc-${GCC_VERSION} ] ; then
echo "tar xf ./mirror/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/"
tar xf ./mirror/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/
fi

if [ -d ./hart-software-services/ ] ; then
rm -rf ./hart-software-services/ || true
fi

echo "git clone -b ${HSS_BRANCH} ${HSS_REPO} ./hart-software-services/ --depth=${GIT_DEPTH}"
git clone -b ${HSS_BRANCH} ${HSS_REPO} ./hart-software-services/ --depth=${GIT_DEPTH}

if [ -d ./u-boot ] ; then
rm -rf ./u-boot || true
fi

echo "git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}"
git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}

if [ -d ./device-tree ] ; then
rm -rf ./device-tree || true
fi

echo "git clone -b ${DT_BRANCH} ${DT_REPO} ./device-tree/ --depth=${GIT_DEPTH}"
git clone -b ${DT_BRANCH} ${DT_REPO} ./device-tree/ --depth=${GIT_DEPTH}

if [ -d ./linux ] ; then
rm -rf ./linux || true
fi

echo "git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}"
git clone --reference-if-able ~/linux-src/ -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}

#BUILDROOT_BRANCH="bvf"
#BUILDROOT_REPO="https://openbeagle.org/beaglev-fire/buildroot-external-microchip.git"
#
#if [ -d ./buildroot ] ; then
#rm -rf ./buildroot || true
#fi
#
#echo "git clone -b ${BUILDROOT_BRANCH} ${BUILDROOT_REPO} ./buildroot/ --depth=${GIT_DEPTH}"
#git clone -b ${BUILDROOT_BRANCH} ${BUILDROOT_REPO} ./buildroot/ --depth=${GIT_DEPTH}

#

1.2 04_build_linux.sh

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#!/bin/bash

CORES=$(getconf _NPROCESSORS_ONLN)
wdir=`pwd`
CC=${CC:-"${wdir}/riscv-toolchain/bin/riscv64-linux-"}

cd ./linux/

if [ ! -f ./.patched ] ; then
if [ -f arch/riscv/configs/mpfs_defconfig ] ; then
git am ../patches/linux/0002-PCIe-Change-controller-and-bridge-base-address.patch
git am ../patches/linux/0003-GPIO-Add-Microchip-CoreGPIO-driver.patch
git am ../patches/linux/0004-ADC-Add-Microchip-MCP356X-driver.patch
git am ../patches/linux/0005-Microchip-QSPI-Add-regular-transfers.patch
git am ../patches/linux/0006-BeagleV-Fire-Add-printk-to-IM219-driver-for-board-te.patch
git am ../patches/linux/0007-MMC-SPI-Hack-to-support-non-DMA-capable-SPI-ctrl.patch
git am ../patches/linux/0008-Add-wireless-regdb-regulatory-database-file.patch
git am ../patches/linux/0009-Makefile-build-mpfs-beaglev-fire.dtb.patch
git am ../patches/linux/0010-BeagleV-Fire-Add-MPFS-TVS-auxiliary-driver.patch
fi
touch .patched
fi

if [ -f arch/riscv/configs/mpfs_defconfig ] ; then
# cp -v ../patches/linux/Makefile arch/riscv/boot/dts/microchip/Makefile
cp -v ../device-tree/src/riscv/microchip/mpfs-beaglev-fire.dts arch/riscv/boot/dts/microchip/
cp -v ../device-tree/src/riscv/microchip/mpfs-beaglev-fire-fabric.dtsi arch/riscv/boot/dts/microchip/
cp -v ../device-tree/src/riscv/microchip/mpfs-beaglev-fire-pinmux.dtsi arch/riscv/boot/dts/microchip/
#echo "************************************"
#git diff arch/riscv/boot/dts/microchip/ > log.txt ; cat log.txt ; rm log.txt
#echo "************************************"
#echo "Current Device Tree Changes (5 second wait)"
#sleep 5
#else
# cp -v ../patches/linux/mainline/Makefile arch/riscv/boot/dts/microchip/Makefile
# cp -v ../patches/linux/mainline/dts/mpfs-beaglev-fire.dts arch/riscv/boot/dts/microchip/
# cp -v ../patches/linux/mainline/dts/mpfs-beaglev-fire-fabric.dtsi arch/riscv/boot/dts/microchip/
fi

echo "make ARCH=riscv CROSS_COMPILE=${CC} clean"
make ARCH=riscv CROSS_COMPILE=${CC} clean

if [ -f arch/riscv/configs/mpfs_defconfig ] ; then
cp -v ../patches/linux/mpfs_defconfig ./arch/riscv/configs/mpfs_defconfig

echo "make ARCH=riscv CROSS_COMPILE=${CC} mpfs_defconfig"
make ARCH=riscv CROSS_COMPILE=${CC} mpfs_defconfig

./scripts/config --set-str CONFIG_LOCALVERSION "-$(date +%Y%m%d)"

./scripts/config --enable CONFIG_OF_OVERLAY
./scripts/config --disable CONFIG_MODULE_DECOMPRESS

#enable CONFIG_DYNAMIC_FTRACE
./scripts/config --enable CONFIG_FUNCTION_TRACER
./scripts/config --enable CONFIG_DYNAMIC_FTRACE

./scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD
./scripts/config --enable CONFIG_MODULE_COMPRESS_XZ
./scripts/config --enable CONFIG_GPIO_AGGREGATOR

./scripts/config --enable CONFIG_CRYPTO_USER_API_HASH
./scripts/config --enable CONFIG_CRYPTO_USER_API_SKCIPHER
./scripts/config --enable CONFIG_KEY_DH_OPERATIONS
./scripts/config --enable CONFIG_CRYPTO_ECB
./scripts/config --enable CONFIG_CRYPTO_MD4
./scripts/config --enable CONFIG_CRYPTO_MD5
./scripts/config --enable CONFIG_CRYPTO_CBC
./scripts/config --enable CONFIG_CRYPTO_SHA256
./scripts/config --enable CONFIG_CRYPTO_AES
./scripts/config --enable CONFIG_CRYPTO_DES
./scripts/config --enable CONFIG_CRYPTO_CMAC
./scripts/config --enable CONFIG_CRYPTO_HMAC
./scripts/config --enable CONFIG_CRYPTO_SHA512
./scripts/config --enable CONFIG_CRYPTO_SHA1

./scripts/config --enable CONFIG_SENSORS_TVS_MPFS

echo "make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} olddefconfig"
make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} olddefconfig
else
echo "make ARCH=riscv CROSS_COMPILE=${CC} defconfig"
make ARCH=riscv CROSS_COMPILE=${CC} defconfig

./scripts/config --enable CONFIG_PCIE_MICROCHIP_HOST

./scripts/config --enable CONFIG_OF_OVERLAY
./scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD

./scripts/config --enable CONFIG_I2C
./scripts/config --enable CONFIG_EEPROM_AT24
./scripts/config --enable CONFIG_I2C_MICROCHIP_CORE

./scripts/config --enable CONFIG_SPI_MICROCHIP_CORE
./scripts/config --enable CONFIG_SPI_MICROCHIP_CORE_QSPI
./scripts/config --module CONFIG_SPI_SPIDEV

./scripts/config --enable CONFIG_GPIO_SYSFS

./scripts/config --enable CONFIG_HW_RANDOM_POLARFIRE_SOC

./scripts/config --enable CONFIG_USB_MUSB_HDRC
./scripts/config --enable CONFIG_NOP_USB_XCEIV
./scripts/config --enable CONFIG_USB_MUSB_POLARFIRE_SOC
./scripts/config --enable CONFIG_USB_MUSB_DUAL_ROLE

./scripts/config --enable CONFIG_MAILBOX
./scripts/config --enable CONFIG_POLARFIRE_SOC_MAILBOX
./scripts/config --disable CONFIG_SUN6I_MSGBOX

./scripts/config --enable CONFIG_REMOTEPROC
./scripts/config --enable CONFIG_REMOTEPROC_CDEV

./scripts/config --enable CONFIG_POLARFIRE_SOC_SYS_CTRL

./scripts/config --enable CONFIG_USB_GADGET
./scripts/config --enable CONFIG_USB_CONFIGFS
./scripts/config --enable CONFIG_CONFIGFS_FS
./scripts/config --enable CONFIG_USB_CONFIGFS_SERIAL
./scripts/config --enable CONFIG_USB_CONFIGFS_ACM
./scripts/config --enable CONFIG_USB_CONFIGFS_OBEX
./scripts/config --enable CONFIG_USB_CONFIGFS_NCM
./scripts/config --enable CONFIG_USB_CONFIGFS_ECM
./scripts/config --enable CONFIG_USB_CONFIGFS_ECM_SUBSET
./scripts/config --enable CONFIG_USB_CONFIGFS_RNDIS
./scripts/config --enable CONFIG_USB_CONFIGFS_EEM
./scripts/config --enable CONFIG_USB_CONFIGFS_PHONET
./scripts/config --enable CONFIG_USB_CONFIGFS_MASS_STORAGE
./scripts/config --enable CONFIG_USB_CONFIGFS_F_LB_SS
./scripts/config --enable CONFIG_USB_CONFIGFS_F_FS
./scripts/config --enable CONFIG_USB_CONFIGFS_F_UAC1
./scripts/config --enable CONFIG_USB_CONFIGFS_F_UAC2
./scripts/config --enable CONFIG_USB_CONFIGFS_F_MIDI
./scripts/config --enable CONFIG_USB_CONFIGFS_F_HID
./scripts/config --enable CONFIG_USB_CONFIGFS_F_UVC
./scripts/config --enable CONFIG_USB_CONFIGFS_F_PRINTER

./scripts/config --module CONFIG_MEDIA_SUPPORT
./scripts/config --enable CONFIG_MEDIA_SUPPORT_FILTER
./scripts/config --enable CONFIG_MEDIA_SUBDRV_AUTOSELECT
./scripts/config --enable CONFIG_MEDIA_CAMERA_SUPPORT
./scripts/config --module CONFIG_VIDEO_IMX219

./scripts/config --module CONFIG_IIO

#Cleanup large DRM...
./scripts/config --disable CONFIG_DRM
./scripts/config --disable CONFIG_DRM_RADEON
./scripts/config --disable CONFIG_DRM_NOUVEAU
./scripts/config --disable CONFIG_DRM_SUN4I

#Optimize:
./scripts/config --enable CONFIG_IP_NF_IPTABLES
./scripts/config --enable CONFIG_NETFILTER_XTABLES
./scripts/config --enable CONFIG_NLS_ISO8859_1
./scripts/config --enable CONFIG_BLK_DEV_DM

./scripts/config --set-str CONFIG_LOCALVERSION "-$(date +%Y%m%d)"

echo "make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} olddefconfig"
make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} olddefconfig
fi

echo "make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs"
make -j${CORES} ARCH=riscv CROSS_COMPILE="ccache ${CC}" Image modules dtbs

if [ ! -f ./arch/riscv/boot/Image ] ; then
echo "Build Failed"
exit 2
fi

KERNEL_UTS=$(cat "${wdir}/linux/include/generated/utsrelease.h" | awk '{print $3}' | sed 's/\"//g' )

if [ -d "${wdir}/deploy/tmp/" ] ; then
rm -rf "${wdir}/deploy/tmp/"
fi
mkdir -p "${wdir}/deploy/tmp/"

make -s ARCH=riscv CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH="${wdir}/deploy/tmp"

if [ -f "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" ] ; then
rm -rf "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" || true
fi
echo "Compressing ${KERNEL_UTS}-modules.tar.gz..."
echo "${KERNEL_UTS}" > "${wdir}/deploy/.modules"
cd "${wdir}/deploy/tmp" || true
tar --create --gzip --file "../${KERNEL_UTS}-modules.tar.gz" ./*
cd "${wdir}/linux/" || exit
rm -rf "${wdir}/deploy/tmp" || true

if [ -f arch/riscv/configs/mpfs_defconfig ] ; then
cp -v ./.config ../patches/linux/mpfs_defconfig
cp -v ./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts ../patches/linux/dts/mpfs-beaglev-fire.dts
cp -v ./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-fabric.dtsi ../patches/linux/dts/mpfs-beaglev-fire-fabric.dtsi
else
cp -v ./.config ../patches/linux/mainline/defconfig
cp -v ./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts ../patches/linux/mainline/dts/mpfs-beaglev-fire.dts
cp -v ./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-fabric.dtsi ../patches/linux/mainline/dts/mpfs-beaglev-fire-fabric.dtsi
fi
if [ ! -d ../deploy/input/ ] ; then
mkdir -p ../deploy/input/ || true
fi
cp -v ./arch/riscv/boot/Image ../deploy/input/
cp -v ./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dtb ../deploy/input/

cd ../

cp -v ./patches/linux/beaglev_fire.its ./deploy/input/
cd ./deploy/input/
gzip -9 Image -c > Image.gz
if [ -f ../../u-boot/tools/mkimage ] ; then
../../u-boot/tools/mkimage -f beaglev_fire.its beaglev_fire.itb
fi
#

1.3 06_generate_ubuntu_console_root.sh

Just update 23.04 to 24.04

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash

if ! id | grep -q root; then
echo "./06_generate_ubuntu_console_root.sh must be run as root:"
echo "sudo ./06_generate_ubuntu_console_root.sh"
exit
fi

wdir=`pwd`

if [ -f /tmp/latest ] ; then
rm -rf /tmp/latest | true
fi
wget --quiet --directory-prefix=/tmp/ https://rcn-ee.net/rootfs/ubuntu-riscv64-24.04-minimal/latest || true
if [ -f /tmp/latest ] ; then
latest_rootfs=$(cat "/tmp/latest")
datestamp=$(cat "/tmp/latest" | awk -F 'riscv64-' '{print $2}' | awk -F '.' '{print $1}')

if [ ! -f ./deploy/ubuntu-24.04.1-console-riscv64-${datestamp}/riscv64-rootfs-ubuntu-lunar.tar ] ; then
if [ -f ./.gitlab-runner ] ; then
wget -c --directory-prefix=./deploy http://192.168.1.98/mirror/rcn-ee.us/rootfs/ubuntu-riscv64-24.04-minimal/${datestamp}/${latest_rootfs}
else
wget -c --directory-prefix=./deploy https://rcn-ee.net/rootfs/ubuntu-riscv64-24.04-minimal/${datestamp}/${latest_rootfs}
fi
cd ./deploy/
tar xf ${latest_rootfs}
cd ../
fi
else
echo "Failure: getting image"
exit 2
fi

if [ -d ./ignore/.root ] ; then
rm -rf ./ignore/.root || true
fi
mkdir -p ./ignore/.root

echo "Extracting: ubuntu-24.04.1-console-riscv64-${datestamp}/riscv64-rootfs-ubuntu-lunar.tar"
tar xfp ./deploy/ubuntu-24.04.1-console-riscv64-${datestamp}/riscv64-rootfs-ubuntu-lunar.tar -C ./ignore/.root
sync

mkdir -p ./deploy/input/ || true
cp -v ./deploy/boot.scr deploy/input/
cp -v ./deploy/sysconf.txt deploy/input/

echo "label Linux eMMC" > ./deploy/input/extlinux.conf
echo " kernel /Image" >> ./deploy/input/extlinux.conf
#echo " append root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait console=ttyS0,115200 earlycon uio_pdrv_genirq.of_id=generic-uio net.ifnames=0" >> ./deploy/input/extlinux.conf
echo " fdtdir /" >> ./deploy/input/extlinux.conf
echo " fdt /mpfs-beaglev-fire.dtb" >> ./deploy/input/extlinux.conf
echo " #fdtoverlays /overlays/<file>.dtbo" >> ./deploy/input/extlinux.conf

#echo "extlinux/extlinux.conf"
#cat ./deploy/input/extlinux.conf

mkdir -p ./ignore/.root/boot/firmware/ || true

echo '/dev/mmcblk0p2 /boot/firmware/ vfat user,uid=1000,gid=1000,defaults 0 2' >> ./ignore/.root/etc/fstab
echo '/dev/mmcblk0p3 / auto errors=remount-ro 0 1' >> ./ignore/.root/etc/fstab
echo 'debugfs /sys/kernel/debug debugfs mode=755,uid=root,gid=gpio,defaults 0 0' >> ./ignore/.root/etc/fstab

#Network-Manager, ignore eth1
#cp -v ./rootfs/etc/NetworkManager/conf.d/*.conf ./ignore/.root/etc/NetworkManager/conf.d/

cp -v ./ignore/.root/etc/bbb.io/templates/eth0-DHCP.network ./ignore/.root/etc/systemd/network/eth0.network || true
cp -v ./ignore/.root/etc/bbb.io/templates/eth1-DHCP.network ./ignore/.root/etc/systemd/network/eth1.network || true

# setuid root ping+ping6
chmod u+s ./ignore/.root/usr/bin/ping ./ignore/.root/usr/bin/ping6

#Default nginx export
rm -f ./ignore/.root/etc/nginx/sites-enabled/default || true
cp -v ./ignore/.root/etc/bbb.io/templates/nginx/nginx-autoindex ./ignore/.root/etc/nginx/sites-enabled/default
cp -v ./ignore/.root/etc/bbb.io/templates/nginx/*.html ./ignore/.root/var/www/html/
rm -f ./ignore/.root/var/www/html/index.nginx-debian.html || true

if [ -f ./deploy/.modules ] ; then
version=$(cat ./deploy/.modules || true)
if [ -f ./deploy/${version}-modules.tar.gz ] ; then
tar xf ./deploy/${version}-modules.tar.gz -C ./ignore/.root/usr/
fi
fi

echo '---------------------'
echo 'File Size'
du -sh ignore/.root/ || true
echo '---------------------'

dd if=/dev/zero of=./deploy/input/root.ext4 bs=1 count=0 seek=3800M
mkfs.ext4 -F ./deploy/input/root.ext4 -d ./ignore/.root

if [ -f ./.06_generate_root.sh ] ; then
rm -f ./.06_generate_root.sh || true
fi

1.4 git_linux_mainline.sh

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

GCC_VERSION="14.2.0"

HSS_BRANCH="v2024.09"
HSS_REPO="https://github.com/polarfire-soc/hart-software-services.git"

#UBOOT_BRANCH="mpfs-uboot-2022.01"
UBOOT_BRANCH="linux4microchip+fpga-2024.09"
UBOOT_REPO="https://github.com/linux4microchip/u-boot-mchp"

#LINUX_BRANCH="linux4microchip+fpga-2023.06"
#LINUX_REPO="https://github.com/linux4microchip/linux.git"

LINUX_BRANCH="master"
LINUX_REPO="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"

#Use custom device tree and Makefile in patches/linux directory...
#LINUX_BRANCH="linux-6.4.y"
#LINUX_BRANCH="linux-6.3.y"
#LINUX_BRANCH="linux-6.2.y"
#LINUX_BRANCH="linux-6.1.y"
#LINUX_REPO="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"

GIT_DEPTH="20"

if [ ! -f ./mirror/x86_64-gcc-${GCC_VERSION}.0-nolibc-riscv64-linux.tar.xz ] ; then
echo "wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/14.2.0/x86_64-gcc-14.2.0-nolibc-riscv64-linux.tar.xz"
wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/14.2.0/x86_64-gcc-14.2.0-nolibc-riscv64-linux.tar.xz
fi

if [ ! -f ./riscv-toolchain/bin/riscv64-linux-gcc-${GCC_VERSION}.0 ] ; then
echo "tar xf ./mirror/x86_64-gcc-14.2.0-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/"
tar xf ./mirror/x86_64-gcc-14.2.0-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/
fi

#if [ ! -f ./mirror/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz ] ; then
# echo "wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz"
# wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz
#fi

#if [ ! -f ./riscv-toolchain/bin/riscv64-linux-gcc-13.2.0 ] ; then
# echo "tar xf ./mirror/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/"
# tar xf ./mirror/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/
#fi

#if [ -d ./hart-software-services/ ] ; then
# rm -rf ./hart-software-services/ || true
#fi

#echo "git clone -b ${HSS_BRANCH} ${HSS_REPO} ./hart-software-services/ --depth=${GIT_DEPTH}"
#git clone -b ${HSS_BRANCH} ${HSS_REPO} ./hart-software-services/ --depth=${GIT_DEPTH}

#if [ -d ./u-boot ] ; then
# rm -rf ./u-boot || true
#fi

#echo "git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}"
#git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}

if [ -d ./linux ] ; then
rm -rf ./linux || true
fi

echo "git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}"
git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}

#

1.5 git_linux_mpfs.sh

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
55
56
57
58
59
60
61
#!/bin/bash

GCC_VERSION="14.2.0"

HSS_BRANCH="v2024.09"
HSS_REPO="https://github.com/polarfire-soc/hart-software-services.git"

#UBOOT_BRANCH="mpfs-uboot-2022.01"
UBOOT_BRANCH="u-boot-2024.07-mchp"
UBOOT_REPO="https://github.com/linux4microchip/u-boot-mchp.git"

LINUX_BRANCH="linux4microchip+fpga-2024.09"
LINUX_REPO="https://github.com/linux4microchip/linux.git"

#LINUX_BRANCH="master"
#LINUX_REPO="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"

GIT_DEPTH="20"

if [ ! -f ./mirror/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz ] ; then
echo "wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/${GCC_VERSION}/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz"
wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/${GCC_VERSION}/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz
fi

if [ ! -f ./riscv-toolchain/bin/riscv64-linux-gcc-${GCC_VERSION} ] ; then
echo "tar xf ./mirror/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/"
tar xf ./mirror/x86_64-gcc-${GCC_VERSION}-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/
fi

#if [ ! -f ./mirror/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz ] ; then
# echo "wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz"
# wget -c --directory-prefix=./mirror/ https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz
#fi

#if [ ! -f ./riscv-toolchain/bin/riscv64-linux-gcc-13.2.0 ] ; then
# echo "tar xf ./mirror/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/"
# tar xf ./mirror/x86_64-gcc-13.2.0-nolibc-riscv64-linux.tar.xz --strip-components=2 -C ./riscv-toolchain/
#fi

#if [ -d ./hart-software-services/ ] ; then
# rm -rf ./hart-software-services/ || true
#fi

#echo "git clone -b ${HSS_BRANCH} ${HSS_REPO} ./hart-software-services/ --depth=${GIT_DEPTH}"
#git clone -b ${HSS_BRANCH} ${HSS_REPO} ./hart-software-services/ --depth=${GIT_DEPTH}

#if [ -d ./u-boot ] ; then
# rm -rf ./u-boot || true
#fi

#echo "git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}"
#git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}

if [ -d ./linux ] ; then
rm -rf ./linux || true
fi

echo "git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}"
git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}

#

2. Manually Flash BeagleV-Fire Board With ALL Updates - Failed To Boot

2.1 01_git_sync.sh

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./01_git_sync.sh 
git clone -b v2024.09 https://github.com/polarfire-soc/hart-software-services.git ./hart-software-services/ --depth=20
Cloning into './hart-software-services'...
remote: Enumerating objects: 1927, done.
remote: Counting objects: 100% (1927/1927), done.
remote: Compressing objects: 100% (1269/1269), done.
remote: Total 1927 (delta 750), reused 1310 (delta 594), pack-reused 0 (from 0)
Receiving objects: 100% (1927/1927), 4.34 MiB | 9.74 MiB/s, done.
Resolving deltas: 100% (750/750), done.
Note: switching to 'd4f264196f6549a41eab246e1df4ab58b5744950'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

git clone -b linux4microchip+fpga-2024.09 https://github.com/linux4microchip/u-boot-mchp.git ./u-boot/ --depth=20
Cloning into './u-boot'...
remote: Enumerating objects: 21768, done.
remote: Counting objects: 100% (21768/21768), done.
remote: Compressing objects: 100% (18900/18900), done.
remote: Total 21768 (delta 3895), reused 13023 (delta 2479), pack-reused 0 (from 0)
Receiving objects: 100% (21768/21768), 28.80 MiB | 21.37 MiB/s, done.
Resolving deltas: 100% (3895/3895), done.
Note: switching to 'f3858c18fa163210ebcb95d44e2ab181a234cdf0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (19998/19998), done.
git clone -b v6.6.x-Beagle https://openbeagle.org/beagleboard/BeagleBoard-DeviceTrees.git ./device-tree/ --depth=20
Cloning into './device-tree'...
remote: Enumerating objects: 461, done.
remote: Counting objects: 100% (461/461), done.
remote: Compressing objects: 100% (301/301), done.
remote: Total 461 (delta 202), reused 303 (delta 133), pack-reused 0 (from 0)
Receiving objects: 100% (461/461), 421.34 KiB | 8.60 MiB/s, done.
Resolving deltas: 100% (202/202), done.
git clone -b linux4microchip+fpga-2024.09.1 https://github.com/linux4microchip/linux.git ./linux/ --depth=20
Cloning into './linux'...
info: Could not add alternate for '/home/lvision/linux-src/': path '/home/lvision/linux-src/' does not exist
remote: Enumerating objects: 104359, done.
remote: Counting objects: 100% (104359/104359), done.
remote: Compressing objects: 100% (86274/86274), done.
remote: Total 104359 (delta 20278), reused 99348 (delta 17156), pack-reused 0 (from 0)
Receiving objects: 100% (104359/104359), 269.63 MiB | 16.51 MiB/s, done.
Resolving deltas: 100% (20278/20278), done.
Note: switching to 'eed24b95b006240f806e6e7730ff3782a16074df'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (81932/81932), done.
➜ BeagleV-Fire-ubuntu git:(main) ✗

2.2 ./02_build_hss.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./02_build_hss.sh 
make: Entering directory '....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
RM ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/hss-payload-generator ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/main.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/yaml_parser.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/blob_handler.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_parser.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_strings.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/crc32.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/generate_payload.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/dump_payload.o ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/debug_printf.o
make: Leaving directory '....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
make -C hart-software-services/tools/hss-payload-generator/
make: Entering directory '....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/main.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/yaml_parser.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/blob_handler.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_parser.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_strings.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/crc32.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/generate_payload.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/dump_payload.o
CC ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/debug_printf.o
LD ....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/hss-payload-generator
make: Leaving directory '....../BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
'./hart-software-services/tools/hss-payload-generator/hss-payload-generator' -> './deploy/hss-payload-generator'

2.3 ./03_build_u-boot.sh

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./03_build_u-boot.sh 
make: Entering directory '....../BeagleV-Fire-ubuntu/u-boot'
make: Leaving directory '....../BeagleV-Fire-ubuntu/u-boot'
make: Entering directory '....../BeagleV-Fire-ubuntu/u-boot'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
YACC scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
make: Leaving directory '....../BeagleV-Fire-ubuntu/u-boot'
make: Entering directory '....../BeagleV-Fire-ubuntu/u-boot'
scripts/kconfig/conf --olddefconfig Kconfig
#
# configuration written to .config
#
make: Leaving directory '....../BeagleV-Fire-ubuntu/u-boot'
make: Entering directory '....../BeagleV-Fire-ubuntu/u-boot'
scripts/kconfig/conf --savedefconfig=defconfig Kconfig
make: Leaving directory '....../BeagleV-Fire-ubuntu/u-boot'
'./u-boot/defconfig' -> './u-boot/configs/microchip_mpfs_icicle_defconfig'
'./u-boot/defconfig' -> './patches/u-boot/beaglev-fire/microchip_mpfs_icicle_defconfig'
make -C u-boot -j48 ARCH=riscv CROSS_COMPILE=....../BeagleV-Fire-ubuntu/riscv-toolchain/bin/riscv64-linux- all
make: Entering directory '....../BeagleV-Fire-ubuntu/u-boot'
scripts/kconfig/conf --syncconfig Kconfig
UPD include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk.dep
GEN include/autoconf.mk
UPD include/generated/dt.h
ENVC include/generated/env.txt
UPD include/generated/timestamp_autogenerated.h
ENVP include/generated/env.in
ENVT include/generated/environment.h
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
LEX scripts/dtc/dtc-lexer.lex.c
YACC scripts/dtc/dtc-parser.tab.h
YACC scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/yamltree.o
UPD include/config/uboot.release
UPD include/generated/version_autogenerated.h
CC lib/asm-offsets.s
CC arch/riscv/lib/asm-offsets.s
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
UPD include/generated/generic-asm-offsets.h
UPD include/generated/asm-offsets.h
LDS u-boot.lds
HOSTLD scripts/dtc/dtc
HOSTCC tools/gen_eth_addr
HOSTCC tools/gen_ethaddr_crc.o
WRAP tools/lib/crc8.c
HOSTCC tools/img2srec
HOSTCC tools/mkenvimage.o
HOSTCC tools/os_support.o
WRAP tools/lib/crc32.c
HOSTCC tools/aisimage.o
HOSTCC tools/atmelimage.o
HOSTCC tools/fit_common.o
HOSTCC tools/fit_image.o
HOSTCC tools/image-host.o
WRAP tools/boot/image-fit.c
HOSTCC tools/image-sig-host.o
WRAP tools/boot/image-fit-sig.c
WRAP tools/boot/image-cipher.c
WRAP tools/boot/fdt_region.c
WRAP tools/boot/bootm.c
HOSTCC tools/lib/crc32.o
HOSTCC tools/default_image.o
WRAP tools/lib/fdtdec_common.c
WRAP tools/lib/fdtdec.c
WRAP tools/boot/image.c
WRAP tools/boot/image-host.c
HOSTCC tools/imagetool.o
HOSTCC tools/imximage.o
HOSTCC tools/imx8image.o
HOSTCC tools/imx8mimage.o
HOSTCC tools/kwbimage.o
WRAP tools/lib/md5.c
HOSTCC tools/lpc32xximage.o
HOSTCC tools/mxsimage.o
HOSTCC tools/omapimage.o
HOSTCC tools/pblimage.o
HOSTCC tools/pbl_crc32.o
HOSTCC tools/renesas_spkgimage.o
HOSTCC tools/vybridimage.o
HOSTCC tools/stm32image.o
WRAP tools/lib/rc4.c
HOSTCC tools/rkcommon.o
HOSTCC tools/rkimage.o
HOSTCC tools/rksd.o
HOSTCC tools/rkspi.o
HOSTCC tools/socfpgaimage.o
HOSTCC tools/sunxi_egon.o
WRAP tools/lib/crc16-ccitt.c
WRAP tools/lib/hash-checksum.c
WRAP tools/lib/sha1.c
WRAP tools/lib/sha256.c
WRAP tools/lib/sha512.c
WRAP tools/common/hash.c
HOSTCC tools/ublimage.o
HOSTCC tools/zynqimage.o
HOSTCC tools/zynqmpimage.o
HOSTCC tools/zynqmpbif.o
WRAP tools/lib/fdt-libcrypto.c
HOSTCC tools/sunxi_toc0.o
HOSTCC tools/libfdt/fdt.o
HOSTCC tools/libfdt/fdt_ro.o
HOSTCC tools/libfdt/fdt_wip.o
HOSTCC tools/libfdt/fdt_sw.o
HOSTCC tools/libfdt/fdt_rw.o
HOSTCC tools/libfdt/fdt_strerror.o
HOSTCC tools/libfdt/fdt_empty_tree.o
HOSTCC tools/libfdt/fdt_addresses.o
HOSTCC tools/libfdt/fdt_overlay.o
HOSTCC tools/libfdt/fdt_check.o
HOSTCC tools/gpimage.o
HOSTCC tools/gpimage-common.o
HOSTCC tools/mtk_image.o
HOSTCC tools/mtk_nand_headers.o
WRAP tools/lib/ecdsa/ecdsa-libcrypto.c
WRAP tools/lib/rsa/rsa-sign.c
WRAP tools/lib/rsa/rsa-verify.c
WRAP tools/lib/rsa/rsa-mod-exp.c
WRAP tools/lib/aes/aes-encrypt.c
WRAP tools/lib/aes/aes-decrypt.c
HOSTCC tools/dumpimage.o
HOSTCC tools/boot/image-fit.o
HOSTCC tools/boot/image-fit-sig.o
HOSTCC tools/boot/image-cipher.o
HOSTCC tools/boot/fdt_region.o
HOSTCC tools/boot/bootm.o
HOSTCC tools/lib/fdtdec_common.o
HOSTCC tools/lib/fdtdec.o
HOSTCC tools/boot/image.o
HOSTCC tools/boot/image-host.o
HOSTCC tools/lib/md5.o
HOSTCC tools/lib/rc4.o
HOSTCC tools/lib/crc16-ccitt.o
HOSTCC tools/lib/hash-checksum.o
HOSTCC tools/lib/sha1.o
HOSTCC tools/lib/sha256.o
HOSTCC tools/lib/sha512.o
HOSTCC tools/common/hash.o
HOSTCC tools/lib/fdt-libcrypto.o
HOSTCC tools/lib/ecdsa/ecdsa-libcrypto.o
HOSTCC tools/lib/rsa/rsa-sign.o
HOSTCC tools/lib/rsa/rsa-verify.o
HOSTCC tools/lib/rsa/rsa-mod-exp.o
HOSTCC tools/lib/aes/aes-encrypt.o
HOSTCC tools/lib/aes/aes-decrypt.o
HOSTCC tools/mkimage.o
HOSTCC tools/fit_info.o
HOSTCC tools/fit_check_sign.o
HOSTCC tools/fdt_add_pubkey.o
HOSTCC tools/proftool.o
WRAP tools/lib/abuf.c
HOSTCC tools/prelink-riscv
HOSTCC tools/fdtgrep.o
HOSTCC tools/spl_size_limit
HOSTCC tools/lib/crc8.o
HOSTLD tools/mkenvimage
HOSTCC tools/lib/abuf.o
HOSTLD tools/gen_ethaddr_crc
HOSTLD tools/fdtgrep
HOSTLD tools/proftool
HOSTLD tools/dumpimage
HOSTLD tools/mkimage
HOSTLD tools/fit_info
HOSTLD tools/fit_check_sign
HOSTLD tools/fdt_add_pubkey
CC arch/riscv/cpu/cpu.o
AS arch/riscv/cpu/mtrap.o
AS arch/riscv/cpu/start.o
CC arch/riscv/cpu/mpfs/dram.o
CC arch/riscv/cpu/mpfs/cpu.o
CC arch/riscv/lib/bootm.o
CC arch/riscv/lib/image.o
CC arch/riscv/lib/boot.o
CC arch/riscv/lib/cache.o
CC arch/riscv/lib/sbi.o
CC board/microchip/mpfs_icicle/mpfs_icicle.o
CC arch/riscv/lib/interrupts.o
AS arch/riscv/lib/setjmp.o
CC arch/riscv/lib/fdt_fixup.o
AS arch/riscv/lib/memset.o
AS arch/riscv/lib/memmove.o
AS arch/riscv/lib/memcpy.o
AS arch/riscv/lib/crt0_riscv_efi.o
CC boot/bootm.o
CC arch/riscv/lib/reloc_riscv_efi.o
CC boot/bootm_os.o
CC boot/pxe_utils.o
CC boot/image.o
CC boot/image-board.o
CC boot/bootdev-uclass.o
CC boot/bootflow.o
CC boot/bootmeth-uclass.o
CC boot/bootstd-uclass.o
CC boot/bootmeth_extlinux.o
CC cmd/boot.o
CC boot/bootmeth_pxe.o
CC cmd/bootm.o
CC common/main.o
CC boot/bootmeth_efi.o
CC common/exports.o
CC cmd/help.o
CC disk/part.o
CC common/cli_hush.o
CC cmd/panic.o
CC boot/image-fdt.o
CC disk/disk-uclass.o
CC common/init/board_init.o
CC disk/part_dos.o
CC boot/image-fit.o
CC common/autoboot.o
CC disk/part_iso.o
AR cmd/riscv/built-in.o
AR drivers/usb/cdns3/built-in.o
CC disk/part_efi.o
CC cmd/version.o
AR drivers/usb/common/built-in.o
AR drivers/adc/built-in.o
AR drivers/ata/built-in.o
AR drivers/usb/dwc3/built-in.o
AR drivers/axi/built-in.o
CC common/board_f.o
CC common/board_r.o
CC boot/vbe.o
CC common/board_info.o
AR drivers/bus/built-in.o
CC drivers/block/blk-uclass.o
AR drivers/usb/emul/built-in.o
CC cmd/blk_common.o
AR drivers/usb/eth/built-in.o
CC common/fdt_support.o
CC drivers/block/blkcache.o
AR drivers/cache/built-in.o
CC cmd/bootflow.o
AR arch/riscv/cpu/mpfs/built-in.o
CC common/miiphyutil.o
AR drivers/clk/analogbits/built-in.o
AR arch/riscv/cpu/built-in.o
CC drivers/clk/imx/clk-gate2.o
CC boot/vbe_request.o
AR drivers/usb/host/built-in.o
CC drivers/clk/microchip/mpfs_clk.o
AR drivers/clk/tegra/built-in.o
AR drivers/usb/isp1760/built-in.o
CC common/splash.o
AR drivers/usb/mtu3/built-in.o
CC boot/vbe_simple.o
CC boot/vbe_simple_os.o
CC common/menu.o
CC drivers/cpu/cpu-uclass.o
CC drivers/core/device.o
AR common/init/built-in.o
AR drivers/clk/ti/built-in.o
CC drivers/core/fdtaddr.o
CC drivers/clk/imx/clk-pllv3.o
CC common/cli_getch.o
CC cmd/source.o
CC drivers/clk/microchip/mpfs_clk_cfg.o
AR arch/riscv/lib/built-in.o
CC drivers/cpu/riscv_cpu.o
CC drivers/clk/imx/clk-pfd.o
CC drivers/clk/clk-uclass.o
CC drivers/core/lists.o
AR board/microchip/mpfs_icicle/built-in.o
AR drivers/usb/musb/built-in.o
CC drivers/core/root.o
CC drivers/crypto/fsl/sec.o
AR drivers/crypto/aspeed/built-in.o
CC drivers/clk/microchip/mpfs_clk_periph.o
AR drivers/crypto/hash/built-in.o
CC drivers/clk/microchip/mpfs_clk_msspll.o
AR drivers/crypto/nuvoton/built-in.o
CC cmd/bdinfo.o
CC drivers/core/uclass.o
CC common/cli_readline.o
AR drivers/dfu/built-in.o
CC cmd/blkcache.o
AR drivers/usb/phy/built-in.o
AR drivers/gpio/built-in.o
AR drivers/usb/ulpi/built-in.o
CC cmd/bootefi.o
CC drivers/core/util.o
CC drivers/clk/clk_fixed_rate.o
CC drivers/clk/clk_fixed_factor.o
CC env/common.o
CC common/cli_simple.o
CC drivers/i2c/i2c-uclass.o
AR drivers/crypto/rsa_mod_exp/built-in.o
CC cmd/booti.o
CC drivers/input/key_matrix.o
CC drivers/core/tag.o
CC fs/ext4/ext4fs.o
AR drivers/crypto/fsl/built-in.o
CC fs/fat/fat_write.o
AR drivers/crypto/built-in.o
CC drivers/clk/clk.o
AR drivers/usb/musb-new/built-in.o
CC common/console.o
CC common/dlmalloc.o
AR lib/crypto/built-in.o
CC cmd/console.o
CC net/arp.o
AR drivers/iommu/built-in.o
AR drivers/cpu/built-in.o
CC lib/efi_driver/efi_uclass.o
CC env/env.o
CC lib/efi_driver/efi_block_device.o
CC env/attr.o
CC drivers/core/device-remove.o
CC env/flags.o
CC fs/ext4/ext4_common.o
CC fs/ubifs/ubifs.o
CC env/callback.o
CC net/bootp.o
CC cmd/cpu.o
AR drivers/clk/imx/built-in.o
CC cmd/dm.o
CC lib/efi_loader/efi_bootmgr.o
CC lib/efi_loader/efi_boottime.o
CC drivers/core/simple-bus.o
AR drivers/clk/microchip/built-in.o
CC drivers/core/dump.o
CC env/nowhere.o
CC fs/ubifs/io.o
CC net/eth-uclass.o
CC lib/efi_loader/efi_helper.o
CC common/malloc_simple.o
CC fs/ubifs/super.o
AR drivers/block/built-in.o
CC lib/libfdt/fdt.o
CC lib/efi_loader/efi_console.o
CC net/eth_bootdev.o
AR drivers/mailbox/built-in.o
CC net/eth_common.o
CC fs/ext4/dev.o
CC drivers/clk/clk-divider.o
CC lib/libfdt/fdt_ro.o
CC common/event.o
CC net/net.o
AR drivers/input/built-in.o
CC fs/fs.o
CC lib/libfdt/fdt_wip.o
CC fs/ubifs/sb.o
CC fs/fs_internal.o
CC drivers/core/regmap.o
CC common/hash.o
CC drivers/clk/clk-mux.o
CC common/memsize.o
CC drivers/clk/clk-gate.o
CC drivers/clk/clk-fixed-factor.o
CC net/nfs.o
CC lib/efi_loader/efi_device_path.o
AR disk/built-in.o
CC drivers/i2c/i2c-microchip.o
AR env/built-in.o
CC lib/lzma/LzmaDec.o
CC cmd/echo.o
CC lib/efi_loader/efi_device_path_to_text.o
CC cmd/eficonfig.o
CC common/stdio.o
AR lib/efi_driver/built-in.o
CC lib/libfdt/fdt_strerror.o
CC lib/libfdt/fdt_sw.o
CC net/ping.o
CC fs/ubifs/master.o
CC fs/ubifs/lpt.o
CC lib/libfdt/fdt_rw.o
CC fs/ubifs/lpt_commit.o
CC cmd/elf.o
AR drivers/memory/built-in.o
CC drivers/core/syscon-uclass.o
CC net/tftp.o
AR drivers/mfd/built-in.o
CC lib/lzma/LzmaTools.o
CC lib/libfdt/fdt_empty_tree.o
AR drivers/misc/built-in.o
CC lib/lzo/lzo1x_decompress.o
CC lib/libfdt/fdt_check.o
CC lib/libfdt/fdt_addresses.o
CC fs/ubifs/scan.o
CC fs/ubifs/lprops.o
CC lib/efi_loader/efi_device_path_utilities.o
CC drivers/core/of_extra.o
CC drivers/mmc/mmc.o
CC drivers/mmc/mmc-uclass.o
CC lib/libfdt/fdt_overlay.o
CC drivers/mmc/mmc_bootdev.o
CC drivers/core/ofnode.o
CC fs/ubifs/tnc.o
CC drivers/core/read_extra.o
AR fs/ext4/built-in.o
CC fs/ubifs/tnc_misc.o
CC cmd/exit.o
AR boot/built-in.o
CC lib/zlib/zlib.o
AR drivers/clk/built-in.o
CC fs/ubifs/debug.o
AR drivers/i2c/built-in.o
CC fs/ubifs/budget.o
CC cmd/ext4.o
CC cmd/ext2.o
AR drivers/net/mscc_eswitch/built-in.o
AR drivers/mtd/onenand/built-in.o
CC drivers/mtd/nand/spi/core.o
AR drivers/power/pmic/built-in.o
CC drivers/mtd/nand/spi/gigadevice.o
CC drivers/net/phy/phy.o
AR drivers/net/qe/built-in.o
CC drivers/mtd/nand/core.o
CC drivers/mmc/mmc_write.o
AR drivers/power/regulator/built-in.o
CC common/cli.o
CC drivers/mtd/nand/spi/macronix.o
CC lib/efi_loader/efi_dt_fixup.o
CC drivers/mtd/nand/bbt.o
CC fs/ubifs/log.o
AR drivers/power/built-in.o
CC drivers/mtd/spi/sf-uclass.o
CC drivers/net/phy/vitesse.o
CC drivers/mtd/spi/sf_probe.o
CC lib/efi_loader/efi_file.o
CC drivers/mtd/spi/spi-nor-ids.o
CC drivers/mtd/ubi/attach.o
CC drivers/mtd/spi/spi-nor-core.o
CC fs/ubifs/orphan.o
CC lib/charset.o
AR drivers/pwm/built-in.o
CC lib/efi_loader/efi_hii.o
CC cmd/fat.o
CC lib/efi_loader/efi_image_loader.o
CC lib/efi_loader/efi_load_options.o
CC drivers/mtd/nand/spi/micron.o
CC drivers/mtd/ubi/build.o
AR lib/lzo/built-in.o
CC common/command.o
CC drivers/mtd/nand/spi/toshiba.o
AR drivers/net/ti/built-in.o
CC drivers/mmc/sdhci-adma.o
CC cmd/fdt.o
CC common/s_record.o
CC fs/ubifs/recovery.o
CC fs/ubifs/replay.o
CC drivers/mtd/mtdcore.o
CC lib/crc8.o
CC fs/ubifs/gc.o
CC common/xyzModem.o
AR net/built-in.o
CC drivers/mtd/nand/spi/winbond.o
CC drivers/mtd/mtd_uboot.o
CC drivers/mtd/ubi/vtbl.o
CC lib/crc16.o
CC lib/efi_loader/efi_memory.o
CC drivers/mtd/mtd-uclass.o
CC drivers/mmc/sdhci.o
CC drivers/mtd/mtdpart.o
AR lib/libfdt/built-in.o
CC cmd/flash.o
AR drivers/reset/built-in.o
CC drivers/mtd/ubi/upd.o
CC drivers/mtd/ubi/vmt.o
AR drivers/mtd/nand/nandcore.o
AR drivers/rtc/built-in.o
CC lib/efi_loader/efi_root_node.o
AR drivers/scsi/built-in.o
CC drivers/net/macb.o
CC cmd/fs.o
CC lib/efi_loader/efi_runtime.o
CC lib/crc16-ccitt.o
CC lib/efi_loader/efi_setup.o
CC drivers/mmc/sdhci-cadence.o
CC drivers/mtd/ubi/kapi.o
CC drivers/mtd/ubi/eba.o
CC lib/fdtdec_common.o
CC cmd/i2c.o
CC lib/efi_loader/efi_string.o
CC drivers/serial/serial-uclass.o
CC lib/efi_loader/efi_unicode_collation.o
CC drivers/mtd/ubi/io.o
CC lib/smbios.o
AR drivers/smem/built-in.o
AR drivers/soc/built-in.o
CC drivers/mtd/ubi/wl.o
CC drivers/serial/ns16550.o
CC drivers/mtd/ubi/crc32.o
CC drivers/spi/spi-uclass.o
CC drivers/spi/spi-mem.o
AR drivers/sound/built-in.o
CC drivers/mtd/ubi/misc.o
CC drivers/spi/microchip_coreqspi.o
CC drivers/mtd/ubi/debug.o
AR drivers/spmi/built-in.o
CC cmd/itest.o
CC lib/ldiv.o
AR drivers/net/phy/built-in.o
AR lib/lzma/built-in.o
CC lib/net_utils.o
AR common/built-in.o
CC lib/rc4.o
CC lib/efi_loader/efi_var_common.o
CC lib/efi_loader/efi_var_mem.o
CC cmd/load.o
AR drivers/core/built-in.o
CC lib/rbtree.o
CC cmd/mem.o
CC cmd/mii.o
CC drivers/sysreset/sysreset-uclass.o
CC cmd/mdio.o
AR drivers/thermal/built-in.o
CC drivers/sysreset/sysreset_sbi.o
CC cmd/sleep.o
CC lib/list_sort.o
CC lib/efi_loader/efi_var_file.o
CC lib/md5.o
CC lib/efi_loader/efi_variable.o
AR drivers/mtd/nand/spi/spinand.o
CC lib/hash-checksum.o
CC cmd/mmc.o
AR drivers/mtd/nand/spi/built-in.o
CC drivers/timer/timer-uclass.o
AR fs/fat/built-in.o
AR drivers/mtd/nand/built-in.o
CC lib/efi_loader/efi_watchdog.o
CC drivers/timer/riscv_timer.o
CC cmd/mtd.o
AR drivers/ufs/built-in.o
AR drivers/watchdog/built-in.o
CC lib/sha1.o
CC lib/efi_loader/efi_disk.o
AR drivers/video/bridge/built-in.o
CC lib/efi_loader/efi_net.o
AR drivers/video/sunxi/built-in.o
CC cmd/mtdparts.o
CC lib/sha256.o
AR drivers/video/tegra20/built-in.o
AR drivers/video/ti/built-in.o
AR drivers/mtd/mtd.o
CC cmd/legacy-mtd-utils.o
AR drivers/serial/built-in.o
CC lib/gunzip.o
CC cmd/net.o
CC cmd/part.o
AR drivers/video/built-in.o
AR drivers/mtd/spi/spi-nor.o
CC cmd/pxe.o
CC cmd/sf.o
AR drivers/mtd/spi/built-in.o
CC lib/lz4_wrapper.o
CC cmd/setexpr.o
CC lib/efi_loader/efi_smbios.o
CC cmd/sysboot.o
CC lib/efi_loader/efi_riscv.o
CC lib/fdtdec.o
CC cmd/test.o
CC lib/qsort.o
CC lib/efi_loader/efi_load_initrd.o
CC cmd/ubi.o
AR drivers/sysreset/built-in.o
AR drivers/mmc/built-in.o
CC cmd/ubifs.o
CC lib/efi_loader/efi_conformance.o
CC lib/efi_loader/boothart.o
AR drivers/spi/built-in.o
CC lib/hashtable.o
AS lib/efi_loader/efi_crt0.o
CC lib/errno.o
CC cmd/unlz4.o
CC cmd/unzip.o
CC lib/efi_loader/efi_reloc.o
AR drivers/timer/built-in.o
CC lib/efi_loader/efi_freestanding.o
CC lib/display_options.o
CC cmd/lzmadec.o
CC lib/crc32.o
CC lib/ctype.o
AR drivers/net/built-in.o
CC lib/efi_loader/helloworld.o
CC lib/efi_loader/dtbdump.o
CC lib/div64.o
CC cmd/ximg.o
CC lib/hang.o
CC lib/linux_compat.o
CC cmd/nvedit.o
CC lib/linux_string.o
CC lib/lmb.o
CC lib/efi_loader/initrddump.o
CC lib/membuff.o
CC lib/slre.o
CC lib/string.o
CC lib/tables_csum.o
CC lib/time.o
CC lib/hexdump.o
CC lib/uuid.o
CC lib/rand.o
CC lib/panic.o
CC lib/vsprintf.o
CC lib/strto.o
CC lib/abuf.o
CC lib/date.o
CC lib/rtc-lib.o
CC lib/elf.o
AR lib/zlib/built-in.o
LD lib/efi_loader/helloworld_efi.so
LD lib/efi_loader/boothart_efi.so
OBJCOPY lib/efi_loader/helloworld.efi
OBJCOPY lib/efi_loader/boothart.efi
AR lib/efi_loader/built-in.o
AR fs/ubifs/built-in.o
AR fs/built-in.o
AR drivers/mtd/ubi/built-in.o
AR drivers/mtd/built-in.o
LD lib/efi_loader/dtbdump_efi.so
AR drivers/built-in.o
LD lib/efi_loader/initrddump_efi.so
OBJCOPY lib/efi_loader/dtbdump.efi
OBJCOPY lib/efi_loader/initrddump.efi
AR cmd/built-in.o
AR lib/built-in.o
LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
DTC arch/riscv/dts/microchip-mpfs-icicle-kit.dtb
DTC arch/riscv/dts/microchip-mpfs-icicle-kit-amp.dtb
DTC arch/riscv/dts/microchip-mpfs-icicle-kit-qspi-nor.dtb
arch/riscv/dts/.microchip-mpfs-icicle-kit.dtb.pre.tmp:74.4-63: Warning (dma_ranges_format): /reserved-memory/non-cached-low-buffer:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 2, child #address-cells == 2, #size-cells == 1)
arch/riscv/dts/.microchip-mpfs-icicle-kit.dtb.pre.tmp:83.4-66: Warning (dma_ranges_format): /reserved-memory/non-cached-high-buffer:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 2, child #address-cells == 2, #size-cells == 1)
arch/riscv/dts/microchip-mpfs.dtsi:476.23-486.5: Warning (spi_bus_bridge): /soc/qspi@21000000: node name for SPI buses should be 'spi'
also defined at arch/riscv/dts/.microchip-mpfs-icicle-kit.dtb.pre.tmp:203.7-216.3
arch/riscv/dts/microchip-mpfs-icicle-kit.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
arch/riscv/dts/microchip-mpfs.dtsi:37.36-41.6: Warning (interrupt_provider): /cpus/cpu@0/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:69.36-73.6: Warning (interrupt_provider): /cpus/cpu@1/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:101.36-105.6: Warning (interrupt_provider): /cpus/cpu@2/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:133.36-137.6: Warning (interrupt_provider): /cpus/cpu@3/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:165.36-169.6: Warning (interrupt_provider): /cpus/cpu@4/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:220.38-231.5: Warning (interrupt_provider): /soc/interrupt-controller@c000000: Missing #address-cells in interrupt provider
arch/riscv/dts/.microchip-mpfs-icicle-kit-amp.dtb.pre.tmp:75.4-63: Warning (dma_ranges_format): /reserved-memory/non-cached-low-buffer:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 2, child #address-cells == 2, #size-cells == 1)
arch/riscv/dts/.microchip-mpfs-icicle-kit-amp.dtb.pre.tmp:84.4-66: Warning (dma_ranges_format): /reserved-memory/non-cached-high-buffer:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 2, child #address-cells == 2, #size-cells == 1)
arch/riscv/dts/microchip-mpfs.dtsi:476.23-486.5: Warning (spi_bus_bridge): /soc/qspi@21000000: node name for SPI buses should be 'spi'
also defined at arch/riscv/dts/.microchip-mpfs-icicle-kit-amp.dtb.pre.tmp:211.7-223.3
arch/riscv/dts/microchip-mpfs-icicle-kit-amp.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
arch/riscv/dts/microchip-mpfs.dtsi:37.36-41.6: Warning (interrupt_provider): /cpus/cpu@0/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:69.36-73.6: Warning (interrupt_provider): /cpus/cpu@1/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:101.36-105.6: Warning (interrupt_provider): /cpus/cpu@2/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:133.36-137.6: Warning (interrupt_provider): /cpus/cpu@3/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:165.36-169.6: Warning (interrupt_provider): /cpus/cpu@4/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:220.38-231.5: Warning (interrupt_provider): /soc/interrupt-controller@c000000: Missing #address-cells in interrupt provider
arch/riscv/dts/.microchip-mpfs-icicle-kit-qspi-nor.dtb.pre.tmp:73.4-63: Warning (dma_ranges_format): /reserved-memory/non-cached-low-buffer:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 2, child #address-cells == 2, #size-cells == 1)
arch/riscv/dts/.microchip-mpfs-icicle-kit-qspi-nor.dtb.pre.tmp:82.4-66: Warning (dma_ranges_format): /reserved-memory/non-cached-high-buffer:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 2, child #address-cells == 2, #size-cells == 1)
arch/riscv/dts/microchip-mpfs.dtsi:476.23-486.5: Warning (spi_bus_bridge): /soc/qspi@21000000: node name for SPI buses should be 'spi'
also defined at arch/riscv/dts/.microchip-mpfs-icicle-kit-qspi-nor.dtb.pre.tmp:202.7-214.3
arch/riscv/dts/microchip-mpfs-icicle-kit-qspi-nor.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
arch/riscv/dts/microchip-mpfs.dtsi:37.36-41.6: Warning (interrupt_provider): /cpus/cpu@0/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:69.36-73.6: Warning (interrupt_provider): /cpus/cpu@1/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:101.36-105.6: Warning (interrupt_provider): /cpus/cpu@2/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:133.36-137.6: Warning (interrupt_provider): /cpus/cpu@3/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:165.36-169.6: Warning (interrupt_provider): /cpus/cpu@4/interrupt-controller: Missing #address-cells in interrupt provider
arch/riscv/dts/microchip-mpfs.dtsi:220.38-231.5: Warning (interrupt_provider): /soc/interrupt-controller@c000000: Missing #address-cells in interrupt provider
SHIPPED dts/dt.dtb
CAT u-boot-dtb.bin
COPY u-boot.dtb
COPY u-boot.bin
OFCHK .config
make: Leaving directory '....../BeagleV-Fire-ubuntu/u-boot'
'./u-boot/u-boot.bin' -> './deploy/u-boot.bin'
'./u-boot/u-boot.bin' -> './deploy/src.bin'

A new file patches/u-boot/beaglev-fire/microchip_mpfs_icicle_defconfig is generated as:

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
CONFIG_RISCV=y
CONFIG_SYS_MALLOC_LEN=0x800000
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
CONFIG_ENV_SIZE=0x2000
CONFIG_DEFAULT_DEVICE_TREE="microchip-mpfs-icicle-kit"
CONFIG_SYS_PROMPT="RISC-V # "
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_LOAD_ADDR=0x80200000
CONFIG_TARGET_MICROCHIP_ICICLE=y
CONFIG_ARCH_RV64I=y
CONFIG_RISCV_SMODE=y
CONFIG_FIT=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_DISPLAY_CPUINFO=y
CONFIG_DISPLAY_BOARDINFO=y
CONFIG_SYS_CBSIZE=256
CONFIG_SYS_PBSIZE=282
CONFIG_SYS_BOOTM_LEN=0x4000000
CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-nand0:2m(payload),119m(ubi)"
CONFIG_CMD_UBI=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_DM_MTD=y
CONFIG_SYSRESET=y

2.4 04_build_linux.sh

You may meet the same issues solved in BeagleV-Fire-1.md.

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./04_build_linux.sh 
Applying: Add wireless-regdb regulatory database file
'../device-tree/src/riscv/microchip/mpfs-beaglev-fire.dts' -> 'arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts'
'../device-tree/src/riscv/microchip/mpfs-beaglev-fire-fabric.dtsi' -> 'arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-fabric.dtsi'
'../device-tree/src/riscv/microchip/mpfs-beaglev-fire-pinmux.dtsi' -> 'arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-pinmux.dtsi'
make ARCH=riscv CROSS_COMPILE=....../BeagleV-Fire-ubuntu/riscv-toolchain/bin/riscv64-linux- clean
CLEAN arch/riscv/kernel/compat_vdso
CLEAN arch/riscv/kernel/pi
CLEAN arch/riscv/kernel/vdso
CLEAN arch/riscv/kernel
CLEAN arch/riscv/purgatory
CLEAN certs
CLEAN drivers/base/firmware_loader/builtin
CLEAN drivers/scsi
CLEAN drivers/tty/vt
CLEAN fs/unicode
CLEAN init
CLEAN kernel
CLEAN lib/raid6
CLEAN lib
CLEAN net/wireless
CLEAN usr
CLEAN .
'../patches/linux/mpfs_defconfig' -> './arch/riscv/configs/mpfs_defconfig'
make ARCH=riscv CROSS_COMPILE=....../BeagleV-Fire-ubuntu/riscv-toolchain/bin/riscv64-linux- mpfs_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/menu.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
make -j48 ARCH=riscv CROSS_COMPILE=....../BeagleV-Fire-ubuntu/riscv-toolchain/bin/riscv64-linux- olddefconfig
#
# configuration written to .config
#
make -j48 ARCH=riscv CROSS_COMPILE=....../BeagleV-Fire-ubuntu/riscv-toolchain/bin/riscv64-linux- Image modules dtbs
SYNC include/config/auto.conf.cmd
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
......
......
......
LD [M] net/nsh/nsh.ko
LD [M] net/hsr/hsr.ko
LD [M] net/qrtr/qrtr.ko
LD [M] net/qrtr/qrtr-smd.ko
LD [M] net/qrtr/qrtr-tun.ko
LD [M] net/qrtr/qrtr-mhi.ko
Kernel: arch/riscv/boot/Image is ready
Compressing 6.6.51-linux4microchip+fpga-2024.09.1-20241024+-modules.tar.gz...
'./.config' -> '../patches/linux/mpfs_defconfig'
'./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts' -> '../patches/linux/dts/mpfs-beaglev-fire.dts'
'./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-fabric.dtsi' -> '../patches/linux/dts/mpfs-beaglev-fire-fabric.dtsi'
'./arch/riscv/boot/Image' -> '../deploy/input/Image'
'./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dtb' -> '../deploy/input/mpfs-beaglev-fire.dtb'
'./patches/linux/beaglev_fire.its' -> './deploy/input/beaglev_fire.its'
FIT description: U-Boot fitImage for the BeagleV-Fire
Created: Thu Oct 24 01:42:47 2024
Image 0 (kernel)
Description: Linux kernel
Created: Thu Oct 24 01:42:47 2024
Type: Kernel Image
Compression: gzip compressed
Data Size: 9687165 Bytes = 9460.12 KiB = 9.24 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x80200000
Entry Point: 0x80200000
Hash algo: sha256
Hash value: 218c9c8681afb659d7a05c80b95330a2b58398367d812ee22fd718030bdb7ffc
Image 1 (base_fdt)
Description: Flattened Device Tree blob
Created: Thu Oct 24 01:42:47 2024
Type: Flat Device Tree
Compression: uncompressed
Data Size: 19036 Bytes = 18.59 KiB = 0.02 MiB
Architecture: RISC-V
Load Address: 0x8a000000
Hash algo: sha256
Hash value: a254f5825e318de185b473b974d53bc291fe0106944b8bad6038c87296d73f03
Default Configuration: 'kernel_dtb'
Configuration 0 (kernel_dtb)
Description: 1 Linux kernel, FDT blob
Kernel: kernel
FDT: base_fdt
Configuration 1 (base_dtb)
Description: Base FDT blob for BeagleV-Fire board
Kernel: unavailable
FDT: base_fdt
➜ BeagleV-Fire-ubuntu git:(main) ✗

Three files are generated as follows:

  • patches/linux/dts/mpfs-beaglev-fire-fabric.dtsi
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/* Copyright (c) 2020-2021 Microchip Technology Inc */

#include "dt-bindings/mailbox/miv-ihc.h"

/ {
fabric_clk3: fabric-clk3 {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
};

fabric_clk1: fabric-clk1 {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <125000000>;
};

fabric-bus@40000000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000>, /* FIC3-FAB */
<0x0 0x60000000 0x0 0x60000000 0x0 0x20000000>, /* FIC0, LO */
<0x0 0xe0000000 0x0 0xe0000000 0x0 0x20000000>, /* FIC1, LO */
<0x20 0x0 0x20 0x0 0x10 0x0>, /* FIC0,HI */
<0x30 0x0 0x30 0x0 0x10 0x0>; /* FIC1,HI */

cape_gpios_p8: gpio@41100000 {
compatible = "microchip,coregpio-rtl-v3";
reg = <0x0 0x41100000 0x0 0x1000>;
clocks = <&fabric_clk3>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <16>;
gpio-line-names = "P8_PIN31", "P8_PIN32", "P8_PIN33", "P8_PIN34",
"P8_PIN35", "P8_PIN36", "P8_PIN37", "P8_PIN38",
"P8_PIN39", "P8_PIN40", "P8_PIN41", "P8_PIN42",
"P8_PIN43", "P8_PIN44", "P8_PIN45", "P8_PIN46";
};

cape_gpios_p9: gpio@41200000 {
compatible = "microchip,coregpio-rtl-v3";
reg = <0x0 0x41200000 0x0 0x1000>;
clocks = <&fabric_clk3>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <20>;
gpio-line-names = "P9_PIN11", "P9_PIN12", "P9_PIN13", "P9_PIN14",
"P9_PIN15", "P9_PIN16", "P9_PIN17", "P9_PIN18",
"P9_PIN21", "P9_PIN22", "P9_PIN23", "P9_PIN24",
"P9_PIN25", "P9_PIN26", "P9_PIN27", "P9_PIN28",
"P9_PIN29", "P9_PIN31", "P9_PIN41", "P9_PIN42";
};

hsi_gpios: gpio@44000000 {
compatible = "microchip,coregpio-rtl-v3";
reg = <0x0 0x44000000 0x0 0x1000>;
clocks = <&fabric_clk3>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <20>;
gpio-line-names = "B0_HSIO70N", "B0_HSIO71N", "B0_HSIO83N",
"B0_HSIO73N_C2P_CLKN", "B0_HSIO70P", "B0_HSIO71P",
"B0_HSIO83P", "B0_HSIO73N_C2P_CLKP", "XCVR1_RX_VALID",
"XCVR1_LOCK", "XCVR1_ERROR", "XCVR2_RX_VALID",
"XCVR2_LOCK", "XCVR2_ERROR", "XCVR3_RX_VALID",
"XCVR3_LOCK", "XCVR3_ERROR", "XCVR_0B_REF_CLK_PLL_LOCK",
"XCVR_0C_REF_CLK_PLL_LOCK", "B0_HSIO81N";
};
};

ihc: mailbox {
compatible = "microchip,miv-ihc";
interrupt-parent = <&plic>;
interrupts = <IHC_HART1_INT>;
microchip,miv-ihc-remote-context-id = <IHC_CONTEXT_B>;
#mbox-cells = <1>;
status = "disabled";
};

fabric-pcie-bus@3000000000 {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges = <0x0 0x40000000 0x0 0x40000000 0x0 0x20000000>,
<0x30 0x0 0x30 0x0 0x10 0x0>;
dma-ranges = <0x0 0x0 0x0 0x80000000 0x0 0x4000000>,
<0x0 0x4000000 0x0 0xc4000000 0x0 0x6000000>,
<0x0 0xa000000 0x0 0x8a000000 0x0 0x8000000>,
<0x0 0x12000000 0x14 0x12000000 0x0 0x10000000>,
<0x0 0x22000000 0x10 0x22000000 0x0 0x5e000000>;

pcie: pcie@3000000000 {
compatible = "microchip,pcie-host-1.0";
#address-cells = <0x3>;
#interrupt-cells = <0x1>;
#size-cells = <0x2>;
device_type = "pci";
dma-noncoherent;
reg = <0x30 0x0 0x0 0x8000000>, <0x0 0x43004000 0x0 0x2000>, <0x0 0x43006000 0x0 0x2000>;
reg-names = "cfg", "bridge", "ctrl";
bus-range = <0x0 0x7f>;
interrupt-parent = <&plic>;
interrupts = <119>;
interrupt-map = <0 0 0 1 &pcie_intc 0>,
<0 0 0 2 &pcie_intc 1>,
<0 0 0 3 &pcie_intc 2>,
<0 0 0 4 &pcie_intc 3>;
interrupt-map-mask = <0 0 0 7>;
clocks = <&ccc_nw CLK_CCC_PLL0_OUT1>,
<&ccc_nw CLK_CCC_PLL0_OUT3>;
clock-names = "fic1", "fic3";
ranges = <0x43000000 0x0 0x9000000 0x30 0x9000000 0x0 0xf000000>,
<0x1000000 0x0 0x8000000 0x30 0x8000000 0x0 0x1000000>,
<0x3000000 0x0 0x18000000 0x30 0x18000000 0x0 0x70000000>;
dma-ranges = <0x3000000 0x0 0x80000000 0x0 0x0 0x0 0x4000000>,
<0x3000000 0x0 0x84000000 0x0 0x4000000 0x0 0x6000000>,
<0x3000000 0x0 0x8a000000 0x0 0xa000000 0x0 0x8000000>,
<0x3000000 0x0 0x92000000 0x0 0x12000000 0x0 0x10000000>,
<0x3000000 0x0 0xa2000000 0x0 0x22000000 0x0 0x5e000000>;
msi-parent = <&pcie>;
msi-controller;
status = "disabled";

pcie_intc: interrupt-controller {
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
};
};
};

refclk_ccc: cccrefclk {
compatible = "fixed-clock";
#clock-cells = <0>;
};
};

&ccc_nw {
clocks = <&refclk_ccc>, <&refclk_ccc>, <&refclk_ccc>, <&refclk_ccc>,
<&refclk_ccc>, <&refclk_ccc>;
clock-names = "pll0_ref0", "pll0_ref1", "pll1_ref0", "pll1_ref1",
"dll0_ref", "dll1_ref";
status = "okay";
};
  • patches/linux/dts/mpfs-beaglev-fire.dts
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/* Copyright (c) 2020-2021 Microchip Technology Inc */

/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include "mpfs.dtsi"
#include "mpfs-beaglev-fire-fabric.dtsi"
#include "mpfs-beaglev-fire-pinmux.dtsi"

/* Clock frequency (in Hz) of the rtcclk */
#define RTCCLK_FREQ 1000000

/ {
#address-cells = <2>;
#size-cells = <2>;
model = "BeagleBoard BeagleV-Fire";
compatible = "beagle,beaglev-fire", "microchip,mpfs";

soc {
dma-ranges = <0x14 0x0 0x0 0x80000000 0x0 0x4000000>,
<0x14 0x4000000 0x0 0xc4000000 0x0 0x6000000>,
<0x14 0xa000000 0x0 0x8a000000 0x0 0x8000000>,
<0x14 0x12000000 0x14 0x12000000 0x0 0x10000000>,
<0x14 0x22000000 0x10 0x22000000 0x0 0x5e000000>;
};

aliases {
serial0 = &mmuart0;
serial1 = &mmuart1;
serial2 = &mmuart2;
serial3 = &mmuart3;
serial4 = &mmuart4;
};

chosen {
stdout-path = "serial0:115200n8";
};

cpus {
timebase-frequency = <RTCCLK_FREQ>;
};

kernel: memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x0 0x4000000>;
};

ddr_cached_low: memory@8a000000 {
device_type = "memory";
reg = <0x0 0x8a000000 0x0 0x8000000>;
};

ddr_non_cached_low: memory@c4000000 {
device_type = "memory";
reg = <0x0 0xc4000000 0x0 0x6000000>;
};

ddr_cached_high: memory@1022000000 {
device_type = "memory";
reg = <0x10 0x22000000 0x0 0x5e000000>;
};

ddr_non_cached_high: memory@1412000000 {
device_type = "memory";
reg = <0x14 0x12000000 0x0 0x10000000>;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

hss: hss-buffer@103fc00000 {
compatible = "shared-dma-pool";
reg = <0x10 0x3fc00000 0x0 0x400000>;
no-map;
};

dma_non_cached_low: non-cached-low-buffer {
compatible = "shared-dma-pool";
size = <0x0 0x4000000>;
no-map;
alloc-ranges = <0x0 0xc4000000 0x0 0x4000000>;
};

dma_non_cached_high: non-cached-high-buffer {
compatible = "shared-dma-pool";
size = <0x0 0x10000000>;
no-map;
linux,dma-default;
alloc-ranges = <0x14 0x12000000 0x0 0x10000000>;
};
};

imx219_vana: fixedregulator-0 {
compatible = "regulator-fixed";
regulator-name = "imx219_vana";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
};

imx219_vdig: fixedregulator-1 {
compatible = "regulator-fixed";
regulator-name = "imx219_vdig";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};

imx219_vddl: fixedregulator-2 {
compatible = "regulator-fixed";
regulator-name = "imx219_vddl";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
};

imx219_clk: camera-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
};
};

&gpio0 {
ngpios=<14>;
gpio-line-names = "", "", "", "", "", "", "",
"", "", "", "", "", "SD_CARD_CS", "USER_BUTTON";
status = "okay";

sd-card-cs-hog {
gpio-hog;
gpios = <12 12>;
output-high;
line-name = "SD_CARD_CS";
};

user-button-hog {
gpio-hog;
gpios = <13 13>;
input;
line-name = "USER_BUTTON";
};
};

&gpio1 {
ngpios=<24>;
gpio-line-names = "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"ADC_IRQn", "", "", "USB_OCn";
status = "okay";

adc-irqn-hog {
gpio-hog;
gpios = <20 20>;
input;
line-name = "ADC_IRQn";
};

usb-ocn-hog {
gpio-hog;
gpios = <23 23>;
input;
line-name = "USB_OCn";
};
};

&gpio2 {
ngpios=<32>;
gpio-line-names = "P8_PIN3_USER_LED_0", "P8_PIN4_USER_LED_1", "P8_PIN5_USER_LED_2",
"P8_PIN6_USER_LED_3", "P8_PIN7_USER_LED_4", "P8_PIN8_USER_LED_5",
"P8_PIN9_USER_LED_6", "P8_PIN10_USER_LED_7", "P8_PIN11_USER_LED_8",
"P8_PIN12_USER_LED_9", "P8_PIN13_USER_LED_10", "P8_PIN14_USER_LED_11",
"P8_PIN15", "P8_PIN16", "P8_PIN17", "P8_PIN18", "P8_PIN19", "P8_PIN20",
"P8_PIN21", "P8_PIN22", "P8_PIN23", "P8_PIN24", "P8_PIN25", "P8_PIN26",
"P8_PIN27", "P8_PIN28", "P8_PIN29", "P8_PIN30", "M2_W_DISABLE1",
"M2_W_DISABLE2", "VIO_ENABLE", "SD_DET";
status = "okay";

vio-enable-hog {
gpio-hog;
gpios = <30 30>;
output-high;
line-name = "VIO_ENABLE";
};

sd-det-hog {
gpio-hog;
gpios = <31 31>;
input;
line-name = "SD_DET";
};
};

&i2c0 {
status = "okay";
};

&i2c1 {
status = "okay";

eeprom: eeprom@50 {
compatible = "at,24c32";
reg = <0x50>;
};

imx219: sensor@10 {
compatible = "sony,imx219";
reg = <0x10>;
clocks = <&imx219_clk>;
VANA-supply = <&imx219_vana>; /* 2.8v */
VDIG-supply = <&imx219_vdig>; /* 1.8v */
VDDL-supply = <&imx219_vddl>; /* 1.2v */

port {
imx219_0: endpoint {
data-lanes = <1 2>;
clock-noncontinuous;
link-frequencies = /bits/ 64 <456000000>;
};
};
};
};

&mac0 {
dma-noncoherent;
status = "okay";
phy-mode = "sgmii";
phy-handle = <&phy0>;
phy0: ethernet-phy@0 {
reg = <0>;
};
};

&mbox {
status = "okay";
};

&mmc {
dma-noncoherent;
bus-width = <4>;
disable-wp;
cap-sd-highspeed;
cap-mmc-highspeed;
mmc-ddr-1_8v;
mmc-hs200-1_8v;
sd-uhs-sdr12;
sd-uhs-sdr25;
sd-uhs-sdr50;
sd-uhs-sdr104;
status = "okay";
};

&mmuart0 {
status = "okay";
};

&mmuart1 {
status = "okay";
};

&refclk {
clock-frequency = <125000000>;
};

&refclk_ccc {
clock-frequency = <50000000>;
};

&rtc {
status = "okay";
};

&spi0 {
status = "okay";
};

&spi1 {
status = "okay";
};

&syscontroller {
microchip,bitstream-flash = <&sys_ctrl_flash>;
status = "okay";
};

&syscontroller_qspi {
status = "okay";

sys_ctrl_flash: flash@0 { // MT25QL01GBBB8ESF-0SIT
compatible = "jedec,spi-nor";
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <20000000>;
spi-rx-bus-width = <1>;
reg = <0>;
};
};

&usb {
dma-noncoherent;
status = "okay";
dr_mode = "otg";
};
  • patches/linux/mpfs_defconfig
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Automatically generated file; DO NOT EDIT.
# Linux/riscv 6.6.51-linux4microchip+fpga-2024.09 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="riscv64-linux-gcc (GCC) 14.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24200
CONFIG_LD_IS_BFD=y
......
......
......
#
# Kernel Testing and Coverage
#
# CONFIG_KUNIT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FUNCTION_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
CONFIG_ARCH_HAS_KCOV=y
CONFIG_CC_HAS_SANCOV_TRACE_PC=y
# CONFIG_KCOV is not set
CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_TEST_DHRY is not set
# CONFIG_LKDTM is not set
# CONFIG_TEST_MIN_HEAP is not set
# CONFIG_TEST_DIV64 is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_TEST_REF_TRACKER is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_REED_SOLOMON_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_PERCPU_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_STRING_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_PRINTF is not set
# CONFIG_TEST_SCANF is not set
# CONFIG_TEST_BITMAP is not set
# CONFIG_TEST_UUID is not set
# CONFIG_TEST_XARRAY is not set
# CONFIG_TEST_MAPLE_TREE is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_TEST_IDA is not set
# CONFIG_TEST_LKM is not set
# CONFIG_TEST_BITOPS is not set
# CONFIG_TEST_VMALLOC is not set
# CONFIG_TEST_USER_COPY is not set
# CONFIG_TEST_BPF is not set
# CONFIG_TEST_BLACKHOLE_DEV is not set
# CONFIG_FIND_BIT_BENCHMARK is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_TEST_DYNAMIC_DEBUG is not set
# CONFIG_TEST_KMOD is not set
# CONFIG_TEST_MEMCAT_P is not set
# CONFIG_TEST_MEMINIT is not set
# CONFIG_TEST_FREE_PAGES is not set
CONFIG_ARCH_USE_MEMTEST=y
# CONFIG_MEMTEST is not set
# end of Kernel Testing and Coverage

#
# Rust hacking
#
# end of Rust hacking
# end of Kernel hacking

2.5 05_generate_payload.bin.sh

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
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./05_generate_payload.bin.sh 
Hart Software Service formatted boot image generator v0.99.37
Copyright (c) 2021-2022 Microchip FPGA Embedded Systems Solutions.

Parsing set-name
Parsing hart entry points
Entry Point U54_1 is 0x80200000
Entry Point U54_2 is 0x80200000
Entry Point U54_3 is 0x80200000
Entry Point U54_4 is 0x80200000
Parsing payload >>src.bin<<
exec_addr is 0x80200000
owner is 1
secondary is 2
secondary is 3
secondary is 4
priv_mode is 1

Processing ELF >>src.bin<<
>>src.bin<< is not an ELF object

Processing blob >>src.bin<< - placing at 0x80200000
lastChunk is 0, numChunks is 1
Set-name is >>PolarFire-SoC-HSS::U-Boot<<
Output filename is >>./input/payload.bin<<
Outputting Payload Header
Outputting Code/Data Chunks
Outputting ZI Chunks
Outputting Binary Data
Outputting Payload Header
Thu 24 Oct 2024 02:26:49 AM PDT
[u-boot.bin: U-Boot 2023.07.02-linux4microchip+fpga-2024.09-dirty (Oct 23 2024 - 23:26:07 -0700)]
[src.bin: U-Boot 2023.07.02-linux4microchip+fpga-2024.09-dirty (Oct 23 2024 - 23:26:07 -0700)]
[payload.bin:U-Boot 2023.07.02-linux4microchip+fpga-2024.09-dirty (Oct 23 2024 - 23:26:07 -0700)]
➜ BeagleV-Fire-ubuntu git:(main) ✗

2.6 sudo ./06_generate_debian_console_root.sh

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
➜  BeagleV-Fire-ubuntu git:(main) ✗ sudo ./06_generate_debian_console_root.sh 
[sudo] password for lvision:
--2024-10-24 02:30:20-- https://rcn-ee.net/rootfs/debian-riscv64-sid-minimal/2024-10-24/debian-sid-console-riscv64-2024-10-24.tar.xz
Resolving rcn-ee.net (rcn-ee.net)... 5.161.107.156
Connecting to rcn-ee.net (rcn-ee.net)|5.161.107.156|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 332982816 (318M) [application/x-xz]
Saving to: ‘./deploy/debian-sid-console-riscv64-2024-10-24.tar.xz’

debian-sid-console-riscv64-2024-10-24.tar.xz 100%[==================================================================================================================================================>] 317.56M 46.0MB/s in 7.5s

2024-10-24 02:30:27 (42.6 MB/s) - ‘./deploy/debian-sid-console-riscv64-2024-10-24.tar.xz’ saved [332982816/332982816]

Extracting: debian-sid-console-riscv64-2024-10-24/riscv64-rootfs-*.tar
'./deploy/boot.scr' -> 'deploy/input/boot.scr'
'./deploy/sysconf.txt' -> 'deploy/input/sysconf.txt'
'./ignore/.root/etc/bbb.io/templates/eth0-DHCP.network' -> './ignore/.root/etc/systemd/network/eth0.network'
'./ignore/.root/etc/bbb.io/templates/eth1-DHCP.network' -> './ignore/.root/etc/systemd/network/eth1.network'
'./ignore/.root/etc/bbb.io/templates/nginx/nginx-autoindex' -> './ignore/.root/etc/nginx/sites-enabled/default'
'./ignore/.root/etc/bbb.io/templates/nginx/Cockpit.html' -> './ignore/.root/var/www/html/Cockpit.html'
'./ignore/.root/etc/bbb.io/templates/nginx/Docs-BeagleBoard.html' -> './ignore/.root/var/www/html/Docs-BeagleBoard.html'
---------------------
File Size
1.4G ignore/.root/
---------------------
0+0 records in
0+0 records out
0 bytes copied, 2.196e-05 s, 0.0 kB/s
mke2fs 1.47.0 (5-Feb-2023)
./deploy/input/root.ext4 contains a ext4 file system
created on Wed Oct 23 02:58:30 2024
Discarding device blocks: done
Creating filesystem with 563200 4k blocks and 140832 inodes
Filesystem UUID: 4630cf75-81d2-47ea-b1ce-79ae03739e62
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done

➜ BeagleV-Fire-ubuntu git:(main) ✗

2.7 sudo ./07_create_sdcard_img.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
➜  BeagleV-Fire-ubuntu git:(main) ✗ sudo ./07_create_sdcard_img.sh 
INFO: cmd: "mkdir -p "....../BeagleV-Fire-ubuntu/deploy/tmp"" (stderr):
INFO: cmd: "rm -rf "....../BeagleV-Fire-ubuntu/deploy/tmp"/*" (stderr):
INFO: cmd: "mkdir -p "....../BeagleV-Fire-ubuntu/deploy/tmp"" (stderr):
INFO: cmd: "cp -a "....../BeagleV-Fire-ubuntu/deploy/root" "....../BeagleV-Fire-ubuntu/deploy/tmp/root"" (stderr):
INFO: cmd: "mkdir -p "....../BeagleV-Fire-ubuntu/deploy/images"" (stderr):
INFO: vfat(boot.vfat): cmd: "mkdosfs '....../BeagleV-Fire-ubuntu/deploy/images/boot.vfat'" (stderr):
INFO: vfat(boot.vfat): adding file 'beaglev_fire.itb' as 'beaglev_fire.itb' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '....../BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '....../BeagleV-Fire-ubuntu/deploy/input/beaglev_fire.itb' '::'" (stderr):
INFO: vfat(boot.vfat): adding file 'boot.scr' as 'boot.scr' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '....../BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '....../BeagleV-Fire-ubuntu/deploy/input/boot.scr' '::'" (stderr):
INFO: vfat(boot.vfat): adding file 'sysconf.txt' as 'sysconf.txt' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '....../BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '....../BeagleV-Fire-ubuntu/deploy/input/sysconf.txt' '::'" (stderr):
INFO: hdimage(sdcard.img): adding partition 'uboot' (in MBR) from 'payload.bin' ...
INFO: hdimage(sdcard.img): adding partition 'kernel' (in MBR) from 'boot.vfat' ...
INFO: hdimage(sdcard.img): adding partition 'rootfs' (in MBR) from 'root.ext4' ...
INFO: hdimage(sdcard.img): adding partition '[MBR]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT header]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT array]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT backup]' ...
INFO: hdimage(sdcard.img): writing GPT
INFO: hdimage(sdcard.img): writing protective MBR
INFO: hdimage(sdcard.img): writing MBR
➜ BeagleV-Fire-ubuntu git:(main) ✗

2.8 Take A Look At The Image

1
2
3
4
5
6
➜  BeagleV-Fire-ubuntu git:(main) ✗ ll deploy/images 
total 1.5G
4.0K drwxr-xr-x 2 root root 4.0K Oct 23 03:18 ./
4.0K drwxr-xr-x 6 lvision users 4.0K Oct 23 03:18 ../
9.6M -rw-r--r-- 1 root root 128M Oct 23 03:18 boot.vfat
1.5G -rw-r--r-- 1 root root 2.3G Oct 23 03:18 sdcard.img

2.9 Failed To Boot

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
55
56
57
58
59
60
61
62
63
64
65
66
➜  ~ tio /dev/ttyUSB0
[02:34:42.727] tio v2.7
[02:34:42.727] Press ctrl-t q to quit
[02:34:42.741] Connected






HSS: decompressing from eNVM to L2 Scratch ... Passed
DDR training ... Passed ( 5648 ms)

---------------------------------
-- BeagleV-Fire --
---------------------------------

[5.711390] PolarFire(R) SoC Hart Software Services (HSS) - version 0.99.36-BVF-0.3.0
MPFS HAL version 2.2.104 / DDR Driver version 0.4.023 / Mi-V IHC version 0.1.1 / BOARD=bvf
(c) Copyright 2017-2022 Microchip FPGA Embedded Systems Solutions.

incorporating OpenSBI - version 1.2
(c) Copyright 2019-2022 Western Digital Corporation.

[5.742377] Build ID: 3f0ed536ff6a0aaef3c9b81896adaee39ec4d8c1
[5.749235] Built with the following tools:
- riscv64-unknown-elf-gcc (xPack GNU RISC-V Embedded GCC (Microsemi SoftConsole build), 64-bit) 8.3.0
- GNU ld (xPack GNU RISC-V Embedded GCC (Microsemi SoftConsole build), 64-bit) 2.32

[5.771108] NOTICE: Running from L2 Scratchpad

[5.776750] Serial Number:
421ad5e6973fae72de847b6a5a30e90300000000000000000000000000000000000000000000000000000000000000000000
[5.789423] Segment Configuration:
Cached: SEG0_0: offset 0x0080000000, physical DDR 0x00000000
Cached: SEG0_1: offset 0x1000000000, physical DDR 0x00000000
Non-cached: SEG1_2: offset 0x00c0000000, physical DDR 0x00000000
Non-cached: SEG1_3: offset 0x1400000000, physical DDR 0x00000000
Non-cached WCB: SEG1_4: offset 0x00d0000000, physical DDR 0x00000000
Non-cached WCB: SEG1_5: offset 0x1800000000, physical DDR 0x00000000
[5.830306] L2 Cache Configuration:
L2-Scratchpad: 4 ways (512 KiB)
L2-Cache: 8 ways (1024 KiB)
L2-LIM: 4 ways (512 KiB)
[5.844801] DDR-Lo size is 32 MiB
[5.849055] DDR-Hi size is 1888 MiB
[5.872864] Design Info:
Design Name: CI_DEFAULT_FD28A2CA1789CDC1137
Design Version: 02.00.2
[5.883280] Attempting to select eMMC ... Passed
[6.161422] User button NOT pressed
Press a key to enter CLI, ESC to skip
Timeout in 1 second
.[6.281293] Character 13 pressed

[6.285459] Type HELP for list of commands
[6.290320] >> mmc
[18.129310] Selecting SDCARD/MMC (fallback) as boot source ...
[18.135994] Attempting to select eMMC ... Passed
[18.391620] >> usbdmsc
[280.344194] initialize MMC
[280.347840] Attempting to select eMMC ... Passed
[280.603552] MMC - 512 byte pages, 512 byte blocks, 30621696 pages
Waiting for USB Host to connect... (CTRL-C to quit)
. 0 bytes written, 0 bytes readUSB Host connected. Waiting for disconnect... (CTRL-C to quit)
. 1724668416 bytes written, 1806021120 bytes read

3. Flash Official BeagleV-Fire Ubuntu 2023-11-21

3.1 Apply Official Flash

The official website of BeagleV-Fire Board provides the official OS BeagleV-Fire Ubuntu 2023-11-21, which is able to flash onto the board directly.

Bingo! This time, we're good to go.

  • The ONLY 2 commands we need to use before flashing are:
    • mmc
    • usbdmsc
  • And openssh-server has already been installed by default. Namely: ssh is enabled by default.

3.2 ssh Into BeagleV-Fire Board

The username and password are respectively: - username: beagle - password: temppwd

1
2
3
4
5
6
7
8
9
10
➜  ~ uname -a
Linux BeagleV 6.1.33-linux4microchip+fpga-2023.06-20231121+ #1 SMP Tue Nov 21 13:43:17 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux
➜ ~ uname -r
6.1.33-linux4microchip+fpga-2023.06-20231121+
➜ ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.04
Release: 23.04
Codename: lunar

BeagleV SSH and Neofetch

3.3 On-board FPGA

1
2
3
4
5
6
7
8
9
10
11
12
13
➜  ~ lspci
00:00.0 Unclassified device [0006]: Actel Device 1556
➜ ~ lspci -v -s 00:00.0

00:00.0 Unclassified device [0006]: Actel Device 1556 (prog-if 04)
!!! Invalid class 0006 for header type 01
Flags: fast devsel
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 1000-1fff [size=4K] [16-bit]
Memory behind bridge: 18000000-181fffff [size=2M] [32-bit]
Prefetchable memory behind bridge: 3009000000-30091fffff [size=2M] [32-bit]
Capabilities: <access denied>

Today, let me have some fun of the open source cellphone PinePhone.

1. Key Points

Please do strictly follow PinePhone and PinePhone Pro - 20.04 Focal Install and Update.

2. Demonstration

2.1. PinePhone Flash Results

Ubuntu Touch 16.04 on eMMC Initially Pine64 20.04 Ubuntu Touch Image Builder Flashed on eMMC In the End
Pine Phone Ubuntu Touch 16.04 Pine Phone Ubuntu Touch 20.04

2.2. Tow-Boot Process

Tow-Boot Installer Interface eMMC Boot Erased
Tow-Boot Tow-Boot
Install Tow-Boot Successfully Booting
Tow-Boot Boot

Today is Canada's Thanksgiving. Let me do something extra on Jetson Orin Orin.

Jetson Orin Nano

1. My Working Environment

1
2
3
4
5
6
➜  ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble

2. Flash From Scratch

2.1 Entering Recovery Mode

In order to enter the Recovery Mode, we need to connect Jetson Orin Nano's Pin 9 and Pin 10 with a jumper, and then turn on the power, and connect the Jetson Orin Nano with your desktop, here in my case, Ubuntu 24.04.1 LTS.

2.2 lsusb

1
2
➜  Resource git:(master) lsusb | grep NVIDIA
Bus 009 Device 016: ID 0955:7523 NVIDIA Corp. APX

2.3 Install Jetson Software with SDK Manager

To use SDK Manager, we need a Ubuntu 22.04.5 LTS or Ubuntu 20.04.6 LTS. In my case, I tried with Ubuntu 20.04.6 LTS.

Step 01 Step 02
Step 01 Step 02

Get stucked at:

Step 03

2.4 Jetson Orin Nano Tutorial: SSD Install, Boot, and JetPack Setup

What can I say?

😞😢😭

My comment: so complicated. I'm too lazy to follow.

2.5 dd Is My Favorite Tool

For some reasons, on my Jetson Orin Nano, there is NO TF card slot, but a 128G SSD instead.

😳😳😳

Therefore, in my case, my BEST solution is to flash the SSD directly.

Simply download and unzip JetPack 6.1 Orin Nano SD Card Image first. Then, do dd:

1
2
3
4
5
6
7
➜  jetson sudo dd bs=1M if=sd-blob.img of=/dev/sdb conv=fsync

[sudo] password for lvision:
22802+0 records in
22802+0 records out
23909629952 bytes (24 GB, 22 GiB) copied, 730.94 s, 32.7 MB/s
➜ jetson

However, again, it's NOT working.

😞😢😭

3. My LAST and FINAL Attempt - Jetson Linux Developer Guide Quick Start

I watched the entire video below, and was expecting a good result.

3.1 Before Flash

Preparation

Extraction

Prerequisites

Apply Binaries

Let's try to do sudo ./apply_binaries.sh again:

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
➜  Linux_for_Tegra sudo ./apply_binaries.sh
Using rootfs directory of: ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/rootfs
Installing extlinux.conf into /boot/extlinux in target rootfs
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh
Root file system directory is ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/rootfs
Copying public debian packages to rootfs
Skipping installation of nvidia-igx-oem-config_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-igx-systemd-reboot-hooks_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-l4t-dgpu-apt-source_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-l4t-dgpu-config_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-l4t-dgpu-tools_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-l4t-dgpu-x11_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-l4t-factory-service_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-igx-bootloader_36.4.0-20240912212859_arm64.deb ....
Skipping installation of nvidia-l4t-jetson-orin-nano-qspi-updater_36.4.0-20240912212859_arm64.deb ....
Start L4T BSP package installation
QEMU binary is not available, looking for QEMU from host system
Found /usr/bin/qemu-aarch64-static
Installing QEMU binary in rootfs
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/rootfs ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra
Host qemu-aarch64-static version: 8.2.2
Skip ldconfig because this version of QEMU suffers from a known issue:
https://gitlab.com/qemu-project/qemu/-/issues/1913
Installing BSP Debian packages in ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/rootfs
Selecting previously unselected package nvidia-l4t-core.
(Reading database ... 166870 files and directories currently installed.)
Preparing to unpack .../nvidia-l4t-core_36.4.0-20240912212859_arm64.deb ...
Pre-installing... skip compatibility checking.
Unpacking nvidia-l4t-core (36.4.0-20240912212859) ...
Setting up nvidia-l4t-core (36.4.0-20240912212859) ...
Selecting previously unselected package jetson-gpio-common.
(Reading database ... 166929 files and directories currently installed.)
Preparing to unpack .../jetson-gpio-common_2.1.7ubuntu1_arm64.deb ...
Unpacking jetson-gpio-common (2.1.7ubuntu1) ...
Selecting previously unselected package python3-jetson-gpio.
Preparing to unpack .../python3-jetson-gpio_2.1.7ubuntu1_arm64.deb ...
Unpacking python3-jetson-gpio (2.1.7ubuntu1) ...
Selecting previously unselected package python-jetson-gpio.
Preparing to unpack .../python-jetson-gpio_2.1.7ubuntu1_arm64.deb ...
Unpacking python-jetson-gpio (2.1.7ubuntu1) ...
Selecting previously unselected package nvidia-l4t-3d-core.
Preparing to unpack .../nvidia-l4t-3d-core_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-3d-core (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-apt-source.
Preparing to unpack .../nvidia-l4t-apt-source_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-apt-source (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-camera.
Preparing to unpack .../nvidia-l4t-camera_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-camera (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-configs.
Preparing to unpack .../nvidia-l4t-configs_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-configs (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-cuda.
Preparing to unpack .../nvidia-l4t-cuda_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-cuda (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-cuda-utils.
Preparing to unpack .../nvidia-l4t-cuda-utils_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-cuda-utils (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-firmware.
Preparing to unpack .../nvidia-l4t-firmware_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-firmware (36.4.0-20240912212859) ...
Replacing files in old package linux-firmware (20220329.git681281e4-0ubuntu3.31) ...
Selecting previously unselected package nvidia-l4t-gbm.
Preparing to unpack .../nvidia-l4t-gbm_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-gbm (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-graphics-demos.
Preparing to unpack .../nvidia-l4t-graphics-demos_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-graphics-demos (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-init.
Preparing to unpack .../nvidia-l4t-init_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-init (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-initrd.
Preparing to unpack .../nvidia-l4t-initrd_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-initrd (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-jetson-io.
Preparing to unpack .../nvidia-l4t-jetson-io_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-jetson-io (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-jetsonpower-gui-tools.
Preparing to unpack .../nvidia-l4t-jetsonpower-gui-tools_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-jetsonpower-gui-tools (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-libwayland-client0.
Preparing to unpack .../nvidia-l4t-libwayland-client0_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-libwayland-client0 (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-libwayland-cursor0.
Preparing to unpack .../nvidia-l4t-libwayland-cursor0_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-libwayland-cursor0 (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-libwayland-egl1.
Preparing to unpack .../nvidia-l4t-libwayland-egl1_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-libwayland-egl1 (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-libwayland-server0.
Preparing to unpack .../nvidia-l4t-libwayland-server0_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-libwayland-server0 (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-multimedia.
Preparing to unpack .../nvidia-l4t-multimedia_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-multimedia (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-multimedia-utils.
Preparing to unpack .../nvidia-l4t-multimedia-utils_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-multimedia-utils (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-nvfancontrol.
Preparing to unpack .../nvidia-l4t-nvfancontrol_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-nvfancontrol (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-nvml.
Preparing to unpack .../nvidia-l4t-nvml_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-nvml (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-nvpmodel.
Preparing to unpack .../nvidia-l4t-nvpmodel_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-nvpmodel (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-nvpmodel-gui-tools.
Preparing to unpack .../nvidia-l4t-nvpmodel-gui-tools_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-nvpmodel-gui-tools (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-nvsci.
Preparing to unpack .../nvidia-l4t-nvsci_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-nvsci (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-oem-config.
Preparing to unpack .../nvidia-l4t-oem-config_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-oem-config (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-openwfd.
Preparing to unpack .../nvidia-l4t-openwfd_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-openwfd (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-optee.
Preparing to unpack .../nvidia-l4t-optee_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-optee (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-pva.
Preparing to unpack .../nvidia-l4t-pva_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-pva (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-tools.
Preparing to unpack .../nvidia-l4t-tools_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-tools (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-vulkan-sc.
Preparing to unpack .../nvidia-l4t-vulkan-sc_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-vulkan-sc (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-vulkan-sc-dev.
Preparing to unpack .../nvidia-l4t-vulkan-sc-dev_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-vulkan-sc-dev (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-vulkan-sc-samples.
Preparing to unpack .../nvidia-l4t-vulkan-sc-samples_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-vulkan-sc-samples (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-vulkan-sc-sdk.
Preparing to unpack .../nvidia-l4t-vulkan-sc-sdk_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-vulkan-sc-sdk (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-wayland.
Preparing to unpack .../nvidia-l4t-wayland_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-wayland (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-weston.
Preparing to unpack .../nvidia-l4t-weston_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-weston (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-x11.
Preparing to unpack .../nvidia-l4t-x11_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-x11 (36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-xusb-firmware.
Preparing to unpack .../nvidia-l4t-xusb-firmware_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-xusb-firmware (36.4.0-20240912212859) ...
Replacing files in old package linux-firmware (20220329.git681281e4-0ubuntu3.31) ...
Selecting previously unselected package nvidia-l4t-display-kernel.
Preparing to unpack .../nvidia-l4t-display-kernel_5.15.148-tegra-36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-display-kernel (5.15.148-tegra-36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-kernel.
Preparing to unpack .../nvidia-l4t-kernel_5.15.148-tegra-36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-kernel (5.15.148-tegra-36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-kernel-dtbs.
Preparing to unpack .../nvidia-l4t-kernel-dtbs_5.15.148-tegra-36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-kernel-dtbs (5.15.148-tegra-36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-kernel-headers.
Preparing to unpack .../nvidia-l4t-kernel-headers_5.15.148-tegra-36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-kernel-headers (5.15.148-tegra-36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-kernel-oot-headers.
Preparing to unpack .../nvidia-l4t-kernel-oot-headers_5.15.148-tegra-36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-kernel-oot-headers (5.15.148-tegra-36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-kernel-oot-modules.
Preparing to unpack .../nvidia-l4t-kernel-oot-modules_5.15.148-tegra-36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-kernel-oot-modules (5.15.148-tegra-36.4.0-20240912212859) ...
Selecting previously unselected package nvidia-l4t-bootloader.
Preparing to unpack .../nvidia-l4t-bootloader_36.4.0-20240912212859_arm64.deb ...
Unpacking nvidia-l4t-bootloader (36.4.0-20240912212859) ...
Setting up jetson-gpio-common (2.1.7ubuntu1) ...
Setting up python3-jetson-gpio (2.1.7ubuntu1) ...
Setting up python-jetson-gpio (2.1.7ubuntu1) ...
Setting up nvidia-l4t-apt-source (36.4.0-20240912212859) ...
Pre-installing... skip changing source list.
Setting up nvidia-l4t-configs (36.4.0-20240912212859) ...
Setting up nvidia-l4t-cuda (36.4.0-20240912212859) ...
Setting up nvidia-l4t-cuda-utils (36.4.0-20240912212859) ...
Setting up nvidia-l4t-firmware (36.4.0-20240912212859) ...
Setting up nvidia-l4t-init (36.4.0-20240912212859) ...
Setting up nvidia-l4t-jetsonpower-gui-tools (36.4.0-20240912212859) ...
Setting up nvidia-l4t-libwayland-client0 (36.4.0-20240912212859) ...
Setting up nvidia-l4t-libwayland-cursor0 (36.4.0-20240912212859) ...
Setting up nvidia-l4t-libwayland-egl1 (36.4.0-20240912212859) ...
Setting up nvidia-l4t-libwayland-server0 (36.4.0-20240912212859) ...
Setting up nvidia-l4t-multimedia-utils (36.4.0-20240912212859) ...
Setting up nvidia-l4t-nvfancontrol (36.4.0-20240912212859) ...
Setting up nvidia-l4t-nvml (36.4.0-20240912212859) ...
Setting up nvidia-l4t-nvpmodel (36.4.0-20240912212859) ...
Setting up nvidia-l4t-nvpmodel-gui-tools (36.4.0-20240912212859) ...
Setting up nvidia-l4t-nvsci (36.4.0-20240912212859) ...
Setting up nvidia-l4t-oem-config (36.4.0-20240912212859) ...
Setting up nvidia-l4t-openwfd (36.4.0-20240912212859) ...
Setting up nvidia-l4t-optee (36.4.0-20240912212859) ...
Setting up nvidia-l4t-pva (36.4.0-20240912212859) ...
Setting up nvidia-l4t-tools (36.4.0-20240912212859) ...
Setting up nvidia-l4t-vulkan-sc (36.4.0-20240912212859) ...
Setting up nvidia-l4t-vulkan-sc-dev (36.4.0-20240912212859) ...
Setting up nvidia-l4t-vulkan-sc-sdk (36.4.0-20240912212859) ...
Setting up nvidia-l4t-wayland (36.4.0-20240912212859) ...
Setting up nvidia-l4t-x11 (36.4.0-20240912212859) ...
Setting up nvidia-l4t-xusb-firmware (36.4.0-20240912212859) ...
Setting up nvidia-l4t-kernel (5.15.148-tegra-36.4.0-20240912212859) ...
Using the existing boot entry 'primary'
Pre-installing kernel package, skip flashing
Setting up nvidia-l4t-kernel-dtbs (5.15.148-tegra-36.4.0-20240912212859) ...
Pre-installing kernel-dtbs package, skip flashing
Setting up nvidia-l4t-kernel-headers (5.15.148-tegra-36.4.0-20240912212859) ...
Setting up nvidia-l4t-kernel-oot-headers (5.15.148-tegra-36.4.0-20240912212859) ...
Setting up nvidia-l4t-kernel-oot-modules (5.15.148-tegra-36.4.0-20240912212859) ...
Setting up nvidia-l4t-bootloader (36.4.0-20240912212859) ...
Pre-installing bootloader package, skip flashing
Setting up nvidia-l4t-3d-core (36.4.0-20240912212859) ...
Setting up nvidia-l4t-gbm (36.4.0-20240912212859) ...
Setting up nvidia-l4t-initrd (36.4.0-20240912212859) ...
nv-update-initrd: deferring update (trigger activated)
Pre-installing initrd package, skip flashing
Setting up nvidia-l4t-jetson-io (36.4.0-20240912212859) ...
Setting up nvidia-l4t-multimedia (36.4.0-20240912212859) ...
Setting up nvidia-l4t-vulkan-sc-samples (36.4.0-20240912212859) ...
Setting up nvidia-l4t-weston (36.4.0-20240912212859) ...
Setting up nvidia-l4t-display-kernel (5.15.148-tegra-36.4.0-20240912212859) ...
Setting up nvidia-l4t-camera (36.4.0-20240912212859) ...
Setting up nvidia-l4t-graphics-demos (36.4.0-20240912212859) ...
Processing triggers for nvidia-l4t-kernel (5.15.148-tegra-36.4.0-20240912212859) ...
Processing triggers for nvidia-l4t-initrd (36.4.0-20240912212859) ...
Include /etc/nv-update-initrd/list.d/binlist
Include /etc/nv-update-initrd/list.d/modules
nv-update-initrd: Updating /boot/initrd from /etc/nv-update-initrd/list.d for kernel version 5.15.148-tegra..
Add /usr/sbin/nvluks-srv-app
Add /lib/modules/5.15.148-tegra/updates/drivers/net/ethernet/nvidia/nvethernet/nvethernet.ko
Add /lib/modules/5.15.148-tegra/updates/drivers/nvpps/nvpps.ko
Add /lib/modules/5.15.148-tegra/updates/drivers/net/ethernet/realtek/r8126/r8126.ko
Add /lib/modules/5.15.148-tegra/updates/drivers/net/ethernet/realtek/r8168/r8168.ko
Add /lib/modules/5.15.148-tegra/modules*
Add /lib/modules/5.15.148-tegra/kernel/drivers/nvme/host/nvme.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/nvme/host/nvme-core.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/thermal/tegra/tegra-bpmp-thermal.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/pwm/pwm-tegra.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/hwmon/pwm-fan.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/pci/controller/dwc/pcie-tegra194.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/phy/tegra/phy-tegra194-p2u.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/usb/gadget/udc/tegra-xudc.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/usb/typec/ucsi/typec_ucsi.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/usb/typec/ucsi/ucsi_ccg.ko
Add /lib/modules/5.15.148-tegra/kernel/drivers/usb/typec/typec.ko
Updating modprobe.d configuration directories for modprobe..
Add config /etc/modprobe.d/alsa-base.conf
Add config /etc/modprobe.d/bcmdhd.conf
Add config /etc/modprobe.d/blacklist-ath_pci.conf
Add config /etc/modprobe.d/blacklist-firewire.conf
Add config /etc/modprobe.d/blacklist-framebuffer.conf
Add config /etc/modprobe.d/blacklist-modem.conf
Add config-link /etc/modprobe.d/blacklist-oss.conf
Add config /usr/lib/linux-sound-base/noOSS.modprobe.conf
Add config /etc/modprobe.d/blacklist-rare-network.conf
Add config /etc/modprobe.d/blacklist.conf
Add config /etc/modprobe.d/denylist-nouveau.conf
Add config /etc/modprobe.d/denylist-oot-modules-audio.conf
Add config /etc/modprobe.d/denylist-ramoops.conf
Add config /etc/modprobe.d/denylist-tegra-safety.conf
Add config /etc/modprobe.d/denylist-tpm-ftpm-tee.conf
Add config /etc/modprobe.d/iwlwifi.conf
Add config /etc/modprobe.d/nvgpu.conf
Add config /etc/modprobe.d/nvidia-display.conf
Add config /etc/modprobe.d/tegra-udrm.conf
Add config /lib/modprobe.d/aliases.conf
Add config /lib/modprobe.d/fbdev-blacklist.conf
Add config /lib/modprobe.d/systemd.conf
Cleaning up the temporary directory for updating the initrd..
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra
Removing QEMU binary from rootfs
Removing stashed Debian packages from rootfs
L4T BSP package installation completed!
Disabling NetworkManager-wait-online.service
Disable the ondemand service by changing the runlevels to 'K'
Success!
➜ Linux_for_Tegra

3.2 DANGER

Right before I tried to run the following command:

1
2
3
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_nvme.xml \
--showlogs --network usb0 jetson-agx-orin-devkit external

I noticed nvme0n1p1 !!! I got another SSD connected to my desktop and listed as nvme0n1p1 ALREADY.

1
2
3
4
5
6
7
➜  Linux_for_Tegra lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
......
nvme0n1 259:1 0 3.6T 0 disk
├─nvme0n1p1 259:2 0 59.6G 0 part
├─nvme0n1p2 259:3 0 59.6G 0 part
└─nvme0n1p3 259:4 0 3.5T 0 part

A whole bunch of command lines are to be used, in order to let my OS not load nvme0n1:

3.2.1 Umount

1
2
3
sudo umount /dev/nvme0n1p1
sudo umount /dev/nvme0n1p2
sudo umount /dev/nvme0n1p3

3.2.2 Check nvmes

1
2
3
4
➜  lspci | grep -i nvme

01:00.0 Non-Volatile memory controller: Phison Electronics Corporation E16 PCIe4 NVMe Controller (rev 01)
02:00.0 Non-Volatile memory controller: Phison Electronics Corporation E16 PCIe4 NVMe Controller (rev 01)

3.2.3 Find the Correct nvme's PCI

1
2
3
4
➜  sudo udevadm info --query=all --name=/dev/nvme0n1 | grep ID_PATH

E: ID_PATH=pci-0000:01:00.0-nvme-1
E: ID_PATH_TAG=pci-0000_01_00_0-nvme-1

3.2.4 Unbind the Corresponding nvme

1
2
3
➜  Linux_for_Tegra echo "0000:01:00.0" | sudo tee /sys/bus/pci/drivers/nvme/unbind

0000:01:00.0

3.3 Flash

Now, ALL ready. Let's flash.

3.3.1 Package Preparations

You may still have to install a couple of more packages on your host Ubuntu 24.04.1 LTS:

  • sshpass
  • abootimg
  • nfs-kernel-server

3.3.2 Run l4t_initrd_flash.sh

However, in the end, in my case, on my host Ubuntu 24.04.1 LTS, I got:

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
➜  Linux_for_Tegra sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_nvme.xml \
--showlogs --network usb0 jetson-agx-orin-devkit external
Please install the Secureboot package to use initrd flash for fused board
# Entry added by NVIDIA initrd flash tool
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/tools/kernel_flash/tmp 127.0.0.1(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
rpcbind: another rpcbind is already running. Aborting
Export list for localhost:
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/tools/kernel_flash/tmp 127.0.0.1
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_nvme.xml --showlogs --network usb0 jetson-agx-orin-devkit external
************************************
* *
* Step 1: Generate flash packages *
* *
************************************
Create folder to store images to flash
Generate image for internal storage devices
Generate images to be flashed
ADDITIONAL_DTB_OVERLAY="" ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/flash.sh --no-flash --sign jetson-agx-orin-devkit external

###############################################################################
# L4T BSP Information:
# R36 , REVISION: 4.0
# User release: 0.0
###############################################################################
ECID is 0x80012344705DF1C06C000000010281C0
copying device_config(~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/generic/BCT/tegra234-mb1-bct-device-p3701-0000.dts)... done.
copying misc_config(~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/generic/BCT/tegra234-mb1-bct-misc-p3701-0000.dts)... done.
copying emc_fuse_dev_params(~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/generic/BCT/tegra234-br-bct-diag-boot.dts)... done.
Existing emcfuse(~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/fuse_t234.xml) reused.
./tegraflash.py --chip "0x23" --applet "~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/mb1_t234_prod.bin" --skipuid --cfg readinfo_t234_min_prod.xml --dev_params tegra234-br-bct-diag-boot.dts --device_config tegra234-mb1-bct-device-p3701-0000.dts --misc_config tegra234-mb1-bct-misc-p3701-0000.dts --bins "mb2_applet applet_t234.bin" --cmd "readfuses fuse_t234.bin fuse_t234.xml; dump eeprom cvm cvm.bin; dump try_custinfo custinfo_out.bin; reboot recovery"
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegraflash_internal.py:1273: SyntaxWarning: invalid escape sequence '\.'
patt = re.compile(".*(mbr|gpt).*\.bin")
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegraflash_internal.py:1389: SyntaxWarning: invalid escape sequence '\.'
patt = re.compile(".*(mbr|gpt).*\.bin")
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegraflash_internal.py:4589: SyntaxWarning: invalid escape sequence '\s'
m = re.search('bpmp_fw_dtb[\s]+([\w._-]+)', values['--bins'])
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegrasign_v3_internal.py:1124: SyntaxWarning: invalid escape sequence '\d'
m = re.search('Key size is (\d+)', ret_str)
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegrasign_v3_internal.py:1169: SyntaxWarning: invalid escape sequence '\d'
m = re.search('Key size is (\d+)', ret_str)
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegrasign_v3_internal.py:1527: SyntaxWarning: invalid escape sequence '\d'
re_string = 'kdf_args_' + temp_stem + '(\d).yaml'
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py:1533: SyntaxWarning: invalid escape sequence '\s'
m = re.search('bpmp_fw_dtb[\s]+([\w._-]+)', values['--bins'])
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py:3025: SyntaxWarning: invalid escape sequence '\.'
patt = re.compile(".*(mbr|gpt).*\.bin")
~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/tegraflash_impl_t234.py:3087: SyntaxWarning: invalid escape sequence '\/'
info_print("Copying enc\/signed file in " + output_dir)
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

[ 0.0420 ] Reading fuses
[ 0.0426 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 0.0430 ] File rcm_state open failed
[ 0.0434 ] ERROR: failed to read rcm_state
[ 0.0435 ]
[ 0.0503 ] tegrasign_v3.py --key None --getmode mode.txt
[ 0.0505 ] Assuming zero filled SBK key
[ 0.0438 ] Pre-processing config: tegra234-mb1-bct-device-p3701-0000.dts
[ 0.0543 ] Pre-processing config: tegra234-mb1-bct-misc-p3701-0000.dts
[ 0.0659 ] Parsing partition layout
[ 0.0663 ] tegraparser_v2 --pt readinfo_t234_min_prod.xml.tmp
[ 0.0674 ] Kernel DTB used: None
[ 0.0674 ] WARNING: dce base dtb is not provided

[ 0.0674 ] Parsing partition layout
[ 0.0677 ] tegraparser_v2 --pt readinfo_t234_min_prod.xml.tmp
[ 0.0682 ] Creating list of images to be signed
[ 0.0685 ] tegrahost_v2 --chip 0x23 0 --partitionlayout readinfo_t234_min_prod.xml.bin --list images_list.xml zerosbk
[ 0.0689 ] MB1: Nvheader already present is mb1_t234_prod_aligned.bin
[ 0.0706 ] Header already present for mb1_t234_prod_aligned_sigheader.bin
[ 0.0710 ] MB1: Nvheader already present is mb1_t234_prod_aligned.bin
[ 0.0761 ] Header already present for mb1_t234_prod_aligned_sigheader.bin
[ 0.0766 ] MB1: Nvheader already present is psc_bl1_t234_prod_aligned.bin
[ 0.0813 ] Header already present for psc_bl1_t234_prod_aligned_sigheader.bin
[ 0.0815 ] adding BCH for mb2_t234_aligned.bin
[ 0.0845 ] MB1: Nvheader already present is psc_bl1_t234_prod_aligned.bin
[ 0.0971 ] Header already present for psc_bl1_t234_prod_aligned_sigheader.bin
[ 0.0973 ] adding BCH for mb2_t234_aligned.bin
[ 0.1129 ] Filling MB1 storage info
[ 0.1129 ] Parsing dev params for multi chains
[ 0.1213 ] Generating br-bct
[ 0.1218 ] Updating dev and MSS params in BR BCT
[ 0.1218 ] tegrabct_v2 --dev_param tegra234-br-bct-diag-boot_cpp.dtb --brbct br_bct.cfg --chip 0x23 0
[ 0.1226 ] Updating bl info
[ 0.1230 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updateblinfo readinfo_t234_min_prod.xml.bin
[ 0.1235 ] WARNING: boot chain is not completed. set to 0
[ 0.1252 ] Generating signatures
[ 0.1320 ] tegrasign_v3.py --key None --list images_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.1322 ] Assuming zero filled SBK key
[ 0.1431 ] Warning: pub_key.key is not found
[ 0.1365 ] Parsing dev params for multi chains
[ 0.1365 ] Generating br-bct
[ 0.1369 ] Updating dev and MSS params in BR BCT
[ 0.1369 ] tegrabct_v2 --dev_param tegra234-br-bct-diag-boot_cpp.dtb --brbct br_bct.cfg --chip 0x23 0
[ 0.1377 ] Updating bl info
[ 0.1382 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updateblinfo readinfo_t234_min_prod.xml.bin --updatesig images_list_signed.xml
[ 0.1386 ] WARNING: boot chain is not completed. set to 0
[ 0.1396 ] Generating SHA2 Hash
[ 0.1473 ] Sha saved in br_bct_BR.sha
[ 0.1405 ] Get Signed section of bct
[ 0.1408 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --listbct bct_list.xml
[ 0.1414 ] Signing BCT
[ 0.1483 ] tegrasign_v3.py --key None --list bct_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.1484 ] Assuming zero filled SBK key
[ 0.1502 ] Sha saved in br_bct_BR.sha
[ 0.1503 ] Warning: pub_key.key is not found
[ 0.1435 ] Updating BCT with signature
[ 0.1439 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updatesig bct_list_signed.xml
[ 0.1443 ] Offset :4608 Len :3584
[ 0.1451 ] Generating SHA2 Hash
[ 0.1520 ] tegrasign_v3.py --key None --list bct_list.xml --sha sha512
[ 0.1521 ] Assuming zero filled SBK key
[ 0.1521 ] Assuming zero filled SBK key
[ 0.1545 ] Sha saved in br_bct_BR.sha
[ 0.1480 ] Updating BCT with SHA2 Hash
[ 0.1483 ] tegrabct_v2 --brbct br_bct_BR.bct --chip 0x23 0 --updatesha bct_list_signed.xml
[ 0.1487 ] Offset :4608 Len :3584
[ 0.1491 ] Offset :68 Len :8124
[ 0.1493 ] Generating coldboot mb1-bct
[ 0.1498 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_cold_boot_bct.cfg --misc tegra234-mb1-bct-misc-p3701-0000_cpp.dtb --device tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[ 0.1502 ] MB1-BCT version: 0.13

[ 0.1514 ] Parsing config file :tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[ 0.1516 ] Added Platform Config 9 data with size :- 100
[ 0.1516 ]
[ 0.1517 ] Updating mb1-bct with firmware information
[ 0.1522 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_cold_boot_bct_MB1.bct --updatefwinfo readinfo_t234_min_prod.xml.bin
[ 0.1536 ] tegrahost_v2 --chip 0x23 0 --align mb1_cold_boot_bct_MB1_aligned.bct
[ 0.1541 ] Generating SHA2 Hash for mb1bct
[ 0.1620 ] Sha saved in mb1_cold_boot_bct_MB1_aligned.sha
[ 0.1632 ] Sha saved in mb1_cold_boot_bct_MB1.sha
[ 0.1569 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --appendsigheader mb1_cold_boot_bct_MB1_aligned.bct zerosbk
[ 0.1573 ] adding BCH for mb1_cold_boot_bct_MB1_aligned.bct
[ 0.1651 ] tegrasign_v3.py --key None --list mb1_cold_boot_bct_MB1_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.1652 ] Assuming zero filled SBK key
[ 0.1669 ] Warning: pub_key.key is not found
[ 0.1607 ] tegrahost_v2 --chip 0x23 0 --updatesigheader mb1_cold_boot_bct_MB1_aligned_sigheader.bct.encrypt mb1_cold_boot_bct_MB1_aligned_sigheader.bct.hash zerosbk
[ 0.1617 ] Generating recovery mb1-bct
[ 0.1623 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_bct.cfg --misc tegra234-mb1-bct-misc-p3701-0000_cpp.dtb --device tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[ 0.1627 ] MB1-BCT version: 0.13

[ 0.1639 ] Parsing config file :tegra234-mb1-bct-device-p3701-0000_cpp.dtb
[ 0.1641 ] Added Platform Config 9 data with size :- 100
[ 0.1641 ]
[ 0.1641 ] Updating mb1-bct with firmware information
[ 0.1646 ] tegrabct_v2 --chip 0x23 0 --mb1bct mb1_bct_MB1.bct --recov --updatefwinfo readinfo_t234_min_prod.xml.bin
[ 0.1660 ] tegrahost_v2 --chip 0x23 0 --align mb1_bct_MB1_aligned.bct
[ 0.1665 ] Generating SHA2 Hash for mb1bct
[ 0.1745 ] Sha saved in mb1_bct_MB1_aligned.sha
[ 0.1756 ] Sha saved in mb1_bct_MB1.sha
[ 0.1693 ] tegrahost_v2 --chip 0x23 0 --magicid MBCT --appendsigheader mb1_bct_MB1_aligned.bct zerosbk
[ 0.1697 ] adding BCH for mb1_bct_MB1_aligned.bct
[ 0.1774 ] tegrasign_v3.py --key None --list mb1_bct_MB1_aligned_sigheader.bct_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.1775 ] Assuming zero filled SBK key
[ 0.1791 ] Warning: pub_key.key is not found
[ 0.1728 ] tegrahost_v2 --chip 0x23 0 --updatesigheader mb1_bct_MB1_aligned_sigheader.bct.encrypt mb1_bct_MB1_aligned_sigheader.bct.hash zerosbk
[ 0.1744 ] Info: Skip generating mem_bct because sdram_config is not defined
[ 0.1744 ] Info: Skip generating mem_bct because sdram_config is not defined
[ 0.1744 ] Copying signatures
[ 0.1748 ] tegrahost_v2 --chip 0x23 0 --partitionlayout readinfo_t234_min_prod.xml.bin --updatesig images_list_signed.xml
[ 0.1802 ] mb1_t234_prod_aligned_sigheader.bin.encrypt filename is from images_list
[ 0.1804 ] psc_bl1_t234_prod_aligned_sigheader.bin.encrypt filename is from images_list
[ 0.1804 ] Boot Rom communication
[ 0.1808 ] tegrarcm_v2 --new_session --chip 0x23 0 --uid --download bct_br br_bct_BR.bct --download mb1 mb1_t234_prod_aligned_sigheader.bin.encrypt --download psc_bl1 psc_bl1_t234_prod_aligned_sigheader.bin.encrypt --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt
[ 0.1813 ] BR_CID: 0x80012344705DF1C06C000000010281C0
[ 0.2486 ] Sending bct_br
[ 0.3149 ] Sending mb1
[ 0.3156 ] Sending psc_bl1
[ 0.3257 ] Sending bct_mb1
[ 0.3314 ] Boot Rom communication completed
[ 0.3327 ] tegrahost_v2 --chip 0x23 0 --align applet_t234_aligned.bin
[ 0.3340 ] tegrahost_v2 --chip 0x23 0 --magicid MB2A --appendsigheader applet_t234_aligned.bin zerosbk
[ 0.3345 ] adding BCH for applet_t234_aligned.bin
[ 0.3511 ] tegrasign_v3.py --key None --list applet_t234_aligned_sigheader.bin_list.xml --pubkeyhash pub_key.key --sha sha512
[ 0.3512 ] Assuming zero filled SBK key
[ 0.3536 ] Warning: pub_key.key is not found
[ 0.3474 ] tegrahost_v2 --chip 0x23 0 --updatesigheader applet_t234_aligned_sigheader.bin.encrypt applet_t234_aligned_sigheader.bin.hash zerosbk
[ 0.3503 ] Sending mb2_applet...

[ 0.3507 ] tegrarcm_v2 --chip 0x23 0 --pollbl --download applet applet_t234_sigheader.bin.encrypt
[ 0.3511 ] BL: version 1.4.0.4-t234-54845784-e89ea9bc last_boot_error: 0
[ 0.5560 ] Sending applet
[ 0.6566 ] completed
[ 0.6573 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 0.6578 ] MB2 Applet version 01.00.0000
[ 0.8424 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 0.8429 ] MB2 Applet version 01.00.0000
[ 0.9119 ] Parsing fuse info as per xml file
[ 0.9125 ] tegraparser_v2 --chip 0x23 0 --get_fuse_names fuse_t234.xml read_fuse_names.txt
[ 0.9132 ] MagicId=0x45535546 version=0x2
[ 0.9139 ] trying to read fuse with MB2 Applet
[ 0.9146 ] tegraparser_v2 --chip 0x23 0 --read_fusetype PublicKeyHash read_fuse.bin
[ 0.9161 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 0.9166 ] MB2 Applet version 01.00.0000
[ 1.0509 ] Saved read fuses in file __fuse_read_scatter.bin
[ 1.0565 ] Fuse read successful
[ 1.0582 ] tegraparser_v2 --chip 0x23 0 --read_fusetype PkcPubkeyHash1 read_fuse.bin
[ 1.0599 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 1.0604 ] MB2 Applet version 01.00.0000
[ 1.1949 ] Saved read fuses in file __fuse_read_scatter.bin
[ 1.2005 ] Fuse read successful
[ 1.2020 ] tegraparser_v2 --chip 0x23 0 --read_fusetype PkcPubkeyHash2 read_fuse.bin
[ 1.2034 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 1.2039 ] MB2 Applet version 01.00.0000
[ 1.3389 ] Saved read fuses in file __fuse_read_scatter.bin
[ 1.3446 ] Fuse read successful
[ 1.3461 ] tegraparser_v2 --chip 0x23 0 --read_fusetype BootSecurityInfo read_fuse.bin
[ 1.3475 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 1.3482 ] MB2 Applet version 01.00.0000
[ 1.4829 ] Saved read fuses in file __fuse_read_scatter.bin
[ 1.4886 ] Fuse read successful
[ 1.4901 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ArmJtagDisable read_fuse.bin
[ 1.4915 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 1.4920 ] MB2 Applet version 01.00.0000
[ 1.9590 ] Saved read fuses in file __fuse_read_scatter.bin
[ 1.9645 ] Fuse read successful
[ 1.9662 ] tegraparser_v2 --chip 0x23 0 --read_fusetype SecurityMode read_fuse.bin
[ 1.9678 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 1.9683 ] MB2 Applet version 01.00.0000
[ 2.1029 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.1085 ] Fuse read successful
[ 2.1099 ] tegraparser_v2 --chip 0x23 0 --read_fusetype SwReserved read_fuse.bin
[ 2.1114 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.1119 ] MB2 Applet version 01.00.0000
[ 2.2458 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.2515 ] Fuse read successful
[ 2.2530 ] tegraparser_v2 --chip 0x23 0 --read_fusetype DebugAuthentication read_fuse.bin
[ 2.2546 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.2550 ] MB2 Applet version 01.00.0000
[ 2.3889 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.3945 ] Fuse read successful
[ 2.3962 ] tegraparser_v2 --chip 0x23 0 --read_fusetype OdmInfo read_fuse.bin
[ 2.3977 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.3981 ] MB2 Applet version 01.00.0000
[ 2.5329 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.5386 ] Fuse read successful
[ 2.5399 ] tegraparser_v2 --chip 0x23 0 --read_fusetype OdmId read_fuse.bin
[ 2.5414 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.5418 ] MB2 Applet version 01.00.0000
[ 2.6759 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.6815 ] Fuse read successful
[ 2.6831 ] tegraparser_v2 --chip 0x23 0 --read_fusetype OdmLock read_fuse.bin
[ 2.6845 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.6850 ] MB2 Applet version 01.00.0000
[ 2.8199 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.8254 ] Fuse read successful
[ 2.8270 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm0 read_fuse.bin
[ 2.8284 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.8289 ] MB2 Applet version 01.00.0000
[ 2.9628 ] Saved read fuses in file __fuse_read_scatter.bin
[ 2.9688 ] Fuse read successful
[ 2.9696 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm1 read_fuse.bin
[ 2.9710 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 2.9715 ] MB2 Applet version 01.00.0000
[ 3.1059 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.1116 ] Fuse read successful
[ 3.1129 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm2 read_fuse.bin
[ 3.1144 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.1149 ] MB2 Applet version 01.00.0000
[ 3.2489 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.2545 ] Fuse read successful
[ 3.2558 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm3 read_fuse.bin
[ 3.2572 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.2577 ] MB2 Applet version 01.00.0000
[ 3.3920 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.3975 ] Fuse read successful
[ 3.3990 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm4 read_fuse.bin
[ 3.4004 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.4012 ] MB2 Applet version 01.00.0000
[ 3.5359 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.5415 ] Fuse read successful
[ 3.5430 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm5 read_fuse.bin
[ 3.5444 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.5452 ] MB2 Applet version 01.00.0000
[ 3.6799 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.6855 ] Fuse read successful
[ 3.6868 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm6 read_fuse.bin
[ 3.6882 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.6889 ] MB2 Applet version 01.00.0000
[ 3.8229 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.8285 ] Fuse read successful
[ 3.8301 ] tegraparser_v2 --chip 0x23 0 --read_fusetype ReservedOdm7 read_fuse.bin
[ 3.8318 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.8323 ] MB2 Applet version 01.00.0000
[ 3.9669 ] Saved read fuses in file __fuse_read_scatter.bin
[ 3.9725 ] Fuse read successful
[ 3.9739 ] tegraparser_v2 --chip 0x23 0 --read_fusetype Sku read_fuse.bin
[ 3.9753 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 3.9758 ] MB2 Applet version 01.00.0000
[ 4.1101 ] Saved read fuses in file __fuse_read_scatter.bin
[ 4.1157 ] Fuse read successful
[ 4.1171 ] tegraparser_v2 --chip 0x23 0 --read_fusetype Uid read_fuse.bin
[ 4.1186 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 4.1190 ] MB2 Applet version 01.00.0000
[ 4.2539 ] Saved read fuses in file __fuse_read_scatter.bin
[ 4.2595 ] Fuse read successful
[ 4.2608 ] tegraparser_v2 --chip 0x23 0 --read_fusetype OptEmcDisable read_fuse.bin
[ 4.2623 ] tegrarcm_v2 --oem readfuses __fuse_read_scatter.bin read_fuse.bin
[ 4.2628 ] MB2 Applet version 01.00.0000
[ 4.3969 ] Saved read fuses in file __fuse_read_scatter.bin
[ 4.4025 ] Fuse read successful
[ 4.4040 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 4.4045 ] MB2 Applet version 01.00.0000
[ 4.4738 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 4.4743 ] MB2 Applet version 01.00.0000
[ 4.5435 ] Retrieving board information
[ 4.5441 ] tegrarcm_v2 --chip 0x23 0 --oem platformdetails chip chip_info.bin
[ 4.5449 ] MB2 Applet version 01.00.0000
[ 4.6138 ] Saved platform info in chip_info.bin
[ 4.6191 ] Chip minor revision: 1
[ 4.6192 ] Bootrom revision: 0x7
[ 4.6193 ] Ram code: 0x2
[ 4.6193 ] Chip sku: 0xd5
[ 4.6194 ] Chip Sample: prod
[ 4.6202 ] Retrieving EEPROM data
[ 4.6202 ] tegrarcm_v2 --oem platformdetails eeprom cvm ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/cvm.bin --chip 0x23 0
[ 4.6208 ] MB2 Applet version 01.00.0000
[ 4.6887 ] Saved platform info in ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/cvm.bin
[ 4.7215 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 4.7220 ] MB2 Applet version 01.00.0000
[ 4.7913 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 4.7918 ] MB2 Applet version 01.00.0000
[ 4.8600 ] Dumping customer Info
[ 4.8606 ] tegrarcm_v2 --chip 0x23 0 --oem dump bct tmp.bct
[ 4.8612 ] MB2 Applet version 01.00.0000
[ 4.9297 ] Saved bct in tmp.bct
[ 4.9502 ] tegrabct_v2 --brbct tmp.bct --chip 0x23 0 --custinfo ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/custinfo_out.bin
[ 4.9507 ] Cust[ 4.9512 ] omer data saved in ~/Desktop/Jetson_Linux_36.4/Linux_for_Tegra/bootloader/custinfo_out.bin successfully
[ 4.9513 ] Rebooting to recovery mode
[ 4.9519 ] tegrarcm_v2 --chip 0x23 0 --ismb2
[ 5.0212 ] tegrarcm_v2 --chip 0x23 0 --ismb2applet
[ 5.0218 ] MB2 Applet version 01.00.0000
[ 5.0897 ] Booting to recovery mode
[ 5.0903 ] tegrarcm_v2 --chip 0x23 0 --reboot recovery
[ 5.0908 ] MB2 Applet version 01.00.0000
Board ID(3767) version(300) sku(0003) revision(S.1)
Preset RAMCODE is 2
Chip SKU(00:00:00:D5) ramcode(2) fuselevel(fuselevel_production) board_FAB(300)
Error: Unrecognized module SKU 0003
Error: failed to generate images
Cleaning up...
➜ Linux_for_Tegra

Extremely sad now:

😭😭😭😭😭😭

I Believe, there is ALWAYS a way out. Solution is finally found at JetPack 6.1 Release Announcement. It's simply because I used a wrong command to flash. Try again:

1
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_t234_nvme.xml -p '-c bootloader/generic/cfg/flash_t234_qspi.xml' --showlogs --network usb0 jetson-orin-nano-devkit internal

This time, succeed.

l4t_initrd_flash succeed

4. Demonstration of Jetson Orin Nano

4.1 Initial Login Without ssh

You need the DP - DisplayPort. I got to purchase this new calbe iCAN 28AWG 1080p DisplayPort to HDMI Cable Male to Male Gold-plated White Color - 3 ft., in order to successfully display for Jetson Orin Nano's first-time running.

4.2 ssh Into Jetson Orin Nano After ssh Is Enabled

ssh into Jetson Orin Nano and neofetch

4.3 jtop

jtop

4.4 jetson_clocks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  ~ sudo jetson_clocks --show
SOC family:tegra234 Machine:NVIDIA Jetson Orin NX Engineering Reference Developer Kit
Online CPUs: 0-5
cpu0: Online=1 Governor=schedutil MinFreq=729600 MaxFreq=1510400 CurrentFreq=729600 IdleStates: WFI=1 c7=1
cpu1: Online=1 Governor=schedutil MinFreq=729600 MaxFreq=1510400 CurrentFreq=1036800 IdleStates: WFI=1 c7=1
cpu2: Online=1 Governor=schedutil MinFreq=729600 MaxFreq=1510400 CurrentFreq=1036800 IdleStates: WFI=1 c7=1
cpu3: Online=1 Governor=schedutil MinFreq=729600 MaxFreq=1510400 CurrentFreq=729600 IdleStates: WFI=1 c7=1
cpu4: Online=1 Governor=schedutil MinFreq=729600 MaxFreq=1510400 CurrentFreq=729600 IdleStates: WFI=1 c7=1
cpu5: Online=1 Governor=schedutil MinFreq=729600 MaxFreq=1510400 CurrentFreq=729600 IdleStates: WFI=1 c7=1
GPU MinFreq=306000000 MaxFreq=624750000 CurrentFreq=306000000
Active GPU TPCs: 4
EMC MinFreq=204000000 MaxFreq=2133000000 CurrentFreq=2133000000 FreqOverride=0
FAN Dynamic Speed Control=nvfancontrol hwmon0_pwm1=69
NV Power Mode: 15W

5. Demonstration of YOLOv11 on Jetson Orin Nano

You can find PyTorch for JetPack 6.1 in Jetson Download Center. However....

5.1 Current Issue

5.2 Make YOLOv11 On Jetson Orin Nano Work With GPU

Solution:

To successfully build torchvision from source, you may need to allocate more swap memory:

1
2
3
4
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Otherwise, you may meet the following error:

1
2
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.

ChatGPT explained it as:

1
The error you're encountering while building torchvision seems to be caused by your system running out of resources, particularly memory. The message c++: fatal error: Killed signal terminated program cc1plus often indicates that the system killed the process due to memory exhaustion.
ssh & neofetch PyTorch for JetPack 6.1 Cuda Enabled
SSH & Neofetch PyTorch Cuda
YOLOv11 Initialization YOLOv11 GPU
YOLO v11 Initialization YOLO v11 GPU

The End.

Haven't tried out my LuckFox Pico Ultra W for over 1 month. Tonight, actually, today, is Canada's Thanksgiving of year 2024.

1. Preparation

1.1 lsusb

  • Step 1: hold the BOOT button
  • Step 2: then connect the USB cable
  • Step 3: release the BOOT button

LuckFox Pico Ultra W is quite picky at USB Type 3 cables.

1
2
➜  ~ lsusb | grep Fuzhou
Bus 009 Device 014: ID 2207:110c Fuzhou Rockchip Electronics Company

1.2 Flash firmware

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
➜  ultra-w-buildroot sudo upgrade_tool uf update.img 
[sudo] password for lvision:
Loading firmware...
Support Type:1106 FW Ver:0.0.00 FW Time:2024-07-08 21:16:43
Loader ver:1.01 Loader Time:2024-07-08 21:15:08
Start to upgrade firmware...
Download Boot Start
Download Boot Success
Wait For Maskrom Start
Wait For Maskrom Success
Test Device Start
Test Device Success
Check Chip Start
Check Chip Success
Get FlashInfo Start
Get FlashInfo Success
Prepare IDB Start
Prepare IDB Success
Download IDB Start
Download IDB Success
Download Firmware Start
Download Image... (100%)
Download Firmware Success
Upgrade firmware ok.
➜ ultra-w-buildroot

1.3 Wired Connection MAC Address Keeps Varying. How?

Please add the following script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
➜  ~ cat /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: false
addresses:
- 192.168.1.122/24 # Replace with your desired static IP address and subnet mask
routes:
- to: default
via: 192.168.1.1 # Replace with your gateway IP address
nameservers:
addresses:
- 8.8.8.8 # Replace with your DNS server IP addresses
- 8.8.4.4
macaddress: 72:a4:45:da:3a:e6
➜ ~

and then do sudo netplan apply.

1.4 ssh Into LuckFox Pico Ultra W

  • username: root
  • password: luckfox
Luckfox Pico Ultra W CPUInfo Luckfox Pico Ultra W MemInfo
Luckfox Pico Ultra W CPUInfo Luckfox Pico Ultra W MemInfo

2. Luckfox Pico Ultra W CSI Camera

2.1 Connection Of CSI Camera

For my LuckFox Pico Ultra W, I need to follow the following citation: When connecting the camera to LuckFox Pico Ultra development boards, ensure that the metal side of the camera ribbon cable faces the chip on the development board. (Refer to CSI Camera)

v4l2-ctl --list-devices and rkipc.ini

2.2 Content of rkipc.ini

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[root@luckfox data]# cat rkipc.ini 
[audio.0]
enable = 1
card_name = hw:0,0
encode_type = G711A
format = S16
sample_rate = 8000
channels = 2
frame_size = 1152
bit_rate = 16000
input = mic_in
volume = 50
enable_aed = 0
enable_bcd = 0
enable_vqe = 1
vqe_cfg = /oem/usr/share/vqefiles/config_aivqe.json
rt_audio_period_size = 1024

[video.source]
enable_aiq = 1
enable_vo = 0
vo_dev_id = 3 ; 0 is hdmi, 3 is mipi
enable_ivs = 1
enable_jpeg = 1
enable_venc_0 = 1
enable_venc_1 = 1
enable_venc_2 = 0
enable_npu = 1
npu_fps = 10
buffer_line = 1296
enable_rtsp = 1
enable_rtmp = 0
rotation = 0 ; available value:0 90 180 270

[video.0]
buffer_size = 1492992 ; w * h / 2
buffer_count = 4
enable_refer_buffer_share = 1
stream_type = mainStream
video_type = compositeStream
max_width = 2304
max_height = 1296
width = 2304
height = 1296
rc_mode = CBR
rc_quality = high
src_frame_rate_den = 1
src_frame_rate_num = 25
dst_frame_rate_den = 1
dst_frame_rate_num = 25
target_rate = 0
mid_rate = 1024
max_rate = 2048
min_rate = 0
output_data_type = H.265
smart = close
h264_profile = high
gop = 50
smartp_viridrlen = 25
gop_mode = normalP
stream_smooth = 50
enable_motion_deblur = 1
enable_motion_static_switch = 0
frame_min_i_qp = 26
frame_min_qp = 28
frame_max_i_qp = 51
frame_max_qp = 51
scalinglist = 0
enable_debreath_effect = 0
debreath_effect_strength = 16

......
......
......
[roi.4]
stream_type = thirdStream
id = 1
enabled = 0
name = test
position_x = 0
position_y = 0
width = 0
height = 0
quality_level = 3

[roi.5]
stream_type = thirdStream
id = 2
enabled = 0
name = test
position_x = 0
position_y = 0
width = 0
height = 0
quality_level = 3

[region_clip.1]
enabled = 0
position_x = 0
position_y = 0
width = 640
height = 480

[network.ntp]
enable = 1
refresh_time_s = 60
ntp_server = 119.28.183.184
[root@luckfox data]#

2.3 luckfox-config

Luckfox Pico Ultra W luckfox-config Luckfox Pico Ultra W About
Luckfox Pico Ultra W luckfox-config Luckfox Pico Ultra W About
Luckfox Pico Ultra W Enable CSI Luckfox Pico Ultra W CSI Enabled
Luckfox Pico Ultra W Enable CSI Luckfox Pico Ultra W CSI Enabled

2.4 Snapshot of Streamed Video Over RTSP

Snapshot

YOLOv11 was just out for a couple of days. People keep talking about its terrrific performance. Today, let me have some fun.

1. YOLOv11 Server App

A Flask implementation is obtained from ChatGPT:

LVT YOLOv11 Server App

2. Demonstration From Client Requests

2.1 Commands

Corresponding to the 5 tasks summarized on YOLOv11, the results of client requests are demonstrated as:

LVT YOLOv11 5 EndPoints Requests

2.2 Resultant Images On Server

Original Image YOLO Detection
Original Image Detection Result
YOLO Segmentation YOLO Pose
Segmentation Boundaries Pose Keypoints
YOLO Oriented Detection YOLO Classification
Oriented Detection Classfication Json

Let me try to provide such a service as public asap..

Peace. Jesus. I'd recommend you The Bible Studio.

Today, I'd love to have some fun of TorchServe.

1. TorchServe Getting Started

Please just follow TorchServe Getting Started, with trivial modifications. In my demonstration, I stick to working under directory /opt/servers/torchserve.

1.1 Clone TorchServe

1
2
3
4
5
6
7
8
➜  torchserve git clone https://github.com/pytorch/serve.git        
Cloning into 'serve'...
remote: Enumerating objects: 60508, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 60508 (delta 6), reused 3 (delta 0), pack-reused 60483 (from 1)
Receiving objects: 100% (60508/60508), 99.06 MiB | 23.01 MiB/s, done.
Resolving deltas: 100% (37656/37656), done.

1.2 Store a Model

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  torchserve mkdir model_store
➜ torchserve wget https://download.pytorch.org/models/densenet161-8d451a50.pth
--2024-10-07 00:35:54-- https://download.pytorch.org/models/densenet161-8d451a50.pth
Resolving download.pytorch.org (download.pytorch.org)... 2600:9000:26ce:7a00:d:607e:4540:93a1, 2600:9000:26ce:6e00:d:607e:4540:93a1, 2600:9000:26ce:3400:d:607e:4540:93a1, ...
Connecting to download.pytorch.org (download.pytorch.org)|2600:9000:26ce:7a00:d:607e:4540:93a1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 115730790 (110M) [application/x-www-form-urlencoded]
Saving to: ‘densenet161-8d451a50.pth’

densenet161-8d451a50.pth 100%[==================================================================================================================================================>] 110.37M 109MB/s in 1.0s

2024-10-07 00:35:55 (109 MB/s) - ‘densenet161-8d451a50.pth’ saved [115730790/115730790]
➜ torchserve torch-model-archiver --model-name densenet161 --version 1.0 --model-file ./serve/examples/image_classifier/densenet_161/model.py --serialized-file densenet161-8d451a50.pth --export-path model_store --extra-files ./serve/examples/image_classifier/index_to_name.json --handler image_classifier
➜ torchserve ll model_store
total 106M
4.0K drwxrwxr-x 2 lvision lvision 4.0K Oct 7 00:36 ./
4.0K drwxrwxr-x 5 lvision lvision 4.0K Oct 7 00:35 ../
106M -rw-rw-r-- 1 lvision lvision 106M Oct 7 00:36 densenet161.mar

1.3 Start TorchServe

1.3.1 config.properties

1
2
3
4
5
6
7
8
9
➜  torchserve cat config.properties 
inference_address=http://127.0.0.1:8080
management_address=http://127.0.0.1:8081
metrics_address=http://127.0.0.1:8082
enable_token_auth=true
ts.key.file=/opt/servers/torchserve/key_file.json
log_location=/opt/servers/torchserve/logs
metrics_location=/opt/servers/torchserve/logs
access_log_location=/opt/servers/torchserve/logs

1.3.2 Start TorchServe to serve the model

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
➜  torchserve torchserve --start --ncs --model-store model_store --models densenet161.mar
➜ torchserve WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2024-10-07T00:38:23,323 [DEBUG] main org.pytorch.serve.util.ConfigManager - xpu-smi not available or failed: Cannot run program "xpu-smi": error=2, No such file or directory
2024-10-07T00:38:23,326 [WARN ] main org.pytorch.serve.util.ConfigManager - Your torchserve instance can access any URL to load models. When deploying to production, make sure to limit the set of allowed_urls in config.properties
2024-10-07T00:38:23,361 [INFO ] main org.pytorch.serve.util.TokenAuthorization -
######
TorchServe now enforces token authorization by default.
This requires the correct token to be provided when calling an API.
Key file located at /opt/servers/torchserve/key_file.json
Check token authorization documenation for information: https://github.com/pytorch/serve/blob/master/docs/token_authorization_api.md
######

2024-10-07T00:38:23,361 [INFO ] main org.pytorch.serve.servingsdk.impl.PluginsManager - Initializing plugins manager...
2024-10-07T00:38:23,399 [INFO ] main org.pytorch.serve.metrics.configuration.MetricConfiguration - Successfully loaded metrics configuration from /home/lvision/.local/lib/python3.12/site-packages/ts/configs/metrics.yaml
2024-10-07T00:38:23,484 [INFO ] main org.pytorch.serve.ModelServer -
Torchserve version: 0.12.0
TS Home: /home/lvision/.local/lib/python3.12/site-packages
Current directory: /opt/servers/torchserve
Temp directory: /tmp
Metrics config path: /home/lvision/.local/lib/python3.12/site-packages/ts/configs/metrics.yaml
Number of GPUs: 1
Number of CPUs: 48
Max heap size: 30208 M
Python executable: /usr/bin/python3
Config file: config.properties
Inference address: http://127.0.0.1:8080
Management address: http://127.0.0.1:8081
Metrics address: http://127.0.0.1:8082
Model Store: /opt/servers/torchserve/model_store
Initial Models: densenet161.mar
Log dir: /opt/servers/torchserve/logs
Metrics dir: /opt/servers/torchserve/logs
Netty threads: 0
Netty client threads: 0
Default workers per model: 1
Blacklist Regex: N/A
Maximum Response Size: 6553500
Maximum Request Size: 6553500
Limit Maximum Image Pixels: true
Prefer direct buffer: false
Allowed Urls: [file://.*|http(s)?://.*]
Custom python dependency for model allowed: false
Enable metrics API: true
Metrics mode: LOG
Disable system metrics: false
Workflow Store: /opt/servers/torchserve/model_store
CPP log config: N/A
Model config: N/A
System metrics command: default
Model API enabled: false
2024-10-07T00:38:23,491 [INFO ] main org.pytorch.serve.servingsdk.impl.PluginsManager - Loading snapshot serializer plugin...
2024-10-07T00:38:23,492 [INFO ] main org.pytorch.serve.ModelServer - Loading initial models: densenet161.mar
2024-10-07T00:38:24,521 [DEBUG] main org.pytorch.serve.wlm.ModelVersionedRefs - Adding new version 1.0 for model densenet161
2024-10-07T00:38:24,521 [DEBUG] main org.pytorch.serve.wlm.ModelVersionedRefs - Setting default version to 1.0 for model densenet161
2024-10-07T00:38:24,521 [INFO ] main org.pytorch.serve.wlm.ModelManager - Model densenet161 loaded.
2024-10-07T00:38:24,521 [DEBUG] main org.pytorch.serve.wlm.ModelManager - updateModel: densenet161, count: 1
2024-10-07T00:38:24,526 [INFO ] main org.pytorch.serve.ModelServer - Initialize Inference server with: EpollServerSocketChannel.
2024-10-07T00:38:24,527 [DEBUG] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerLifeCycle - Worker cmdline: [/usr/bin/python3, /home/lvision/.local/lib/python3.12/site-packages/ts/model_service_worker.py, --sock-type, unix, --sock-name, /tmp/.ts.sock.9000, --metrics-config, /home/lvision/.local/lib/python3.12/site-packages/ts/configs/metrics.yaml]
2024-10-07T00:38:24,568 [INFO ] main org.pytorch.serve.ModelServer - Inference API bind to: http://127.0.0.1:8080
2024-10-07T00:38:24,568 [INFO ] main org.pytorch.serve.ModelServer - Initialize Management server with: EpollServerSocketChannel.
2024-10-07T00:38:24,569 [INFO ] main org.pytorch.serve.ModelServer - Management API bind to: http://127.0.0.1:8081
2024-10-07T00:38:24,570 [INFO ] main org.pytorch.serve.ModelServer - Initialize Metrics server with: EpollServerSocketChannel.
2024-10-07T00:38:24,570 [INFO ] main org.pytorch.serve.ModelServer - Metrics API bind to: http://127.0.0.1:8082
Model server started.
2024-10-07T00:38:24,720 [WARN ] pool-3-thread-1 org.pytorch.serve.metrics.MetricCollector - worker pid is not available yet.
2024-10-07T00:38:25,152 [INFO ] pool-3-thread-1 TS_METRICS - CPUUtilization.Percent:20.0|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,153 [INFO ] pool-3-thread-1 TS_METRICS - DiskAvailable.Gigabytes:1412.4598426818848|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,153 [INFO ] pool-3-thread-1 TS_METRICS - DiskUsage.Gigabytes:215.69704055786133|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,153 [INFO ] pool-3-thread-1 TS_METRICS - DiskUtilization.Percent:13.2|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,153 [INFO ] pool-3-thread-1 TS_METRICS - GPUMemoryUtilization.Percent:2.5472005208333335|#Level:Host,DeviceId:0|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,153 [INFO ] pool-3-thread-1 TS_METRICS - GPUMemoryUsed.Megabytes:626.0|#Level:Host,DeviceId:0|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,154 [INFO ] pool-3-thread-1 TS_METRICS - GPUUtilization.Percent:0.0|#Level:Host,DeviceId:0|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,154 [INFO ] pool-3-thread-1 TS_METRICS - MemoryAvailable.Megabytes:248234.90625|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,154 [INFO ] pool-3-thread-1 TS_METRICS - MemoryUsed.Megabytes:6890.875|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,154 [INFO ] pool-3-thread-1 TS_METRICS - MemoryUtilization.Percent:3.6|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286705
2024-10-07T00:38:25,632 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - s_name_part0=/tmp/.ts.sock, s_name_part1=9000, pid=62344
2024-10-07T00:38:25,636 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Listening on port: /tmp/.ts.sock.9000
2024-10-07T00:38:25,637 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Successfully loaded /home/lvision/.local/lib/python3.12/site-packages/ts/configs/metrics.yaml.
2024-10-07T00:38:25,637 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - [PID]62344
2024-10-07T00:38:25,637 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Torch worker started.
2024-10-07T00:38:25,637 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Python runtime: 3.12.3
2024-10-07T00:38:25,638 [DEBUG] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerThread - W-9000-densenet161_1.0 State change null -> WORKER_STARTED
2024-10-07T00:38:25,641 [INFO ] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerThread - Connecting to: /tmp/.ts.sock.9000
2024-10-07T00:38:25,646 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Connection accepted: /tmp/.ts.sock.9000.
2024-10-07T00:38:25,648 [DEBUG] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerThread - Flushing req.cmd LOAD repeats 1 to backend at: 1728286705648
2024-10-07T00:38:25,649 [INFO ] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerThread - Looping backend response at: 1728286705649
2024-10-07T00:38:25,674 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - model_name: densenet161, batchSize: 1
2024-10-07T00:38:26,881 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Enabled tensor cores
2024-10-07T00:38:26,882 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - OpenVINO is not enabled
2024-10-07T00:38:26,882 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - proceeding without onnxruntime
2024-10-07T00:38:26,882 [INFO ] W-9000-densenet161_1.0-stdout MODEL_LOG - Torch TensorRT not enabled
2024-10-07T00:38:27,263 [WARN ] W-9000-densenet161_1.0-stderr MODEL_LOG - /home/lvision/.local/lib/python3.12/site-packages/ts/torch_handler/base_handler.py:355: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
2024-10-07T00:38:27,264 [WARN ] W-9000-densenet161_1.0-stderr MODEL_LOG - state_dict = torch.load(model_pt_path, map_location=map_location)
2024-10-07T00:38:27,564 [INFO ] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerThread - Backend response time: 1915
2024-10-07T00:38:27,564 [DEBUG] W-9000-densenet161_1.0 org.pytorch.serve.wlm.WorkerThread - W-9000-densenet161_1.0 State change WORKER_STARTED -> WORKER_MODEL_LOADED
2024-10-07T00:38:27,565 [INFO ] W-9000-densenet161_1.0 TS_METRICS - WorkerLoadTime.Milliseconds:3041.0|#WorkerName:W-9000-densenet161_1.0,Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286707
2024-10-07T00:38:27,565 [INFO ] W-9000-densenet161_1.0 TS_METRICS - WorkerThreadTime.Milliseconds:2.0|#Level:Host|#hostname:lvision-MS-7C60,timestamp:1728286707


1.3.3 key_file.json

By running the above command, a key_file.json file is generated under the current working directory (Please refer to TorchServe token authorization API):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
➜  torchserve ll key_file.json
4.0K -rw------- 1 lvision lvision 243 Oct 7 00:38 key_file.json
➜ torchserve cat key_file.json
{
"management": {
"key": "c_7-MgUE",
"expiration time": "2024-10-07T08:38:23.343462778Z"
},
"inference": {
"key": "IMc5oeRf",
"expiration time": "2024-10-07T08:38:23.343456097Z"
},
"API": {
"key": "_tFv4L56"
}
}%

1.3.4 Is TorchServe Service Running?

1
2
3
4
5
6
7
8
9
➜  ~ curl -H "Authorization: Bearer c_7-MgUE" http://127.0.0.1:8081/models
{
"models": [
{
"modelName": "densenet161",
"modelUrl": "densenet161.mar"
}
]
}

1.4 Get Predictions

1.4.1 Using REST APIs

1
2
3
4
➜  torchserve curl -O https://raw.githubusercontent.com/pytorch/serve/master/docs/images/kitten_small.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7341 100 7341 0 0 28980 0 --:--:-- --:--:-- --:--:-- 29015

Let's take a look:

kitten

1
2
3
4
5
6
7
8
➜  torchserve curl -H "Authorization: Bearer IMc5oeRf" http://127.0.0.1:8080/predictions/densenet161 -T kitten_small.jpg
{
"tabby": 0.47793325781822205,
"lynx": 0.20019005239009857,
"tiger_cat": 0.16827784478664398,
"tiger": 0.062009651213884354,
"Egyptian_cat": 0.05115227773785591
}%

1.4.2 Using gRPC APIs through Python Client

1.4.2.1 Install gRPC Python dependencies

1
pip install -U grpcio protobuf grpcio-tools googleapis-common-protos

1.4.2.2 Generate inference client using proto files

Must under folder serve:

1
➜  torchserve cd serve

Then,

1
2
3
4
➜  serve git:(master) python -m grpc_tools.protoc --proto_path=frontend/server/src/main/resources/proto/ --python_out=ts_scripts --grpc_python_out=ts_scripts frontend/server/src/main/resources/proto/inference.proto frontend/server/src/main/resources/proto/management.proto
google/rpc/status.proto: File not found.
inference.proto:6:1: Import "google/rpc/status.proto" was not found or had errors.
inference.proto:32:14: "google.rpc.Status" is not defined.
Why????
😞😢😭

Solution::

1
2
3
4
5
6
7
8
9
➜  serve git:(master) git clone https://github.com/googleapis/googleapis.git

Cloning into 'googleapis'...
remote: Enumerating objects: 233669, done.
remote: Counting objects: 100% (13457/13457), done.
remote: Compressing objects: 100% (410/410), done.
remote: Total 233669 (delta 13122), reused 13077 (delta 13042), pack-reused 220212 (from 1)
Receiving objects: 100% (233669/233669), 205.13 MiB | 21.65 MiB/s, done.
Resolving deltas: 100% (196982/196982), done.
  • Step 2: Generate inference client using Google APIs's necessary .proto files:
1
2
3
4
5
6
7
➜  serve git:(master) ✗ python -m grpc_tools.protoc \
--proto_path=frontend/server/src/main/resources/proto/ \
--proto_path=googleapis/ \
--python_out=ts_scripts \
--grpc_python_out=ts_scripts \
frontend/server/src/main/resources/proto/inference.proto \
frontend/server/src/main/resources/proto/management.proto
  • Step 3: Modify ts_scripts/torchserve_grpc_client.py as follows:
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
import argparse
import queue
import threading
from functools import partial

import grpc
import inference_pb2
import inference_pb2_grpc
import management_pb2
import management_pb2_grpc

# Function to get an inference stub for making gRPC calls to the inference service.
def get_inference_stub():
channel = grpc.insecure_channel("localhost:7070")
stub = inference_pb2_grpc.InferenceAPIsServiceStub(channel)
return stub

# Function to get a management stub for making gRPC calls to the model management service.
def get_management_stub():
channel = grpc.insecure_channel("localhost:7071")
stub = management_pb2_grpc.ManagementAPIsServiceStub(channel)
return stub

# Perform a single inference call.
def infer(stub, model_name, model_input, metadata):
with open(model_input, "rb") as f:
data = f.read()

input_data = {"data": data}
response = stub.Predictions(
inference_pb2.PredictionsRequest(model_name=model_name, input=input_data),
metadata=metadata,
)

try:
prediction = response.prediction.decode("utf-8")
print(prediction)
except grpc.RpcError as e:
print(f"gRPC error: {e.details()}")
exit(1)

# Perform streaming inference.
def infer_stream(stub, model_name, model_input, metadata):
with open(model_input, "rb") as f:
data = f.read()

input_data = {"data": data}
responses = stub.StreamPredictions(
inference_pb2.PredictionsRequest(model_name=model_name, input=input_data),
metadata=metadata,
)

try:
for resp in responses:
prediction = resp.prediction.decode("utf-8")
print(prediction)
except grpc.RpcError as e:
print(f"gRPC error: {e.details()}")
exit(1)

# Perform an advanced streaming inference with multiple input files.
def infer_stream2(model_name, sequence_id, input_files, metadata):
response_queue = queue.Queue()
process_response_func = partial(
InferStream2.default_process_response, response_queue
)

client = InferStream2SimpleClient()
try:
client.start_stream(
model_name=model_name,
sequence_id=sequence_id,
process_response=process_response_func,
metadata=metadata,
)
sequence = input_files.split(",")

for input_file in sequence:
client.async_send_infer(input_file.strip())

for i in range(0, len(sequence)):
response = response_queue.get()
print(str(response))

print("Sequence completed!")

except grpc.RpcError as e:
print("infer_stream2 received error", e)
exit(1)
finally:
client.stop_stream()
client.stop()

# Register a new model with TorchServe.
def register(stub, model_name, mar_set_str, metadata):
mar_set = set()
if mar_set_str:
mar_set = set(mar_set_str.split(","))
marfile = f"{model_name}.mar"
print(f"## Check {marfile} in mar_set :", mar_set)
if marfile not in mar_set:
marfile = "https://torchserve.s3.amazonaws.com/mar_files/{}.mar".format(
model_name
)

print(f"## Register marfile: {marfile}\n")
params = {
"url": marfile,
"initial_workers": 1,
"synchronous": True,
"model_name": model_name,
}
try:
response = stub.RegisterModel(
management_pb2.RegisterModelRequest(**params), metadata=metadata
)
print(f"Model {model_name} registered successfully")
except grpc.RpcError as e:
print(f"Failed to register model {model_name}.")
print(str(e.details()))
exit(1)

# Unregister a model from TorchServe.
def unregister(stub, model_name, metadata):
try:
response = stub.UnregisterModel(
management_pb2.UnregisterModelRequest(model_name=model_name),
metadata=metadata,
)
print(f"Model {model_name} unregistered successfully")
except grpc.RpcError as e:
print(f"Failed to unregister model {model_name}.")
print(str(e.details()))
exit(1)

# The rest of the code defines the streaming classes and the command-line interface.

if __name__ == "__main__":
# Argument parsing for the script
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument(
"model_name",
type=str,
default=None,
help="Name of the model used.",
)
parent_parser.add_argument(
"--auth-token",
dest="auth_token",
type=str,
default=None,
required=False,
help="Authorization token",
)

parser = argparse.ArgumentParser(
description="TorchServe gRPC client",
formatter_class=argparse.RawTextHelpFormatter,
)
subparsers = parser.add_subparsers(help="Action", dest="action")

infer_action_parser = subparsers.add_parser(
"infer", parents=[parent_parser], add_help=False
)
infer_stream_action_parser = subparsers.add_parser(
"infer_stream", parents=[parent_parser], add_help=False
)
infer_stream2_action_parser = subparsers.add_parser(
"infer_stream2", parents=[parent_parser], add_help=False
)
register_action_parser = subparsers.add_parser(
"register", parents=[parent_parser], add_help=False
)
unregister_action_parser = subparsers.add_parser(
"unregister", parents=[parent_parser], add_help=False
)

# Arguments for different actions
infer_action_parser.add_argument(
"model_input", type=str, default=None, help="Input for model for inference."
)
infer_stream_action_parser.add_argument(
"model_input",
type=str,
default=None,
help="Input for model for stream inference.",
)
infer_stream2_action_parser.add_argument(
"sequence_id",
type=str,
default=None,
help="Input for sequence id for stream inference.",
)
infer_stream2_action_parser.add_argument(
"input_files",
type=str,
default=None,
help="Comma separated list of input files",
)
register_action_parser.add_argument(
"mar_set",
type=str,
default=None,
nargs="?",
help="Comma separated list of mar models to be loaded using [model_name=]model_location format.",
)

# Parse command line arguments
args = parser.parse_args()

# Create metadata with or without the authorization token
if args.auth_token:
metadata = (
("protocol", "gRPC"),
("session_id", "12345"),
("authorization", f"Bearer {args.auth_token}"),
)
else:
metadata = (("protocol", "gRPC"), ("session_id", "12345"))

# Perform the selected action
if args.action == "infer":
infer(get_inference_stub(), args.model_name, args.model_input, metadata)
elif args.action == "infer_stream":
infer_stream(get_inference_stub(), args.model_name, args.model_input, metadata)
elif args.action == "infer_stream2":
infer_stream2(args.model_name, args.sequence_id, args.input_files, metadata)
elif args.action == "register":
register(get_management_stub(), args.model_name, args.mar_set, metadata)
elif args.action == "unregister":
unregister(get_management_stub(), args.model_name, metadata)
  • Step 4: Run inference using a sample client gRPC python client:
1
2
3
4
5
6
7
8
9
10
11
12
13
➜  serve git:(master) ✗ python ts_scripts/torchserve_grpc_client.py infer --auth-token IMc5oeRf densenet161 examples/image_classifier/kitten.jpg

/home/lvision/.local/lib/python3.12/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.2 is older than the runtime version 5.28.2 at inference.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
warnings.warn(
/home/lvision/.local/lib/python3.12/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.2 is older than the runtime version 5.28.2 at management.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
warnings.warn(
{
"tabby": 0.46603792905807495,
"tiger_cat": 0.4651001989841461,
"Egyptian_cat": 0.06611046195030212,
"lynx": 0.001293532201088965,
"plastic_bag": 0.000228719727601856
}

China's 75th National Day

Today, it's China's 75th Birthday. Let me join the celebration. And, today, I'm going to build up a customized Linux operating system by following Linux From Scratch, with the MOST up-to-date kernel 6.11.1.

1. Preparation

1.1 Create a Disk Image File

1
2
3
4
➜  repo dd if=/dev/zero of=./lfs.img bs=1M count=65536 
65536+0 records in
65536+0 records out
68719476736 bytes (69 GB, 64 GiB) copied, 114.926 s, 598 MB/s
1
2
➜  repo ll lfs.img
65G -rw-rw-r-- 1 lvision lvision 64G Oct 1 00:01 lfs.img

1.2 Format the Disk Image

1
2
3
4
5
6
7
8
9
10
11
12
13
➜  repo mkfs.ext4 lfs.img
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Creating filesystem with 16777216 4k blocks and 4194304 inodes
Filesystem UUID: 7cffdaf4-2fa9-4688-8269-5a60e637b887
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

1.3 Mount the Disk Image

1
2
➜  repo sudo mount -o loop lfs.img /mnt/lfs
➜ repo
1
2
3
➜  lfs df -h /mnt/lfs
Filesystem Size Used Avail Use% Mounted on
/dev/loop14 63G 27G 34G 45% /mnt/lfs

1.4 Login As Root

From now on, we need to login as user root.

1
2
3
➜  repo su - root                          
Password:
root@lvision-MS-7C60:~#

1.5 Exports

1
2
root@lvision-MS-7C60:~# export LFS=/mnt/lfs
root@lvision-MS-7C60:~# export LFS_TGT=$(uname -m)-lfs-linux-gnu

1.6 Download Source

1
2
3
4
root@lvision-MS-7C60:~# mkdir -v $LFS/sources
mkdir: created directory '/sources'
root@lvision-MS-7C60:~# chmod -v a+wt $LFS/sources
mode of '/sources' changed from 0755 (rwxr-xr-x) to 1777 (rwxrwxrwt)
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
root@lvision-MS-7C60:/mnt/docker/repo# wget --input-file=wget-list-sysv --continue --directory-prefix=$LFS/sources
--2024-08-27 03:49:06-- https://download.savannah.gnu.org/releases/acl/acl-2.3.2.tar.xz
Resolving download.savannah.gnu.org (download.savannah.gnu.org)... 2001:470:142:5::200, 209.51.188.200
Connecting to download.savannah.gnu.org (download.savannah.gnu.org)|2001:470:142:5::200|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://mirrors.ocf.berkeley.edu/nongnu/acl/acl-2.3.2.tar.xz [following]
--2024-08-27 03:49:06-- https://mirrors.ocf.berkeley.edu/nongnu/acl/acl-2.3.2.tar.xz
Resolving mirrors.ocf.berkeley.edu (mirrors.ocf.berkeley.edu)... 2607:f140:0:32::70, 169.229.200.70
Connecting to mirrors.ocf.berkeley.edu (mirrors.ocf.berkeley.edu)|2607:f140:0:32::70|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 371680 (363K) [application/octet-stream]
Saving to: ‘/mnt/lfs/sources/acl-2.3.2.tar.xz’

acl-2.3.2.tar.xz 100%[====================================================================================================================================>] 362.97K --.-KB/s in 0.1s

2024-08-27 03:49:07 (3.07 MB/s) - ‘/mnt/lfs/sources/acl-2.3.2.tar.xz’ saved [371680/371680]

--2024-08-27 03:49:07-- https://download.savannah.gnu.org/releases/attr/attr-2.5.2.tar.gz
Connecting to download.savannah.gnu.org (download.savannah.gnu.org)|2001:470:142:5::200|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://nongnu.askapache.com/attr/attr-2.5.2.tar.gz [following]
--2024-08-27 03:49:07-- https://nongnu.askapache.com/attr/attr-2.5.2.tar.gz
Resolving nongnu.askapache.com (nongnu.askapache.com)... 50.87.145.190
Connecting to nongnu.askapache.com (nongnu.askapache.com)|50.87.145.190|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 492539 (481K) [application/x-gzip]
Saving to: ‘/mnt/lfs/sources/attr-2.5.2.tar.gz’

attr-2.5.2.tar.gz 100%[====================================================================================================================================>] 481.00K 2.13MB/s in 0.2s

......
sysvinit-3.10-consolidated-1.patch 100%[====================================================================================================================================>] 2.41K --.-KB/s in 0s

2024-08-27 03:51:25 (2.39 GB/s) - ‘/mnt/lfs/sources/sysvinit-3.10-consolidated-1.patch’ saved [2464/2464]

FINISHED --2024-08-27 03:51:25--
Total wall clock time: 2m 20s
Downloaded: 94 files, 519M in 1m 32s (5.67 MB/s)
You have new mail in /var/mail/root
root@lvision-MS-7C60:/mnt/docker/repo#

1.7 Creating a Limited Directory Layout in the LFS Filesystem

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
root@lvision-MS-7C60:/mnt/lfs# mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin}

for i in bin lib sbin; do
ln -sv usr/$i $LFS/$i
done

case $(uname -m) in
x86_64) mkdir -pv $LFS/lib64 ;;
esac
mkdir: created directory '/mnt/lfs/etc'
mkdir: created directory '/mnt/lfs/var'
mkdir: created directory '/mnt/lfs/usr'
mkdir: created directory '/mnt/lfs/usr/bin'
mkdir: created directory '/mnt/lfs/usr/lib'
mkdir: created directory '/mnt/lfs/usr/sbin'
'/mnt/lfs/bin' -> 'usr/bin'
'/mnt/lfs/lib' -> 'usr/lib'
'/mnt/lfs/sbin' -> 'usr/sbin'
mkdir: created directory '/mnt/lfs/lib64'
root@lvision-MS-7C60:/mnt/lfs# mkdir -pv $LFS/tools
mkdir: created directory '/mnt/lfs/tools'
root@lvision-MS-7C60:/mnt/lfs#

1.8 Adding the LFS User

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
root@lvision-MS-7C60:/mnt/lfs# groupadd lfs
useradd -s /bin/bash -g lfs -m -k /dev/null lfs
groupadd: group 'lfs' already exists
useradd: user 'lfs' already exists
root@lvision-MS-7C60:/mnt/lfs# chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools}
case $(uname -m) in
x86_64) chown -v lfs $LFS/lib64 ;;
esac
changed ownership of '/mnt/lfs/usr' from root to lfs
changed ownership of '/mnt/lfs/usr/bin' from root to lfs
changed ownership of '/mnt/lfs/usr/lib' from root to lfs
changed ownership of '/mnt/lfs/usr/sbin' from root to lfs
ownership of '/mnt/lfs/lib' retained as lfs
changed ownership of '/mnt/lfs/var' from root to lfs
changed ownership of '/mnt/lfs/etc' from root to lfs
ownership of '/mnt/lfs/bin' retained as lfs
ownership of '/mnt/lfs/sbin' retained as lfs
changed ownership of '/mnt/lfs/tools' from root to lfs
changed ownership of '/mnt/lfs/lib64' from root to lfs
1
2
root@lvision-MS-7C60:/mnt/lfs# su - lfs
lfs@lvision-MS-7C60:~$

2. Building the LFS Cross Toolchain and Temporary Tools

Please just strictily follow:

[!Note:] One key point to be emphasized: Entering Chroot for Chapter 7

1
2
3
4
chown --from lfs -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools}
case $(uname -m) in
x86_64) chown --from lfs -R root:root $LFS/lib64 ;;
esac
1
2
3
4
5
6
7
8
9
10
root@lvision-MS-7C60:/mnt/lfs# mount -v --bind /dev $LFS/dev
mount -vt devpts devpts -o gid=5,mode=0620 $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
mount: /dev bound on /mnt/lfs/dev.
mount: devpts mounted on /mnt/lfs/dev/pts.
mount: proc mounted on /mnt/lfs/proc.
mount: sysfs mounted on /mnt/lfs/sys.
mount: tmpfs mounted on /mnt/lfs/run.
1
2
3
4
5
6
root@lvision-MS-7C60:/mnt/lfs# if [ -h $LFS/dev/shm ]; then
install -v -d -m 1777 $LFS$(realpath /dev/shm)
else
mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
fi
mount: tmpfs mounted on /mnt/lfs/dev/shm.
1
2
3
4
5
6
7
8
9
root@lvision-MS-7C60:/mnt/lfs# chroot "$LFS" /usr/bin/env -i   \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/usr/bin:/usr/sbin \
MAKEFLAGS="-j$(nproc)" \
TESTSUITEFLAGS="-j$(nproc)" \
/bin/bash --login
(lfs chroot) root:/#

3. Building the LFS System

[!Note:] Two bugs MUST be fixed:

3.1 fatal error: getopt-cdefs.h: No such file or directory in LFS Chapter 8 - 8.35. Grep-3.11

The Bug:

1
2
3
4
5
In file included from grep.c:43:
../lib/getopt.h:84:10: fatal error: getopt-cdefs.h: No such file or directory
84 | #include <getopt-cdefs.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.

The Solution:

1
(lfs chroot) root:/sources/grep-3.11# cp ../coreutils-9.5/lib/getopt-cdefs.h ./lib/

3.2 i386-pc vs. x86_64-efi in LFS Chapter 8 - 8.64. GRUB-2.12

In order to build GRUB, please strictly follow: BLFS Chapter 5 - GRUB-2.12 for EFI instead.

3.2.1. Build x86_64-efi Instead of i386-pc

Do NOT use the following for i386-pc:

1
2
3
4
./configure --prefix=/usr          \
--sysconfdir=/etc \
--disable-efiemu \
--disable-werror

Instead, use the following for x86_64-efi:

1
2
3
4
5
6
7
./configure --prefix=/usr        \
--sysconfdir=/etc \
--disable-efiemu \
--enable-grub-mkfont \
--with-platform=efi \
--target=x86_64 \
--disable-werror

After you obtained the following message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
*******************************************************
GRUB2 will be compiled with following components:
Platform: x86_64-efi
With devmapper support: No (need libdevmapper header)
With memory debugging: No
With disk cache statistics: No
With boot time statistics: No
efiemu runtime: No (not available on efi)
grub-mkfont: No (need freetype2 library)
grub-mount: No (need fuse or fuse3 libraries)
starfield theme: No (No build-time grub-mkfont)
With libzfs support: No (need zfs library)
Build-time grub-mkfont: No (need freetype2 library)
Without unifont (no build-time grub-mkfont)
With liblzma from -llzma (support for XZ-compressed mips images)
With stack smashing protector: No
*******************************************************

we do:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
unset TARGET_CC &&
make
......
TARGET_OBJ2ELF= sh genmod.sh moddep.lst gcry_whirlpool.module build-grub-module-verifier gcry_whirlpool.mod
make[3]: Leaving directory '/sources/grub-2.12/grub-core'
make[2]: Leaving directory '/sources/grub-2.12/grub-core'
Making all in po
make[2]: Entering directory '/sources/grub-2.12/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/sources/grub-2.12/po'
Making all in docs
make[2]: Entering directory '/sources/grub-2.12/docs'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/sources/grub-2.12/docs'
Making all in util/bash-completion.d
make[2]: Entering directory '/sources/grub-2.12/util/bash-completion.d'
../../config.status --file=grub:grub-completion.bash.in
config.status: creating grub
make[2]: Leaving directory '/sources/grub-2.12/util/bash-completion.d'
make[1]: Leaving directory '/sources/grub-2.12'

3.2.2. efibootmgr and FreeType2 Preferrably Enabled

From BLFS Chapter 5 - efibootmgr-18, some required or recommended libraries are also recommended by me to install.

From BLFS Chapter 10 - FreeType-2.13.3, those recommended libraries are also recommended by me to install.

4. GRUB and UEFI Configuration

4.1 Find UUID of File lfs.img

1
2
3
4
➜  lfs sudo blkid ./lfs.img

[sudo] password for lvision:
./lfs.img: UUID="174bc795-5e06-4c0b-979f-7eccfca1ab10" BLOCK_SIZE="4096" TYPE="ext4"

4.2 Configure /etc/fstab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(lfs chroot) root:/boot# cat /etc/fstab
# Begin /etc/fstab

# file system mount-point type options dump fsck
# order

UUID=174bc795-5e06-4c0b-979f-7eccfca1ab10 / ext4 defaults 1 1
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
tmpfs /dev/shm tmpfs nosuid,nodev 0 0
cgroup2 /sys/fs/cgroup cgroup2 nosuid,noexec,nodev 0 0

# End /etc/fstab

4.3 Generate Configuration File /boot/grub/grub.cfg for GRUB

1
2
3
4
5
6
7
8
(lfs chroot) root:/boot# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.11.1-lfs-12.2
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

Let's take a look at the generated /boot/grub/grub.cfg:

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
(lfs chroot) root:~# cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod ext2
search --no-floppy --fs-uuid --set=root 174bc795-5e06-4c0b-979f-7eccfca1ab10
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-174bc795-5e06-4c0b-979f-7eccfca1ab10' {
load_video
insmod gzio
insmod ext2
search --no-floppy --fs-uuid --set=root 174bc795-5e06-4c0b-979f-7eccfca1ab10
echo 'Loading Linux 6.11.1-lfs-12.2 ...'
linux /boot/vmlinuz-6.11.1-lfs-12.2 root=/dev/loop14 ro
}
submenu 'Advanced options for GNU/Linux' $menuentry_id_option 'gnulinux-advanced-174bc795-5e06-4c0b-979f-7eccfca1ab10' {
menuentry 'GNU/Linux, with Linux 6.11.1-lfs-12.2' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.11.1-lfs-12.2-advanced-174bc795-5e06-4c0b-979f-7eccfca1ab10' {
load_video
insmod gzio
insmod ext2
search --no-floppy --fs-uuid --set=root 174bc795-5e06-4c0b-979f-7eccfca1ab10
echo 'Loading Linux 6.11.1-lfs-12.2 ...'
linux /boot/vmlinuz-6.11.1-lfs-12.2 root=/dev/loop14 ro
}
menuentry 'GNU/Linux, with Linux 6.11.1-lfs-12.2 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.11.1-lfs-12.2-recovery-174bc795-5e06-4c0b-979f-7eccfca1ab10' {
load_video
insmod gzio
insmod ext2
search --no-floppy --fs-uuid --set=root 174bc795-5e06-4c0b-979f-7eccfca1ab10
echo 'Loading Linux 6.11.1-lfs-12.2 ...'
linux /boot/vmlinuz-6.11.1-lfs-12.2 root=/dev/loop14 ro single
}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
fwsetup --is-supported
if [ "$?" = 0 ]; then
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
(lfs chroot) root:~#

4.4 Generate UEFI

1
2
3
4
5
6
7
8
9
10
11
12
13
14
(lfs chroot) root:~# # Create a FAT filesystem image
dd if=/dev/zero of=/boot/efi.img bs=1M count=10
mkfs.fat /boot/efi.img

# Create the mount point if it doesn't already exist
mkdir -p /boot/efi

# Mount the image to simulate an EFI System Partition
mount -o loop /boot/efi.img /boot/efi
10+0 records in
10+0 records out
10485760 bytes (10 MB, 10 MiB) copied, 0.0157083 s, 668 MB/s
mkfs.fat 4.2 (2021-01-31)
(lfs chroot) root:~#

and then:

1
2
3
(lfs chroot) root:/boot# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --no-nvram --removable
Installing for x86_64-efi platform.
Installation finished. No error reported.

Now, you can see the following file:

1
2
(lfs chroot) root:/# ls /boot/efi/EFI/BOOT/BOOTX64.EFI 
/boot/efi/EFI/BOOT/BOOTX64.EFI```

4.5 Clear Up

  • Exit chroot
  • unmount efi.img

5. Demonstration

5.1 QEMU

1
➜  lfs sudo qemu-system-x86_64 -drive file=./lfs.img,format=raw,if=virtio -kernel /mnt/lfs/boot/vmlinuz-6.11.1-lfs-12.2 -append "root=/dev/vda rw rootdelay=5" -m 2048

LFS QEMU Logged In

1. Download the Official Release

  • Qt 6.7.3 Archive
  • Extract under /opt/qt
    1
    2
    [14:49:18] lvision /opt/qt 
    $ tar xvf qt-everywhere-src-6.7.3.tar.xz

2. CMake Configuration with Generator Ninja

1
2
[14:47:52] lvision /opt/qt/qt-everywhere-src-6.7.3/build 
$ cmake -G "Ninja" ../

3. Build with Trivial Modifications

1
2
[14:51:43] lvision /opt/qt/qt-everywhere-src-6.7.3/build 
$ ccmake ../

The MOST important: Include /usr/include/litehtml in

4. Installation

1
2
[14:51:43] lvision /opt/qt/qt-everywhere-src-6.7.3/build 
$ ninja

and you'll get:

1
2
3
4
5
6
7
8
9
10
......
In function ‘fxcrt::RetainPtr<T> pdfium::MakeRetain(Args&& ...) [with T = CFX_ReadOnlySpanStream; Args = {span<const unsigned char>}]’,
inlined from ‘std::vector<UnsupportedFeature> CPDF_Metadata::CheckForSharedForm() const’ at ../../../../../../qtwebengine/src/3rdparty/chromium/third_party/pdfium/core/fpdfdoc/cpdf_metadata.cpp:86:75:
../../../../../../qtwebengine/src/3rdparty/chromium/third_party/pdfium/core/fxcrt/retain_ptr.h:210:23: note: returned from ‘void* operator new(std::size_t)’
210 | return RetainPtr<T>(new T(std::forward<Args>(args)...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1323/1323] STAMP QtPdf.stamp
[10785/10857] Automatic MOC for target Pdf
AutoMoc: /opt/qt/qt-everywhere-src-6.7.3/qtwebengine/src/pdf/qpdflinkmodel_p.h: note: No relevant classes found. No output generated.
[10857/10857] Linking CXX shared module qtbase/qml/QtQuick/Pdf/libpdfquickplugin.so

Good, ALL passed.

Finally, do ninja install.

1
2
3
➜  ~ qmake --version
QMake version 3.1
Using Qt version 6.7.3 in /opt/qt/6/lib

1. Commercial NAS vs. DIY NAS?

  • For me, the BIGGEST difference between Commerial NAS vs. DIY NAS is their prices 😂
  • Without considering respective capabilities, DIY is ALWAYS of more freedom. And, freedom is so so so important as well

2. OpenMediaVault on Raspberry Pi 5

2.1 Use Lite Instead Of Desktop

On Raspberry Pi's official webpage Raspbian Operating Systems, find Raspberry Pi OS Lite in category Raspberry Pi OS (64-bit). As of today, the most up-to-date release is raspios_lite_arm64-2024-07-04.

1
2
3
4
5
6
➜  RaspberryPi sudo dd if=./2024-07-04-raspios-bookworm-arm64-lite.img of=/dev/sda bs=1M status=progress conv=fsync 
2031091712 bytes (2.0 GB, 1.9 GiB) copied, 2 s, 1.0 GB/s2835349504 bytes (2.8 GB, 2.6 GiB) copied, 2.88047 s, 984 MB/s

2704+0 records in
2704+0 records out
2835349504 bytes (2.8 GB, 2.6 GiB) copied, 312.17 s, 9.1 MB/s

Don’t forget to enable SSH after installation.

2.2 Install OpenMediaVault Upon Raspberry Pi OS Lite

Now, ssh into Raspberry Pi 5:

OpenMediaVault ssh

Follow OpenMediaVault's official documentation OpenMediaVault Installation on Debian, do the following:

  • apt-get install --yes gnupg
  • wget --quiet --output-document=- https://packages.openmediavault.org/public/archive.key | sudo gpg --dearmor --yes --output "/usr/share/keyrings/openmediavault-archive-keyring.gpg"
  • nvim /etc/apt/sources.list.d/openmediavault.list and add
    1
    2
    3
    4
    5
    6
    7
    8
    9
    deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://packages.openmediavault.org/public sandworm main
    # deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://downloads.sourceforge.net/project/openmediavault/packages sandworm main
    ## Uncomment the following line to add software from the proposed repository.
    # deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://packages.openmediavault.org/public sandworm-proposed main
    # deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://downloads.sourceforge.net/project/openmediavault/packages sandworm-proposed main
    ## This software is not part of OpenMediaVault, but is offered by third-party
    ## developers as a service to OpenMediaVault users.
    # deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://packages.openmediavault.org/public sandworm partner
    # deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://downloads.sourceforge.net/project/openmediavault/packages sandworm partner

By the way, please refer to OpenMediaVault SourceForge Distributions, sandworm is the MOST RECENT distribution.

  • Exports
    1
    2
    3
    export LANG=C.UTF-8
    export DEBIAN_FRONTEND=noninteractive
    export APT_LISTCHANGES_FRONTEND=none
  • sudo apt-get --yes --auto-remove --show-upgraded --allow-downgrades --allow-change-held-packages --no-install-recommends --option DPkg::Options::="--force-confdef" --option DPkg::Options::="--force-confold" install openmediavault
  • sudo omv-confdbadm populate

Now, ALL done.

2.3 OpenMediaVault Overview

OpenMediaVault Login Page OpenMediaVault After Login
OpenMediaVault Login Page OpenMediaVault After Login
  • username: admin
  • password: openmediavault, all lower case

OpenMediaVault Dashboard

3. NAS Configuration on My Raspberry Pi 5

3.1 Abbreviation

NAS is the abbreviation of Network Attached Storage.

3.2 Geekbord X1005 with a M.2 to Sata3.0 Extended Card

3.2.1 Enable NFS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
➜  ~ sudo omv-salt deploy run nfs   
raspberrypi5b:
----------
ID: stop_nfs_server_service
Function: service.dead
Name: nfs-server
Result: True
Comment: The service nfs-server is already dead
Started: 02:13:22.114977
Duration: 28.964 ms
Changes:

Summary for raspberrypi5b
------------
Succeeded: 1
Failed: 0
------------
Total states run: 1
Total run time: 28.964 ms
➜ ~

3.2.2 Hailo AI Accelerators On Geekbord X1005

I’ll give it a go with Hailo AI Accelerators some time soon. Please refer to my new blog Raspberry Pi 5 + Hailo AI.

0%