krglaws / MyLFS

A giant Bash script that builds Linux From Scratch
MIT License
90 stars 18 forks source link

Not bootable iso #5

Open marceloengecom opened 2 years ago

marceloengecom commented 2 years ago

Hello,

Thanks for your great job.

I running your script without errors. The IMG file was generate with 10GB.

I used DD to generate ISO file from IMG file, but on the test on Virtual Box the message "Not bootable medium found..." appear.

krglaws commented 2 years ago

Yes, I've experienced this as well, except I tried dd'ing the img file onto a flash drive.

Also, when I mount the flash drive and run ls /mnt/flashdrive, I get something like ls: cannot access <dirname>: Bad message a bunch of times. I do not know enough about filesystems to determine what causes this. From what I read online, it might have something to do with the size of the img file not being the same as the drive it has been copied onto. I would love to find a fix for this, but I simply do not know how.

In the mean time, I am working on a somewhat poor --install command that will partition a target device, and then just cp everything from the img file onto the device.

krglaws commented 2 years ago

Just wondering, how do you create the ISO from the IMG file? What are the commands?

mkikets99 commented 2 years ago

Just wondering, how do you create the ISO from the IMG file? What are the commands?

He said he used DD.. so it might be

sudo dd if=/path/to/file.img of=/path/to/output.iso

i also tried a qemu-img solution to make a virtual drive, but it didn't work for me:

qemu-img convert -f raw -O qcow2 lfs.img lfs.qcow2 # for KVM/QEMU
# or
qemu-img convert -f raw -O vdi lfs.img lfs.vdi # for VirtualBox
mkikets99 commented 2 years ago

I have a link on other "outdated" project... Ill check if i can bring some iso functionality from it here...

mkikets99 commented 2 years ago

@krglaws I found something... i'll try it later, but: git://mkikets99/lfs-scripts/master/03-mkiso It was my fork for Fedora distros for LFS Script, but it is "outdated" because of LFS version (if i remember it was a 8.0) but in this script rhere is a usage of xorriso to build iso. Maybe use that?

krglaws commented 2 years ago

Hi there, thanks for joining in.

He said he used DD.. so it might be

sudo dd if=/path/to/file.img of=/path/to/output.iso

If that is indeed the command he used, he might as well have just cp'd or just renamed the file with mv...

Anywho, that xorriso sounds promising. Someone also pointed me towards mkisofs. Honestly reading the man pages for both of these commands is like chinese to me right now, but if you have a POC in that script you linked, that could be a good starting point to look into. Thanks!

mkikets99 commented 2 years ago

Anywho, that xorriso sounds promising. Someone also pointed me towards mkisofs. Honestly reading the man pages for both of these commands is like chinese to me right now, but if you have a POC in that script you linked, that could be a good starting point to look into. Thanks!

In that script there is a usage of both mkisofs and xorriso I already forked the project to make an --iso action... Will contact as soon as I integrate it

mkikets99 commented 2 years ago

So, as it turns out, there is 1 more package with patch to install: syslinux (it's not a linux-kernel, but a bootable section with isolinux on board) Also... @krglaws i spot 1 odd thing... on phase4 there is no output about last installation (grub installlation)... I added RN that syslinux package to phase4, but i'll be able to check it on my morning I think it might be a output issue, cause grub files are generated

krglaws commented 2 years ago

I have also noticed the same thing about the phase 4 grub build. Not sure what's causing it. I'm planning on looking into it more this weekend.

mkikets99 commented 2 years ago

@marceloengecom please, be patient. We are on the road... It finally loads vmz aka vmlinux on the VM, but there some issues that are not described in the book, and they must be resolved before making any further steps on generating a iso file from this. Have a nice day!