ISRC-CAS / tarsier-oerv

Project magament for porting openEuler to RISC-V
Apache License 2.0
33 stars 51 forks source link

[avocado-vt] oE rv qemu中grubby修改kernel启动参数失败 #447

Closed lvxiaoqian555 closed 2 years ago

lvxiaoqian555 commented 2 years ago

在 openEuler riscv64 qemu 中使用 grubby 明白修改 kernel 启动参数无效

复现步骤:

[root@openEuler-riscv64 ~]# grubby --extlinux --default-kernel
/boot/Image
[root@openEuler-riscv64 ~]# cat /proc/cmdline
root=/dev/vda1 rw
[root@openEuler-riscv64 ~]# grubby --extlinux --info DEFAULT
index=0
kernel=/boot/Image
args="console=ttyS0,115200"
title=openEuler-riscv
[root@openEuler-riscv64 ~]# grubby --extlinux --update-kernel=`grubby --extlinux --default-kernel` --args ipv6.disable=1
[root@openEuler-riscv64 ~]# cat /proc/cmdline
root=/dev/vda1 rw
[root@openEuler-riscv64 ~]# grubby --extlinux --info DEFAULT
index=0
kernel=/boot/Image
args="console=ttyS0,115200 ipv6.disable=1"
title=openEuler-riscv
[root@openEuler-riscv64 ~]# reboot
******
[root@openEuler-riscv64 ~]# cat /proc/cmdline
root=/dev/vda1 rw
[root@openEuler-riscv64 ~]# grubby --extlinux --info DEFAULT
index=0
kernel=/boot/Image
args="console=ttyS0,115200 ipv6.disable=1"
title=openEuler-riscv
[root@openEuler-riscv64 ~]#

重启过后 /proc/cmdline 中没有添加的参数 ipv6.disable=1

在unmatched上复现此步骤,grubby修改参数是成功的

[root@openEuler-riscv64 ~]# grubby --extlinux --info DEFAULT
index=0
kernel=/boot/Image
args="earlyprintk rw rootfstype=ext4 rootwait console=ttySIF0,115200 LANG=en_US.UTF-8 earlycon"
root=/dev/mmcblk0p3
title=openEuler-riscv
[root@openEuler-riscv64 ~]# grubby --extlinux --update-kernel=`grubby --extlinux --default-kernel` --args ipv6.disable=1
[root@openEuler-riscv64 ~]# cat /proc/cmdline
earlyprintk rw root=/dev/mmcblk0p3 rootfstype=ext4 rootwait console=ttySIF0,115200 LANG=en_US.UTF-8 earlycon
[root@openEuler-riscv64 ~]# grubby --extlinux --info DEFAULT
index=0
kernel=/boot/Image
args="earlyprintk rw rootfstype=ext4 rootwait console=ttySIF0,115200 LANG=en_US.UTF-8 earlycon ipv6.disable=1"
root=/dev/mmcblk0p3
title=openEuler-riscv
[root@openEuler-riscv64 ~]# reboot
******
[root@openEuler-riscv64 ~]# cat /proc/cmdline
earlyprintk rw root=/dev/mmcblk0p3 rootfstype=ext4 rootwait console=ttySIF0,115200 LANG=en_US.UTF-8 earlycon ipv6.disable=1
[root@openEuler-riscv64 ~]# grubby --extlinux --info DEFAULT
index=0
kernel=/boot/Image
args="earlyprintk rw rootfstype=ext4 rootwait console=ttySIF0,115200 LANG=en_US.UTF-8 earlycon ipv6.disable=1"
root=/dev/mmcblk0p3
title=openEuler-riscv
[root@openEuler-riscv64 ~]# 

重启过后 /proc/cmdline 中有添加的参数 ipv6.disable=1

lvxiaoqian555 commented 2 years ago

qemu启动命令

virt-install  \
    --qemu-commandline='-bios none -append "root=/dev/vda1 rw console=ttyS0,115200"' \
    --name avocado-vt-vm1  \
    --arch riscv64  \
    --machine virt  \
    --vcpus 2  \
    --memory 2048  \
    --boot kernel=/var/lib/libvirt/images/fw_payload_oe_qemuvirt.elf  \
    --disk path=/var/lib/libvirt/images/openeuler-qemu.qcow2 \
    --network bridge=virbr0,model=virtio  \
    --rng device=/dev/urandom,model=virtio  \
    --channel name=org.qemu.guest_agent.0  \
    --graphics none \
    --osinfo detect=on,require=off
lvxiaoqian555 commented 2 years ago

使用此目录下的镜像可以解决问题 https://mirror.iscas.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/testing/openEuler-RISC-V-22.03-Preview/QEMU/