Files
Arch-R/projects/Amlogic/bootloader/mkimage
kszaq 55bbee2989 projects/Amlogic: move aml_autoscript generation to a package
This allows to make the script installation device-specific in device options and removing the ugly case in bootloader mkimage.
2018-03-06 00:10:43 +01:00

42 lines
1.8 KiB
Bash

#!/bin/bash
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
# compile and copy amlogic autoscript files to part1
mcopy $RELEASE_DIR/3rdparty/bootloader/*autoscript :: 2>&1 > /dev/null || true
# copy device trees to part1
for dtb in $RELEASE_DIR/3rdparty/bootloader/device_trees $RELEASE_DIR/3rdparty/bootloader/*.dtb $RELEASE_DIR/3rdparty/bootloader/dtb.img ; do
[ -e "$dtb" ] && mcopy -s "$dtb" ::
done
if [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot" ]; then
echo "Writing u-boot to $(basename $DISK)"
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot" of="$DISK" conv=fsync,notrunc bs=1 count=112 >"$SAVE_ERROR" 2>&1 || show_error
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot" of="$DISK" conv=fsync,notrunc bs=512 skip=1 seek=1 >"$SAVE_ERROR" 2>&1 || show_error
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.ini" ]; then
mcopy $RELEASE_DIR/3rdparty/bootloader/boot.ini ::
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/config.ini" ]; then
mcopy $RELEASE_DIR/3rdparty/bootloader/config.ini ::
fi