You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@echo ' ARCH - Specify one of the supported architectures: x86_64, i386, arm64 (default: x86_64)'
43
-
@echo ' ACK - Set to 1 if building ACK instead of the Linux kernel. Does not need to be set for `ack` and `run-ack` targets (default: 0)'
43
+
@echo ' ACK - Set to 1 to build ACK instead of the Linux kernel. Does not need to be set for `ack` and `run-ack` targets (default: 0)'
44
44
@echo ' VERBOSE - Set to 1 to enable verbose output (default: 0)'
45
45
@echo ''
46
46
@echo '$(GREEN)Build/Config:$(NC)'
47
47
@echo ' Targets:'
48
-
@echo ' linux (default) - Builds the Linux kernel'
49
-
@echo ' linux_defconfig - Builds the Linux kernel'
50
-
@echo ' linux_modules - Builds the Linux kernel modules'
48
+
@echo ' linux (default) - Build the Linux kernel'
49
+
@echo ' linux_defconfig - Run `make defconfig`'
50
+
@echo ' linux_menuconfig - Run `make menuconfig`'
51
+
@echo ' linux_modules - Build the Linux kernel modules'
51
52
@echo ' linux_debpkg - Creates a Debian package for the kernel'
52
-
@echo ' ack - Builds the Android Common Kernel'
53
-
@echo ' tools-vm - Builds linux/tools/vm'
53
+
@echo ' ack - Build the Android Common Kernel'
54
+
@echo ' tools-vm - Build linux/tools/vm'
54
55
@echo ''
55
56
@echo ' Environment Variables:'
56
57
@echo ' LINUX_DEFCONFIG - The defconfig to use when building the kernel (default: defconfig, ACK default: gki_defconfig)'
57
58
@echo ' LINUX_SRC - The path to the kernel source directory (default: linux, ACK default: ack/common)'
58
59
@echo ' LINUX_OUT - The path where the kernel build output should be stored (default: out/linux/$$ARCH, ACK default: out/ack/common/$$ARCH)'
59
-
@echo ' LINUX_CONFIG_FRAGMENT - A kernel config fragment to merge with the defconfig (default: config/config.fragment, ACK default: config/config.fragment)'
60
+
@echo ' LINUX_CONFIG_FRAGMENT - A kernel config fragment to merge with the defconfig (default: config/config.fragment)'
60
61
@echo ''
61
62
@echo '$(GREEN)Clean:$(NC)'
62
63
@echo ' Targets:'
63
-
@echo ' clean - Cleans output from default build targets'
64
-
@echo ' <target>_clean - Cleans output for <target>'
64
+
@echo ' clean - Clean output from default build targets'
65
+
@echo ' <target>_clean - Clean output for <target>, where <target> is one of: ack, linux, tools-vm, rootfs'
65
66
@echo ''
66
67
@echo '$(GREEN)Run/Debug:$(NC)'
67
68
@echo ' Targets:'
68
-
@echo ' run - Run QEMU with the built kernel, bootloader, and rootfs image'
69
+
@echo ' run - Run QEMU with the built kernel and rootfs image'
69
70
@echo ' run-ack - Same as `run` but runs ACK instead'
70
71
@echo ''
71
72
@echo ' Environment Variables:'
72
73
@echo ' GDB - Set to 1 to start a gdbserver and wait for GDB when running QEMU (default: 0)'
73
-
@echo ' CPU - Specify the number of CPUs to use when running QEMU (default: 4)'
74
-
@echo ' MEM - Specify the memory size in MB to use when running QEMU (default: 1024)'
75
-
@echo ' QEMU_EXTRA_ARGS - Specify additional arguments to pass to QEMU (default: "")'
76
-
@echo ' QEMU_EXTRA_KERNEL_CMDLINE - Specify additional arguments to pass to the kernel (default: "")'
77
-
@echo ' QEMU_KERNEL_IMAGE - The path to the kernel image to run (x86_64 default: $$LINUX_OUT/arch/$$ARCH/boot/bzImage, arm64 default: $$LINUX_OUT/arch/$$ARCH/boot/Image)'
78
-
@echo ' ROOTFS - The path to the rootfs image file (default: rootfs/rootfs-$$ARCH.img)'
79
-
@echo ' ROOTFS_FORMAT - The format of the rootfs image file (default: qcow2)'
80
-
@echo ' INITRD - The path to a gziped initramfs CPIO file to use instead of a rootfs image (default: "")'
81
-
@echo ' RDINIT - The value of the `rdinit` kernel command line paramter (default: "", default if INITRD is set: /sbin/init)'
74
+
@echo ' CPU - The number of CPUs to use when running QEMU (default: 4)'
75
+
@echo ' MEM - The memory size in MB to use when running QEMU (default: 1024)'
76
+
@echo ' QEMU_EXTRA_ARGS - Additional arguments to pass to QEMU (default: "")'
77
+
@echo ' QEMU_EXTRA_KERNEL_CMDLINE - Additional arguments to pass to the kernel (default: "")'
78
+
@echo ' QEMU_KERNEL_IMAGE - The path to the kernel image to run (x86_64/i386 default: $$LINUX_OUT/arch/$$ARCH/boot/bzImage, arm64 default: $$LINUX_OUT/arch/$$ARCH/boot/Image)'
79
+
@echo ' ROOTFS - The path to the rootfs image file (default: rootfs/alpine-$$ARCH.img)'
80
+
@echo ' ROOTFS_FORMAT - The format of the rootfs image file: raw, qcow2 (default: qcow2)'
81
+
@echo ' INITRD - Set to 1 to use the $$CPIO_FILE initramfs instead of the $$ROOTFS image as the rootfs, or specify the path to an alternative CPIO file (default: "")'
82
+
@echo ' RDINIT - The value of the `rdinit` kernel command line parameter (default: "", default if INITRD is set: /sbin/init)'
83
+
@echo ' ECHR - The value of the QEMU `-echr` flag (default: 1)'
84
+
@echo ' ROOT - The value of the `root` kernel command line parameter (default: /dev/vda)'
85
+
@echo ' RW - Whether to mount the rootfs as read-write or read-only: ro, rw (default: rw)'
86
+
@echo ' KASLR - Set to 1 to enable KASLR (default: 0)'
82
87
@echo ''
83
88
@echo '$(GREEN)rootfs:$(NC)'
84
89
@echo ' Targets:'
85
-
@echo ' rootfs-init - Extracts the Alpine Linux rootfs to rootfs/alpine-$$ARCH, makes arch-specific changes, and builds a rootfs image at rootfs/alpine-$$ARCH.img'
86
-
@echo ' rootfs - An alias for the `ext4` target'
87
-
@echo ' ext4 - Builds a QCOW2 rootfs image at rootfs/alpine-$$ARCH.img with an ext4 filesystem'
88
-
@echo ' cpio - Builds a gziped initramfs CPIO file from the $$INITRAMFS_DIR directory'
89
-
@echo ' rootfs-mount - Mount rootfs image at /tmp/rootfs'
90
-
@echo ' rootfs-unmount - Unmount rootfs image'
90
+
@echo ' rootfs-init - Extract the Alpine Linux rootfs to $$ROOTFS_DIR and then run the `rootfs-overlay` target'
91
+
@echo ' rootfs-overlay - Apply arch-specific changes to $$ROOTFS_DIR and run the `rootfs` target'
92
+
@echo ' rootfs - Run the `ext4` and `cpio` targets'
93
+
@echo ' ext4 - Build a $$ROOTFS $$ROOTFS_FORMAT (default qcow2) image with an ext4 filesystem from $$ROOTFS_DIR'
94
+
@echo ' cpio - Build a $$CPIO_FILE gzipped initramfs CPIO file from $$ROOTFS_DIR'
95
+
@echo ' initramfs - An alias for the `cpio` target'
96
+
@echo ' uncpio - Extract $$CPIO_FILE to $$ROOTFS_DIR'
97
+
@echo ' rootfs-mount - Mount $$ROOTFS image at /tmp/rootfs'
98
+
@echo ' rootfs-unmount - Unmount rootfs image from /tmp/rootfs'
99
+
@echo ' chroot - chroot into $$ROOTFS_DIR'
91
100
@echo ''
92
101
@echo ' Environment Variables:'
93
102
@echo ' EXT4_SIZE - The disk size of the rootfs image to build'
94
103
@echo ' ROOTFS_DIR - The directory to create the ext4 rootfs image and initramfs CPIO from (default: rootfs/alpine-$$ARCH)'
95
-
@echo ' ROOTFS - The path to the rootfs image file (default: rootfs/rootfs-$$ARCH.img)'
96
-
@echo ' ROOTFS_FORMAT - The format of the rootfs image file (default: qcow2)'
104
+
@echo ' ROOTFS - The path to the rootfs image file (default: rootfs/alpine-$$ARCH.img)'
105
+
@echo ' ROOTFS_FORMAT - The format of the rootfs image file: raw, qcow2 (default: qcow2)'
106
+
@echo ' CPIO_FILE - The path to the CPIO file to create (default: rootfs/alpine-$$ARCH.cpio.gz)'
Copy file name to clipboardExpand all lines: README.md
+41-31Lines changed: 41 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,69 +52,79 @@ ARCH=arm64 make run
52
52
```
53
53
$ make help
54
54
General Environment Variables:
55
-
ARCH - Specify one of the supported architectures: x86_64, arm64 (default: x86_64)
56
-
ACK - Set to 1 if building ACK instead of the Linux kernel. Does not need to be set for `ack` and `run-ack` targets (default: 0)
55
+
ARCH - Specify one of the supported architectures: x86_64, i386, arm64 (default: x86_64)
56
+
ACK - Set to 1 to build ACK instead of the Linux kernel. Does not need to be set for `ack` and `run-ack` targets (default: 0)
57
57
VERBOSE - Set to 1 to enable verbose output (default: 0)
58
58
59
59
Build/Config:
60
60
Targets:
61
-
linux (default) - Builds the Linux kernel
62
-
linux_defconfig - Builds the Linux kernel
63
-
linux_modules - Builds the Linux kernel modules
64
-
ack - Builds the Android Common Kernel
65
-
tools-vm - Builds linux/tools/vm
61
+
linux (default) - Build the Linux kernel
62
+
linux_defconfig - Run `make defconfig`
63
+
linux_menuconfig - Run `make menuconfig`
64
+
linux_modules - Build the Linux kernel modules
65
+
linux_debpkg - Creates a Debian package for the kernel
66
+
ack - Build the Android Common Kernel
67
+
tools-vm - Build linux/tools/vm
66
68
67
69
Environment Variables:
68
70
LINUX_DEFCONFIG - The defconfig to use when building the kernel (default: defconfig, ACK default: gki_defconfig)
69
71
LINUX_SRC - The path to the kernel source directory (default: linux, ACK default: ack/common)
70
72
LINUX_OUT - The path where the kernel build output should be stored (default: out/linux/$ARCH, ACK default: out/ack/common/$ARCH)
71
-
LINUX_CONFIG_FRAGMENT - A kernel config fragment to merge with the defconfig (default: config/config.fragment, ACK default: config/config.fragment)
73
+
LINUX_CONFIG_FRAGMENT - A kernel config fragment to merge with the defconfig (default: config/config.fragment)
72
74
73
75
Clean:
74
76
Targets:
75
-
clean - Cleans output from default build targets
76
-
<target>_clean - Cleans output for <target>
77
+
clean - Clean output from default build targets
78
+
<target>_clean - Clean output for <target>, where <target> is one of: ack, linux, tools-vm, rootfs
77
79
78
80
Run/Debug:
79
81
Targets:
80
-
run - Run QEMU with the built kernel, bootloader, and rootfs image
82
+
run - Run QEMU with the built kernel and rootfs image
81
83
run-ack - Same as `run` but runs ACK instead
82
84
83
85
Environment Variables:
84
86
GDB - Set to 1 to start a gdbserver and wait for GDB when running QEMU (default: 0)
85
-
CPU - Specify the number of CPUs to use when running QEMU (default: 4)
86
-
MEM - Specify the memory size in MB to use when running QEMU (default: 1024)
87
-
QEMU_EXTRA_ARGS - Specify additional arguments to pass to QEMU (default: "")
88
-
QEMU_EXTRA_KERNEL_CMDLINE - Specify additional arguments to pass to the kernel (default: "")
89
-
KERNEL_IMAGE - The path to the kernel image to run (x86_64 default: $LINUX_OUT/arch/$ARCH/boot/bzImage, arm64 default: $LINUX_OUT/arch/$ARCH/boot/Image)
90
-
ROOTFS - The path to the rootfs image file (default: rootfs/rootfs-$ARCH.img)
91
-
ROOTFS_FORMAT - The format of the rootfs image file (default: qcow2)
92
-
INITRD - The path to a gziped initramfs CPIO file to use instead of a rootfs image (default: "")
93
-
RDINIT - The value of the `rdinit` kernel command line paramter (default: "", default if INITRD is set: /sbin/init)
87
+
CPU - The number of CPUs to use when running QEMU (default: 4)
88
+
MEM - The memory size in MB to use when running QEMU (default: 1024)
89
+
QEMU_EXTRA_ARGS - Additional arguments to pass to QEMU (default: "")
90
+
QEMU_EXTRA_KERNEL_CMDLINE - Additional arguments to pass to the kernel (default: "")
91
+
QEMU_KERNEL_IMAGE - The path to the kernel image to run (x86_64/i386 default: $LINUX_OUT/arch/$ARCH/boot/bzImage, arm64 default: $LINUX_OUT/arch/$ARCH/boot/Image)
92
+
ROOTFS - The path to the rootfs image file (default: rootfs/alpine-$ARCH.img)
93
+
ROOTFS_FORMAT - The format of the rootfs image file: raw, qcow2 (default: qcow2)
94
+
INITRD - Set to 1 to use the $CPIO_FILE initramfs instead of the $ROOTFS image as the rootfs, or specify the path to an alternative CPIO file (default: "")
95
+
RDINIT - The value of the `rdinit` kernel command line parameter (default: "", default if INITRD is set: /sbin/init)
96
+
ECHR - The value of the QEMU `-echr` flag (default: 1)
97
+
ROOT - The value of the `root` kernel command line parameter (default: /dev/vda)
98
+
RW - Whether to mount the rootfs as read-write or read-only: ro, rw (default: rw)
99
+
KASLR - Set to 1 to enable KASLR (default: 0)
94
100
95
101
rootfs:
96
102
Targets:
97
-
rootfs-init - Extracts the Alpine Linux rootfs to rootfs/alpine-$ARCH, makes arch-specific changes, and builds a rootfs image at rootfs/alpine-$ARCH.img
98
-
rootfs - An alias for the `ext4` target
99
-
ext4 - Builds a QCOW2 rootfs image at rootfs/alpine-$ARCH.img with an ext4 filesystem
100
-
cpio - Builds a gziped initramfs CPIO file from the $INITRAMFS_DIR directory
101
-
rootfs-mount - Mount rootfs image at /tmp/rootfs
102
-
rootfs-unmount - Unmount rootfs image
103
+
rootfs-init - Extract the Alpine Linux rootfs to $ROOTFS_DIR and then run the `rootfs-overlay` target
104
+
rootfs-overlay - Apply arch-specific changes to $ROOTFS_DIR and run the `rootfs` target
105
+
rootfs - Run the `ext4` and `cpio` targets
106
+
ext4 - Build a $ROOTFS $ROOTFS_FORMAT (default qcow2) image with an ext4 filesystem from $ROOTFS_DIR
107
+
cpio - Build a $CPIO_FILE gzipped initramfs CPIO file from $ROOTFS_DIR
108
+
initramfs - An alias for the `cpio` target
109
+
uncpio - Extract $CPIO_FILE to $ROOTFS_DIR
110
+
rootfs-mount - Mount $ROOTFS image at /tmp/rootfs
111
+
rootfs-unmount - Unmount rootfs image from /tmp/rootfs
112
+
chroot - chroot into $ROOTFS_DIR
103
113
104
114
Environment Variables:
105
115
EXT4_SIZE - The disk size of the rootfs image to build
106
-
INITRAMFS_DIR - The directory to create the initramfs from (default: rootfs/alpine-$ARCH)
107
-
ROOTFS_DIR - The directory to create the ext4/rootfs image from (default: rootfs/alpine-$ARCH)
108
-
ROOTFS- The path to the rootfs image file(default: rootfs/rootfs-$ARCH.img)
109
-
ROOTFS_FORMAT - The format of the rootfs image file (default: qcow2)
116
+
ROOTFS_DIR- The directory to create the ext4 rootfs image and initramfs CPIO from (default: rootfs/alpine-$ARCH)
117
+
ROOTFS- The path to the rootfs image file (default: rootfs/alpine-$ARCH.img)
118
+
ROOTFS_FORMAT - The format of the rootfs image file: raw, qcow2 (default: qcow2)
119
+
CPIO_FILE- The path to the CPIO file to create (default: rootfs/alpine-$ARCH.cpio.gz)
110
120
111
121
Miscellaneous:
112
122
Targets:
113
123
linux_download - Downloads an archive of the Linux kernel source for the version specified in $VERSION
114
124
linux_checkout - Checks out the version specified by $VERSION of the linux kernel in $LINUX_SRC
115
125
116
126
Environment Variables:
117
-
VERSION - The version to download or checkout. If the patch version is a 'y', the latest version of the kernel with that major and minor version is used. Examples: 5.10, 5.10.107, v5.10, 5.10.y, linux-5.10.y, android13-5.10
127
+
VERSION - The version to download or checkout. For checkout only, if the third number in the version string is a 'y', the latest version of the kernel with that major and minor version is used. Examples: 5.10, 5.10.107, v5.10, 5.10.y, linux-5.10.y
0 commit comments