1、h3-sd-friendlycore-xenial-4.14-armhf-20210618.img.gz 在WIN10下使用7-ZIP解壓縮/ubuntu20.04下使用tar
2、Win32DiskImager.exe 寫如32GB的TF卡。【以管理員身份運行】
3、TF卡如果已經做過會有3個磁盤分區,可以使用SD Card Formatter/SDCardFormatterv5_WinEN.zip格式化TF卡。DiskGenius可以嘗試。
制作好Ubuntu core22.04.3系統的IMG固件之后,還需要你編輯TF卡中的文件:
1、修改H:\eflasher.conf
autoStart=/mnt/sdcard/friendlycore-jammy
autoExit=true
2、root@NanoPi-NEO-Core:/opt# vi run-eflasher.sh?
root@NanoPi-NEO-Core:/opt# cat run-eflasher.sh?
poweroff
如果能夠直接編輯IMG固件就好了。到時候寫TF卡之后不需要每次都來編輯這兩個文件。
20250519使用TF卡將NanoPi NEO core開發板刷機為Ubuntu core22.04.3系統完成之后執行poweroff自動關機
2025/5/19 15:38
緣起:在上電之后,TF卡將NanoPi NEO core開發板刷機之后自動關機,安全/保險一點。
【不會丟數據^_】
【你放心吧】生產線的工人只會問你插入TF卡之后上電幾分鐘刷機完成。【2分鐘搞定】
不要想他們會去看DEBUG串口打印信息。
【切記,不需要在H:\eflasher.conf的autoStart項目之后手工輸入autoExit項目。conf配置文件有/自帶的。^_】
1、使用Win32DiskImager.exe寫TF卡之后,將TF卡插入讀卡器之后插入到WIN10/WIN11的電腦。
【理論上在ubuntu20.04.6下使用gedit修改也OK的。】
修改H:\eflasher.conf。【具體盤符H以您的電腦為準。^_不通的電腦肯定會變化的!】
C:\TF1emmc-jammy22.04\FriendlyARM\eflasher.conf
; This is the eFlasher configuration file.
; See http://wiki.friendlyarm.com/wiki/index.php/EFlasher for detailed information.
[General]
; Automate OS installation at system startup,
; Use the "autoStart" field to specify the image path or RAW image file,
; The RAW image file can be a gzip compressed file,
; The RAW image file extension must be ".raw" or ".gz",
; Available values: friendlycore-jammy
autoStart=friendlycore-jammy
; If the "autoExit" field set to true, the eflasher-gui will automatically exit after burning or restoring is completed,?
; You can do something else after burning or restoring by modifying /opt/run-eflasher.sh.
autoExit=false
; Don't erase the flash before burning, useful if you only want to update part of the system files
disableLowFormatting=false
[UI]
; HDMI overscan option, examples:
;?? ? screenSizePercent=auto
;?? ? screenSizePercent=90
screenSizePercent=auto
welcomeMessage=
hideMenuButton=false
hideBackupAndRestoreButton=false
hideStatusBar=false
autoRebootWhenSDBeEjected=true
修改成為:
H:\eflasher.conf
; This is the eFlasher configuration file.
; See http://wiki.friendlyarm.com/wiki/index.php/EFlasher for detailed information.
[General]
; Automate OS installation at system startup,
; Use the "autoStart" field to specify the image path or RAW image file,
; The RAW image file can be a gzip compressed file,
; The RAW image file extension must be ".raw" or ".gz",
; Available values: friendlycore-jammy
autoStart=/mnt/sdcard/friendlycore-jammy
; If the "autoExit" field set to true, the eflasher-gui will automatically exit after burning or restoring is completed,?
; You can do something else after burning or restoring by modifying /opt/run-eflasher.sh.
autoExit=true
; Don't erase the flash before burning, useful if you only want to update part of the system files
disableLowFormatting=false
[UI]
; HDMI overscan option, examples:
;?? ? screenSizePercent=auto
;?? ? screenSizePercent=90
screenSizePercent=auto
welcomeMessage=
hideMenuButton=false
hideBackupAndRestoreButton=false
hideStatusBar=false
autoRebootWhenSDBeEjected=true
2、將TF卡插入到NanoPi NEO core開發板,使用vi編輯run-eflasher.sh:【加入poweroff關機】
詳細LOG:
root@NanoPi-NEO-Core:/# ll
total 72
drwxr-xr-x ?19 root root ?4096 Mar 20 14:32 ./
drwxr-xr-x ?19 root root ?4096 Mar 20 14:32 ../
drwxr-xr-x ? 2 root root ?4096 Mar 20 14:32 Settings/
lrwxrwxrwx ? 1 root root ? ? 7 Aug 22 ?2023 bin -> usr/bin/
drwxr-xr-x ? 2 root root ?4096 Apr 18 ?2022 boot/
drwxr-xr-x ?14 root root ?3860 Mar 20 14:32 dev/
drwxr-xr-x ?65 root root ?4096 Mar 20 14:32 etc/
drwxr-xr-x ? 3 root root ?4096 Aug 22 ?2023 home/
lrwxrwxrwx ? 1 root root ? ? 7 Aug 22 ?2023 lib -> usr/lib/
drwx------ ? 2 root root 16384 Apr ?2 ?2025 lost+found/
drwxr-xr-x ? 2 root root ?4096 Aug 22 ?2023 media/
drwxr-xr-x ? 4 root root ?4096 Mar 21 ?2025 mnt/
drwxr-xr-x ? 2 root root ?4096 Nov 28 ?2024 opt/
dr-xr-xr-x 116 root root ? ? 0 Jan ?1 ?1970 proc/
drwx------ ? 2 root root ?4096 Mar 20 ?2023 root/
drwxr-xr-x ?19 root root ? 520 Mar 20 14:32 run/
lrwxrwxrwx ? 1 root root ? ? 8 Aug 22 ?2023 sbin -> usr/sbin/
drwxr-xr-x ? 2 root root ?4096 Aug 22 ?2023 srv/
dr-xr-xr-x ?12 root root ? ? 0 Feb 11 ?2016 sys/
drwxrwxrwt ?11 root root ?4096 Mar 20 14:32 tmp/
drwxr-xr-x ?11 root root ?4096 Jul 16 ?2024 usr/
drwxr-xr-x ?11 root root ?4096 Aug 22 ?2023 var/
root@NanoPi-NEO-Core:/# cd opt/
root@NanoPi-NEO-Core:/opt# ll
total 3248
drwxr-xr-x ?2 root root ? ?4096 Nov 28 ?2024 ./
drwxr-xr-x 19 root root ? ?4096 Mar 20 14:32 ../
-rwxr-xr-x ?1 root root 3309892 Mar 19 ?2025 eflasher-gui*
-rwxr-xr-x ?1 root root ? ? ?80 Aug 25 ?2022 run-eflasher.sh*
root@NanoPi-NEO-Core:/opt#?
root@NanoPi-NEO-Core:/opt#?
root@NanoPi-NEO-Core:/opt# cp run-eflasher.sh /etc/
root@NanoPi-NEO-Core:/opt# ll
total 3248
drwxr-xr-x ?2 root root ? ?4096 Nov 28 ?2024 ./
drwxr-xr-x 19 root root ? ?4096 Mar 20 14:32 ../
-rwxr-xr-x ?1 root root 3309892 Mar 19 ?2025 eflasher-gui*
-rwxr-xr-x ?1 root root ? ? ?80 Aug 25 ?2022 run-eflasher.sh*
root@NanoPi-NEO-Core:/opt#?
root@NanoPi-NEO-Core:/opt#?
root@NanoPi-NEO-Core:/opt# vi run-eflasher.sh?
root@NanoPi-NEO-Core:/opt#?
root@NanoPi-NEO-Core:/opt#?
root@NanoPi-NEO-Core:/opt# vi run-eflasher.sh?
root@NanoPi-NEO-Core:/opt# ll
total 3248
drwxr-xr-x ?2 root root ? ?4096 Nov 28 ?2024 ./
drwxr-xr-x 19 root root ? ?4096 Mar 20 14:32 ../
-rwxr-xr-x ?1 root root 3309892 Mar 19 ?2025 eflasher-gui*
-rwxr-xr-x ?1 root root ? ? ?91 Mar 20 14:34 run-eflasher.sh*
root@NanoPi-NEO-Core:/opt# cat run-eflasher.sh?
#!/bin/bash
. /usr/bin/setqt4env
cd /opt/
./eflasher-gui -qws >/dev/null 2>&1
poweroff
root@NanoPi-NEO-Core:/opt# sync
root@NanoPi-NEO-Core:/opt# sync
root@NanoPi-NEO-Core:/opt# poweroff
3、上電刷機的LOG:
【在黃燈快閃的時候,通過top可以看見:eflasher-+ 在工作ING中!】
[ ?OK ?] Finished Permit User Sessions.
[ ?OK ?] Started Serial Getty on ttyS0.
? ? ? ? ?Starting Set console scheme...
[ ?OK ?] Finished Set console scheme.
[ ?OK ?] Created slice Slice /system/getty.
[ ?OK ?] Finished Load/Save Random Seed.
[ ?OK ?] Started OpenBSD Secure Shell server.
Ubuntu 22.04 LTS NanoPi-NEO-Core ttyS0
Default Login:
Username = pi
Password = pi
NanoPi-NEO-Core login: root
Password:?
Last login: Mon Mar 20 14:32:28 UTC 2023 on ttyS0
root@NanoPi-NEO-Core:~# top
top - 14:32:38 up 0 min, ?1 user, ?load average: 1.06, 0.27, 0.09
Tasks: 102 total, ? 2 running, 100 sleeping, ? 0 stopped, ? 0 zombie
%Cpu(s): ?2.7 us, 13.6 sy, ?0.0 ni, 53.6 id, 30.0 wa, ?0.0 hi, ?0.0 si, ?0.0 st
MiB Mem : ? ?491.8 total, ? ? 32.8 free, ? ? 74.6 used, ? ?384.4 buff/cache
MiB Swap: ? ? ?0.0 total, ? ? ?0.0 free, ? ? ?0.0 used. ? ?401.8 avail Mem?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0.0 ? 0:00.00 cpuhp/0 ? ?
? ?12 root ? ? ?20 ? 0 ? ? ? 0 ? ? ?0 ? ? ?0 S ? 0.0 ? 0.0 ? 0:00.00 cpuhp/1 ? ?
? ?13 root ? ? ?rt ? 0 ? ? ? 0 ? ? ?0 ? ? ?0 S ? 0.0 ? 0.0 ? 0:00.00 migration+?
? ?14 root ? ? ?20 ? 0 ? ? ? 0 ? ? ?0 ? ? ?0 S ? 0.0 ? 0.0 ? 0:00.01 ksoftirqd+?
top - 14:32:41 up 0 min, ?1 user, ?load average: 1.06, 0.27, 0.09
Tasks: 101 total, ? 2 running, ?99 sleeping, ? 0 stopped, ? 0 zombie
%Cpu(s): ?0.9 us, 13.0 sy, ?0.0 ni, 80.1 id, ?6.0 wa, ?0.0 hi, ?0.0 si, ?0.0 st
MiB Mem : ? ?491.8 total, ? ? 26.3 free, ? ? 74.6 used, ? ?390.9 buff/cache
MiB Swap: ? ? ?0.0 total, ? ? ?0.0 free, ? ? ?0.0 used. ? ?401.5 avail Mem?
4、完美謝幕/曲終人散,上電大概2分鐘之后,你就可以看到TF卡旁邊的紅燈/黃燈都滅了!
【刷機完成了。拔卡,下一個!NEXT ^_】
如果你接入了串口,就可以在串口打印中看到NanoPi NEO core開發板執行關機步驟的LOG了。