PetaLinux_User_udev
1.版本说明
2.概述
- PetaLinux2023.2/2024.1
- 修复PetaLinux U盘挂载/下载的BUG;
3.默认脚本
- MPSOC Linux启动
- 重点查看脚本 /etc/udev/scripts/mount.sh
- 该默认脚本存在BUG(和版本有关)
4.用户脚本
- 增加路径 ./project_dir/project-spec/meta-user/recipes-core/udev-extraconf/
- 增加文件 ./project_dir/project-spec/meta-user/recipes-core/udev-extraconf/files/mount.sh
- 增加文件 ./project_dir/project-spec/meta-user/recipes-core/udev-extraconf/udev-extraconf_%.bbappend
# ./project_dir/project-spec/meta-user/recipes-core/udev-extraconf/files/mount.sh
#
# 建议:原始脚本在MPSOC LINUX运行以后,实际板子上会有, 先拷贝出来备份,
# 然后修改下面指定部分,或者自己调试BUG发生的位置,然后修改,
# 目前该BUG,只出现在自动卸载上,其他部分没遇到BUG;
#
# 修改部分重点:
if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; thenname="`basename "$DEVNAME"`"tmpfile=`find /tmp/ | grep "\.automount-${name}[1-9]"`if [ ! -e "/sys/$DEVPATH" -a -e "$tmpfile" ]; thenlogger "mount.sh/remove" "cleaning up $DEVNAME, was mounted by the auto-mounter"for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `do$UMOUNT $mntdone# Remove mount directory created by the auto-mounter# and clean up our tmp cache filemntdir=`cat "$tmpfile"`rm_dir "$MOUNT_BASE/$mntdir"rm "$tmpfile"fi
fi
# ./project_dir/project-spec/meta-user/recipes-core/udev-extraconf/udev-extraconf_%.bbappendFILESEXTRAPATHS:prepend := "${THISDIR}/files:"SRC_URI:append = " file://mount.sh"do_install:append() {install -d ${D}${sysconfdir}/udev/scriptsinstall -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
}
- 目录结构
