Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image fails to boot if kiss-bootstrap is executed on kiss linux. #2

Open
eudaldgr opened this issue Nov 4, 2020 · 15 comments
Open

Comments

@eudaldgr
Copy link

eudaldgr commented Nov 4, 2020

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.

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

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.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

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.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

https://0x0.st/idv2.png

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.

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

without logs, no idea what is going wrong.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

My qemu logs are empty.

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

im talking about the output of the kiss-bootstrap script.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

There are no errors, it just reboots to infinity. Ok, script logs.

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

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.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

Well, this is the logs, https://termbin.com/vdhy

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

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.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

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?

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

Im usually building on a Debian system.

@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

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.

@abbbi
Copy link
Owner

abbbi commented Nov 4, 2020

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..

@abbbi abbbi changed the title Documentation Image does not boo if kiss-bootstrap is executed on kiss linux. Nov 4, 2020
@abbbi abbbi changed the title Image does not boo if kiss-bootstrap is executed on kiss linux. Image fails to booot if kiss-bootstrap is executed on kiss linux. Nov 4, 2020
@abbbi abbbi changed the title Image fails to booot if kiss-bootstrap is executed on kiss linux. Image fails to boot if kiss-bootstrap is executed on kiss linux. Nov 4, 2020
@eudaldgr
Copy link
Author

eudaldgr commented Nov 4, 2020

It doesn't show the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants