I have been working on kernel compilation of Raspberry Pi on Ubuntu using a cross compiler. I have compiled the kernel, and I got the image file generated (https://www.raspberrypi.org/documentation/linux/kernel/building.md). The website I mentioned only tells how to install our compiled kernel on pre-installed NOOBS or Raspbian sdcard.

I have done Raspbian installation on an SD card and have seen partions where boot partions (FAT32) contains elf, kernel image, config.txt, etc. and the other partition (ext4) contains some folders.

I tried partitioning my new SD card in to FAT32 (bootable) and ext4 and copied the start.elf kernel image, bootcode, dtb, etc. into the boot folder and followed the make of modules and modules_install step for my second partion, but after installing the folder alignment doesn't look like the preinstalled Raspbian ext4 folder.

I know there is some file system doing that. How do I build an OS and file system on a new SD card?

1 Answer 1


I don't know why you would want to make your own OS.

There is far more to making an OS than constructing a kernel.

Assuming you want your own kernel, why not follow the procedure you referenced on top of a standard install.

If you really want to, the following describes how to structure the partitions (and the 8K offset of the 1st sector is critical).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.