Home | Projects | Notes > Linux Kernel Analysis > Environment Setup

Environment Setup

 

Repository Setup

  1. Create a GitHub repository to which you want to import the Linux kernel source. (e.g., https://github.com/kyungjae-lee/linux-kernel-v6.4.2.git)

  2. Clone the Linux kernel source repository to your local machine.

    The last argument specifies the name of the local directory into which the Linux kernel source will be cloned.

  3. Move into the local directory

  4. Remove the .git directory.

  5. Restructure your local directory according to your needs. (I've moved the entire source tree into a newly created subdirectory named linux.)

  6. Convert the local directory to a Git repository.

  7. Create a new remote called origin located at your GitHub repository.

    Once you do this, in your push commands, you can push to origin instead of typing out the whole URL.

  8. Add the change in the working directory to the staging area.

  9. Perform the initial commit.

  10. Push your local changes to your online repository.

 

Build Tool Installation

 

Kernel Build (Cross-Compilation)

Using a Shell Script

  1. Create a shell script in the root path of the local directory.

  2. Give the shell script execute permission.

  3. Run the shell script.

    When the build is complete, vmlinux will be created in out/, and Image will be generated in out/arch/arm64/boot/.