Page 1 of 1

WSL编译下载固件提示oem.img不存在

Posted: 2023-12-15 13:06
by Luckfox Taylor
1.在使用WSL编译镜像后,下载固件时遇到了 "oem.img 文件不存在" 的问题。
Luckfox-Pico-WSL-oem.img.png
2.在检查时发现,当从我的电脑访问固件文件夹后,oem.img 文件的大小仅为1KB。
Luckfox-Pico-WSL-part.png
3.进一步使用 ls -l 命令在终端查看,发现有三个文件实际上是软链接。
Luckfox-Pico-WSL-oem-link.png
4.为了解决问题,需要删除这些软链接,并将相应的指向文件修改为软链接的名字。如果不想一个个手动修改,可以使用脚本进行批量处理。

Code: Select all

#!/bin/bash

files=("output/image/oem.img"
       "output/image/rootfs.img"
       "output/image/userdata.img")

for file in "${files[@]}"; do
    if [ -e "$file" ]; then
        filename=$(basename "$file")
        target=$(readlink -f "$file")
        rm "$file"
        mv "$target" "output/image/$filename"

        echo "文件 '$filename' 已删除并重命名为 '$filename'"
    else
        echo "文件 '$file' 不存在"
    fi
done
5.将上述代码保存到一个脚本文件(比如 part.sh),并确保脚本文件有执行权限:

Code: Select all

sudo chmod +x part.sh
6.然后执行脚本:

Code: Select all

sudo ./part.sh
Luckfox-Pico-WSL-part-1.png

Re: WSL编译下载固件提示oem.img不存在

Posted: 2024-06-07 5:47
by gkirill
Hello, Taylor!
Is it correct to use files for flashing the controller along this path:
"\\wsl.localhost\Ubuntu-24.04\home\username\rockchip\luckfox-pico\IMAGE\(LUCKFOX_VERSION_AND_TIME)_RELEASE_TEST\IMAGES" ?
Then you can do without any substitutions.