-
Notifications
You must be signed in to change notification settings - Fork 13
Developing MiniArch
MiniArch (the same like MiniMyth2) uses common build system based on GAR (https://www.linuxjournal.com/article/5819)
Most frequently actions are described here: https://github.com/warpme/minimyth2/wiki/Developing-MiniMyth2
MiniArch related components are in ~/minimyth2/script/miniarch
- do desired changes in kernel config (helpful might be
make menuconfigin(mm_home)/script/kernel/kernel-<ver>dir) - go to
(mm_home)/script/kernel/kernel-<ver> - run
make makesums-all clean - go to
(mm_home)/script/meta/miniarch/ - run
make update-kernel
steep 4 will build image for board you have in $(HOME)/.minimyth2/minimyth.conf file (variable mm_BOARD_TYPE=)- so good practice is to set your desired board in this file. (alternatively - you can again rebuild image for different board by using prepare-miniarch-image.sh script
- go to
~/minimyth2/script/kernel/linux-x.y/work/main.d/linux-x.y.z - do desired changes in kernel code
- go to
~/minimyth2/script/kernel/linux-x.y - run
make rebuild reinstall - go to
~/minimyth2/script/miniarch - run
make update-kernel - run
./build-image-for-board.sh - type number to select desired board then press Enter
- after some time You should get sd card image for selected board in
builddir
Note: running make clean in ~/minimyth2/script/kernel/linux-x.y will delete all your changes. If you want to have them permanently, please do following:
Here is example for linux kernel:
- go to
~/minimyth2/script/kernel/linux-x.y - run
make clean patch - do desired changes in kernel code in
~/minimyth2/script/kernel/linux-x.y/work/main.d/linux-x.y.z - run
make makepatchin~/minimyth2/script/kernel/linux-x.y - you will get
current-changes.patchfile in~/minimyth2/script/kernel/linux-x.ycopy this file to~/minimyth2/script/kernel/linux-x.y/filesdir with desired patch_file_name - add
PATCHFILES += patch_file_nameentry in~/minimyth2/script/kernel/linux-x.y/Makefileat end of PATCHFILES +=... list - go to
~/minimyth2/script/kernel/linux-x.yand runmake makesums-all
Now you can build kernel with your changes by make clean install in ~/minimyth2/script/kernel/linux-x.y and then build MiniArch image by following Example: rebuilding MiniArch image with updated kernel
Note: due nature how patch utility works - please do make makepatch on clean sources.
If you do this on sources with build artefacts - then current-changes.patch file will contain also build artefacts.
To avoid this, you may do whole Include your code changes in MiniMyth2 build system procedure in some temp dir.
Example:
- copy
~/minimyth2/script/kernel/linux-x.yto~/minimyth2/script/kernel/linux-x.y-temp - go to
~/minimyth2/script/kernel/linux-x.y-tempand do Include your code changes in MiniMyth2 build system procedure - copy
current-changes.patchfile from~/minimyth2/script/kernel/linux-x.y-tempto~/minimyth2/script/kernel/linux-x.y/filesdir with desired patch_file_name - add
PATCHFILES += patch_file_nameentry in~/minimyth2/script/kernel/linux-x.y/Makefileat end of PATCHFILES +=... list - go to
~/minimyth2/script/kernel/linux-x.yand runmake makesums-all
Now you can build kernel with your changes by make clean install in ~/minimyth2/script/kernel/linux-x.y and then build MiniArch image by following Example: rebuilding MiniArch image with updated kernel
Happy developing