SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Rep:
nvme boot on qemu howto?
hi all, I have an nvme disk on real hardware booting from the bios in csm mode using (a patched version of) lilo, and it works fine. however, I am trying to test the patch on a virtual machine as well, just to make sure it (the patch) is ok. I am using qemu.
If I have just nvme drive/s in the vm, how can I specify to boot on that drive?. According to some qemu mail log, nvme boot support was added in 2016, but I haven't been able to find the parameters to use. I don't want to use uefi as I am testing my lilo patch on csm. I know I can add a second none-nvme drive to the vm and do it that way, but that defeats the point of testing booting off nvme only, with lilo on the nvme mbr.
Any hints would be appreciated.
I've read on a handful of Arch pages that you can do it with a efi partition with grub and systemd.
I can't even begin to think on how you would get it to play nice with lilo.
I searched for a while and couldn't find anything, sorry.
Depending on your nvme Intel? Samsung? Kingston? or other model, go to the manufactures website for the device and see if they offer any tips for getting it to boot in a vm.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
my real nvme is adata (the right price, but still fast). I got that to boot initially using sys/etxlinux, and then after patching lilo, got it to boot with lilo (the real bios is eufi but running in legacy (csm) mode. an ami bios on an asrock a320m-hdv)
I have found ovmf for qemu (on sbo) which has a csm module, and offers to boot from nvme, but I havn't got it working yet, and am not sure whether it is my patch, or the bios. I'll keep this LQ thread open, and update it with progress..
Just to clarify, I have it working on real nvme hardware already with patched lilo, I am just tring to test my patch with virtual hardware now, (it is easier for remote testing, and repeatability, without messing up my real development pc, and I want more testing before submitting the patch to Pat)
my real nvme is adata (the right price, but still fast). I got that to boot initially using sys/etxlinux, and then after patching lilo, got it to boot with lilo (the real bios is eufi but running in legacy (csm) mode. an ami bios on an asrock a320m-hdv)
I have found ovmf for qemu (on sbo) which has a csm module, and offers to boot from nvme, but I havn't got it working yet, and am not sure whether it is my patch, or the bios. I'll keep this LQ thread open, and update it with progress..
Just to clarify, I have it working on real nvme hardware already with patched lilo, I am just tring to test my patch with virtual hardware now, (it is easier for remote testing, and repeatability, without messing up my real development pc, and I want more testing before submitting the patch to Pat)
I didn't want to comment before Tim get other answers, but I have tried his patch on a VirtualBox VM, to no avail so far. The patched lilo runs with no errors after having edited the boot= option of /etc/lilo.conf but still the virtual machine didn't reboot yet.
Maybe Tim you could either post your patch as an attachment (just give it a .txt extension then so it be accepted by LQ) or upload it somewhere and provide a link to there.
This way others could have a chance to test it in more contexts (like another virtualization program, or another mobo on bare metal).
Last edited by Didier Spaier; 02-23-2018 at 04:36 AM.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
good idea Didier, attached is the patch so far. just apply the patch to the lilo source and build. it doesn't patch liloconfig yet, just lilo, but allows it to write to nvme disks. copy patch to lilo.Slackbuild folder, and add
Code:
patch -p1 < $CWD/mylilo.patch.txt
to the slackbuild, just after the other patch. run the script and install the package. To run from boot, replace existing lilo package with this one and re-create your dvd iso.
You will need to manually edit lilo.conf and replace /dev/sdva references with your /dev/nvme0n1 references.
if anyone can test it on a vm I would be grateful. (I can't get qemu to boot with ovmf yet, and the standard qemu bios does not give the option to boot from the nvme). I can boot from sda with nvme present, but that doesn't really test lilo installing to nvme. Any imput from someone who has done this successfully would be wonderful.
as I mentioned earlier, it is booting on real hardware. I will remove the other disks on the real hardware just leaving the nvme and see if it still boots, just to make sure.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
i can boot to the ovmf uefi shell. the ouput of map shows the nvme as blk4, and dblk blk4 shows the lilo string in the boot sector of the virtual nvme disk. unfortunately, I think I need the nvme blk device aliased to an fs device to get legacy (csm) boot to work. any input on legacy booting from uefi shell is appreciated...
I am not posting to be judgemental. I think "because I want to" is a perfectly good reason to justify about anything one might do with a computer but...Can I ask why you want to boot with the CSM? Again more curious than anything?
elilo is really quite nice, IMHO with its text config and not needing to be re-installed to change kernels and initrds....
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
since you asked,I am of the view "if it ain't broke, don't fix it". Apart from gpt support, which could have been added to regular bios, uefi is overkill, and has all sorts of ideas - such as safeboot, which sound nice, but are overkill, and make it harder for people to use linux. -most bioses only have microsoft certs in them, and anyone who likes playing around with kernels will have great difficulties with this extra secuirty features, unless they are bypassed, in which case - what's the point!.
having said all that, I don't like having to learn new stuff all the time, and it is easier for me to patch lilo to work with nvme disks, than to learn another boot manager; well, i'll delay it as long as i can - call me a troglodyte, i don't mind :-)
As a number of modern motherboards work with nvme in legacy mode (including my own), it is worth while emulating that, so that testing can be done. I already have it working on my hardware. it is emulation that I am having difficulties with. If you can contribute in this it would be appreciated.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
success :-)
i re-tested my real hardware with just nvme drive and sata cdrw, and it boots fine.
good news :-). an updated version of qemu is available from sbo, and the newer version works. ie. I can boot from single virtual nvme drive (and virtual cdrom attached for the installation), using my patched lilo - using non-uefi bios!
For those interested in testing, I used the following qemu parameters
to paramter list to get the bios boot menu and booted from the cdrom.)
defining a pcie root port is probably overkill, although you can use it if you want multiple nvme drives define another port the same bus but different id and slot, and change the second nvme device to point to the id of the second "bus". see here http://lists.gnu.org/archive/html/qemu-devel/2018-02/msg00022.html for details.
see attachements for lilo boot screen on the vm, and once booted and logged in.
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Original Poster
Rep:
liloconfig patch
for those interested, a patch for liloconfig is attached. When applied along with the lilo patch and package created, and used in place of the original, the installation "just works". - at least testing with a single nvme drive and sata cd/dvd.
to apply, copy attachment to same directory as liloconfig, cd to that directory and run
Code:
patch liloconfig myliloconfig.patch.txt
add the lilo patch into the slackbuild, (after the other patch) and run it. replace the old lilo package with the new one and create a new bootable dvd and enjoy :-)
If you find any problems, please let me know so I can fix them.
The only omission I would like to do is change the lba32 option to make it the default if the bios is more recent than 2000 (all bioses after 1998 should support lba32). something like...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.