Last active
January 18, 2023 07:42
-
-
Save ookiineko/cbf7864b0a8275c187e729d8f8117595 to your computer and use it in GitHub Desktop.
personal script for generating Android boot image for archlinux ARM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
_create_boot_image() { | |
mkbootimg --kernel /boot/Image.gz-dtb \ | |
--ramdisk /boot/initramfs-linux.img \ | |
--cmdline "root=/dev/sda15 rw loglevel=5 ${1}" \ | |
--base 0x80000000 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 \ | |
--second_offset 0x00f00000 --os_version "11.0.0" --os_patch_level "2022-07" \ | |
--tags_offset 0x00000100 --board "" --pagesize 4096 --header_version 0 \ | |
--output "${2}" | |
} | |
echo -n '=> Updating Image.gz-dtb... ' | |
cat /boot/Image.gz /boot/dtbs/qcom/msm8996pro-xiaomi-scorpio.dtb > /boot/Image.gz-dtb | |
echo 'OK' | |
echo -n '=> Updating boot.img... ' | |
_create_boot_image "" /boot/boot.img | |
echo 'OK' | |
echo -n '=> Updating boot-rescue.img... ' | |
_create_boot_image "init=/bin/bash" /boot/boot-rescue.img | |
echo 'OK' | |
echo 'NOTE: run "dd if=/boot/boot.img of=/dev/sde36" to flash your new boot image.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment