Differences

This shows you the differences between two versions of the page.

Link to this comparison view

batocera.linux_buildroot_modifications [2020/01/28 20:49]
genetik57 created
batocera.linux_buildroot_modifications [2020/05/26 04:18] (current)
lbrpdx
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
 ===== Steps ===== ===== Steps =====
-To work on batocera, the first step is to get sources and compile it on your computer using this [[compile_batocera.linux|procedure]].+To work on Batocera, the first step is to get sources and compile it on your computer using this [[compile_batocera.linux|procedure]].
  
-Basically, batocera-linux is based on buildroot.+Basically, Batocera.linux is based on buildroot.
 The buildroot documentation for extra information can be found here : [[https://buildroot.org/downloads/manual/manual.html]]. The buildroot documentation for extra information can be found here : [[https://buildroot.org/downloads/manual/manual.html]].
  
-The buildroot steps to compile batocera is the following :+The buildroot steps to compile batocera are described in this page. 
 + 
 +==== Define your configuration ==== 
 +Let's assume you want to compile for Raspberry Pi3 (other architecture options and the steps to get there are described on [[compile_batocera.linux|this page]]).
  
-==== you define your configuration ==== 
   make batocera-rpi3_defconfig   make batocera-rpi3_defconfig
      
-This steps mainly creates the file .config from the file configs/batocera-rpi3_defconfig.+This steps mainly creates the file ''.config'' from the file ''configs/batocera-rpi3_defconfig''.
  
-If you modified manually the .config file, you can reset it by rerunning this command.+If you modified manually the ''.config file'' for testing/dev purposes, you can reset it by running the previous command again.
  
-batocera-rpi3_defconfig is a quite small file defining what is wanted to be built in the target. For example, kodi and emulationstation (and a bit more).+''batocera-rpi3_defconfig'' is a quite small file defining what is wanted to be built in the target. For example, kodi and emulationstation (and... well, a bit more ;) ...).
  
-.config is a file listing all the packages available, and for each of them, it says if it's to be built or not.+''.config'' is a file listing all the packages available, and for each of them, if it'going to be built or not.
  
-In other word, batocera-rpi3_defconfig is a smaller version of the .config file without dependancies. For example, if you build emulationstation which requires sdl2, in the .config, both are listed to yes in the .config while only emulationstation is listed in the _defconfig file.+In other words''batocera-rpi3_defconfig'' is a smaller version of the ''.config'' file without explicit dependencies. For example, if you build **emulationstation** which requires **sdl2**, in the ''.config'', both are listed to yes (like ''BR2_PACKAGE_BATOCERA_EMULATIONSTATION=y''in the ''.config'' while only **emulationstation** is listed in the ''batocera-rpi3_defconfig'' file.
  
-==== package compilation ====+==== Package compilation ====
 For each package (ie kodi, emulationstation), buildroot does the following : For each package (ie kodi, emulationstation), buildroot does the following :
   - do prerequisites   - do prerequisites
Line 33: Line 35:
  
 More exactly: More exactly:
-  - do the prerequisite packages recursively if not yet done (ie sdl2 if you want to build emulationstation) +  - do the prerequisite packages recursively if not yet done (ie **sdl2** if you want to build **emulationstation**
-  - download the package in the dl directory according to information from package/package-name/package-name.mk or package/batocera/package-name/package-name.mk +  - download the package in the dl directory according to information from ''package/package-name/package-name.mk'' or ''package/batocera/package-name/package-name.mk'' 
-  - extract the package in output/build/package-name-version +  - extract the package in ''output/build/package-name-version'' 
-  - patch the package from *.patch files (files next to the .mk file or board/recalbox/patches or board/recalbox/rpi3/patches) +  - patch the package from ''*.patch'' files (files next to the ''.mk'' file or ''board/batocera/patches/'' or ''board/batocera/rpi/patches/''
-  - configure the package according to the .mk file +  - configure the package according to the ''.mk'' file 
-  - build the package according to the .mk file +  - build the package according to the ''.mk'' file 
-  - install in the output/staging directory, in case of libaries +  - install in the ''output/rpi3/host/'' staging directory, in case of libraries 
-  - install in the output/target directory+  - install in the ''output/rpi3/target/'' directory
  
-For each step, buildroot create a flag file, ie .stamp_downloaded in output/build/package-name-version.+For each step, buildroot create a flag file, i.e. ''.stamp_downloaded'' in ''output/rpi3/build/package-name-version''.
  
-In case a step failed, just rerun make or make package-name to continue the build.+In case a step failed, just run ''make'' or ''make package-name'' again to restart/continue the build where you left.
  
-In case you want to rebuild completly a package, just do : +In case you want to rebuild completely a package, just do: 
-  rm -rf output/build/package-name-version+ 
 +  rm -rf output/rpi3/build/package-name-version
   make package-name   make package-name
  
-for example:+For example, to build EmulationStation again from the latest ''master'' git version:
  
-  rm -rf output/build/batocera-emulationstation-master+  rm -rf output/rpi3/build/batocera-emulationstation-master
   make batocera-emulationstation   make batocera-emulationstation
  
 ===== Main directories/files ===== ===== Main directories/files =====
-When you clone the batocera.linux git repository, you've mainly the following directories :+When you clone the batocera.linux git repository, you mainly get the following directories:
  
-.config : the list of all packages, stating if you are going to build it or not.+  * ''.config'' : the list of all packages, stating if you are going to build it or not
 +  *  ''dl'' : the directory where all files are downloaded, for example, ''batocera-emulationstation-master.tar.gz'' 
 +  * ''output'' : the directory where everything is built.
  
-dl : the directory where all files are downloadedfor examplebatocera-emulationstation-master.tar.gz+In other wordsin order to reinitialize your buildyou can type: 
 +  rm -rf .config dl output
  
-output : the directory where everything is built. 
  
-in other words, if you do +personally use the following command to confirm I have no other remaining files:
-  rm -rf .config dl output +
-you reinit your build. +
-personnally the following command to confirm i've no other files.+
   git status --ignored   git status --ignored
  
-My dl directory is a link on ../DL to use the same download directory for all my build, to avoid to redownload them each time. Note that you may have to remove some packages like batocera-emulationstation-master.tar.gz or recalbox-configgen-master.tar.gz while the contains is the master branch of their respective git. In other word, the content is dynamic. If you commit something on configgen, while the file is in the dl directory, buildroot will not redownload it again.+My ''dl'' directory is a link on ''../DL'' in order to use the same download directory for all my builds, to avoid to download the source archives each time again and again. Note that you may have to remove some packages like ''batocera-emulationstation-master.tar.gz'' or ''batocera-configgen-master.tar.gz'' while the contains is the master branch of their respective git repositories. In other wordswhenever the content is dynamic (''master'') and not a precise GitHub version. If you commit something on ''configgen'', while the file is in the ''dl'' directory, buildroot will not download it again as it is seen as the same filename.
  
-==== Working on the package ====+==== Working on packages ====
 Let's say you want to work on the package "retroarch" to make it evolve via a patch. Let's say you want to work on the package "retroarch" to make it evolve via a patch.
  
-First, compile a version of batocera for the architecture you will test.+First, compile a version of Batocera for the architecture you will test.
  
-Once done, you don't need to rebuild it for your tests. Just run the following commands :+Once this is done, you don't need to build it for your tests again. Just run the following commands:
  
-  mv output/target output/target_ +  mv output/rpi3/target output/rpi3/target_ 
-  cd output/build/retroarch-version+  cd output/rpi3/build/retroarch-version
   git init   git init
   git add <the file(s) you want to modify>   git add <the file(s) you want to modify>
Line 86: Line 88:
   git diff > ../../package/batocera/retroarch/001-mymodification.patch   git diff > ../../package/batocera/retroarch/001-mymodification.patch
   cd ../../..   cd ../../..
-  rm -rf ouput/build/batocera/retroarch-version+  rm -rf ouput/rpi3/build/batocera/retroarch-version
   make retroarch-patch # to confirm the patch is applied   make retroarch-patch # to confirm the patch is applied
   make retroarch # to finish other steps   make retroarch # to finish other steps
  
-At this step, output/target contains only the retroarch package. You can install it on your target machine via the command :+At this step, output/target contains only the retroarch package. You can install it on your target machine via the command:
  
   rsync -av output/target/ root@batocera.local:/   rsync -av output/target/ root@batocera.local:/
  
-Remember, batocera system modification are done on the linux overlay, ie, in ram, thus rebooting batocera without saving your overlay will acts as if you've not changed it in other words, it's nice to make tests while your system is not modified.+Remember, Batocera system modification are done on the Linux overlay, i.e. in RAM. Rebooting batocera without saving your overlay acts as if you hadn'changed it -- in other words, it'nice way to make tests while your system is not modified, but those changes are not persistent. If you want to permanently save the modification and keep them upon reboot, you need to use [[modify_the_system_while_it_s_running|batocera-save-overlay]]. 
 + 
 +==== Working on EmulationStation ==== 
 +EmulationStation is a [[https://github.com/batocera-linux/batocera-emulationstation|separate git repository]] from Batocera system. To work on EmulationStation, the simplest way is to directly get it on your computer and compile it without buildroot.
  
-==== Working on emulationstation ==== 
-emulationstation is a separate git repository. To work on it, the simpler way is to directly get it on your computer and compile it without working via buildroot. 
  • batocera.linux_buildroot_modifications.txt
  • Last modified: 2 months ago
  • by lbrpdx