Merge branch 'thingos' into better-firmware-update

This commit is contained in:
Calin Crisan 2017-03-06 21:27:21 +02:00
commit 09ac214491
18 changed files with 103 additions and 27 deletions

View File

@ -41,6 +41,11 @@ trap on_exit EXIT
msg "Waiting for sdcard"
sleep 2
if [ -x /prepare_initramfs ]; then
msg "Preparing initramfs"
/prepare_initramfs
fi
msg "Mounting pseudo filesystems"
mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc

View File

@ -230,7 +230,13 @@ function flash_boot() {
wait $pid
mount -o rw /boot
restore_boot_$board $FW_DIR/old_boot 2>/dev/null || true
# the /usr/libexec/fw-restore-boot-cfg script, if present, takes the old (backup) boot dir as argument
# and should restore any /boot configuration that needs to be preserved across updates
# from the old boot dir to the current (new) /boot dir
if [ -x /usr/libexec/fw-restore-boot-cfg ]; then
/usr/libexec/fw-restore-boot-cfg $FW_DIR/old_boot 2>/dev/null || true
fi
touch $FW_DIR/$BOOT_READY_FILE
}
@ -257,19 +263,6 @@ function flash_cleanup() {
mount /boot 2>/dev/null
}
function restore_boot_raspberrypi() {
old_boot=$1
cp $old_boot/config.txt /boot
}
function restore_boot_raspberrypi2() {
restore_boot_raspberrypi
}
function restore_boot_raspberrypi3() {
restore_boot_raspberrypi
}
#### flash reboot ####
@ -278,8 +271,13 @@ function flash_reboot() {
board=$(cat $SYS_BOARD_FILE)
# the /usr/libexec/fw-prepare-boot script should be present and should
# make the necessary changes to the current boot configuration so that
# the firmware update initramfs will be used by the next boot
mount -o remount,rw /boot
prepare_boot_$board
if [ -x /usr/libexec/fw-prepare-boot ]; then
/usr/libexec/fw-prepare-boot
fi
sync
busybox reboot &
@ -289,18 +287,6 @@ function flash_reboot() {
exit 0
}
function prepare_boot_raspberrypi() {
echo "initramfs fwupdater.gz" >> /boot/config.txt
}
function prepare_boot_raspberrypi2() {
prepare_boot_raspberrypi
}
function prepare_boot_raspberrypi3() {
prepare_boot_raspberrypi
}
#### status ####

View File

@ -51,6 +51,7 @@ setenv bootargs "console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait ro no_conso
# Booting
fatload mmc 0:1 0x21000000 uImage
fatload mmc 0:1 0x22000000 uInitrd
fatload mmc 0:1 0x21800000 meson8b_odroidc.dtb
fdt addr 21800000

View File

@ -0,0 +1,7 @@
#!/bin/sh
# we don't have the codepage kernel modules compiled in, so we have to manually insert them
mkdir /system
mount /dev/mmcblk0p2 /system
/system/bin/busybox insmod /system/lib/modules/*/kernel/fs/nls/nls_cp437.ko

View File

@ -0,0 +1,4 @@
#!/bin/sh
sed -i 's/00 0x22000000 0x/00 - 0x/' /boot/boot.ini

View File

@ -8,6 +8,7 @@ cp $IMG_DIR/meson8b_odroidc.dtb $BOOT_DIR
cp $BOARD_DIR/bl1.bin.hardkernel $IMG_DIR
cp $BOARD_DIR/u-boot.bin $IMG_DIR
cp $BOARD_DIR/boot.ini $BOOT_DIR
cp $BOARD_DIR/uInitrd $BOOT_DIR
# fix some lib dirs
if ! [ -L $TARGET/lib/arm-linux-gnueabihf ]; then

BIN
board/odroidc1/uInitrd Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/bash
sed -i 's/00 - 0x/00 0x22000000 0x/' /boot/boot.ini

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "initramfs fwupdater.gz" >> /boot/config.txt

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <old_boot>" 1>&2
exit -1
fi
old_boot=$1
cp $old_boot/config.txt /boot

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "initramfs fwupdater.gz" >> /boot/config.txt

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <old_boot>" 1>&2
exit -1
fi
old_boot=$1
cp $old_boot/config.txt /boot

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "initramfs fwupdater.gz" >> /boot/config.txt

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <old_boot>" 1>&2
exit -1
fi
old_boot=$1
cp $old_boot/config.txt /boot

View File

@ -0,0 +1,26 @@
BR2_arm=y
BR2_cortex_a5=y
BR2_ARM_ENABLE_NEON=y
BR2_ARM_ENABLE_VFP=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_DL_DIR="$(TOPDIR)/.download"
BR2_CCACHE=y
BR2_CCACHE_DIR="$(TOPDIR)/.buildroot-ccache-odroidc1-initramfs"
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-linux-gnueabihf"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_1=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TARGET_OPTIMIZATION="-pipe"
BR2_ROOTFS_SKELETON_CUSTOM=y
BR2_ROOTFS_SKELETON_CUSTOM_PATH="board/common/skeleton-initramfs"
BR2_ROOTFS_OVERLAY="board/common/overlay-initramfs board/raspberrypi/overlay-initramfs"
BR2_PACKAGE_BUSYBOX_CONFIG="board/common/busybox_initramfs.config"
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
# BR2_TARGET_ROOTFS_TAR is not set