V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  wniming  ›  全部回复第 1 页 / 共 3 页
回复总数  54
1  2  3  
@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 ,还不知道要怎么搞
@424778940 感谢回复,我的系统上没有 /usr/lib/aarch64-linux-gnu/pkgconfig 这个路径,这个路径是哪个包里的?
@BrettD 感谢回复,我试一下
@pagxir 感谢回复,update 一下 binfmt 要怎么操作?

我开发不可能用手机的,编译效率太低了,不可能每次改了代码都交叉编译的。
@424778940

[email protected]:~/build$ sudo apt -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu cpp-aarch64-linux-gnu binutils-aarch64-linux-gnu
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
cpp-aarch64-linux-gnu is already the newest version (4:11.2.0-1ubuntu1).
g++-aarch64-linux-gnu is already the newest version (4:11.2.0-1ubuntu1).
gcc-aarch64-linux-gnu is already the newest version (4:11.2.0-1ubuntu1).
binutils-aarch64-linux-gnu is already the newest version (2.38-4ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
[email protected]:~/build$
[email protected]:~/build$
[email protected]:~/build$ ~/qemu-7.2.0/configure --target-list=aarch64-softmmu --cross-prefix=aarch64-linux-gnu- --prefix=/home/d/.local

ERROR: pkg-config binary 'aarch64-linux-gnu-pkg-config' not found

[email protected]:~/build$

我刚才是已经试过了才回帖的
@mepwang @424778940
两位说的包我早就安装了,不行的
@tagorewu 感谢回复,刚刚 apt install crossbuild-essential-arm64 安装了还是一样的问题
@lechain 他提示什么我当然能看懂,但不知道怎么解决
@hwdef 有这么简单我就不会发帖问了

[email protected]:/home/d# apt update
Hit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Fetched 336 kB in 4s (80.6 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
10 packages can be upgraded. Run 'apt list --upgradable' to see them.
[email protected]:/home/d# apt-get install -y pkg-config-aarch64-linux-gnu
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package pkg-config-aarch64-linux-gnu
[email protected]:/home/d#
@yanqiyu 昨天搞了好久没解决,今天不知道改了那里问题没了
应该是我之前哪里设置错了,现在问题解决了
1  2  3  
关于   ·   帮助文档   ·   博客   ·   nftychat   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   实用小工具   ·   945 人在线   最高记录 5556   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 21:15 · PVG 05:15 · LAX 14:15 · JFK 17:15
Developed with CodeLauncher
♥ Do have faith in what you're doing.