BuildYourOwn PDF
BuildYourOwn PDF
BuildYourOwn PDF
Tools
Buildroot
Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux
systems through cross-compilation. We will use Buildroot to build Linux kernel
and root filesystem for Raspberry Pi.
Buildroot Commands
make menuconfig
run the configuration assistant for Buildroot
make linux-menuconfig
run the configuration assistant for kernel
make clean
to delete all build products (including build directories, host, staging and target
trees, the images and the toolchain)
make distclean
to delete all build products as well as the configuration
make help
display help
make configuration file
to generate .config from common configuration.
e.g. make raspberrypi_defconfig. configuration file raspberrypi_defconfig in
configs/ will be used
Build Your Own Linux System For Raspberry Pi
image sdcard.img {
hdimage {
} We will create two partitions
partition boot { One fat32 for boot
partition-type = 0xC
bootable = "true" Another ext4 for root fileystem
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
}
}
Build Your Own Linux System For Raspberry Pi
make-image.sh
#!/bin/sh
GENIMAGE_CFG="genimage-raspberrypi2.cfg"
GENIMAGE_TMP="genimage.tmp"
rm -rf "${GENIMAGE_TMP}"
genimage \
--rootpath "path_to_buildroot/output/target" \
--tmppath "${GENIMAGE_TMP}" \
--inputpath "./" \
--outputpath "./" \
--config "${GENIMAGE_CFG}"
mkknlimg can be found in output/host/usr/bin, or you can download it from
https://github.com/raspberrypi/tools/blob/master/mkimage/mkknlimg
exit $?
Build Your Own Linux System For Raspberry Pi
Prepare SD Card
1. Download and install SDFormatter https://www.sdcard.org/downloads/formatter_4/
2. Run SDFormatter, Click Option and choose FORMAT SIZE ADJUSTMENT on
3. Click Format
Build Your Own Linux System For Raspberry Pi