wniming 最近的时间轴更新
wniming

wniming

V2EX 第 597700 号会员,加入于 2022-10-17 12:44:33 +08:00
今日活跃度排名 9951
如何在 x86 架构上交叉编译 arm64 架构的 qemu?
Linux  •  wniming  •  6 天前  •  最后回复来自 424778940
25
Linux 内核在 arm 架构下启动是不是必须要 initramfs?
Linux  •  wniming  •  7 天前  •  最后回复来自 cy18
7
那个品牌的 cpu 供电线兼容海韵电源线序?
硬件  •  wniming  •  11 天前  •  最后回复来自 wniming
5
wniming 最近回复了
@yanqiyu 刚才试了把 /usr/bin/systemctl 重命名,没有这个完全不影响登录的,真是搞不明白 systemd 这一套的设计。
@yanqiyu systemctl 怎么会在登录过程中被调用呢?是谁调用了这个程序?为什么普通用户登录就不会调用这个?
@yanqiyu 我感觉 cp 这个命令直接去写软链接链接的那个文件根本就不合理,rsync 和 mv 就是只修改软链接本身。
@yanqiyu 大佬你是怎么这么快就定位问题的?我之前只知道把 /sbin/reboot 重命名以防止被使用,怎么都没想到 /usr/bin/systemctl 早就被修改了
@yanqiyu 感谢回复,我通过 rpm -V systemd 检查了一下,/usr/bin/systemctl 确实是被修改了,是我不小心修改的。

我之前写了一个 reboot 命令替换了 /sbin/reboot ,我当时是直接 cp reboot /sbin/reboot 这么操作的,因为 /sbin/reboot 是 /usr/bin/systemctl 的软连接,这才导致 /usr/bin/systemctl 被替换了,真是不好意思,自己坑了自己又浪费了 V 友们的时间。。
@barathrum @yanzhiling2001

我把镜像上传到 google driver 了,2 位可以下载下来试一下:
https://drive.google.com/file/d/1xTmHuTG9hBGppaf7PqLB-u61cwKFapoO/view?usp=sharing

还有 initramfs:
https://drive.google.com/file/d/12c3m1l8b-UE6tpwvgjH6_JMkd1VvODN6/view?usp=sharing

/usr/bin/qemu-system-x86_64 -enable-kvm -name fedora -smp 2 -m 2G -drive file=/a/disk/fedora-server.raw,if=virtio,format=raw -nic none -kernel /boot/vmlinuz-6.0.7-301.fc37.x86_64 -initrd ~/initramfs-6.0.7-301.fc37.x86_64.img -append "root=/dev/vda2 rw console=ttyS0" -nographic
刚刚在 intel 平台下测试了一下,有同样的问题,而且也不仅限于 ssh ,qemu 的串口 root 登录也是会重启。
楼主从 fedora 28 用到现在,从来没遇到过这么奇怪的问题。
@424778940 我发现 fedora 的交叉编译只能编译内核,bootloader 等裸程序,连 hello world 都不支持:

https://discussion.fedoraproject.org/t/cross-compiling-to-arm/71516/6
@424778940 感谢大佬指点,搞定了,而且不需要自己写 pkg-config 的 wrapper

不过我主要是想在 fedora 系统上交叉编译 qemu ,还不知道要怎么搞
关于   ·   帮助文档   ·   博客   ·   nftychat   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   实用小工具   ·   3396 人在线   最高记录 5556   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms · UTC 05:07 · PVG 13:07 · LAX 22:07 · JFK 01:07
Developed with CodeLauncher
♥ Do have faith in what you're doing.