Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 97 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,17 @@ docker build -t kmake-image .
```

### 2. Setup the aliases in your .bashrc

Explicitly add a uid:gid entry in a file a pass it with docker start command.
```
alias kmake-image-run='docker run -it --rm --user $(id -u):$(id -g) --workdir="$PWD" -v "$(dirname $PWD)":"$(dirname $PWD)" kmake-image'
cd kernel
#Make sure you are in the kernel source directory before giving below commands
passwd_b4=$(mktemp)
echo "user:x:$(id -u):$(id -g):User:/:/bin/bash" > "$passwd_b4"
```

```
alias kmake-image-run='docker run -it --rm --user $(id -u):$(id -g) --workdir="$PWD" -v "$passwd_b4":/etc/passwd:ro -v "$(dirname $PWD)":"$(dirname $PWD)" kmake-image'
alias kmake='kmake-image-run make'
```

Expand Down Expand Up @@ -165,6 +174,14 @@ fastboot reboot bootloader
fastboot boot images/boot.img
```

### 10. Or Build Ubuntu Kernel deb packages

```
kmake mrproper O=../debian
kmake defconfig O=../debian
kmake -j16 O=../debian bindeb-pkg
```

## Finer Details

### kmake-image-run
Expand Down Expand Up @@ -268,5 +285,84 @@ kmake-image-run mkbootimg \
--output boot.img
```

### Install kernel deb packages

Kernel deb packages can be built using
https://github.com/qualcomm-linux/kmake-image?tab=readme-ov-file#10-Or-Build-Ubuntu-Kernel-deb-packages

The linux-image-<kernel_ver>_arm64.deb contains kernel image and modules.
Copy the deb package to the device. Either, via copying it to system.img
or adb push command or via some Ethernet/WIFI/NW interface. Once the package
is on device and the device is booted, install the deb package on device
using "dpkg -i" to install the kernel image and the modules on the device
and reboot the device. Below are examples of how this can be achieved.

Build Ubuntu Kernel deb packages
https://github.com/qualcomm-linux/kmake-image?tab=readme-ov-file#10-Or-Build-Ubuntu-Kernel-deb-packages

#### Method 1: Mount and flash via system image:

1. Copy the system.img from the flat META to your linux machine.
2. mount the system.img and copy kernel deb package to it.
```
mkdir ./temp
sudo mount system.img ./temp
sudo cp /<path>/linux-image-6.17.0-rc7-dbg_6.17.0~rc7-7_arm64.deb ./temp
sudo umount ./temp
```

3. Put the device in fastboot mode and flash system.img OR copy the updated system.img
as a flat META and flash device via image downloader tool.
```
fastboot flash system system.img
fastboot reboot
```
4. Once device is booted, run below commands on device to install kernel and modules.
```
dpkg -i /linux-image-6.17.0-rc7-dbg_6.17.0~rc7-7_arm64.deb
reboot
```
#After reboot your kernel will be booted on device.

#### Method 2: Use Ubuntu distro daily image:
1. Build a ubuntu.img using below steps using ubuntu daily image:
https://github.com/qualcomm-linux/qcom-build-utils/tree/latest

2. Once built, you get ubuntu.img and espefi.bin.
Copy ubuntu.img and espefi.bin back to the flat META. Rename them as system.img
and efi.bin respectivly.

3. Flash the above flat META to boot your device.

4. mount the ubuntu.img and copy kernel deb package to it:
```
mkdir ./temp
sudo mount ubuntu.img ./temp
sudo cp /<path>/linux-image-6.17.0-rc7-dbg_6.17.0~rc7-7_arm64.deb ./temp
sudo umount ./temp
```
5. Put the device in fastboot mode and flash ubuntu.img:
```
fastboot flash system ubuntu.img
fastboot reboot
```

6. Once device is booted, run below commands on device to install kernel and modules.
```
dpkg -i /linux-image-6.17.0-rc7-dbg_6.17.0~rc7-7_arm64.deb
reboot
```
#After reboot your kernel will be booted on device.

#### Method 3: You have a booted ubuntu distro with adb or internet(via WIFI or Ethernet)

1. Once device is booted, copy the deb package to the booted deivce via N/W or adb.
Run below commands on device to install kernel and modules.
```
dpkg -i /linux-image-6.17.0-rc7-dbg_6.17.0~rc7-7_arm64.deb
reboot
```
#After reboot your kernel will be booted on device.

## License
kmake-image is licensed under the [*BSD-3-clause-clear License*](https://spdx.org/licenses/BSD-3-Clause-Clear.html). See [*LICENSE*](https://github.com/qualcomm-linux/kmake-image/blob/main/LICENSE) for the full license text.
Loading