mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 11:46:30 +00:00
initramfs config now uses overlays
This commit is contained in:
parent
521bce6da6
commit
a21e1b1e93
71
board/common/overlay-initramfs/init
Executable file
71
board/common/overlay-initramfs/init
Executable file
@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
PATH=/bin
|
||||
BOOT_DEV=/dev/mmcblk0p1
|
||||
ROOT_DEV=/dev/mmcblk0p2
|
||||
DATA_DEV=/dev/mmcblk0p3
|
||||
|
||||
FW_DIR=/data/.fwupdate
|
||||
FW_FILE=firmware.img.gz
|
||||
FW_FILE_EXTR=firmware.img
|
||||
|
||||
ROOT_INFO_FILE=root_info
|
||||
|
||||
msg() {
|
||||
echo "* $1"
|
||||
}
|
||||
|
||||
on_exit() {
|
||||
msg "Switching to normal boot"
|
||||
/normal_boot
|
||||
|
||||
msg "Syncing"
|
||||
sync
|
||||
|
||||
msg "Unmounting data partition"
|
||||
umount /data
|
||||
|
||||
msg "Unmounting boot partition"
|
||||
umount /boot
|
||||
|
||||
msg "Rebooting"
|
||||
echo 'b' > /proc/sysrq-trigger
|
||||
}
|
||||
|
||||
trap on_exit EXIT
|
||||
|
||||
msg "Waiting for sdcard"
|
||||
sleep 2
|
||||
|
||||
msg "Mounting pseudo filesystems"
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
mount -t proc proc /proc
|
||||
|
||||
msg "Mounting boot partition"
|
||||
mount $BOOT_DEV $BOOT
|
||||
|
||||
msg "Mounting data partition"
|
||||
mount $DATA_DEV $DATA
|
||||
|
||||
if ! [ -r $FW_DIR/$FW_FILE_EXTR ]; then
|
||||
msg "No firmware found, aborting"
|
||||
normal_boot
|
||||
fi
|
||||
|
||||
if ! [ -r $FW_DIR/$ROOT_INFO ]; then
|
||||
msg "No root partition info, aborting"
|
||||
normal_boot
|
||||
fi
|
||||
|
||||
msg "Copying root image"
|
||||
root_info=($(cat $FW_DIR/$ROOT_INFO))
|
||||
root_start=${root_info[0]}
|
||||
root_size=${root_info[1]}
|
||||
|
||||
dd if=$FW_DIR/$FW_FILE_EXTR skip=$root_start of=$ROOT_DEV bs=1048576 count=$root_size
|
||||
|
||||
msg "Cleaning up"
|
||||
rm -rf $FW_DIR
|
||||
|
0
board/common/skeleton-initramfs/usr/lib/.empty
Normal file
0
board/common/skeleton-initramfs/usr/lib/.empty
Normal file
4
board/raspberrypi/overlay-initramfs/remove_initramfs
Executable file
4
board/raspberrypi/overlay-initramfs/remove_initramfs
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
sed -i 's/^initramfs.*//g' /boot/config.txt
|
||||
|
2
build.sh
2
build.sh
@ -51,6 +51,6 @@ elif [ -n "$target" ]; then
|
||||
make O=$outputdir $target
|
||||
else
|
||||
make O=$outputdir
|
||||
$boarddir/mkimage.sh
|
||||
test -x $boarddir/mkimage.sh && $boarddir/mkimage.sh
|
||||
fi
|
||||
|
||||
|
@ -15,6 +15,7 @@ BR2_TARGET_GENERIC_HOSTNAME=""
|
||||
BR2_TARGET_GENERIC_ISSUE=""
|
||||
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_GZIP=y
|
||||
|
Loading…
x
Reference in New Issue
Block a user