Open eudaldgr opened 4 years ago
Logging output for sure would help. There are some requirements such as the kernel NBD module for mapping the qemu images to real disks, which are then prepared and written with the data.
Yeah i have the NBD module, that was an example. My issue was that there is no documentation about what this script needs, so i can create the image, but these image can't boot unlike yours, it was into a infinite loop where grub try to boot from hard disk. So there is something missing in my system, that's all.
Your image on the right, mine on the left.
It's only a screenshot, but mine it's in a loop that shows that and reboots immediately in less than a second, until you kill the virtual machine.
without logs, no idea what is going wrong.
My qemu logs are empty.
im talking about the output of the kiss-bootstrap script.
There are no errors, it just reboots to infinity. Ok, script logs.
If GRUB does not boot, it fails to find its entry address, so there is most probably going something wrong with the NBD mappings or grub executed in the chroot that is used to setup the disk does not work correctly.
Well, this is the logs, https://termbin.com/vdhy
grub bootloader installed correctly in your run. The grub bootloader is setu plike this:
chroot_exec "grub-install --target=i386-pc ${NBD_DEV}" ${TARGET_DIR}
chroot_exec "grub-mkconfig -o /boot/grub/grub.cfg" ${TARGET_DIR}
sed -i 's/nbd0p2/sda2/g' ${TARGET_DIR}/boot/grub/grub.cfg
the last statement is required to replace the root device in the grub.cfg, making it /dev/sdaX instead of the NBD mapped device.
I think this is where things might go wrong on your system.. Probably the bootloader references the wrong root disk/partition.
No, the sed command worked. I'm trying right now to run your script inside a virtual machine with linux mint, and the image created boots well. Your image was created inside a KISSLinux machine or under other distro?
Im usually building on a Debian system.
Well, so maybe this script doesn't work with KISS. It build, but wrong, unable to boot correctly. But i can't figure why...
Something is missing, to build this.
One would need to check both images the one working and not working for differences. The grub installation is executed within the chroot and should not depend on any components outside the system the build script is executed on.
Does it even show the GRUB menu? If it doesnt show the menu, it fails so early its not having access to its second stage files which are on disk (thus, fails to access the disk, somehow). If it shows the menu, one could at least try several grub commands to see what is going on..
It doesn't show the menu.
I'm unable to create a bootable image from your script, maybe I'm missing some parameters to configure in the kernel to manipulate NBD's or maybe some part of qemu that I forget, but don't boot the images I create with your script, only those you push.