Skip to content

Commit

Permalink
not build with esp partition
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingfate committed Sep 22, 2023
1 parent 7214163 commit d18b32a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
24 changes: 3 additions & 21 deletions create-seperated-image.sh
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
#!/bin/bash
set -ex
image_name=$1
efi_start_sector=$(gdisk -l ./${image_name}|grep efi|awk '{print $2}')
efi_end_sector=$(gdisk -l ./${image_name}|grep efi|awk '{print $3}')
rootfs_start_sector=$(gdisk -l ./${image_name}|grep rootfs|awk '{print $2}')
rootfs_end_sector=$(gdisk -l ./${image_name}|grep rootfs|awk '{print $3}')
rm esp*.img rootfs*.img ||true
dd if=./${image_name} skip=${efi_start_sector} count=$((${efi_end_sector} - ${efi_start_sector})) of=esp.img
rm rootfs*.img ||true
dd if=./${image_name} skip=${rootfs_start_sector} count=$((${rootfs_end_sector} - ${rootfs_start_sector})) of=rootfs.img
rm ${image_name}

old_rootfs_image=rootfs.img
old_rootfs_image_mount_dir=rootfs
old_rootfs_image_uuid=$(blkid -s UUID -o value ${old_rootfs_image})
old_esp_image=esp.img
old_esp_image_mount_dir=esp
old_esp_image_uuid=$(blkid -s UUID -o value ${old_esp_image})
new_rootfs_image=${image_name%*.img}-rootfs.img
new_rootfs_image_mount_dir=rootfs-new
new_esp_image=${image_name%*.img}-esp.img
new_esp_image_mount_dir=esp-new
mkdir -p ${old_rootfs_image_mount_dir} ${old_esp_image_mount_dir} ${new_rootfs_image_mount_dir} ${new_esp_image_mount_dir}
mkdir -p ${old_rootfs_image_mount_dir} ${new_rootfs_image_mount_dir}
truncate --size=8192M ${new_rootfs_image}
truncate --size=200M ${new_esp_image}
mkfs.fat -S 4096 ${new_esp_image}
mkfs.ext4 -F ${new_rootfs_image}
new_esp_image_uuid=$(blkid -s UUID -o value ${new_esp_image})
new_rootfs_image_uuid=$(blkid -s UUID -o value ${new_rootfs_image})
sudo mount ${old_esp_image} ${old_esp_image_mount_dir}
sudo mount ${new_esp_image} ${new_esp_image_mount_dir}
sudo cp -rfp ${old_esp_image_mount_dir}/* ${new_esp_image_mount_dir}/
sudo umount ${new_esp_image_mount_dir}
sudo umount ${old_esp_image_mount_dir}
sudo mount ${old_rootfs_image} ${old_rootfs_image_mount_dir}
sudo mount ${new_rootfs_image} ${new_rootfs_image_mount_dir}
sudo cp -rfp ${old_rootfs_image_mount_dir}/* ${new_rootfs_image_mount_dir}/
sudo sed -i "s|${old_rootfs_image_uuid}|${new_rootfs_image_uuid}|g" ${new_rootfs_image_mount_dir}/etc/fstab
sudo sed -i "s|${old_esp_image_uuid}|${new_esp_image_uuid}|g" ${new_rootfs_image_mount_dir}/etc/fstab
gzip -c ./${new_rootfs_image_mount_dir}/boot/vmlinuz-*-sm8250-arm64 > Image.gz
for panel_type in boe csot
do
Expand All @@ -58,7 +41,6 @@ sudo umount ${old_rootfs_image_mount_dir}
e2fsck -p -f ${new_rootfs_image}
resize2fs -M ${new_rootfs_image}
xz -z -T0 ${new_rootfs_image}
xz -z -T0 ${new_esp_image}
xz -z -T0 armbian-kernel-boe.img
xz -z -T0 armbian-kernel-csot.img
rm ${old_rootfs_image} ${old_esp_image} ||true
rm ${old_rootfs_image} ||true
11 changes: 11 additions & 0 deletions qcom-abl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
#
# Important: LINUXFAMILY and ARCH are defined _before_ including the common family include
declare -g LINUXFAMILY="arm64"
declare -g ARCH="arm64"
12 changes: 4 additions & 8 deletions xiaomi-elish.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# aarch64 via UEFI for all UEFI-enabled boards
declare -g BOARD_NAME="Xiaomi Elish"
declare -g BOARDFAMILY="uefi-arm64"
declare -g BOARD_MAINTAINER="rpardini"
declare -g BOARD_MAINTAINER="amazingfate"
declare -g BOARDFAMILY="qcom-abl"
declare -g KERNEL_TARGET="sm8250"
declare -g EXTRAWIFI="no"
declare -g MODULES="spi-geni-qcom nt36523_ts"

declare -g BOOT_LOGO=desktop

# This board boots via EFI/Grub, but requires a DTB to be passed, from Grub, to the Kernel.
declare -g BOOT_FDT_FILE="qcom/sm8250-xiaomi-elish-boe.dtb"
enable_extension "grub-with-dtb" # important, puts the whole DTB handling in place.
declare -g BOOTCONFIG="none"
declare -g IMAGE_PARTITION_TABLE="gpt"

function post_family_config_branch_sm8250__pmos_kernel() {
display_alert "Setting up steev's kernel for" "${BOARD}" "warn"
Expand Down

0 comments on commit d18b32a

Please sign in to comment.