From 6134fabb211be0a7c19bec8d791c9ca8e5bf1cfd Mon Sep 17 00:00:00 2001 From: john-liu2039 Date: Wed, 18 May 2022 03:37:25 +0000 Subject: [PATCH 1/2] update init/Kconfig with ARM64 depends for ghost kernel and add compile steps for odroid n2 --- init/Kconfig | 2 +- odroidn2_compile.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 odroidn2_compile.md diff --git a/init/Kconfig b/init/Kconfig index cec0f33a7f0d..4db791469f33 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2358,7 +2358,7 @@ config ARCH_HAS_SYSCALL_WRAPPER config SCHED_CLASS_GHOST bool "ghOSt scheduling class" - depends on X86_64 + depends on (X86_64 || ARM64) default n help ghOSt is a scheduling class with policy decisions delegated diff --git a/odroidn2_compile.md b/odroidn2_compile.md new file mode 100644 index 000000000000..c74459a42416 --- /dev/null +++ b/odroidn2_compile.md @@ -0,0 +1,37 @@ +0. Pre-request: + 1. [Odroid n2 board](https://www.hardkernel.com/shop/odroid-n2-with-4gbyte-ram/) (n2+ should be fine, but I have not test it yet). + 2. [Armbian linux image](https://www.armbian.com/odroid-n2/): the version of image I'm using is `Armbian_22.02.2_Odroidn2_focal_current_5.10.103`. +1. Install required packages +` + $sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison -y +` +2. Clone the source code +`$ git clone https://github.com/google/ghost-kernel.git && cd ghost_kernel` +3. Copy the config file to source code directory +`$ cp /boot/cp /boot/config-5.10.103-meson64 .config ` +4. Remove the signature checking certificates +`$ make menuconfig` +Remove 'debian/canonical-certs.pem' in Cryptographic API -> Certificates for signature checking +5. Start to compile `make -j4` +6. Install the kernel module +`$ sudo make INSTALL_MOD_STRIP=1 modules_install # strip the modules to reduce the size of initrd` +Or +``` + $ sudo make install + $ cd /lib/modules/ + $ find . -name *.ko -exec strip --strip-unneeded {} + +``` +7. After executing above command, proceed to create initramfs/initrd +``` + $ sudo make install + $ sudo ln -s vmlinuz-5.11.0+ Image +``` +8. Reboot and check the version of new kernel +``` + $ sudo reboot + $ uname -a to check the kernel +``` +It should output the new kernel version which is `5.11.0+`: ` Linux ubuntu 5.11.0+ #2 SMP PREEMPT Mon Apr 18 00:50:21 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux` +9. Finally install the headers +` sudo make headers_install INSTALL_HDR_PATH=/usr` +10. Have fun From bf0047328a5b06b80b32b63cceea9972a63608d0 Mon Sep 17 00:00:00 2001 From: "John Y. Liu" <52974454+john-liu2039@users.noreply.github.com> Date: Tue, 17 May 2022 22:41:04 -0500 Subject: [PATCH 2/2] Update format --- odroidn2_compile.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odroidn2_compile.md b/odroidn2_compile.md index c74459a42416..96573aab2484 100644 --- a/odroidn2_compile.md +++ b/odroidn2_compile.md @@ -32,6 +32,8 @@ Or $ uname -a to check the kernel ``` It should output the new kernel version which is `5.11.0+`: ` Linux ubuntu 5.11.0+ #2 SMP PREEMPT Mon Apr 18 00:50:21 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux` + 9. Finally install the headers ` sudo make headers_install INSTALL_HDR_PATH=/usr` + 10. Have fun