https://github.com/cyring/corefreq-buildroot
CoreFreq buildroot for EFI MBR images
https://github.com/cyring/corefreq-buildroot
Last synced: 3 months ago
JSON representation
CoreFreq buildroot for EFI MBR images
- Host: GitHub
- URL: https://github.com/cyring/corefreq-buildroot
- Owner: cyring
- License: gpl-3.0
- Created: 2021-09-05T09:39:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-06T16:48:45.000Z (over 2 years ago)
- Last Synced: 2025-03-04T07:46:03.663Z (over 1 year ago)
- Size: 24.4 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prerequisities
## GNU
* `nproc` @ [coreutils](https://www.gnu.org/software/coreutils)
## QEMU
* `qemu-x86_64` @ [qemu](https://wiki.qemu.org)
## EFI
* [edk2-ovmf](https://github.com/tianocore/edk2)
## Buildroot
* submodule [buildroot/buildroot](https://github.com/buildroot/buildroot)
# Build
## EFI
```
cd buildroot \
&& make BR2_EXTERNAL=../external defconfig BR2_DEFCONFIG=../efi-defconfig \
&& make BR2_EXTERNAL=../external \
&& cd ..
```
## MBR
```
cd buildroot \
&& make BR2_EXTERNAL="../external" defconfig BR2_DEFCONFIG=../mbr-defconfig \
&& make BR2_EXTERNAL=../external \
&& cd ..
```
# Run
## EFI
```
declare -i CPU_COUNT=$(nproc) \
&& qemu-system-x86_64 -smp ${CPU_COUNT} -m $(( ${CPU_COUNT} * 128 )) \
-enable-kvm -cpu max,hv-runtime \
-drive file=buildroot/output/images/disk.img,format=raw \
-bios /usr/share/OVMF/x64/OVMF.fd
```
## MBR
```
declare -i CPU_COUNT=$(nproc) \
&& qemu-system-x86_64 -smp ${CPU_COUNT} -m $(( ${CPU_COUNT} * 128 )) \
-enable-kvm -cpu max,hv-runtime \
-cdrom buildroot/output/images/rootfs.iso9660
```
## Command-line
* Run twice number of CPUs
```
declare -i CPU_COUNT=$(( $(nproc) * 2 )) \
&& qemu-system-x86_64 -smp ${CPU_COUNT} -m $(( ${CPU_COUNT} * 128 )) \
-enable-kvm -cpu max,hv-runtime \
-drive file=buildroot/output/images/disk.img,format=raw \
-kernel buildroot/output/images/bzImage \
-append "nr_cpus=${CPU_COUNT} root=/dev/sda2 rootwait console=tty1 quiet"
```
## [Example](https://github.com/cyring/CoreFreq-buildroot/issues/1)