您尚未登录。

楼主 # 2023-10-10 09:38:57

onion
会员
注册时间: 2019-10-12
已发帖子: 3
积分: 4

WSL编译buildroot问题,软连接不能被硬链接

报错如下:

rsync -a --link-dest=/mnt/d/work/arm/output/per-package/host-skeleton/host/ /mnt/d/work/arm/buildroot/output/per-package/host-skeleton/host/ /mnt/d/work/arm/buildroot/output/per-package/host-ccache/host
rsync: failed to hard-link /mnt/d/work/arm/buildroot/output/per-package/host-skeleton/host/lib64 with lib64: Is a directory (21)
rsync: failed to hard-link /mnt/d/work/arm/buildroot/output/per-package/host-skeleton/host/usr with usr: Is a directory (21)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1205) [sender=3.1.3]

查看目标目录, lib64软链接已经被硬链接了,usr软链接是被复制过去的

ls -lia /mnt/d/work/arm/buildroot/output/per-package/host-ccache/host
total 0
 844424931203368 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 .
1125899907914014 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 ..
 844424931203523 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 arm-buildroot-linux-musleabi
 844424931203581 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 bin
 844424931203527 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 include
 844424931203528 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 lib
 844424931203525 lrwxrwxrwx 207 kun kun    3 Oct  9 09:19 lib64 -> lib
 844424931203583 drwxrwxrwx   1 kun kun 4096 Oct  9 09:19 share
 844424931203526 lrwxrwxrwx   1 kun kun    1 Oct  9 09:19 usr -> .

修改package/pkg-utils.mk文件

rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/$(2)/ \

改为

-rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/$(2)/ \

临时忽略掉该命令错误

补充:用的是WSL1感觉读写IO会更快,但要关掉Microsoft Defender的实时保护

最近编辑记录 onion (2023-10-10 09:47:02)

离线

#1 2023-10-10 09:41:15

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,386
积分: 1902
个人网站

Re: WSL编译buildroot问题,软连接不能被硬链接

出个歪主意,建议用过虚拟机





离线

楼主 #2 2023-10-10 10:00:23

onion
会员
注册时间: 2019-10-12
已发帖子: 3
积分: 4

Re: WSL编译buildroot问题,软连接不能被硬链接

查看文件系统

rootfs on / type wslfs (rw,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
C:\ on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
D:\ on /mnt/d type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
E:\ on /mnt/e type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
F:\ on /mnt/f type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
G:\ on /mnt/g type drvfs (rw,noatime,uid=1000,gid=1000,case=off)

在根目录下(wslfs系统)可以被正常创建硬链接,在drvfs下才有这个问题,d盘是ntfs的

rsync -a --link-dest=/home/user/a/ a/ b/
$ ls a -lai
total 0
45880421203913456 drwxr-xr-x 1 kun kun 4096 Oct  5 18:52 .
 3377699720632823 drwxr-xr-x 1 kun kun 4096 Oct 10 08:10 ..
21110623253398590 -rwxr-xr-x 2 kun kun    8 Oct  5 18:52 1.txt
17451448556211638 drwxr-xr-x 1 kun kun 4096 Oct  5 18:52 lib
 5066549580914859 lrwxrwxrwx 2 kun kun    3 Oct  5 18:52 lib64 -> lib
22799473113681371 lrwxrwxrwx 2 kun kun    1 Oct  5 18:52 usr -> .
$ ls b -lai
total 0
16044073672661868 drwxr-xr-x 1 kun kun 4096 Oct  5 18:52 .
 3377699720632823 drwxr-xr-x 1 kun kun 4096 Oct 10 08:10 ..
21110623253398590 -rwxr-xr-x 2 kun kun    8 Oct  5 18:52 1.txt
 4222124650816684 drwxr-xr-x 1 kun kun 4096 Oct  5 18:52 lib
 5066549580914859 lrwxrwxrwx 2 kun kun    3 Oct  5 18:52 lib64 -> lib
22799473113681371 lrwxrwxrwx 2 kun kun    1 Oct  5 18:52 usr -> .

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn