From 1c3a97069f0ddc9043dc58253836f28206a53d3f Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 26 Apr 2023 09:33:28 -0500 Subject: [PATCH 01/12] README.md: update for external changes - github no longer supports git:// and needs https:// instead - Ubuntu ships the required compiler --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5db6a5a..d42c8c4 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,10 @@ System Requirements * User account with `sudo` enabled * Packages: - # If you haven't already added the ev3dev.org repository... - sudo apt-add-repository ppa:ev3dev/tools sudo apt-get update # then install required packages sudo apt-get install git build-essential ncurses-dev fakeroot bc \ - u-boot-tools lzop flex bison libssl-dev \ - gcc-linaro-arm-linux-gnueabihf-6.4 + u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi Scripts @@ -53,11 +50,9 @@ First time kernel build update the submodule commit in the kernel repo, so you have to pull manually to get the most recent commits). - ~/work $ git clone git://github.com/ev3dev/ev3dev-buildscripts - ~/work $ git clone --recursive --depth 150 git://github.com/ev3dev/ev3-kernel - ~/work $ cd ev3-kernel/drivers/lego - ~/work/ev3-kernel/drivers/lego $ git pull origin ev3dev-stretch - ~/work/ev3-kernel/drivers/lego $ cd - + ~/work $ git clone https://github.com/ev3dev/ev3dev-buildscripts --branch ev3dev-stretch + ~/work $ git clone --recursive --depth 150 https://github.com/ev3dev/ev3-kernel \ + --branch ev3dev-stretch 3. Change to the `ev3dev-buildscripts` directory and have a look around. From f8383a3da47ea183c1cdd5af54710800f308bd82 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 26 Apr 2023 10:18:41 -0500 Subject: [PATCH 02/12] use system arm-linux-gnueabi- by default Newer versions of Ubuntu ship with arm-linux-gnueabi-gcc so we can use that by default instead of the old Linaro toolchain. --- build-kernel | 2 +- defconfig | 2 +- setup-env | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build-kernel b/build-kernel index df535c6..4429285 100755 --- a/build-kernel +++ b/build-kernel @@ -21,7 +21,7 @@ dtbs_install_path="$EV3DEV_INSTALL_DTBS" make_args="$EV3DEV_MAKE_ARGS -C ${kernel_src_path} KBUILD_OUTPUT=${obj_path} ARCH=arm - CROSS_COMPILE=$EV3DEV_TOOLCHAIN/$EV3DEV_ABI" + CROSS_COMPILE=${EV3DEV_TOOLCHAIN}${EV3DEV_ABI}" extra_default_targets="$EV3DEV_EXTRA_DEFAULT_TARGETS" uenv_txt_install_path="$EV3DEV_INSTALL_UENV_TXT" diff --git a/defconfig b/defconfig index a648efe..ef03eb9 100755 --- a/defconfig +++ b/defconfig @@ -7,7 +7,7 @@ kernel_src_path="$EV3DEV_KERNEL" obj_path="$EV3DEV_OBJ" make_args="$EV3DEV_MAKE_ARGS -C ${kernel_src_path} KBUILD_OUTPUT=${obj_path} \ -ARCH=arm CROSS_COMPILE=$EV3DEV_TOOLCHAIN/$EV3DEV_ABI" +ARCH=arm CROSS_COMPILE=${EV3DEV_TOOLCHAIN}${EV3DEV_ABI}" show_usage () { diff --git a/setup-env b/setup-env index 9554e3e..cea73d6 100755 --- a/setup-env +++ b/setup-env @@ -20,7 +20,7 @@ # EV3DEV_INSTALL_MODULES: Where the kernel modules will be installed. # EV3DEV_INSTALL_DTBS: Where the device tree blocks will be installed. # EV3DEV_INSTALL_UENV_TXT: Where the uEnv.txt file is installed (BeagleBoard only). -# EV3DEV_TOOLCHAIN: Where to find the cross-compiler toolchain. +# EV3DEV_TOOLCHAIN: Where to find the cross-compiler toolchain (be sure to include trailing /). # EV3DEV_MERGE_CMD: The command that the defconfig script uses to merge files. # # Advanced/internal variables variables are: @@ -53,8 +53,7 @@ fi export EV3DEV_KERNEL_FLAVOR=${EV3DEV_KERNEL_FLAVOR-"ev3"} export EV3DEV_BUILD_AREA=${EV3DEV_BUILD_AREA-"$(pwd)/build-area"} export EV3DEV_MERGE_CMD=${EV3DEV_MERGE_CMD-"vimdiff \$file1 \$file2"} -export EV3DEV_TOOLCHAIN=${EV3DEV_TOOLCHAIN-"/usr/lib/x86_64-linux-gnu/gcc-linaro-arm-linux-gnueabihf-6.4/bin"} -export EV3DEV_ABI=${EV3DEV_ABI-"arm-linux-gnueabihf-"} +export EV3DEV_ABI=${EV3DEV_ABI-"arm-linux-gnueabi-"} if [ "$EV3DEV_KERNEL_FLAVOR" = "ev3" ]; then export EV3DEV_KERNEL=${EV3DEV_KERNEL-"$(pwd)/../ev3-kernel"} From 7194ea342234738681c57e60bbfe0509ea3e8ffa Mon Sep 17 00:00:00 2001 From: project516 Date: Sat, 2 Aug 2025 21:22:01 -0500 Subject: [PATCH 03/12] start trying to compile ev3dev trixie --- setup-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-env b/setup-env index 604d4c0..e413112 100755 --- a/setup-env +++ b/setup-env @@ -53,7 +53,7 @@ fi export EV3DEV_KERNEL_FLAVOR=${EV3DEV_KERNEL_FLAVOR-"ev3"} export EV3DEV_BUILD_AREA=${EV3DEV_BUILD_AREA-"$(pwd)/build-area"} export EV3DEV_MERGE_CMD=${EV3DEV_MERGE_CMD-"vimdiff \$file1 \$file2"} -export EV3DEV_TOOLCHAIN=${EV3DEV_TOOLCHAIN-"/usr/lib/x86_64-linux-gnu/gcc-arm-linux-gnueabihf-8.3/bin"} +export EV3DEV_TOOLCHAIN=${EV3DEV_TOOLCHAIN-"/usr/bin"} export EV3DEV_ABI=${EV3DEV_ABI-"arm-linux-gnueabihf-"} if [ "$EV3DEV_KERNEL_FLAVOR" = "ev3" ]; then From 1687a252dabb5cd7f7ec9c37d927b643e1415f6b Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Wed, 13 Aug 2025 07:31:29 -0500 Subject: [PATCH 04/12] Update README.md change links to my own --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 377835a..445499c 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,8 @@ First time kernel build update the submodule commit in the kernel repo, so you have to pull manually to get the most recent commits). - ~/work $ git clone https://github.com/ev3dev/ev3dev-buildscripts --branch ev3dev-stretch - ~/work $ git clone --recursive --depth 150 https://github.com/ev3dev/ev3-kernel \ - --branch ev3dev-stretch + ~/work $ git clone https://github.com/project516/ev3dev-buildscripts + ~/work $ git clone --recursive --depth 25 https://github.com/project516/ev3-kernel 3. Change to the `ev3dev-buildscripts` directory and have a look around. From 2c2fddba03c24cf69495bf61bb934b265d906e0a Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Wed, 13 Aug 2025 07:33:38 -0500 Subject: [PATCH 05/12] Update README.md fix few things --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 445499c..a4a8d55 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ These are the scripts used to compile the ev3dev kernel. Originally it also included scripts to bootstrap a root file system and create a disk image. Those scripts have evolved into the [brickstrap] package. -**NOTE:** The instructions below are for ev3dev-buster. If you want to build +**NOTE:** The instructions below are for ev3dev-trixie. If you want to build a kernel for ev3dev-stretch, please use the [ev3dev-stretch branch]. [ev3dev-stretch branch]: https://github.com/ev3dev/ev3dev-buildscripts/tree/ev3dev-stretch @@ -13,7 +13,7 @@ a kernel for ev3dev-stretch, please use the [ev3dev-stretch branch]. System Requirements ------------------- * Ubuntu LTS (can be run in a [virtual machine](https://www.virtualbox.org/) - or with [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)) + or with [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install)) * User account with `sudo` enabled * Packages: From f0310c4d4081616570dd1fb4984e3cb51ddb235b Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Wed, 13 Aug 2025 07:34:45 -0500 Subject: [PATCH 06/12] Update setup-env add missing / --- setup-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-env b/setup-env index ac44422..7f958cb 100755 --- a/setup-env +++ b/setup-env @@ -55,7 +55,7 @@ export EV3DEV_BUILD_AREA=${EV3DEV_BUILD_AREA-"$(pwd)/build-area"} export EV3DEV_MERGE_CMD=${EV3DEV_MERGE_CMD-"vimdiff \$file1 \$file2"} export EV3DEV_TOOLCHAIN=${EV3DEV_TOOLCHAIN-"/usr/bin"} -export EV3DEV_ABI=${EV3DEV_ABI-"arm-linux-gnueabihf-"} +export EV3DEV_ABI=${EV3DEV_ABI-"/arm-linux-gnueabihf-"} if [ "$EV3DEV_KERNEL_FLAVOR" = "ev3" ]; then From ad031853b2f8c1e1ce6de3341be4ed74069f959e Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Fri, 15 Aug 2025 16:16:10 -0500 Subject: [PATCH 07/12] Update README.md Add the hf version of arm-linux-gnueabihf-gcc --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a4a8d55..8f0f772 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ System Requirements sudo apt-get update # then install required packages sudo apt-get install git build-essential ncurses-dev fakeroot bc \ - u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi + u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf Scripts @@ -51,7 +51,7 @@ First time kernel build to get the most recent commits). ~/work $ git clone https://github.com/project516/ev3dev-buildscripts - ~/work $ git clone --recursive --depth 25 https://github.com/project516/ev3-kernel + ~/work $ git clone --recursive --depth 25 https://github.com/project516/ev3-kernel 3. Change to the `ev3dev-buildscripts` directory and have a look around. From 426bdd3ef2245493685e76cd6b45582be6c488a9 Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:13:28 -0500 Subject: [PATCH 08/12] Update README.md Re add: 6. That's it! The uImage and kernel modules you just built are saved in `./build-area`. You just need to copy the files to your already formatted SD card. For an easier way of getting the kernel on your EV3, see [Sharing Your Kernel](#sharing-your-kernel). Starting with ev3dev-stretch images dated 2018-05 or later, the uImage file is no longer used. Create a Debian package as described in the *Sharing Your Kernel* section. ~/work/ev3dev-buildscripts $ cd ./build-area/linux-ev3dev-ev3-dist ~/work/ev3dev-buildscripts/build-area/linux-ev3dev-ev3-dist $ cp uImage /uImage ~/work/ev3dev-buildscripts/build-area/linux-ev3dev-ev3-dist $ sudo cp -r lib/ --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8f0f772..f4f2a9a 100644 --- a/README.md +++ b/README.md @@ -79,14 +79,19 @@ First time kernel build # BeagleBoard EV3DEV_KERNEL_FLAVOR=bb.org ./build-kernel -6. That's it! - - TODO: add instructions on how to modify uEnv.txt to use uImage file. - - For now, see [Sharing Your Kernel](#sharing-your-kernel) for how to create - a debian package to install the kernel you just built. - +6. That's it! The uImage and kernel modules you just built are saved in + `./build-area`. You just need to copy the files to your + already formatted SD card. For an easier way of getting the kernel on + your EV3, see [Sharing Your Kernel](#sharing-your-kernel). Starting with + ev3dev-stretch images dated 2018-05 or later, the uImage file is no longer + used. Create a Debian package as described in the *Sharing Your Kernel* + section. + + ~/work/ev3dev-buildscripts $ cd ./build-area/linux-ev3dev-ev3-dist + ~/work/ev3dev-buildscripts/build-area/linux-ev3dev-ev3-dist $ cp uImage /uImage + ~/work/ev3dev-buildscripts/build-area/linux-ev3dev-ev3-dist $ sudo cp -r lib/ + Faster Builds and Custom Locations ---------------------------------- From 0b8eb9db3e979be76731e71f066de10bb51922ba Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:06:06 -0500 Subject: [PATCH 09/12] Update README.md add -y in install packages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4f2a9a..2cf545c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ System Requirements sudo apt-get update # then install required packages sudo apt-get install git build-essential ncurses-dev fakeroot bc \ - u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf + u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf -y Scripts From 6954cc0b58615aac0339878ed5cf87f8294a2f47 Mon Sep 17 00:00:00 2001 From: project516 <138796702+Project516@users.noreply.github.com> Date: Fri, 12 Dec 2025 03:34:11 +0000 Subject: [PATCH 10/12] Add secton on rebasing --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2cf545c..aa1ab88 100644 --- a/README.md +++ b/README.md @@ -226,3 +226,13 @@ Common Errors [brickstrap]: https://github.com/ev3dev/brickstrap [wiki]: https://github.com/ev3dev/ev3dev/wiki + +Rebasing +-------- + +```bash +git remote add kernel https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git +git fetch kernel tag v6.12.y +git checkout bookworm +git rebase v6.12.y +``` From f80563a58d4946b564fb9a8efc3fa324d523b6e1 Mon Sep 17 00:00:00 2001 From: project516 <138796702+Project516@users.noreply.github.com> Date: Fri, 12 Dec 2025 21:05:45 +0000 Subject: [PATCH 11/12] Remove outdated checkout command from rebasing instructions in README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index aa1ab88..42017f2 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,5 @@ Rebasing ```bash git remote add kernel https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git git fetch kernel tag v6.12.y -git checkout bookworm git rebase v6.12.y ``` From 4758b78a026c7d5d8dac109037f984fd5671ab11 Mon Sep 17 00:00:00 2001 From: project516 <138796702+Project516@users.noreply.github.com> Date: Tue, 16 Dec 2025 17:13:17 +0000 Subject: [PATCH 12/12] Add changes suggested by @dlech, add -b flag to cloning the kernel instructons, so it clones the trixie branch, add instructions to install debhelper for sharing your kernel, updated rebasing guide, added a submodule updating guide - successfully compiled the kernel (build debian package) with these changes - there is a problem with ./build-kernel by itself, with generating a uImage --- README.md | 27 ++++++++++++++++++++++----- setup-env | 4 ++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 42017f2..2e02b1b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ System Requirements sudo apt-get update # then install required packages sudo apt-get install git build-essential ncurses-dev fakeroot bc \ - u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf -y + u-boot-tools lzop flex bison libssl-dev gcc-arm-linux-gnueabi Scripts @@ -50,8 +50,8 @@ First time kernel build update the submodule commit in the kernel repo, so you have to pull manually to get the most recent commits). - ~/work $ git clone https://github.com/project516/ev3dev-buildscripts - ~/work $ git clone --recursive --depth 25 https://github.com/project516/ev3-kernel + ~/work $ git clone https://github.com/ev3dev/ev3dev-buildscripts + ~/work $ git clone --recursive --depth 25 -b ev3dev-trixie https://github.com/ev3dev/ev3-kernel 3. Change to the `ev3dev-buildscripts` directory and have a look around. @@ -161,6 +161,12 @@ Sharing Your Kernel Want to send your custom kernel to someone so that they can use it? Never fear, there is an easy way to do that - using Debian packaging. +Make sure to install debhelper with: + +```bash +sudo apt-get install debhelper +``` + First, we want to set a kernel option so that our friends will know what kernel they are running. Run `./menuconfig` and set this option: @@ -230,8 +236,19 @@ Common Errors Rebasing -------- +If you want to update your kernel, rebase! + ```bash -git remote add kernel https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -git fetch kernel tag v6.12.y +git remote add stable https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git +git fetch stable tag v6.12.y # with 'y' being the latest version git rebase v6.12.y ``` + +Updating Submodules +------------------- + +If you want to update the submodules in the ev3-kernel (or you forgot to initialize them): + +```bash +git submodule update --init --recursive --remote +``` diff --git a/setup-env b/setup-env index 7f958cb..d0d2bb3 100755 --- a/setup-env +++ b/setup-env @@ -54,8 +54,8 @@ export EV3DEV_KERNEL_FLAVOR=${EV3DEV_KERNEL_FLAVOR-"ev3"} export EV3DEV_BUILD_AREA=${EV3DEV_BUILD_AREA-"$(pwd)/build-area"} export EV3DEV_MERGE_CMD=${EV3DEV_MERGE_CMD-"vimdiff \$file1 \$file2"} -export EV3DEV_TOOLCHAIN=${EV3DEV_TOOLCHAIN-"/usr/bin"} -export EV3DEV_ABI=${EV3DEV_ABI-"/arm-linux-gnueabihf-"} +export EV3DEV_TOOLCHAIN=${EV3DEV_TOOLCHAIN-"/usr/bin/"} +export EV3DEV_ABI=${EV3DEV_ABI-"arm-linux-gnueabi-"} if [ "$EV3DEV_KERNEL_FLAVOR" = "ev3" ]; then