summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/image.mk7
-rw-r--r--package/grub/Makefile96
-rw-r--r--package/grub/files/core.img.i386-pcbin25564 -> 0 bytes
-rw-r--r--package/grub/files/grub.cfg1
-rwxr-xr-xscripts/create.sh2
-rw-r--r--target/x86/Makefile19
-rw-r--r--target/x86_64/Makefile10
7 files changed, 84 insertions, 51 deletions
diff --git a/mk/image.mk b/mk/image.mk
index f2f00e650..b880e48af 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -299,11 +299,16 @@ endif
-d "$(TARGET_DIR)" \
-o $(FW_DIR)/rootfs.ext $(MAKE_TRACE)
PATH='${HOST_PATH}' genimage \
- --config "$(ADK_TOPDIR)/target/$(ADK_TARGET_CPU_ARCH)/$(ADK_TARGET_SYSTEM)/genimage.cfg" \
+ --config "$(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/genimage.cfg" \
--tmppath "${FW_DIR}/temp" \
--rootpath "$(TARGET_DIR)" \
--inputpath "$(FW_DIR)" \
--outputpath "$(FW_DIR)" $(MAKE_TRACE)
+ifeq ($(ADK_PACKAGE_GRUB_EFI_X86)$(ADK_PACKAGE_GRUB_EFI_X86_64),y)
+ @if [ ! -f $(ADK_TOPDIR)/bios-$(ADK_TARGET_ARCH).bin ]; then \
+ cd $(ADK_TOPDIR); wget http://distfiles.openadk.org/bios-$(ADK_TARGET_ARCH).bin ;\
+ fi
+endif
imageclean:
rm -f $(FW_DIR)/$(ADK_TARGET_SYSTEM)-* ${BUILD_DIR}/$(ADK_TARGET_SYSTEM)-*
diff --git a/package/grub/Makefile b/package/grub/Makefile
index ecbbdb2ed..12124fae2 100644
--- a/package/grub/Makefile
+++ b/package/grub/Makefile
@@ -4,7 +4,7 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= grub
-PKG_VERSION:= git
+PKG_VERSION:= 28511b0da900876151c71b66885b89615c68cfa4
PKG_RELEASE:= 1
PKG_DESCR:= multiboot boot loader
PKG_SECTION:= base/boot
@@ -36,53 +36,47 @@ TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS))
AUTOTOOL_STYLE:= autogen
-GRUB2_BOOT_PARTITION:= hd0,msdos1
-
ifeq ($(ADK_PACKAGE_GRUB_ARC),y)
-GRUB2_ARCH:= mips-arc
-CONFIGURE_ARGS+= --with-platform=arc
-GRUB2_IMAGE = $(FW_DIR)/grub.img
-GRUB2_CFG = $(TARGET_DIR)/boot/grub/grub.cfg
-GRUB2_PREFIX = ($(GRUB2_BOOT_PARTITION))/boot/grub
-GRUB2_TARGET = mips
-GRUB2_PLATFORM = arc
-GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal biosdisk
+GRUB_ARCH= mips-arc
+GRUB_IMAGE= grub.img
+GRUB_DIR= boot/grub
+GRUB_PREFIX= (hd0,msdos1)/boot/grub
+GRUB_TARGET= mips
+GRUB_PLATFORM= arc
+GRUB_MODULES= boot linux ext2 fat part_msdos part_gpt normal biosdisk
endif
ifeq ($(ADK_PACKAGE_GRUB_PC),y)
-GRUB2_ARCH:= i386-pc
-CONFIGURE_ARGS+= --with-platform=pc
HOST_CONFIGURE_ARGS+= --with-platform=pc
-GRUB2_IMAGE = $(FW_DIR)/grub.img
-GRUB2_CFG = $(TARGET_DIR)/boot/grub/grub.cfg
-GRUB2_PREFIX = ($(GRUB2_BOOT_PARTITION))/boot/grub
-GRUB2_TARGET = i386
-GRUB2_PLATFORM = pc
-GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal biosdisk
+GRUB_ARCH= i386-pc
+GRUB_IMAGE= grub.img
+GRUB_DIR= boot/grub
+GRUB_PREFIX= (hd0,msdos1)/boot/grub
+GRUB_TARGET= i386
+GRUB_PLATFORM= pc
+GRUB_MODULES= boot linux ext2 fat part_msdos part_gpt normal biosdisk
endif
ifeq ($(ADK_PACKAGE_GRUB_EFI_X86),y)
-GRUB2_ARCH:= x86_64-efi
-CONFIGURE_ARGS+= --with-platform=efi
HOST_CONFIGURE_ARGS+= --with-platform=efi
-GRUB2_IMAGE = $(FW_DIR)/efi-part/EFI/BOOT/bootia32.efi
-GRUB2_CFG = $(FW_DIR)/efi-part/EFI/BOOT/grub.cfg
-GRUB2_PREFIX = /EFI/BOOT
-GRUB2_TARGET = i386
-GRUB2_PLATFORM = efi
-GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal efi_gop
+GRUB_ARCH= i386-efi
+GRUB_IMAGE= efi-part/EFI/BOOT/bootia32.efi
+GRUB_DIR= efi-part/EFI/BOOT
+GRUB_PREFIX= /EFI/BOOT
+GRUB_TARGET= i386
+GRUB_PLATFORM= efi
+GRUB_MODULES= boot linux ext2 fat part_msdos part_gpt normal efi_gop
endif
ifeq ($(ADK_PACKAGE_GRUB_EFI_X86_64),y)
-GRUB2_ARCH:= x86_64-efi
-CONFIGURE_ARGS+= --with-platform=efi
HOST_CONFIGURE_ARGS+= --with-platform=efi
-GRUB2_IMAGE = $(FW_DIR)/efi-part/EFI/BOOT/bootx64.efi
-GRUB2_CFG = $(FW_DIR)/efi-part/EFI/BOOT/grub.cfg
-GRUB2_PREFIX = /EFI/BOOT
-GRUB2_TARGET = x86_64
-GRUB2_PLATFORM = efi
-GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal efi_gop
+GRUB_ARCH= x86_64-efi
+GRUB_IMAGE= efi-part/EFI/BOOT/bootx64.efi
+GRUB_DIR= efi-part/EFI/BOOT
+GRUB_PREFIX= /EFI/BOOT
+GRUB_TARGET= x86_64
+GRUB_PLATFORM= efi
+GRUB_MODULES= boot linux ext2 fat part_msdos part_gpt normal efi_gop
endif
HOST_CONFIGURE_ARGS+= --enable-efiemu=no \
@@ -94,22 +88,36 @@ CONFIGURE_ARGS+= --disable-grub-mkfont \
--enable-efiemu=no \
--enable-device-mapper=no \
--enable-libzfs=no \
+ --with-platform=$(GRUB_PLATFORM) \
--disable-werror
XAKE_FLAGS+= GCC_HONOUR_COPTS=s
grub-install:
+ $(INSTALL_DIR) $(FW_DIR)/$(GRUB_DIR)
+ $(INSTALL_DIR) $(IDIR_GRUB)/$(GRUB_DIR)
+ifeq ($(ADK_PACKAGE_GRUB_PC),y)
+ $(STAGING_HOST_DIR)/usr/bin/grub-mkimage \
+ -d $(WRKINST)/usr/lib/grub/$(GRUB_ARCH) \
+ -O $(GRUB_ARCH) \
+ -p "$(GRUB_PREFIX)" \
+ -o $(IDIR_GRUB)/$(GRUB_DIR)/core.img \
+ -c ./files/embed.cfg ext2 part_msdos biosdisk
+endif
ifeq ($(ADK_PACKAGE_GRUB_EFI_X86)$(ADK_PACKAGE_GRUB_EFI_X86_64),y)
- $(INSTALL_DIR) $(FW_DIR)/efi-part/EFI/BOOT
- ${CP} ${WRKINST}/usr/lib/grub/${GRUB2_ARCH} \
- $(FW_DIR)/efi-part/EFI/BOOT
+ ${CP} ${WRKINST}/usr/lib/grub/$(GRUB_ARCH) \
+ $(FW_DIR)/$(GRUB_DIR)
+ $(CP) ./files/grub.cfg $(FW_DIR)/$(GRUB_DIR)
+else
+ ${CP} ${WRKINST}/usr/lib/grub/${GRUB_ARCH} \
+ $(IDIR_GRUB)/$(GRUB_DIR)
+ $(CP) ./files/grub.cfg $(IDIR_GRUB)/$(GRUB_DIR)
endif
$(STAGING_HOST_DIR)/usr/bin/grub-mkimage \
- -d $(WRKINST)/usr/lib/grub/$(GRUB2_ARCH) \
- -O $(GRUB2_ARCH) \
- -o $(GRUB2_IMAGE) \
- -p "$(GRUB2_PREFIX)" \
- $(GRUB2_MODULES)
- $(CP) ./files/grub.cfg $(GRUB2_CFG)
+ -d $(WRKINST)/usr/lib/grub/$(GRUB_ARCH) \
+ -O $(GRUB_ARCH) \
+ -o $(FW_DIR)/$(GRUB_IMAGE) \
+ -p "$(GRUB_PREFIX)" \
+ $(GRUB_MODULES)
grub-tools-install:
${INSTALL_DIR} $(IDIR_GRUB_TOOLS)/usr/{sbin,bin,share,lib}
diff --git a/package/grub/files/core.img.i386-pc b/package/grub/files/core.img.i386-pc
deleted file mode 100644
index bd6fbac6f..000000000
--- a/package/grub/files/core.img.i386-pc
+++ /dev/null
Binary files differ
diff --git a/package/grub/files/grub.cfg b/package/grub/files/grub.cfg
index 66ce6e0a0..d87a52cac 100644
--- a/package/grub/files/grub.cfg
+++ b/package/grub/files/grub.cfg
@@ -2,6 +2,7 @@ set default=0
set timeout=3
menuentry "OpenADK" {
+ echo "Loading OpenADK"
set root=(hd0,2)
linux (hd0,2)/boot/kernel root=/dev/sda2 rootfstype=ext4 rootwait panic=10
}
diff --git a/scripts/create.sh b/scripts/create.sh
index f421d4b80..1d0c467d0 100755
--- a/scripts/create.sh
+++ b/scripts/create.sh
@@ -152,7 +152,7 @@ else
fi
if (( usegrub )); then
- tar -xOzf "$src" boot/grub/core.img >"$T/core.img"
+ tar -xOJf "$src" boot/grub/core.img >"$T/core.img"
integer coreimgsz=$($statcmd "$T/core.img")
if (( coreimgsz < 1024 )); then
print -u2 core.img is probably too small: $coreimgsz
diff --git a/target/x86/Makefile b/target/x86/Makefile
index ba1961bca..3ff21095a 100644
--- a/target/x86/Makefile
+++ b/target/x86/Makefile
@@ -12,6 +12,10 @@ QEMU_ARGS:=-M pc
QEMU_ARGS+=${ADK_QEMU_ARGS}
QEMU_ARGS+=-net user -net nic,model=e1000
+ifeq ($(ADK_PACKAGE_GRUB_EFI_X86),y)
+QEMU_ARGS+=-L . -bios bios-x86.bin
+endif
+
ifeq ($(ADK_TARGET_QEMU_WITH_AUDIO),y)
QEMU_ARGS+=-soundhw ac97
endif
@@ -33,7 +37,7 @@ targethelp:
ifeq ($(ADK_TARGET_QEMU),y)
@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
@echo "Use following command to create a QEMU Image:"
- @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
+ @echo "$(CREATE) qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
@echo "Start qemu with following options:"
ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
@echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} qemu-${ADK_TARGET_CPU_ARCH}.img'
@@ -83,6 +87,16 @@ ifeq ($(ADK_TARGET_FS),iso)
targethelp:
@echo 'ISO image is at $<'
endif
+ifeq ($(ADK_TARGET_FS),genimage)
+targethelp:
+ @echo "The disk image is: $(FW_DIR)/disk.img"
+ @echo "Use following command to install it on SD card:"
+ifeq ($(ADK_TARGET_QEMU),y)
+ @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
+else
+ @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
+endif
+endif
# image creation and kernel install
kernel-strip:
@@ -104,6 +118,9 @@ endif
ifeq ($(ADK_TARGET_FS),initramfspiggyback)
imageinstall: createinitramfs targethelp
endif
+ifeq (${ADK_TARGET_FS},genimage)
+imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
+endif
ifeq (${ADK_TARGET_FS},iso)
imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
endif
diff --git a/target/x86_64/Makefile b/target/x86_64/Makefile
index dfaaa1e43..6445cff6c 100644
--- a/target/x86_64/Makefile
+++ b/target/x86_64/Makefile
@@ -8,11 +8,13 @@ include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/arch/x86/boot/bzImage
QEMU_ARCH:=x86_64
+
QEMU_ARGS:=-M pc
-QEMU_ARGS+=-L . -bios bios.bin
+ifeq ($(ADK_PACKAGE_GRUB_EFI_X86_64),y)
+QEMU_ARGS+=-L . -bios bios-x86_64.bin
+endif
QEMU_ARGS+=${ADK_QEMU_ARGS}
QEMU_ARGS+=-net user -net nic,model=e1000
-
ifeq ($(ADK_TARGET_QEMU_WITH_AUDIO),y)
QEMU_ARGS+=-soundhw ac97
endif
@@ -34,7 +36,7 @@ targethelp:
ifeq ($(ADK_TARGET_QEMU),y)
@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
@echo "Use following command to create a QEMU Image:"
- @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
+ @echo "$(CREATE) qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
@echo "Start qemu with following options:"
ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
@echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} qemu-${ADK_TARGET_CPU_ARCH}.img'
@@ -78,7 +80,7 @@ endif
ifeq ($(ADK_TARGET_FS),usb)
targethelp:
@echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
- @echo "To install everything to USB use:"
+ @echo "To install everything to USB disk use:"
@echo "sudo ./scripts/install.sh -g -t default /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
endif
ifeq ($(ADK_TARGET_FS),iso)