Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 556328 - netboot-s390x-kernel fails installation in qemu-system-s390x because of missing virto drivers
Summary: netboot-s390x-kernel fails installation in qemu-system-s390x because of missi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Netboot (show other bugs)
Hardware: s390 Linux
: Normal normal
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-30 13:26 UTC by Benjamin Zimmermann
Modified: 2015-12-08 20:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Zimmermann 2015-07-30 13:26:26 UTC
The only way (known to me) to have network in a qemu-system-s390x environment is with virtio drivers.

The config of netboot-s390x-kernel-20150723 (Linux/s390 4.1.3-gentoo) is missing those:

<snip 763-766>
CONFIG_TUN=m
# CONFIG_VETH is not set
# CONFIG_VIRTIO_NET is not set
# CONFIG_NLMON is not set
<snap>

<snip 671-674>
CONFIG_SCM_BLOCK=m
CONFIG_SCM_BLOCK_CLUSTER_WRITE=y
# CONFIG_VIRTIO_BLK is not set
# CONFIG_BLK_DEV_RBD is not set
<snap>

Is there any chance that the autobuilded netboot-s390x-kernel will have
CONFIG_VIRTIO_NET and CONFIG_VIRTIO_BLK enabled (or as modules)?
Comment 1 SpanKY gentoo-dev 2015-11-14 06:43:55 UTC
could you give this a try and see if it works for you:
https://wh0rd.org/dump/netboot-s390-20151113.tar.xz
Comment 2 Benjamin Zimmermann 2015-11-16 09:27:40 UTC
(In reply to SpanKY from comment #1)
> could you give this a try and see if it works for you:
> https://wh0rd.org/dump/netboot-s390-20151113.tar.xz

Network does work now, disk access still doesn't.

Not surprising so:
<zip>
# zcat /proc/config.gz|grep VIRTIO
# CONFIG_VIRTIO_BLK is not set
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_VIRTIO=y
# CONFIG_VIRTIO_BALLOON is not set
<zap>

So far we need CONFIG_VIRTIO_BLK to use blockdevices with qemu on s390x.
Could you please add also CONFIG_VIRTIO_BLK to kernel configuration?
Comment 3 SpanKY gentoo-dev 2015-11-17 04:12:54 UTC
(In reply to Benjamin Zimmermann from comment #2)

try this one:
https://wh0rd.org/dump/netboot-s390-20151116.tar.xz

also how are you booting the image in qemu ?  we probably want to add some automated testing to these steps so we know things work :).
Comment 4 Benjamin Zimmermann 2015-11-17 11:57:19 UTC
(In reply to SpanKY from comment #3)

Almost there, already got the device (after loading virtio-blk):
<zip>
# modprobe virtio-blk
# ls -l /dev/vd*
brw-rw----    1 root     root      254,   0 Nov 17 11:39 /dev/vda
<zap>

Testing the network (10.0.0.1 as gateway):
<zip>
# ifconfig eth0 10.0.0.10 netmask 255.255.255.0
# ping -c 1 10.0.0.1
<zap>

fdisk and partx still have dependency problems:
<zip>
# fdisk /dev/vda
fdisk: error while loading shared libraries: libfdisk.so.1: cannot open shared object file: No such file or directory
# partx
partx: error while loading shared libraries: libsmartcols.so.1: cannot open shared object file: No such file or directory
<zap>

Preparing and booting the system with minimal effort:
<zip>
# qemu-img create -f raw test.img 100M
# sudo ip link add link enccw0.0.xxxx name macvtap0 type macvtap mode bridge
# sudo ip link set macvtap0 up
# sudo sh -c "qemu-system-s390x -runas qemu -enable-kvm -nographic -m 2048 -kernel netboot-s390-kernel -initrd netboot-s390-initramfs -hda test.img -net nic,model=virtio,macaddr=$(< /sys/class/net/macvtap0/address) -net tap,fd=3 3<>/dev/tap$(< /sys/class/net/macvtap0/ifindex)"
<zap>

Thanks for making my life easier! (:
Comment 5 SpanKY gentoo-dev 2015-11-17 19:17:33 UTC
(In reply to Benjamin Zimmermann from comment #4)

i'll commit the kernel config then and close this bug once i do.  the issue of dependency resolution is a bigger one and i think this code needs to be rewritten to use lddtree instead, and i'll create a new bug to track that.
Comment 6 Benjamin Zimmermann 2015-11-17 20:35:30 UTC
(In reply to SpanKY from comment #5)
Please note the bug # here for reference.
I'll gladly do the testing...
Comment 7 SpanKY gentoo-dev 2015-12-08 20:53:23 UTC
(In reply to SpanKY from comment #5)

missing libs turned out to be easy to hack around in the mean time:
http://gitweb.gentoo.org/proj/releng.git/commit/?id=6cfbdd0570e2a35988e1a3e962e4de62c7cf147b