- Buildroot notes
- Entry: 2018.02.x downgrading Erlang to 19.3
- Date: Sun Mar 25 18:06:10 EDT 2018-2021
- Make the trivial changes in package/erlang/erlang.mk
- Download the tarball to the dl directory manually, and update erlang.hash
- Maybe easier to go back in buildroot source and copy the old build dir.
- https://github.com/buildroot/buildroot/tree/2017.11.x/package/erlang
- Doing so creates failures:
- [email protected]:~/exo/br/target/i586/build/erlang-19.3$ export PATH="/home/tom/exo/br/target/i586/host/bin:/home/tom/exo/br/target/i586/host/sbin:/home/tom/exo/br/target/i586/host/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
- [email protected]:~/exo/br/target/i586/build/erlang-19.3$ make cross_check_erl
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * ERROR: No usable Erlang/OTP system for the build machine found! Cannot
- * cross compile without such a system.
- *
- * Either build a bootstrap system for the build machine, or provide
- * an Erlang/OTP-19 system in the $PATH, and try again. For more
- * information on cross compiling Erlang/OTP-19, see the
- * $ERL_TOP/xcomp/README file.
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- Makefile:343: recipe for target 'cross_check_erl' failed
- make: *** [cross_check_erl] Error 1
- Let's first rebuild the whole thing. Might be some staile stuff.
- Entry: Kernel
- Date: Thu May 3 10:59:39 EDT 2018
- What I want to know.
- I already have defconfig/savedefconfig setup + the possibility to
- customize the buildroot archive itself (patches to package Makefiles).
- How to create a custom kernel configuration?
- https://stackoverflow.com/questions/1414968/how-do-i-configure-the-linux-kernel-within-buildroot
- 1 configure Linux kernel: make linux-menuconfig
- 2 After leaving menuconfig your configuration will be stored in file:
- output/build/linux-XYZ/.config where XYZ is your kernel version.
- 3 After that you can copy file output/build/linux-*XYZ*/.config to
- board/your_kernel_config/.config
- 4 later in Buildroot menuconfig you can under kernel settings
- configure to use custom kernel config file and enter path:
- board/your_kernel_config/.config
- Entry: Tuning sdcard.img
- Date: Thu May 17 09:04:00 EDT 2018
- Partition table seems to be misaligned:
- # parted /dev/mmcblk0
- GNU Parted 3.2
- Using /dev/mmcblk0
- Welcome to GNU Parted! Type 'help' to view a list of commands.
- (parted) unit s
- (parted) p
- Model: SD N1BW1 (sd/mmc)
- Disk /dev/mmcblk0: 4016128s
- Sector size (logical/physical): 512B/512B
- Partition Table: msdos
- Disk Flags:
- Number Start End Size Type File system Flags
- 1 1s 32768s 32768s primary fat16 boot, lba
- 2 32769s 1081344s 1048576s primary ext4
- Where is this configured?
- buildroot/board/beaglebone/genimg.cfg
- It doesn't specify much for partition table layout.
- Looks like this is relevant:
- BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/post-image.sh"
- So to customize, copy that script elsewhere and modify it.
- Entry: bootloader config
- Date: Fri May 18 09:03:33 EDT 2018
- I want a more straightforward bootloader setup.
- There is uEnv.txt, but where is all the rest of the config?
- Where does board_name get set?
- uboot-2018.01/include/env_default.h
- #ifdef CONFIG_SYS_BOARD
- "board=" CONFIG_SYS_BOARD "\0"
- "board_name=" CONFIG_SYS_BOARD "\0"
- #endif
- [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ cat u-boot.cfg |grep CONFIG_SYS_BOARD
- #define CONFIG_SYS_BOARD "am335x"
- But that's not the same..
- => printenv board_name
- board_name=A335BNLT
- EDIT: I can't figure out where this is set.
- This means it is clearly too complicated.
- Entry: BBB u-boot config
- Date: Fri May 18 09:43:08 EDT 2018
- Can't figure out how this is configured. uEnv.txt is only part of the story.
- config/bbb.buildroot has:
- BR2_TARGET_UBOOT=y
- BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
- BR2_TARGET_UBOOT_CUSTOM_VERSION=y
- BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.01"
- BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_evm"
- BR2_TARGET_UBOOT_NEEDS_DTC=y
- # BR2_TARGET_UBOOT_FORMAT_BIN is not set
- BR2_TARGET_UBOOT_FORMAT_IMG=y
- BR2_TARGET_UBOOT_SPL=y
- BR2_TARGET_UBOOT_SPL_NAME="MLO"
- [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ cat configs/am335x_evm_defconfig
- I just don't understand where the config is generated eventually.
- Ok, look into the build directory for
- [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ ls -al .*.cmd
- -rw-r--r-- 1 tom tom 122 May 17 17:31 .MLO.byteswap.cmd
- -rw-r--r-- 1 tom tom 92 May 17 17:31 .MLO.cmd
- -rw-r--r-- 1 tom tom 47 May 17 17:31 .u-boot.bin.cmd
- -rw-r--r-- 1 tom tom 1527 May 17 17:31 .u-boot.cmd
- -rw-r--r-- 1 tom tom 71 May 17 17:31 .u-boot-dtb.bin.cmd
- -rw-r--r-- 1 tom tom 394 May 17 17:31 .u-boot-dtb.img.cmd
- -rw-r--r-- 1 tom tom 386 May 17 17:31 .u-boot.img.cmd
- -rw-r--r-- 1 tom tom 936 May 17 17:31 .u-boot.lds.cmd
- -rw-r--r-- 1 tom tom 356 May 17 17:31 .u-boot-nodtb.bin.cmd
- -rw-r--r-- 1 tom tom 343 May 17 17:31 .u-boot.srec.cmd
- -rw-r--r-- 1 tom tom 126 May 17 17:31 .u-boot.sym.cmd
- [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ for f in .*.cmd; do echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: $f"; cat $f; done
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .MLO.byteswap.cmd
- cmd_MLO.byteswap := ./tools/mkimage -T omapimage -n byteswap -a 0x402F0400 -d spl/u-boot-spl.bin MLO.byteswap >/dev/null
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .MLO.cmd
- cmd_MLO := ./tools/mkimage -T omapimage -a 0x402F0400 -d spl/u-boot-spl.bin MLO >/dev/null
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.bin.cmd
- cmd_u-boot.bin := cp u-boot-dtb.bin u-boot.bin
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.cmd
- cmd_u-boot := /brcache/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-musleabihf-ld.bfd -pie --gc-sections -Bstatic --no-dynamic-linker -Ttext 0x80800000 -o u-boot -T u-boot.lds arch/arm/cpu/armv7/start.o --start-group arch/arm/cpu/built-in.o arch/arm/cpu/armv7/built-in.o arch/arm/lib/built-in.o arch/arm/mach-omap2/built-in.o board/ti/am335x/built-in.o board/ti/common/built-in.o cmd/built-in.o common/built-in.o disk/built-in.o drivers/built-in.o drivers/dma/built-in.o drivers/gpio/built-in.o drivers/i2c/built-in.o drivers/mtd/built-in.o drivers/mtd/nand/built-in.o drivers/mtd/onenand/built-in.o drivers/mtd/spi/built-in.o drivers/net/built-in.o drivers/net/phy/built-in.o drivers/pci/built-in.o drivers/power/built-in.o drivers/power/battery/built-in.o drivers/power/domain/built-in.o drivers/power/fuel_gauge/built-in.o drivers/power/mfd/built-in.o drivers/power/pmic/built-in.o drivers/power/regulator/built-in.o drivers/serial/built-in.o drivers/spi/built-in.o drivers/usb/common/built-in.o drivers/usb/dwc3/built-in.o drivers/usb/emul/built-in.o drivers/usb/eth/built-in.o drivers/usb/gadget/built-in.o drivers/usb/gadget/udc/built-in.o drivers/usb/host/built-in.o drivers/usb/musb-new/built-in.o drivers/usb/musb/built-in.o drivers/usb/phy/built-in.o drivers/usb/ulpi/built-in.o env/built-in.o fs/built-in.o lib/built-in.o net/built-in.o test/built-in.o test/dm/built-in.o --end-group arch/arm/lib/eabi_compat.o arch/arm/lib/lib.a -Map u-boot.map; true
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot-dtb.bin.cmd
- cmd_u-boot-dtb.bin := cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot-dtb.img.cmd
- cmd_u-boot-dtb.img := ./tools/mkimage -f auto -A arm -T firmware -C none -O u-boot -a 0x80800000 -e 0 -n "U-Boot 2018.01"" for am335x board" -E -b arch/arm/dts/am335x-evm.dtb -b arch/arm/dts/am335x-bone.dtb -b arch/arm/dts/am335x-boneblack.dtb -b arch/arm/dts/am335x-evmsk.dtb -b arch/arm/dts/am335x-bonegreen.dtb -b arch/arm/dts/am335x-icev2.dtb -d u-boot-nodtb.bin u-boot-dtb.img >/dev/null
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.img.cmd
- cmd_u-boot.img := ./tools/mkimage -f auto -A arm -T firmware -C none -O u-boot -a 0x80800000 -e 0 -n "U-Boot 2018.01"" for am335x board" -E -b arch/arm/dts/am335x-evm.dtb -b arch/arm/dts/am335x-bone.dtb -b arch/arm/dts/am335x-boneblack.dtb -b arch/arm/dts/am335x-evmsk.dtb -b arch/arm/dts/am335x-bonegreen.dtb -b arch/arm/dts/am335x-icev2.dtb -d u-boot-nodtb.bin u-boot.img >/dev/null
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.lds.cmd
- cmd_u-boot.lds := /brcache/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-musleabihf-gcc -E -Wp,-MD,./.u-boot.lds.d -D__KERNEL__ -D__UBOOT__ -D__ARM__ -Wa,-mimplicit-it=always -mthumb -mthumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -D__LINUX_ARM_ARCH__=7 -I./arch/arm/mach-omap2/include -Iinclude -I./arch/arm/include -include ./include/linux/kconfig.h -nostdinc -isystem /brcache/tom/gw_buildroot/target/bbb/host/lib/gcc/arm-buildroot-linux-musleabihf/6.4.0/include -ansi -include ./include/u-boot/u-boot.lds.h -DCPUDIR=arch/arm/cpu/armv7 -D__ASSEMBLY__ -x assembler-with-cpp -P -o u-boot.lds board/ti/am335x/u-boot.lds
- source_u-boot.lds := board/ti/am335x/u-boot.lds
- deps_u-boot.lds := \
- include/u-boot/u-boot.lds.h \
- u-boot.lds: $(deps_u-boot.lds)
- $(deps_u-boot.lds):
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot-nodtb.bin.cmd
- cmd_u-boot-nodtb.bin := /brcache/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-musleabihf-objcopy --gap-fill=0xff -j .text -j .secure_text -j .secure_data -j .rodata -j .hash -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn -j .binman_sym_table -j .dtb.init.rodata -j .efi_runtime -j .efi_runtime_rel -O binary u-boot u-boot-nodtb.bin
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.srec.cmd
- cmd_u-boot.srec := /brcache/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-musleabihf-objcopy --gap-fill=0xff -j .text -j .secure_text -j .secure_data -j .rodata -j .hash -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn -j .binman_sym_table -j .dtb.init.rodata -j .efi_runtime -j .efi_runtime_rel -O srec u-boot u-boot.srec
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.sym.cmd
- cmd_u-boot.sym := /brcache/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-musleabihf-objdump -t u-boot > u-boot.sym
- Entry: Override full environment?
- Date: Fri May 18 10:12:33 EDT 2018
- I want something similar to this:
- https://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Default_uBoot_Environment_Variables
- load mmc 1:2 0x80F80000 /boot/am335x-boneblack.dtb
- load mmc 1:2 0x80007fc0 /boot/uImage
- setenv bootargs console=ttyO0,115200n8 ${optargs} root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
- bootm 0x80007fc0 - 0x80F80000
- Modified it to:
- load mmc 0:1 0x80F80000 am335x-boneblack.dtb
- load mmc 0:1 0x80007fc0 zImage
- setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
- bootz 0x80007fc0 - 0x80F80000
- Which boots the kernel
- so how to overwrite the environment?
- Entry: How does it actually work?
- Date: Fri May 18 10:35:58 EDT 2018
- SPL first tries to boot from MMC1, then loads u-boot.img from SD card.
- U-Boot SPL 2018.01 (May 17 2018 - 21:31:43)
- Trying to boot from MMC1
- *** Warning - bad CRC, using default environment
- reading u-boot.img
- reading u-boot.img
- reading u-boot.img
- reading u-boot.img
- U-Boot 2018.01 (May 17 2018 - 21:31:43 +0000)
- CPU : AM335X-GP rev 2.1
- Model: TI AM335x BeagleBone Black
- DRAM: 512 MiB
- NAND: 0 MiB
- MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
- Entry: buildroot pocketbeagle tutorial
- Date: Fri May 18 10:47:26 EDT 2018-2021
- https://bootlin.com/pub/conferences/2018/elc/petazzoni-e-ale-buildroot-tutorial/petazzoni-buildroot-tutorial-lab.pdf
- This has pocketbeagle patches. Can I just use a different version
- that doesn't need the patches?
- Let's look at them first.
- https://github.com/e-ale/buildroot-e-ale
- Ok, these patches are extensive. I'm going to wait until they are integrated.
Recent Pastes