Mudanças entre as edições de "Compiling Linux with Buildroot"
Ir para navegação
Ir para pesquisar
(8 revisões intermediárias por 2 usuários não estão sendo mostradas) | |||
Linha 1: | Linha 1: | ||
+ | =About= | ||
+ | This tutorial is an adapted version of [https://rocketboards.org/foswiki/view/Documentation/NiosIILinuxUserManual NiosII Linux User Manual]. | ||
=Requirements= | =Requirements= | ||
* Download Mentor's [https://sourcery.mentor.com/GNUToolchain/subscription42545 compiler]; | * Download Mentor's [https://sourcery.mentor.com/GNUToolchain/subscription42545 compiler]; | ||
Linha 6: | Linha 8: | ||
==Nios II Configuration== | ==Nios II Configuration== | ||
+ | * Export the need environment variables in order to continue: | ||
+ | ** export PATH=$PATH:/home/aluno/Documentos/sourceryg/bin (path to the binaries of your compiler) | ||
+ | ** export ARCH=nios2 | ||
+ | ** export CROSS_COMPILE=nios2-linux-gnu- | ||
* Go to the my_first_linux/buildroot/configs/ directory and run "wget https://rocketboards.org/foswiki/pub/Documentation/NiosIILinuxUserManual/nios2_defconfig"; | * Go to the my_first_linux/buildroot/configs/ directory and run "wget https://rocketboards.org/foswiki/pub/Documentation/NiosIILinuxUserManual/nios2_defconfig"; | ||
* Now edit this file with any editor like "vim nios2_defconfig"; | * Now edit this file with any editor like "vim nios2_defconfig"; | ||
Linha 11: | Linha 17: | ||
==Buildroot Options== | ==Buildroot Options== | ||
− | * Now go to the directory my_first_linux/buildroot/ and run "make nios2_defconfig" | + | * Now go to the directory my_first_linux/buildroot/ and run "make nios2_defconfig"; |
+ | * After that open the config menu with "make menuconfig"; | ||
* [Optional] Enter your root password at System Configuration -> Enable root login with password; | * [Optional] Enter your root password at System Configuration -> Enable root login with password; | ||
+ | * [Optional] Add OpenSSH at Target packages -> Networking applications -> openssh; | ||
* Select an text editor such as nano at Target packages-> Text Editors and viewers -> nano; | * Select an text editor such as nano at Target packages-> Text Editors and viewers -> nano; | ||
* Exit & Save; | * Exit & Save; | ||
Linha 19: | Linha 27: | ||
==Bootloader== | ==Bootloader== | ||
* Go to the my_first_linux/buildroot/ directory and download the bootloader running "git clone https://github.com/altera-opensource/u-boot-socfpga.git"; | * Go to the my_first_linux/buildroot/ directory and download the bootloader running "git clone https://github.com/altera-opensource/u-boot-socfpga.git"; | ||
− | |||
− | |||
− | |||
− | |||
* To generate to bootloader, go to my_first_linux/buildroot/u-boot-socfpga/ directory and run "make nios2-generic_config"; | * To generate to bootloader, go to my_first_linux/buildroot/u-boot-socfpga/ directory and run "make nios2-generic_config"; | ||
* For an unknown reason it might require you to run this command again "make nios2-generic_config"; | * For an unknown reason it might require you to run this command again "make nios2-generic_config"; | ||
Linha 33: | Linha 37: | ||
* Go to my_first_linux/linux/ and run "make clean"; | * Go to my_first_linux/linux/ and run "make clean"; | ||
* Then, run "make 3c120_defconfig"; | * Then, run "make 3c120_defconfig"; | ||
− | * And finally | + | * Then, "make vmImage"; |
+ | * And finally "make 3c120_devboard.dtb" | ||
+ | |||
+ | ==Joint All Generated Files== | ||
+ | * Create a new directory called joint_binaries at my_first_linux/; | ||
+ | * Go to my_first_linux/; | ||
+ | * Start copying all binaries to this directory: | ||
+ | ** cp buildroot/output/images/rootfs.* joint_binaries/ | ||
+ | ** cp u-boot-socfpga/u-boot joint_binaries/ | ||
+ | ** cp linux/arch/nios2/boot/vmImage joint_binaries/ | ||
+ | ** cp linux/arch/nios2/boot/vmlinux.bin joint_binaries/ | ||
+ | ** cp linux/arch/nios2/boot/3c120_devboard.dtb joint_binaries/ |
Edição atual tal como às 14h44min de 8 de julho de 2016
About
This tutorial is an adapted version of NiosII Linux User Manual.
Requirements
- Download Mentor's compiler;
- Download buildroot Embedded Linux Generator;
- Create a work directory, e.g. "mkdir my_first_linux";
- Extract bot files to my_first_linux directory as "sourcery" and "buildroot" respectively;
Nios II Configuration
- Export the need environment variables in order to continue:
- export PATH=$PATH:/home/aluno/Documentos/sourceryg/bin (path to the binaries of your compiler)
- export ARCH=nios2
- export CROSS_COMPILE=nios2-linux-gnu-
- Go to the my_first_linux/buildroot/configs/ directory and run "wget https://rocketboards.org/foswiki/pub/Documentation/NiosIILinuxUserManual/nios2_defconfig";
- Now edit this file with any editor like "vim nios2_defconfig";
- At the third line, change the value of the variable 'BR2_TOOLCHAIN_EXTERNAL_PATH' to the path where you extracted the compiler, e.g: '/home/aluno/Documentos/sourceryg++-2016.05'.
Buildroot Options
- Now go to the directory my_first_linux/buildroot/ and run "make nios2_defconfig";
- After that open the config menu with "make menuconfig";
- [Optional] Enter your root password at System Configuration -> Enable root login with password;
- [Optional] Add OpenSSH at Target packages -> Networking applications -> openssh;
- Select an text editor such as nano at Target packages-> Text Editors and viewers -> nano;
- Exit & Save;
- Run "make".
Bootloader
- Go to the my_first_linux/buildroot/ directory and download the bootloader running "git clone https://github.com/altera-opensource/u-boot-socfpga.git";
- To generate to bootloader, go to my_first_linux/buildroot/u-boot-socfpga/ directory and run "make nios2-generic_config";
- For an unknown reason it might require you to run this command again "make nios2-generic_config";
- Finally, run "make".
Linux Kernel
- Go to my_first_linux/;
- Download the kernel with "wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.6.3.tar.xz";
- Extract the file as a directory named "linux";
- Go to my_first_linux/linux/ and run "make clean";
- Then, run "make 3c120_defconfig";
- Then, "make vmImage";
- And finally "make 3c120_devboard.dtb"
Joint All Generated Files
- Create a new directory called joint_binaries at my_first_linux/;
- Go to my_first_linux/;
- Start copying all binaries to this directory:
- cp buildroot/output/images/rootfs.* joint_binaries/
- cp u-boot-socfpga/u-boot joint_binaries/
- cp linux/arch/nios2/boot/vmImage joint_binaries/
- cp linux/arch/nios2/boot/vmlinux.bin joint_binaries/
- cp linux/arch/nios2/boot/3c120_devboard.dtb joint_binaries/