mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 11:46:30 +00:00
Merge branch 'thingos' into better-firmware-update
This commit is contained in:
commit
09ac214491
@ -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
|
||||
|
@ -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 ####
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
7
board/odroidc1/overlay-initramfs/prepare_initramfs
Executable file
7
board/odroidc1/overlay-initramfs/prepare_initramfs
Executable 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
|
||||
|
4
board/odroidc1/overlay-initramfs/remove_initramfs
Executable file
4
board/odroidc1/overlay-initramfs/remove_initramfs
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
sed -i 's/00 0x22000000 0x/00 - 0x/' /boot/boot.ini
|
||||
|
@ -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
BIN
board/odroidc1/uInitrd
Normal file
Binary file not shown.
4
board/odroidc1/usr/libexec/fw-prepare-boot
Executable file
4
board/odroidc1/usr/libexec/fw-prepare-boot
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
sed -i 's/00 - 0x/00 0x22000000 0x/' /boot/boot.ini
|
||||
|
Binary file not shown.
4
board/raspberrypi/overlay/usr/libexec/fw-prepare-boot
Executable file
4
board/raspberrypi/overlay/usr/libexec/fw-prepare-boot
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "initramfs fwupdater.gz" >> /boot/config.txt
|
||||
|
10
board/raspberrypi/overlay/usr/libexec/fw-restore-boot-cfg
Executable file
10
board/raspberrypi/overlay/usr/libexec/fw-restore-boot-cfg
Executable 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.
4
board/raspberrypi2/overlay/usr/libexec/fw-prepare-boot
Executable file
4
board/raspberrypi2/overlay/usr/libexec/fw-prepare-boot
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "initramfs fwupdater.gz" >> /boot/config.txt
|
||||
|
10
board/raspberrypi2/overlay/usr/libexec/fw-restore-boot-cfg
Executable file
10
board/raspberrypi2/overlay/usr/libexec/fw-restore-boot-cfg
Executable 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.
4
board/raspberrypi3/overlay/usr/libexec/fw-prepare-boot
Executable file
4
board/raspberrypi3/overlay/usr/libexec/fw-prepare-boot
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "initramfs fwupdater.gz" >> /boot/config.txt
|
||||
|
10
board/raspberrypi3/overlay/usr/libexec/fw-restore-boot-cfg
Executable file
10
board/raspberrypi3/overlay/usr/libexec/fw-restore-boot-cfg
Executable 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
|
||||
|
26
configs/odroidc1_initramfs_defconfig
Normal file
26
configs/odroidc1_initramfs_defconfig
Normal 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
|
Loading…
x
Reference in New Issue
Block a user