aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorGravatar Erico Nunes <nunes.erico@gmail.com>2017-10-22 15:54:24 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-10-22 16:27:53 +0200
commit6fab2432375cb2ba0f9aa1af4de55d43afae68a9 (patch)
treee3d5dea4a061ac20a3e5a25264035da3a05217ca /board
parent6393b6904b6a2ee429e60cf3a107eb7eb8b7e0c3 (diff)
downloadbuildroot-6fab2432375cb2ba0f9aa1af4de55d43afae68a9.tar.gz
buildroot-6fab2432375cb2ba0f9aa1af4de55d43afae68a9.tar.bz2
configs/pc: refactor to use genimage and grub.cfg
This simplifies the pc configs and respective post image scripts to use the shared genimage script and separate grub config files. Separate grub files are cleaner to maintain and easier to copy and modify, for example to support booting the pc defconfigs in qemu. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'board')
-rw-r--r--board/pc/grub-bios.cfg6
-rwxr-xr-xboard/pc/grub-efi.cfg6
-rwxr-xr-xboard/pc/post-image.sh29
3 files changed, 16 insertions, 25 deletions
diff --git a/board/pc/grub-bios.cfg b/board/pc/grub-bios.cfg
new file mode 100644
index 0000000000..bd3e3f0006
--- /dev/null
+++ b/board/pc/grub-bios.cfg
@@ -0,0 +1,6 @@
+set default="0"
+set timeout="5"
+
+menuentry "Buildroot" {
+ linux /boot/bzImage root=/dev/sda1 rootwait console=tty1
+}
diff --git a/board/pc/grub-efi.cfg b/board/pc/grub-efi.cfg
new file mode 100755
index 0000000000..222301a4e0
--- /dev/null
+++ b/board/pc/grub-efi.cfg
@@ -0,0 +1,6 @@
+set default="0"
+set timeout="5"
+
+menuentry "Buildroot" {
+ linux /bzImage root=/dev/sda2 rootwait console=tty1
+}
diff --git a/board/pc/post-image.sh b/board/pc/post-image.sh
index c88ecb1dc2..bdd0847ec5 100755
--- a/board/pc/post-image.sh
+++ b/board/pc/post-image.sh
@@ -1,35 +1,14 @@
#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+
# Detect boot strategy, EFI or BIOS
if [ -f ${BINARIES_DIR}/efi-part/startup.nsh ]; then
- BOOT_TYPE=efi
- # grub.cfg needs customization for EFI since the root partition is
- # number 2, and bzImage is in the EFI partition (1)
- cat >${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg <<__EOF__
-set default="0"
-set timeout="5"
-
-menuentry "Buildroot" {
- linux /bzImage root=/dev/sda2 rootwait console=tty1
-}
-__EOF__
+ cp -f ${BOARD_DIR}/grub-efi.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
else
- BOOT_TYPE=bios
+ cp -f ${BOARD_DIR}/grub-bios.cfg ${TARGET_DIR}/boot/grub/grub.cfg
# Copy grub 1st stage to binaries, required for genimage
cp -f ${HOST_DIR}/lib/grub/i386-pc/boot.img ${BINARIES_DIR}
fi
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOOT_TYPE}.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}"
-
exit $?