Cleanup odroid

This commit is contained in:
Pascal Vizeli
2018-08-22 22:15:08 +00:00
parent 3b45011982
commit 9b170812d6
131 changed files with 91 additions and 64 deletions

View File

@@ -219,7 +219,7 @@ function create_disk_mbr() {
# Update disk layout
(
echo "label: dos"
echo "label-id: 0x0d3e0000"
echo "label-id: 0x48617373"
echo "unit: sectors"
echo "hassos-boot : start= ${boot_start}, size= ${boot_size}, type=c, bootable" #create the boot partition
echo "hassos-extended : start= ${extended_start}, size= ${extended_size}, type=5" #Make an extended partition

View File

@@ -4,9 +4,10 @@ set -e
SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts
BOARD_DIR=${2}
. ${BR2_EXTERNAL_HASSOS_PATH}/meta
. ${BOARD_DIR}/meta
. ${SCRIPT_DIR}/rootfs-layer.sh
. ${BR2_EXTERNAL_HASSOS_PATH}/info
. ${BOARD_DIR}/info
. ${SCRIPT_DIR}/name.sh
. ${SCRIPT_DIR}/rauc.sh
@@ -35,7 +36,7 @@ install_hassos_cli
) > ${TARGET_DIR}/etc/machine-info
# Setup rauc
# Setup RAUC
write_rauc_config
install_rauc_certs
install_bootloader_config

View File

@@ -23,36 +23,35 @@ function _write_rauc_boot() {
local boot_device=${1}
(
echo "[slot.boot.0]"
echo "device=${boot_device}"
echo "device=/dev/disk/by-partlabel/hassos-boot"
echo "type=vfat"
) >> ${TARGET_DIR}/etc/rauc/system.conf
if [ "${BOOT_SYS}" != "spl" ]; then
# SPL
if ! [[ "${BOOT_SYS}" =~ (spl|mbr) ]]; then
return 0
fi
(
echo "[slot.spl.0]"
echo "device=${boot_device}"
echo "device=/dev/disk/by-partlabel/hassos-boot"
echo "type=raw"
) >> ${TARGET_DIR}/etc/rauc/system.conf
}
function _write_rauc_system() {
local kernel_device=${1}
local system_device=${2}
local slot_num=${3}
local slot_name=${4}
local slot_num=${1}
local slot_name=${2}
(
echo "[slot.kernel.${slot_num}]"
echo "device=${kernel_device}"
echo "device=/dev/disk/by-partlabel/hassos-kernel${slot_num}"
echo "type=ext4"
echo "bootname=${slot_name}"
echo "[slot.rootfs.${slot_num}]"
echo "device=${system_device}"
echo "device=/dev/disk/by-partlabel/hassos-system${slot_num}"
echo "type=raw"
echo "parent=kernel.${slot_num}"
) >> ${TARGET_DIR}/etc/rauc/system.conf
@@ -60,18 +59,12 @@ function _write_rauc_system() {
function write_rauc_config() {
local boot_d="${PART_BOOT:-/dev/disk/by-partlabel/hassos-boot}"
local kernel_d0="${PART_KERNEL_0:-/dev/disk/by-partlabel/hassos-kernel0}"
local system_d0="${PART_SYSTEM_0:-/dev/disk/by-partlabel/hassos-system0}"
local kernel_d1="${PART_KERNEL_1:-/dev/disk/by-partlabel/hassos-kernel1}"
local system_d1="${PART_SYSTEM_1:-/dev/disk/by-partlabel/hassos-system1}"
mkdir -p ${TARGET_DIR}/etc/rauc
_create_rauc_header
_write_rauc_boot "${boot_d}"
_write_rauc_system "${kernel_d0}" "${system_d0}" 0 A
_write_rauc_system "${kernel_d1}" "${system_d1}" 1 B
_write_rauc_boot
_write_rauc_system 0 A
_write_rauc_system 1 B
}
@@ -85,11 +78,15 @@ function install_rauc_certs() {
function install_bootloader_config() {
local boot_env="${BOOT_ENV:-/dev/disk/by-partlabel/hassos-bootstate}"
local boot_env_off="${BOOT_ENV_OFF:-0x0000}"
if [ "${BOOTLOADER}" == "uboot" ]; then
echo -e "${boot_env}\t${boot_env_off}\t${BOOT_ENV_SIZE}" > ${TARGET_DIR}/etc/fw_env.config
echo -e "/dev/disk/by-partlabel/hassos-bootstate\t0x0000\t${BOOT_ENV_SIZE}" > ${TARGET_DIR}/etc/fw_env.config
else
cp ${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb ${TARGET_DIR}/etc/barebox-state.dtb
cp -f ${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb ${TARGET_DIR}/etc/barebox-state.dtb
fi
# Fix MBR
if [ "${BOOT_SYS}" == "mbr" ]; then
mkdir -p ${TARGET_DIR}/etc/udev/rules.d
cp -f ${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-fix.rules ${TARGET_DIR}/etc/udev/rules.d/
fi
}