mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 22:26:31 +00:00
board/minnowboard: Rework to generate SD card image
Let's rework the board and config files to use genimage to generate the SD card image directly. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
e645a3b0ed
commit
54ec0e2a74
34
board/minnowboard/genimage.cfg
Normal file
34
board/minnowboard/genimage.cfg
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Create an image of the efi partition
|
||||||
|
image efi-part.vfat {
|
||||||
|
vfat {
|
||||||
|
file startup.nsh {
|
||||||
|
image = "efi-part/startup.nsh"
|
||||||
|
}
|
||||||
|
file EFI {
|
||||||
|
image = "efi-part/EFI"
|
||||||
|
}
|
||||||
|
file bzImage {
|
||||||
|
image = "bzImage"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
size=10M
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create the sdcard image, pulling in
|
||||||
|
# * the image created by buildroot
|
||||||
|
# * the efi-partition created above
|
||||||
|
image sdcard.img {
|
||||||
|
hdimage {
|
||||||
|
}
|
||||||
|
|
||||||
|
partition boot {
|
||||||
|
partition-type = 0xEF
|
||||||
|
image = "efi-part.vfat"
|
||||||
|
}
|
||||||
|
|
||||||
|
partition rootfs {
|
||||||
|
partition-type = 0x83
|
||||||
|
image = "rootfs.ext4"
|
||||||
|
size = 512M
|
||||||
|
}
|
||||||
|
}
|
13
board/minnowboard/post-image.sh
Executable file
13
board/minnowboard/post-image.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
GENIMAGE_CFG="board/minnowboard/genimage.cfg"
|
||||||
|
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
|
||||||
|
|
||||||
|
rm -rf "${GENIMAGE_TMP}"
|
||||||
|
|
||||||
|
genimage \
|
||||||
|
--rootpath "${TARGET_DIR}" \
|
||||||
|
--tmppath "${GENIMAGE_TMP}" \
|
||||||
|
--inputpath "${BINARIES_DIR}" \
|
||||||
|
--outputpath "${BINARIES_DIR}" \
|
||||||
|
--config "${GENIMAGE_CFG}"
|
@ -1,40 +1,25 @@
|
|||||||
Prepare the SD card for the Minnow Board
|
How to get started with the MinnowBoard
|
||||||
========================================
|
========================================
|
||||||
|
|
||||||
1. Partition the SD card with a GPT partition table
|
1. Build
|
||||||
|
|
||||||
sudo cgdisk /dev/mmcblk0
|
Apply the defconfig:
|
||||||
|
|
||||||
Create two partitions:
|
$ make minnowboard_defconfig
|
||||||
|
|
||||||
a) First partition of a few dozens of megabytes, which will be
|
Add any additional packages required and build:
|
||||||
used to store the bootloader and the kernel image. Type must
|
|
||||||
be EF00 (EFI partition).
|
|
||||||
|
|
||||||
b) Second partition of any size, which will be used to store the
|
$ make
|
||||||
root filesystem. Type must be 8300 (Linux filesystem)
|
|
||||||
|
|
||||||
2. Prepare the boot partition
|
2. Write the SD card
|
||||||
|
|
||||||
We will format it, mount it, copy the EFI data generated by
|
The build process will create a SD card image in output/images.
|
||||||
Buildroot, and the kernel image.
|
Write the image to an mSD card, insert into the MinnowBoard
|
||||||
|
and power the board on.
|
||||||
|
|
||||||
sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1
|
$ dd if=output/images/sdcard.img of=/dev/mmcblk0; sync
|
||||||
sudo mount /dev/mmcblk0p1 /mnt
|
|
||||||
sudo cp -a output/images/efi-part/* /mnt/
|
|
||||||
sudo cp output/images/bzImage /mnt/
|
|
||||||
sudo umount /mnt
|
|
||||||
|
|
||||||
3. Prepare the root partition
|
3. Enjoy
|
||||||
|
|
||||||
We will format it, mount it, and extract the root filesystem.
|
|
||||||
|
|
||||||
sudo mkfs.ext3 -L root /dev/mmcblk0p2
|
|
||||||
sudo mount /dev/mmcblk0p2 /mnt
|
|
||||||
sudo tar -C /mnt -xf output/images/rootfs.tar
|
|
||||||
sudo umount /mnt
|
|
||||||
|
|
||||||
4. Enjoy
|
|
||||||
|
|
||||||
Additional information about this board can be found at
|
Additional information about this board can be found at
|
||||||
http://www.minnowboard.org/.
|
http://www.minnowboard.org/.
|
||||||
|
@ -5,9 +5,13 @@ BR2_x86_atom=y
|
|||||||
# Misc
|
# Misc
|
||||||
BR2_TARGET_GENERIC_GETTY_PORT="ttyPCH0"
|
BR2_TARGET_GENERIC_GETTY_PORT="ttyPCH0"
|
||||||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh"
|
BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh"
|
||||||
|
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard/post-image.sh"
|
||||||
|
|
||||||
# Linux headers same as kernel, a 3.8 series
|
# Linux headers same as kernel, a 3.8 series
|
||||||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8=y
|
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8=y
|
||||||
|
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||||
|
BR2_PACKAGE_HOST_GENIMAGE=y
|
||||||
|
BR2_PACKAGE_HOST_MTOOLS=y
|
||||||
|
|
||||||
# Linux kernel
|
# Linux kernel
|
||||||
BR2_LINUX_KERNEL=y
|
BR2_LINUX_KERNEL=y
|
||||||
@ -20,3 +24,8 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard/linux-3.8.config"
|
|||||||
# Bootloader
|
# Bootloader
|
||||||
BR2_TARGET_GRUB2=y
|
BR2_TARGET_GRUB2=y
|
||||||
BR2_TARGET_GRUB2_I386_EFI=y
|
BR2_TARGET_GRUB2_I386_EFI=y
|
||||||
|
|
||||||
|
# Filesystem image
|
||||||
|
BR2_TARGET_ROOTFS_EXT2=y
|
||||||
|
BR2_TARGET_ROOTFS_EXT2_4=y
|
||||||
|
# BR2_TARGET_ROOTFS_TAR is not set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user