求助: Rclone 挂载 onedrive 后在 1drive 中 git 问题

2020-03-29 12:33:18 +08:00
 xuerui911
编程小白求助, 求大佬们指导

我想编译定制 openwrt 固件, 需要 git clone -b dev-19.07 https://github.com/Lienol/openwrt && cd openwrt && ./scripts/feeds clean && ./scripts/feeds update -a && ./scripts/feeds install -a && make menuconfig.
自己选择需要的配置后, make -j1 V=s

上面那个 github 项目写着不要用 root 用户 git 和编译, 在本地电脑虚拟机, 用普通用户执行命令会报错无法 git clone 提示没权限创建文件夹, 用 root 用户可以完成 make menuconfig, 在 make V=s 这步会报错提示你不应该用 root 用户, 最终用普通用户 sudo su 执行完 make menuconfig 再 exit 回到普通用户执行 make V=s 能成功编译.

北京联通, 访问 github 奇慢无比, 通过梯子可以成功, 但编译也太占本地硬盘空间.

我买了 onedrive for business.
有个墙外 vps, 多数端口被墙, 但给留了 22 和 80 端口, 所以考虑 ssh 此 vps 挂载 onedrive 后 git clone 到 1drive 中并编译, 编译完后再把固件下载回来.

在 Windows 下用的是 RaiDrive, 上网一番查, Linux 下大家用的比较多的是 RClone.

本地电脑虚拟机和 VPS 系统都是 Ubuntu.

rclone config, 我的配置中, 我给挂载盘在 rclone 中起名为 my1drive, VPS 中目录为 /VPSMount/hk1, 本地挂载目录为 /home/mnt1drive/1drive

执行 rclone mount my1drive:VPSMount/hk1 /home/mnt1drive/1drive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode minimal

这时程序运行, 没有返回结果. 先不注册为服务, 先能进入 make menuconfig 目录再说, 新建 ssh 会话, sudo su, git clone -b dev-19.07 https://github.com/Lienol/openwrt && cd openwrt && ./scripts/feeds clean && ./scripts/feeds update -a && ./scripts/feeds install -a && make menuconfig
这时会提示
Cloning into 'openwrt'...
remote: Enumerating objects: 518949, done.
remote: Total 518949 (delta 0), reused 0 (delta 0), pack-reused 518949
Receiving objects: 100% (518949/518949), 378.20 MiB | 9.18 MiB/s, done.
Resolving deltas: 100% (349100/349100), done.
error: unable to append to '/home/mnt1drive/1drive/openwrt/.git/logs/refs/remotes/origin/HEAD': Input/output error
fatal: update_ref failed for ref 'HEAD': cannot update the ref 'HEAD': unable to append to '/home/mnt1drive/1drive/openwrt/.git/logs/HEAD': Input/output error

此时之前执行 rclone 挂载命令那个 ssh session 中, 会提示
2020/03/29 11:43:49 ERROR : openwrt/.git/tsjG3i7(0xc0004c4f40): failed to find cache file: object not found
2020/03/29 11:43:49 ERROR : openwrt/.git/tsjG3i7(0xc0004c4f40): RWFileHandle.Release error: failed to find cache file: object not found

求大佬们指导
862 次点击
所在节点    Linux
25 条回复
learningman
2020-03-29 22:37:27 +08:00
@xuerui911 编译和硬盘读写关系不大,只要不是上世纪的 IDE,基本都能编译出来,只是时间问题
jim9606
2020-03-30 00:20:06 +08:00
@xuerui911 关于频繁 sudo 的问题,虽然 sudo 要求密码但输过一次在几分钟内反复 sudo 是不用输密码的,实在烦的可以 visudo 修改配置允许无密码 sudo,但不要养成用 root 做日常工作的坏习惯,编译 openwrt 这个过程中除了安装软件包外,包括克隆仓库等操作都应该用非 root 用户。如果你用虚拟机安装时无论是 desktop 还是 server 都会在安装向导指引创建一个有 sudo 权限的用户的。
编译速度的话只要是 SSD 问题都不大,make -j4 这样允许 4 线程编译,线程数建议等于 cpu 核心数,如果出错再用 make -j1,可以节省一点时间(排除卡网络的问题)
如果想跳过下载源码可以这样,在 VPS 配置好后运行 make download -j4 下载源码,然后把 dl 目录单独拉回本地
xuerui911
2020-03-30 10:32:16 +08:00
@jim9606 受教了
ipixeloldc
2020-03-30 13:33:35 +08:00
那么多 CI,有免费套餐....你直接用他们不就行了,编译个 openwrt 够用
xuerui911
2020-03-30 18:30:20 +08:00
@ipixeloldc 求明示 CI 全称是啥...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/657246

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX