Commit 144dc9ca authored by Yann E. MORIN's avatar Yann E. MORIN Committed by Arnout Vandecappelle (Essensium/Mind)
Browse files

boot/grub: remove



grub is no longer maintained: it is stuck at version 0.97 with huge
patches that have no opportunity to be applied upstream, as upstream
has even renamed it grub-legacy.

Besides, it no longer builds correctly with recent binutils versions,
and even the huge patches we could grab from Debian do not help the
slightest.

Since upstream really considers it dead, and there are at least two
alternatives (grub2 and syslinux), just remove grub.

Add a legacy entry.

Remove the test cases as well.
Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
parent 54a76f08
......@@ -226,8 +226,6 @@ tests.fs.test_ext.TestExt3: *runtime_test
tests.fs.test_ext.TestExt4: *runtime_test
tests.fs.test_iso9660.TestIso9660Grub2External: *runtime_test
tests.fs.test_iso9660.TestIso9660Grub2Internal: *runtime_test
tests.fs.test_iso9660.TestIso9660GrubExternal: *runtime_test
tests.fs.test_iso9660.TestIso9660GrubInternal: *runtime_test
tests.fs.test_iso9660.TestIso9660SyslinuxExternal: *runtime_test
tests.fs.test_iso9660.TestIso9660SyslinuxInternal: *runtime_test
tests.fs.test_jffs2.TestJffs2: *runtime_test
......
......@@ -169,6 +169,15 @@ config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
###############################################################################
comment "Legacy options removed in 2017.08"
config BR2_TARGET_GRUB
bool "grub (aka grub-legacy) has been removed"
select BR2_LEGACY
help
grub-legacy is no longer maintained, and no longer builds with
recent binutils versions.
Use grub2 or syslinux instead.
config BR2_PACKAGE_SIMICSFS
bool "simicsfs support removed"
select BR2_LEGACY
......
......@@ -7,7 +7,6 @@ source "boot/at91dataflashboot/Config.in"
source "boot/arm-trusted-firmware/Config.in"
source "boot/barebox/Config.in"
source "boot/boot-wrapper-aarch64/Config.in"
source "boot/grub/Config.in"
source "boot/grub2/Config.in"
source "boot/gummiboot/Config.in"
source "boot/lpc32xxcdl/Config.in"
......
config BR2_TARGET_GRUB
bool "grub"
depends on BR2_i386 || BR2_x86_64
select BR2_HOSTARCH_NEEDS_IA32_COMPILER
help
The GRand Unified Bootloader for x86 systems.
Some notes on creating a disk image with Grub installed:
1. Create an empty disk image
dd if=/dev/zero of=disk.img bs=1M count=32
2. Create one primary partition
cfdisk -h 16 -s 63 disk.img
3. Set up a loop device
sudo losetup -f disk.img
4. Set up loop devices per partitions
sudo partx -a /dev/loop0
5. Create the ext2 filesystem
sudo mkfs.ext2 -L root /dev/loop0p1
6. Mount the filesystem
mount /dev/loop0p1 /mnt
7. Extract the root filesystem
sudo tar -C /mnt -xf output/images/rootfs.tar
8. Unmount the filesystem, clean up loop device
sudo umount /mnt
sudo partx -d /dev/loop0
sudo losetup -d /dev/loop0
9. Install grub
output/host/sbin/grub --device-map=/dev/null
and in the grub shell, enter:
device (hd0) disk.img
geometry (hd0) <cylinders> 16 63
root (hd0,0)
setup (hd0)
10. Image is ready
Can be tested in Qemu, with:
qemu-system-{i386,x86-64} -hda disk.img
if BR2_TARGET_GRUB
config BR2_TARGET_GRUB_SPLASH
bool "Splashimage support"
help
Add support for splashimage.
A splashimage is a 14-color indexed .xpm picture which is
displayed as background for the grub menu. See
http://www.katspace.org/computers/Grub_Splash/ for details
on how to generate a splashimage.
config BR2_TARGET_GRUB_DISKLESS
bool "diskless support"
help
enable diskless support
menu "filesystem drivers"
config BR2_TARGET_GRUB_FS_EXT2
bool "ext2"
default y
help
Enable support for the ext2 filesystem in Grub
config BR2_TARGET_GRUB_FS_FAT
bool "FAT"
default y
help
Enable support for the FAT filesystem in Grub.
config BR2_TARGET_GRUB_FS_ISO9660
bool "ISO9660"
help
Enable support for the ISO9660 filesystem in Grub.
config BR2_TARGET_GRUB_FS_JFS
bool "IBM JFS"
help
Enable support for the JFS filesystem in Grub.
config BR2_TARGET_GRUB_FS_REISERFS
bool "ReiserFS"
help
Enable support for the ReiserFS filesystem in Grub.
config BR2_TARGET_GRUB_FS_XFS
bool "SGI XFS"
help
Enable support for the XFS filesystem in Grub.
endmenu
menu "network drivers"
config BR2_TARGET_GRUB_3c595
bool "3Com595 driver"
help
enable 3Com595 driver
config BR2_TARGET_GRUB_3c90x
bool "3Com90x driver"
help
enable 3Com90x driver
config BR2_TARGET_GRUB_davicom
bool "Davicom driver"
help
enable Davicom driver
config BR2_TARGET_GRUB_e1000
bool "Etherexpress Pro/1000 driver"
help
enable Etherexpress Pro/1000 driver
config BR2_TARGET_GRUB_eepro100
bool "Etherexpress Pro/100 driver"
help
enable Etherexpress Pro/100 driver
config BR2_TARGET_GRUB_epic100
bool "SMC 83c170 EPIC/100 driver"
help
enable SMC 83c170 EPIC/100 driver
config BR2_TARGET_GRUB_forcedeth
bool "Nvidia Geforce driver"
help
enable Nvidia Geforce driver
config BR2_TARGET_GRUB_natsemi
bool "NatSemi DP8381x driver"
help
enable NatSemi DP8381x driver
config BR2_TARGET_GRUB_ns83820
bool "NS83820 driver"
help
enable NS83820 driver
config BR2_TARGET_GRUB_ns8390
bool "NE2000 PCI driver"
help
enable NE2000 PCI driver
config BR2_TARGET_GRUB_pcnet32
bool "AMD Lance/PCI PCNet/32 driver"
help
enable AMD Lance/PCI PCNet/32 driver
config BR2_TARGET_GRUB_pnic
bool "Bochs Pseudo Nic driver"
help
enable Bochs Pseudo Nic driver
config BR2_TARGET_GRUB_rtl8139
bool "Realtek 8139 driver"
help
enable Realtek 8139 driver
config BR2_TARGET_GRUB_r8169
bool "Realtek 8169 driver"
help
enable Realtek 8169 driver
config BR2_TARGET_GRUB_sis900
bool "SIS 900 and SIS 7016 driver"
help
enable SIS 900 and SIS 7016 driver
config BR2_TARGET_GRUB_tg3
bool "Broadcom Tigon3 driver"
help
enable Broadcom Tigon3 driver
config BR2_TARGET_GRUB_tulip
bool "Tulip driver"
help
enable Tulip driver
config BR2_TARGET_GRUB_tlan
bool "TI ThunderLAN driver"
help
enable TI ThunderLAN driver
config BR2_TARGET_GRUB_undi
bool "PXE UNDI driver"
help
enable PXE UNDI driver
config BR2_TARGET_GRUB_via_rhine
bool "Rhine-I/II driver"
help
enable Rhine-I/II driver
config BR2_TARGET_GRUB_w89c840
bool "Winbond W89c840 driver"
help
enable Winbond W89c840 driver
endmenu
endif # BR2_TARGET_GRUB
This diff is collapsed.
Index: b/stage2/disk_io.c
===================================================================
--- a/stage2/disk_io.c
+++ b/stage2/disk_io.c
@@ -365,7 +365,7 @@
int
devwrite (unsigned int sector, int sector_count, char *buf)
{
-#if defined(GRUB_UTIL) && defined(__linux__)
+#if defined(GRUB_UTIL) && defined(__linux__) && !defined(SUPPORT_LOOPDEV)
if (current_partition != 0xFFFFFF
&& is_disk_device (device_map, current_drive))
{
Index: b/grub/asmstub.c
===================================================================
--- a/grub/asmstub.c
+++ b/grub/asmstub.c
@@ -18,10 +18,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <features.h>
+#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_LFS__)
/* Try to use glibc's transparant LFS support. */
#define _LARGEFILE_SOURCE 1
/* lseek becomes synonymous with lseek64. */
#define _FILE_OFFSET_BITS 64
+#endif
/* Simulator entry point. */
int grub_stage2 (void);
Index: b/lib/device.c
===================================================================
--- a/lib/device.c
+++ b/lib/device.c
@@ -18,10 +18,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <features.h>
+#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_LFS__)
/* Try to use glibc's transparant LFS support. */
#define _LARGEFILE_SOURCE 1
/* lseek becomes synonymous with lseek64. */
#define _FILE_OFFSET_BITS 64
+#endif
#include <stdio.h>
#include <stdlib.h>
This diff is collapsed.
# From http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/g/grub/grub_0.97-68.dsc
sha256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b grub_0.97.orig.tar.gz
sha256 a453489cf1fec5d311a0b76dea8c8b2ff67eee1a3eba6c06ab80864494d9773c grub_0.97-68.diff.gz
################################################################################
#
# grub
#
################################################################################
GRUB_VERSION = 0.97
GRUB_SOURCE = grub_$(GRUB_VERSION).orig.tar.gz
GRUB_PATCH = grub_$(GRUB_VERSION)-68.diff.gz
GRUB_SITE = http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/g/grub
GRUB_LICENSE = GPL-2.0+
GRUB_LICENSE_FILES = COPYING
# Passing -O0 since the default -O2 passed by Buildroot generates
# non-working stage2. Passing --build-id=none to the linker, because
# the ".note.gnu.build-id" ELF sections generated by default confuse
# objcopy when generating raw binaries. Passing -fno-stack-protector
# to avoid undefined references to __stack_chk_fail.
GRUB_CFLAGS = \
-DSUPPORT_LOOPDEV \
-O0 -Wl,--build-id=none \
-fno-stack-protector
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_SPLASH),--enable-graphics,--disable-graphics)
GRUB_CONFIG-$(BR2_TARGET_GRUB_DISKLESS) += --enable-diskless
GRUB_CONFIG-$(BR2_TARGET_GRUB_3c595) += --enable-3c595
GRUB_CONFIG-$(BR2_TARGET_GRUB_3c90x) += --enable-3c90x
GRUB_CONFIG-$(BR2_TARGET_GRUB_davicom) += --enable-davicom
GRUB_CONFIG-$(BR2_TARGET_GRUB_e1000) += --enable-e1000
GRUB_CONFIG-$(BR2_TARGET_GRUB_eepro100) += --enable-eepro100
GRUB_CONFIG-$(BR2_TARGET_GRUB_epic100) += --enable-epic100
GRUB_CONFIG-$(BR2_TARGET_GRUB_forcedeth) += --enable-forcedeth
GRUB_CONFIG-$(BR2_TARGET_GRUB_natsemi) += --enable-natsemi
GRUB_CONFIG-$(BR2_TARGET_GRUB_ns83820) += --enable-ns83820
GRUB_CONFIG-$(BR2_TARGET_GRUB_ns8390) += --enable-ns8390
GRUB_CONFIG-$(BR2_TARGET_GRUB_pcnet32) += --enable-pcnet32
GRUB_CONFIG-$(BR2_TARGET_GRUB_pnic) += --enable-pnic
GRUB_CONFIG-$(BR2_TARGET_GRUB_rtl8139) += --enable-rtl8139
GRUB_CONFIG-$(BR2_TARGET_GRUB_r8169) += --enable-r8169
GRUB_CONFIG-$(BR2_TARGET_GRUB_sis900) += --enable-sis900
GRUB_CONFIG-$(BR2_TARGET_GRUB_tg3) += --enable-tg3
GRUB_CONFIG-$(BR2_TARGET_GRUB_tulip) += --enable-tulip
GRUB_CONFIG-$(BR2_TARGET_GRUB_tlan) += --enable-tlan
GRUB_CONFIG-$(BR2_TARGET_GRUB_undi) += --enable-undi
GRUB_CONFIG-$(BR2_TARGET_GRUB_via_rhine) += --enable-via-rhine
GRUB_CONFIG-$(BR2_TARGET_GRUB_w89c840) += --enable-w89c840
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_EXT2),--enable-ext2fs,--disable-ext2fs)
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_FAT),--enable-fat,--disable-fat)
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_ISO9660),--enable-iso9660,--disable-iso9660)
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_JFS),--enable-jfs,--disable-jfs)
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_REISERFS),--enable-reiserfs,--disable-reiserfs)
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_XFS),--enable-xfs,--disable-xfs)
GRUB_CONFIG-y += --disable-ffs --disable-ufs2 --disable-minix --disable-vstafs
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_EXT2),e2fs)
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_FAT),fat)
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_ISO9660),iso9660)
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_JFS),jfs)
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_REISERFS),reiserfs)
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_XFS),xfs)
define GRUB_DEBIAN_PATCHES
# Apply the patches from the Debian patch
(cd $(@D) ; for f in `cat debian/patches/series | grep -v ^#` ; do \
cat debian/patches/$$f | patch -g0 -p1 ; \
done)
endef
GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
GRUB_CONF_ENV = \
$(HOST_CONFIGURE_OPTS) \
CFLAGS="$(HOST_CFLAGS) $(GRUB_CFLAGS) -m32"
GRUB_CONF_OPTS = \
--disable-auto-linux-mem-opt \
$(GRUB_CONFIG-y)
ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
define GRUB_INSTALL_SPLASH
$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz $(TARGET_DIR)/boot/grub/splash.xpm.gz
endef
else
define GRUB_INSTALL_SPLASH
$(SED) '/^splashimage/d' $(TARGET_DIR)/boot/grub/menu.lst
endef
endif
# We're cheating here as we're installing the grub binary not in the
# target directory (where it is useless), but in the host
# directory. This grub binary can be used to install grub into the MBR
# of a disk or disk image.
define GRUB_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/grub/grub $(HOST_DIR)/sbin/grub
$(INSTALL) -D -m 0755 $(@D)/stage1/stage1 $(TARGET_DIR)/boot/grub/stage1
for f in $(GRUB_STAGE_1_5_TO_INSTALL) ; do \
$(INSTALL) -D -m 0755 $(@D)/stage2/$${f}_stage1_5 \
$(TARGET_DIR)/boot/grub/$${f}_stage1_5 ; \
done
$(INSTALL) -D -m 0644 $(@D)/stage2/stage2 $(TARGET_DIR)/boot/grub/stage2
$(INSTALL) -D -m 0644 boot/grub/menu.lst $(TARGET_DIR)/boot/grub/menu.lst
$(GRUB_INSTALL_SPLASH)
endef
$(eval $(autotools-package))
default 0
timeout 10
# Used when no splashimage is used
color cyan/blue white/blue
# Gets enabled/disabled depending on Grub support for splashimage
splashimage (hd0,0)/boot/grub/splash.xpm.gz
# Used when a splashimage is enabled
foreground 000000
background cccccc
title Buildroot
root (hd0,0)
kernel /boot/bzImage rw root=/dev/sda1 rootwait
default 0
timeout 1
# Used when no splashimage is used
color cyan/blue white/blue
# Gets enabled/disabled depending on Grub support for splashimage
splashimage /boot/grub/splash.xpm.gz
# Used when a splashimage is enabled
foreground 000000
background cccccc
title Buildroot ISO9660 image
kernel __KERNEL_PATH__ root=/dev/sr0 console=ttyS0,115200
initrd __INITRD_PATH__
title Hard Drive (first partition)
rootnoverify (hd0)
chainloader +1
......@@ -84,43 +84,6 @@ BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"
exit_code = test_touch_file(self.emulator)
self.assertEqual(exit_code, 0)
#
# Grub
#
class TestIso9660GrubExternal(infra.basetest.BRTest):
config = BASIC_CONFIG + \
"""
BR2_TARGET_ROOTFS_ISO9660=y
# BR2_TARGET_ROOTFS_ISO9660_INITRD is not set
BR2_TARGET_GRUB=y
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"
""".format(infra.filepath("conf/grub-menu.lst"))
def test_run(self):
exit_code = test_mount_internal_external(self.emulator,
self.builddir, internal=False)
self.assertEqual(exit_code, 0)
exit_code = test_touch_file(self.emulator)
self.assertEqual(exit_code, 1)
class TestIso9660GrubInternal(infra.basetest.BRTest):
config = BASIC_CONFIG + \
"""
BR2_TARGET_ROOTFS_ISO9660=y
BR2_TARGET_GRUB=y
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="{}"
""".format(infra.filepath("conf/grub-menu.lst"))
def test_run(self):
exit_code = test_mount_internal_external(self.emulator,
self.builddir, internal=True)
self.assertEqual(exit_code, 0)
exit_code = test_touch_file(self.emulator)
self.assertEqual(exit_code, 0)
#
# Syslinux
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment