Step 2 : Compile Openwrt Linux

  • In this program, you are going to learn

  • How to ?

Topics in this section,

  • Install qemu-system-arm package in the build system.

sudo apt-get install qemu-system-arm
  • Make sure current dir is $HOME

$ cd $HOME
  • Download the openwrt source code.

$ git clone https://git.openwrt.org/openwrt/openwrt.git
  • Go to the openwrt directory and update the feeds.

$ cd openwrt
$ ./scripts/feeds update -a
  • Replace the .config file by the default qemu x86-64 config file downloaded from the below link.

$ wget https://downloads.openwrt.org/releases/21.02.2/targets/armvirt/64/config.buildinfo
$ cp config.buildinfo .config
  • Run make command from “openwrt” directory to build the bare-linux

$ make
  • Once the build is done, the final target image will be present in the following directory.

$pwd
$HOME/openwrt/bin/targets/armvirt/64
test:64$ ls -l
total 329288
-rw-r--r-- 1 test test      2787 Jan 31 16:14 config.buildinfo
-rw-r--r-- 1 test test        71 Jan 31 16:14 feeds.buildinfo
-rw-r--r-- 1 test test 108354337 Jan 31 16:34 kernel-debug.tar.zst
-rw-r--r-- 1 test test      3585 Jan 31 16:34 openwrt-21.02.2-armvirt-64-default.manifest
-rw-r--r-- 1 test test   4957617 Jan 31 16:34 openwrt-21.02.2-armvirt-64-default-rootfs.tar.gz
-rwxr-xr-x 1 test test   9624064 Jan 31 16:34 openwrt-21.02.2-armvirt-64-Image
-rwxr-xr-x 1 test test  21551616 Jan 31 16:34 openwrt-21.02.2-armvirt-64-Image-initramfs
-rw-r--r-- 1 test test   4960901 Jan 31 16:34 openwrt-21.02.2-armvirt-64-rootfs.cpio.gz
-rw-r--r-- 1 test test   5076391 Jan 31 16:34 openwrt-21.02.2-armvirt-64-rootfs-ext4.img.gz
-rw-r--r-- 1 test test   4038448 Jan 31 16:34 openwrt-21.02.2-armvirt-64-rootfs-squashfs.img.gz
-rw-r--r-- 1 test test  69259584 Jan 31 16:35 openwrt-imagebuilder-21.02.2-armvirt-64.Linux-x86_64.tar.xz
-rw-r--r-- 1 test test 109265004 Jan 31 16:36 openwrt-sdk-21.02.2-armvirt-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz
drwxr-xr-x 2 test test     86016 Jan 31 16:36 packages
-rw-r--r-- 1 test test    117414 Jan 31 16:36 sha256sums
-rw-r--r-- 1 test test        18 Jan 31 16:14 version.buildinfo

What is /.bashrc file?