TEXT 12
Buildroot.txt Guest on 10th February 2021 12:40:09 AM
  1. Buildroot notes
  2.  
  3. Entry: 2018.02.x downgrading Erlang to 19.3
  4. Date: Sun Mar 25 18:06:10 EDT 2018-2021
  5.  
  6. Make the trivial changes in package/erlang/erlang.mk
  7. Download the tarball to the dl directory manually, and update erlang.hash
  8.  
  9. Maybe easier to go back in buildroot source and copy the old build dir.
  10.  
  11. https://github.com/buildroot/buildroot/tree/2017.11.x/package/erlang
  12.  
  13.  
  14. Doing so creates failures:
  15.  
  16. [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"
  17. [email protected]:~/exo/br/target/i586/build/erlang-19.3$ make cross_check_erl
  18. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  19. * ERROR:   No usable Erlang/OTP system for the build machine found! Cannot
  20. *          cross compile without such a system.
  21. *
  22. *          Either build a bootstrap system for the build machine, or provide
  23. *          an Erlang/OTP-19 system in the $PATH, and try again. For more
  24. *          information on cross compiling Erlang/OTP-19, see the
  25. *          $ERL_TOP/xcomp/README file.
  26. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  27. Makefile:343: recipe for target 'cross_check_erl' failed
  28. make: *** [cross_check_erl] Error 1
  29.  
  30.  
  31. Let's first rebuild the whole thing.  Might be some staile stuff.
  32.  
  33.  
  34.  
  35. Entry: Kernel
  36. Date: Thu May  3 10:59:39 EDT 2018
  37.  
  38. What I want to know.
  39.  
  40. I already have defconfig/savedefconfig setup + the possibility to
  41. customize the buildroot archive itself (patches to package Makefiles).
  42.  
  43. How to create a custom kernel configuration?
  44.  
  45. https://stackoverflow.com/questions/1414968/how-do-i-configure-the-linux-kernel-within-buildroot
  46.  
  47.  
  48. 1 configure Linux kernel: make linux-menuconfig
  49.  
  50. 2 After leaving menuconfig your configuration will be stored in file:
  51.   output/build/linux-XYZ/.config where XYZ is your kernel version.
  52.  
  53. 3 After that you can copy file output/build/linux-*XYZ*/.config to
  54.   board/your_kernel_config/.config
  55.  
  56. 4 later in Buildroot menuconfig you can under kernel settings
  57.   configure to use custom kernel config file and enter path:
  58.   board/your_kernel_config/.config
  59.  
  60.  
  61.  
  62. Entry: Tuning sdcard.img
  63. Date: Thu May 17 09:04:00 EDT 2018
  64.  
  65. Partition table seems to be misaligned:
  66.  
  67. # parted /dev/mmcblk0
  68. GNU Parted 3.2
  69. Using /dev/mmcblk0
  70. Welcome to GNU Parted! Type 'help' to view a list of commands.
  71. (parted) unit s                                                          
  72. (parted) p                                                                
  73. Model: SD N1BW1 (sd/mmc)
  74. Disk /dev/mmcblk0: 4016128s
  75. Sector size (logical/physical): 512B/512B
  76. Partition Table: msdos
  77. Disk Flags:
  78.  
  79. Number  Start   End       Size      Type     File system  Flags
  80.  1      1s      32768s    32768s    primary  fat16        boot, lba
  81.  2      32769s  1081344s  1048576s  primary  ext4
  82.  
  83.  
  84. Where is this configured?
  85.  
  86. buildroot/board/beaglebone/genimg.cfg
  87.  
  88. It doesn't specify much for partition table layout.
  89. Looks like this is relevant:
  90. BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/post-image.sh"
  91.  
  92. So to customize, copy that script elsewhere and modify it.
  93.    
  94.  
  95.  
  96. Entry: bootloader config
  97. Date: Fri May 18 09:03:33 EDT 2018
  98.  
  99. I want a more straightforward bootloader setup.
  100.  
  101. There is uEnv.txt, but where is all the rest of the config?
  102.  
  103. Where does board_name get set?
  104.  
  105. uboot-2018.01/include/env_default.h
  106.  
  107. #ifdef CONFIG_SYS_BOARD
  108.         "board="        CONFIG_SYS_BOARD                "\0"
  109.         "board_name="   CONFIG_SYS_BOARD                "\0"
  110. #endif
  111.  
  112. [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ cat u-boot.cfg |grep CONFIG_SYS_BOARD
  113. #define CONFIG_SYS_BOARD "am335x"
  114.  
  115.  
  116. But that's not the same..
  117. => printenv board_name
  118. board_name=A335BNLT
  119.  
  120.  
  121. EDIT: I can't figure out where this is set.
  122. This means it is clearly too complicated.
  123.  
  124.  
  125.  
  126. Entry: BBB u-boot config
  127. Date: Fri May 18 09:43:08 EDT 2018
  128.  
  129. Can't figure out how this is configured.  uEnv.txt is only part of the story.
  130.  
  131. config/bbb.buildroot has:
  132.  
  133. BR2_TARGET_UBOOT=y
  134. BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
  135. BR2_TARGET_UBOOT_CUSTOM_VERSION=y
  136. BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.01"
  137. BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_evm"
  138. BR2_TARGET_UBOOT_NEEDS_DTC=y
  139. # BR2_TARGET_UBOOT_FORMAT_BIN is not set
  140. BR2_TARGET_UBOOT_FORMAT_IMG=y
  141. BR2_TARGET_UBOOT_SPL=y
  142. BR2_TARGET_UBOOT_SPL_NAME="MLO"
  143.  
  144. [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ cat configs/am335x_evm_defconfig
  145.  
  146.  
  147.  
  148. I just don't understand where the config is generated eventually.
  149.  
  150. Ok, look into the build directory for
  151.  
  152. [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ ls -al .*.cmd
  153. -rw-r--r-- 1 tom tom  122 May 17 17:31 .MLO.byteswap.cmd
  154. -rw-r--r-- 1 tom tom   92 May 17 17:31 .MLO.cmd
  155. -rw-r--r-- 1 tom tom   47 May 17 17:31 .u-boot.bin.cmd
  156. -rw-r--r-- 1 tom tom 1527 May 17 17:31 .u-boot.cmd
  157. -rw-r--r-- 1 tom tom   71 May 17 17:31 .u-boot-dtb.bin.cmd
  158. -rw-r--r-- 1 tom tom  394 May 17 17:31 .u-boot-dtb.img.cmd
  159. -rw-r--r-- 1 tom tom  386 May 17 17:31 .u-boot.img.cmd
  160. -rw-r--r-- 1 tom tom  936 May 17 17:31 .u-boot.lds.cmd
  161. -rw-r--r-- 1 tom tom  356 May 17 17:31 .u-boot-nodtb.bin.cmd
  162. -rw-r--r-- 1 tom tom  343 May 17 17:31 .u-boot.srec.cmd
  163. -rw-r--r-- 1 tom tom  126 May 17 17:31 .u-boot.sym.cmd
  164.  
  165. [email protected]:~/gw_buildroot/target/bbb/build/uboot-2018.01$ for f in .*.cmd; do echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: $f"; cat $f; done
  166.  
  167. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .MLO.byteswap.cmd
  168. cmd_MLO.byteswap := ./tools/mkimage -T omapimage -n byteswap -a 0x402F0400 -d spl/u-boot-spl.bin MLO.byteswap  >/dev/null
  169.  
  170. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .MLO.cmd
  171. cmd_MLO := ./tools/mkimage -T omapimage -a 0x402F0400 -d spl/u-boot-spl.bin MLO  >/dev/null
  172.  
  173. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.bin.cmd
  174. cmd_u-boot.bin := cp u-boot-dtb.bin u-boot.bin
  175.  
  176. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.cmd
  177. 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
  178.  
  179. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot-dtb.bin.cmd
  180. cmd_u-boot-dtb.bin := cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin
  181.  
  182. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot-dtb.img.cmd
  183. 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
  184.  
  185. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.img.cmd
  186. 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
  187.  
  188. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.lds.cmd
  189. 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
  190.  
  191. source_u-boot.lds := board/ti/am335x/u-boot.lds
  192.  
  193. deps_u-boot.lds := \
  194.   include/u-boot/u-boot.lds.h \
  195.  
  196. u-boot.lds: $(deps_u-boot.lds)
  197.  
  198. $(deps_u-boot.lds):
  199.  
  200. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot-nodtb.bin.cmd
  201. 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
  202.  
  203. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.srec.cmd
  204. 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
  205.  
  206. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CMD: .u-boot.sym.cmd
  207. cmd_u-boot.sym := /brcache/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-musleabihf-objdump -t u-boot > u-boot.sym
  208.  
  209.  
  210.  
  211. Entry: Override full environment?
  212. Date: Fri May 18 10:12:33 EDT 2018
  213.  
  214. I want something similar to this:
  215. https://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Default_uBoot_Environment_Variables
  216.  
  217. load mmc 1:2 0x80F80000 /boot/am335x-boneblack.dtb
  218. load mmc 1:2 0x80007fc0 /boot/uImage
  219. setenv bootargs console=ttyO0,115200n8 ${optargs} root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
  220. bootm 0x80007fc0 - 0x80F80000
  221.  
  222.  
  223. Modified it to:
  224.  
  225. load mmc 0:1 0x80F80000 am335x-boneblack.dtb
  226. load mmc 0:1 0x80007fc0 zImage
  227. setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
  228. bootz 0x80007fc0 - 0x80F80000
  229.  
  230. Which boots the kernel
  231.  
  232.  
  233. so how to overwrite the environment?
  234.  
  235.  
  236.  
  237. Entry: How does it actually work?
  238. Date: Fri May 18 10:35:58 EDT 2018
  239.  
  240. SPL first tries to boot from MMC1, then loads u-boot.img from SD card.
  241.  
  242.  
  243. U-Boot SPL 2018.01 (May 17 2018 - 21:31:43)
  244. Trying to boot from MMC1
  245. *** Warning - bad CRC, using default environment                                                                                                                                
  246.  
  247. reading u-boot.img
  248. reading u-boot.img
  249. reading u-boot.img
  250. reading u-boot.img
  251.  
  252. U-Boot 2018.01 (May 17 2018 - 21:31:43 +0000)
  253.  
  254. CPU  : AM335X-GP rev 2.1
  255. Model: TI AM335x BeagleBone Black
  256. DRAM:  512 MiB
  257. NAND:  0 MiB
  258. MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
  259.  
  260.  
  261.  
  262. Entry: buildroot pocketbeagle tutorial
  263. Date: Fri May 18 10:47:26 EDT 2018-2021
  264.  
  265. https://bootlin.com/pub/conferences/2018/elc/petazzoni-e-ale-buildroot-tutorial/petazzoni-buildroot-tutorial-lab.pdf
  266.  
  267. This has pocketbeagle patches.  Can I just use a different version
  268. that doesn't need the patches?
  269.  
  270. Let's look at them first.
  271.  
  272. https://github.com/e-ale/buildroot-e-ale
  273.  
  274. Ok, these patches are extensive.  I'm going to wait until they are integrated.

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.