Janardhan's insights
Home PageEmotional Intelligence book
  • About Insights
  • Janardhanpulivarthi.com
  • Books I've read
  • Bridge Engineering
    • code and books
    • Pier calculations
    • Suspension cables
    • Seismic coefficients
    • Shear check in pilecap
    • finance tasks
    • /bin/sh: 1: flex: not found
    • Biology animations
  • 🏕️SEASON 1
    • Social formulation
    • Words in Computer Science
    • Best use of internet
    • Products for sustainability
    • Tools for parents in digital age
    • Identify books in library
    • Control digital footprint
    • Search like a Pro
    • Dev productivity tips & tools
    • McKinsey, How it operates
    • Secrets, which ones to share
    • How to be Straightforward
    • Productive procrastination
    • Everyday things
    • Future of waste
    • Emotional weather
    • Money rules
    • Qualities of an Artist
    • Shameful Inconsistency
    • Mean Sea Level
    • Screenshot on Windows
    • Edu loan EMI calculation
    • Advanced Gmail tips
    • 24 hours before an exam
    • FAQ - git
    • Life skills by 25
    • Install Microsoft IIS server
    • gcloud commands hang
    • Google Cloud Data Engineering
    • Google Cloud Architect
    • find location of the command
    • JNI short tutorial
    • Civil distance
    • Being a friend to children
    • How to talk to a teenager
    • Resilience and relationship
    • 9 to 5 vs 4 hour workweek
    • Return on Investment
    • Alternative to PFA
    • Hand position for Ctrl key
    • Education: The Good Parts
    • Education: The proposed parts
    • On feeling stuck
    • How to read Financial news
    • What is in my hands
    • Mistakes founders do
    • On Self Worth
    • Emotional draining situations
    • Time
    • Hygiene
    • 5 Percent rule
    • How not to build a startup
    • How to lead a mediocre life
    • Day-to-day tips from extraordinary people
    • Who owns .com domain
    • Do not make bed first thing in morning
    • How to read kubernetes docs
    • Do not use morning alarm
  • ☀️Season 2
    • Practicing self care
    • Payment methods
    • Things to learn before MBA
    • Hum toh udd gaye
    • Time windows
    • How to quit a job emotionally
    • Journal on a year after quitting
    • Engineering the future
    • Build linux kernel
    • Important inventions
    • bashrc and bash_profile
    • $TERM
    • How Kubernetes pod get terminated
    • What data does google collect? when you search...
    • Should I build a personal brand?
    • The better startup ideas
    • Regex in Visual Studio Code
    • Few pieces to read before breakfast
    • core file
    • How to keep home for ambience
    • 🐬A story on repetition
    • Basic Unicode characters
    • Java operator precedence
    • Install latest maven on Ubuntu
    • Build ecosystems, not only products
  • ⛈️SEASON 3
  • ❄️Season 4
    • Be original
    • Change and Contingency
    • Read and write email
    • How to use Pomodoro
    • Humans and software
    • Saving money without money
    • Five skills for Civil Engineers
    • Que sera sera
    • Keep scrolling
    • Being unemployed
    • Friendship and modularity
    • Happy is not a default emotion
    • The missing piece in the online courses
    • How to build products
    • I am always tired
    • Instead company subscribe to user
    • Car electric or diesel ask google ngram viewer
    • Emotional currency and binge watching
    • ADR
  • Known Nokia 7.1 problems
  • Coursera-dl HTTPError: 400
  • Failed to retrieve identities from agent
  • Custom domain email
  • Qwiklabs tips and tricks
  • Online shopping rules
  • Protect a apt package from upgrade
  • Kubernetes troubleshooting guide
  • TOOLS
    • Lenovo Ideapad
    • Quantum - Holevo's theorem
    • Install VPP on Ubuntu
  • Phone camera slider
  • Physical internet infrastructure
  • 100 Days Of Code - Learning Java
  • Blogs I found interesting
  • 5g
    • 5G Glossary
    • Archive
      • Latex and gitbook
      • Japan Progress
      • Online buying guide
      • ఏవిధంగా కృషి చేయాలి?
      • Tech prediction 2030
      • Alphabet Financials
      • Apachecoin does not exist
      • non profits
      • What to Google Search
      • Resume tips
      • Discussion before marriage
      • Wi-Fi
      • How to read
      • Basic soil test
Powered by GitBook
On this page
  • Get a copy of source code
  • Generate .config file
  • build a image
  • Errors
  • Video

Was this helpful?

Edit on GitHub
  1. Season 2

Build linux kernel

PreviousEngineering the futureNextImportant inventions

Last updated 1 year ago

Was this helpful?

Get a copy of source code

Take a copy of the linux kernel source repository via git software

git clone --depth=1 https://github.com/torvalds/linux

or download a zip file from this link -

Generate .config file

make menuconfig

menuconfig options

Here are the images of the some menuconfig options chosen.

Run make help to get the hints and options for building.

build a image

After that do, make bzImage.

/workspace/linux (master) $ make bzImage

  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
...
  GZIP    arch/x86/boot/compressed/vmlinux.bin.gz
  HOSTCC  arch/x86/boot/compressed/mkpiggy
  MKPIGGY arch/x86/boot/compressed/piggy.S
  AS      arch/x86/boot/compressed/piggy.o
  CC      arch/x86/boot/compressed/cpuflags.o
  CC      arch/x86/boot/compressed/early_serial_console.o
  CC      arch/x86/boot/compressed/kaslr.o
  CC      arch/x86/boot/compressed/ident_map_64.o
  CC      arch/x86/boot/compressed/idt_64.o
  AS      arch/x86/boot/compressed/idt_handlers_64.o
  AS      arch/x86/boot/compressed/mem_encrypt.o
  CC      arch/x86/boot/compressed/pgtable_64.o
  CC      arch/x86/boot/compressed/acpi.o
  AS      arch/x86/boot/compressed/efi_thunk_64.o
  LD      arch/x86/boot/compressed/vmlinux
  ZOFFSET arch/x86/boot/zoffset.h
  AS      arch/x86/boot/header.o
  CC      arch/x86/boot/main.o
  CC      arch/x86/boot/memory.o
  CC      arch/x86/boot/pm.o
  AS      arch/x86/boot/pmjump.o
  CC      arch/x86/boot/printf.o
  CC      arch/x86/boot/regs.o
  CC      arch/x86/boot/string.o
  CC      arch/x86/boot/tty.o
  CC      arch/x86/boot/video.o
  CC      arch/x86/boot/video-mode.o
  CC      arch/x86/boot/version.o
  CC      arch/x86/boot/video-vga.o
  CC      arch/x86/boot/video-vesa.o
  CC      arch/x86/boot/video-bios.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  OBJCOPY arch/x86/boot/vmlinux.bin
  HOSTCC  arch/x86/boot/tools/build
  BUILD   arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready  (#1)
/workspace/linux (master) $ 

Note Kernel: arch/x86/boot/bzImage is ready (#1).

Errors

fatal error: libelf.h: No such file or directory

/workspace/linux (master) $ make
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
...
  DESCEND objtool
<stdin>:1:10: fatal error: libelf.h: No such file or directory
compilation terminated.
  HOSTCC  /workspace/linux/tools/objtool/fixdep.o
...
  AR      /workspace/linux/tools/objtool/libsubcmd.a
  CC      /workspace/linux/tools/objtool/arch/x86/special.o
In file included from /workspace/linux/tools/objtool/include/objtool/objtool.h:13,
                 from /workspace/linux/tools/objtool/include/objtool/arch.h:11,
                 from /workspace/linux/tools/objtool/include/objtool/check.h:11,
                 from /workspace/linux/tools/objtool/include/objtool/special.h:10,
                 from arch/x86/special.c:4:
/workspace/linux/tools/objtool/include/objtool/elf.h:10:10: fatal error: gelf.h: No such file or directory
   10 | #include <gelf.h>
      |          ^~~~~~~~
compilation terminated.
make[4]: *** [/workspace/linux/tools/build/Makefile.build:97: /workspace/linux/tools/objtool/arch/x86/special.o] Error 1
make[3]: *** [/workspace/linux/tools/build/Makefile.build:139: arch/x86] Error 2
make[2]: *** [Makefile:56: /workspace/linux/tools/objtool/objtool-in.o] Error 2
make[1]: *** [Makefile:69: objtool] Error 2
make: *** [Makefile:1337: tools/objtool] Error 2

Install libelf-dev package

/workspace/linux (master) $ make bzImage
  SYNC    include/config/auto.conf.cmd
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
*
* Restart config...
*
*
* Control Group support
*
Control Group support (CGROUPS) [Y/n/?] y
  Favor dynamic modification latency reduction by default (CGROUP_FAVOR_DYNMODS) [N/y/?] (NEW) y

aa

/workspace/linux (master) $ make bzImage
  SYNC    include/config/auto.conf.cmd
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
*
* Restart config...
*
*
* Control Group support
*
Control Group support (CGROUPS) [Y/n/?] y
  Favor dynamic modification latency reduction by default (CGROUP_FAVOR_DYNMODS) [N/y/?] (NEW) y

Video

☀️
Page cover image
https://github.com/torvalds/linux/archive/refs/heads/master.zip
menuconfig
Options
kernel .config support
Module unloading
Kernel Function Tracer