20250516使用TF卡將NanoPi NEO core開發板出廠的Ubuntu core22.04.3系統降級到Ubuntu core16.04.2
2025/5/16 10:58
緣起:NanoPi NEO core核心板出廠預制的OS操作系統為Ubuntu core22.04.3系統。
【雖然是友善之臂提供的最新的系統,但是缺少很多用用程序。新的程序可能并不一定那么穩定!】
由于Ubuntu core16.04.2久經考驗,我們也在Ubuntu core16.04.2上做了很多開發了。
根據領導要求,降級了。
以前/生產線要求,插入TF卡,給一個時間點,多長時間斷電拔卡。
為了滿足它們的要求。現在開始琢磨升級卡了。
1、你們這個呼吸燈【快閃2次,然后等一秒^_】、 快閃【一秒2/3/5次】 慢閃【一秒一次?2秒一次】。沒有量化指標。
2、大概知道了。你們 在后臺自動升級的時候 ,前臺的串口還是要輸入 賬號 密碼的。
3、如果是 配置成為上電 自動刷機。我希望的是 刷機成功之后2-5秒鐘?執行 poweroff操作。這樣安全的關電 拔卡[表情]
https://wiki.friendlyelec.com/wiki/index.php/EFlasher/zh#.E5.BC.80.E6.9C.BA.E8.87.AA.E5.8A.A8.E7.83.A7.E5.86.99.E6.8C.87.E5.AE.9A.E7.9A.84.E7.B3.BB.E7.BB.9F
EFlasher/zh
7 開機自動燒寫指定的系統
7.1 默認已開啟自動燒寫
所有文件名為XXXX-eflasher-OS-YYYYMMDD.img.gz的單個OS的固件,默認情況下均開啟了自動燒寫,如果你不希望開機自動燒寫,請使用文件名為 XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz 的固件。
7.2 配置方法
有三種途徑可以進行配置:
方法1:在圖形界面上,選擇你要燒寫的系統,在Ready to Go預覽界面上,在屏幕下方鉤選 "Start automatically at startup" 。
方法2: 將SD卡掛載到Windows電腦上,用notepad+文本編輯器在SD卡的Fat分區上新建一個名為eflasher.conf文件 (如果已存在就直接編輯即可),其內容如下:
[General]
autoStart=/mnt/sdcard/XXXXXX
其中,XXXXXX替換成SD卡中存放固件的目錄名,例如H3平臺的FriendlyCore系統目錄名為 friendlycore-xenial_4.14_armhf。
方法3: 開發板運行狀態下,通過串口終端,用vi編輯文件:/mnt/sdcard/eflasher.conf,文件不存在就新增一個,內容同上面的方法2。
7.3 自動燒寫的進度指示
上電開機時,板上的狀態燈先是呈呼吸燈狀態,開機燒寫固件時狀態燈會快閃,燒寫完成后變成慢閃,并一直停留在慢閃狀態。
狀態燈通常為藍燈,某些平臺板子可能會是其他顏色。
也可以利用 LCD2USB 模塊,或者LCD和HDMI屏幕,得到可視化的進度指示。
8 燒寫或恢復系統完成后做些其他事情
在量產時,你可能會希望在燒寫系統完成后做一些額外的事情,比如點亮某個LED,你可以修改 /opt/run-eflasher.sh 腳本,在 "./eflasher-gui" 開頭這一行的后面加入代碼,例如下面的示例,在燒寫完成后,設置某個GPIO針腳:
./eflasher-gui -qws >/dev/null 2>&1
echo 13 > /sys/class/gpio/export?
echo out > /sys/class/gpio/gpio13/direction?
echo 0 > /sys/class/gpio/gpio13/value
echo 13 > /sys/class/gpio/unexport
以下腳本則演示在S5P4418/S5P6818平臺上, 燒寫系統后, 將cpu id寫入到eMMC系統的 /etc/cpuid.txt 文件中:
./eflasher-gui -qws >/dev/null 2>&1
partprobe /dev/mmcblk1
mount /dev/mmcblk1p2 /media/
cat /sys/devices/platform/cpu/uuid > /media/etc/cpuid.txt
umount /media/
要讓上面的腳本正常運作,我們還需要設置讓 eflasher-gui 在燒寫完成后自動退出,需要做以下設置:
用notepad+文本編輯器在SD卡的Fat分區上編輯并新建一個名為eflasher.conf文件,將AutoExit字段設置為True:
[General]
autoStart=/mnt/sdcard/friendlycore-xenial
autoExit=true
autoStart字段則是指定開機自動燒寫指定的系統而無需交互, 如果沒有連接屏幕, 可以通過 LED 燒來識別燒寫狀態, 默認情況下, 綠色LED快閃表示正在燒寫.
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
autoStart=friendlycore
; 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
修改:
; 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
autoStart=/mnt/sdcard/friendlycore
; 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
如果要升級到出廠的Ubuntu core22.04.3系統
H:\eflasher.conf
autoStart=friendlycore-jammy
修改為:
autoStart=/mnt/sdcard/friendlycore-jammy
打印LOG:
[ ?OK ?] Reached target Network.
? ? ? ? ?Starting /etc/rc.local...
? ? ? ? ?Starting OpenBSD Secure Shell server...
? ? ? ? ?Starting Permit User Sessions...
[ ?OK ?] Started /etc/rc.local.
[ ?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:?
root@NanoPi-NEO-Core:~#?
root@NanoPi-NEO-Core:~# whoami
root
root@NanoPi-NEO-Core:~#?
root@NanoPi-NEO-Core:~# pwd
/root
root@NanoPi-NEO-Core:~# cd /
root@NanoPi-NEO-Core:/#?
root@NanoPi-NEO-Core:/# cd /mnt/sdcard/
root@NanoPi-NEO-Core:/mnt/sdcard# ls -l
total 96
drwxr-xr-x 2 root root 32768 May 16 ?2025 'System Volume Information'
-rwxr-xr-x 1 root root ?1023 May 16 ?2025 ?eflasher.conf
drwxr-xr-x 2 root root 32768 Apr ?2 ?2025 ?friendlycore
root@NanoPi-NEO-Core:/mnt/sdcard# cd friendlycore/
root@NanoPi-NEO-Core:/mnt/sdcard/friendlycore#?
root@NanoPi-NEO-Core:/mnt/sdcard/friendlycore# ls -l
total 1063424
-rwxr-xr-x 1 root root ? 41943040 Nov ?5 ?2024 boot.img
-rwxr-xr-x 1 root root ? ? ? ? 53 Apr ?2 ?2025 info.conf
-rwxr-xr-x 1 root root ? ? ? ?416 Apr ?2 ?2025 partmap.txt
-rwxr-xr-x 1 root root 1044652408 Apr ?2 ?2025 rootfs.img
-rwxr-xr-x 1 root root ? ?2088960 Nov ?9 ?2023 u-boot-sunxi-with-spl.bin
-rwxr-xr-x 1 root root ? ? 159868 Apr ?2 ?2025 userdata.img
root@NanoPi-NEO-Core:/mnt/sdcard/friendlycore#?
root@NanoPi-NEO-Core:/mnt/sdcard/friendlycore# cd /
root@NanoPi-NEO-Core:/#?
root@NanoPi-NEO-Core:/# uname -a
Linux NanoPi-NEO-Core 4.14.111 #193 SMP Thu Jun 10 18:20:47 CST 2021 armv7l armv7l armv7l GNU/Linux
root@NanoPi-NEO-Core:/#?
root@NanoPi-NEO-Core:/# cat /etc/issue
Ubuntu 22.04 LTS \n \l
Default Login:
Username = pi
Password = pi
root@NanoPi-NEO-Core:/#?
root@NanoPi-NEO-Core:/#?