From patchwork Mon Jun 8 22:21:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 482029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 09DC5140213 for ; Tue, 9 Jun 2015 08:22:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 50A5E8B01B; Mon, 8 Jun 2015 22:22:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id npdemBUeo06p; Mon, 8 Jun 2015 22:22:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 639C5947FA; Mon, 8 Jun 2015 22:22:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 972A81C0A5C for ; Mon, 8 Jun 2015 22:22:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 918908A49A for ; Mon, 8 Jun 2015 22:22:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rPRvVEHSQYWF for ; Mon, 8 Jun 2015 22:21:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by hemlock.osuosl.org (Postfix) with ESMTP id 916638AD65 for ; Mon, 8 Jun 2015 22:21:59 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 44E03204D; Tue, 9 Jun 2015 00:22:06 +0200 (CEST) Received: from localhost (AToulouse-657-1-1012-185.w83-200.abo.wanadoo.fr [83.200.214.185]) by mail.free-electrons.com (Postfix) with ESMTPSA id EBBD4871; Tue, 9 Jun 2015 00:22:05 +0200 (CEST) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Tue, 9 Jun 2015 00:21:40 +0200 Message-Id: <1433802108-14351-8-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1433802108-14351-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1433802108-14351-1-git-send-email-thomas.petazzoni@free-electrons.com> Cc: Thomas Petazzoni Subject: [Buildroot] [PATCHv2 07/15] fs/iso9660: prepare cleaner kernel/initrd path handling X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The iso9660.mk modifies the menu.lst file from Grub to set the correct initrd/kernel image locations. However, with the upcoming support of other bootloaders for iso9660 filesystems, we need to modify a bit this logic. Instead of relying on the specific details of the grub menu.lst syntax, we introduce the __KERNEL_PATH__ and __INITRD_PATH__ magic keywords, which iso9660.mk will replace by the appropriate values. They can therefore be used where needed in grub menu.lst, and in similar configuration files of other bootloaders, as will be supported in the following commits. Also, in order to be consistent with the soon to be introduced support for having the root filesystem itself as iso9660, this commit changes the installation location of the initrd and kernel. Instead of being /initrd and /kernel, they become /boot/initrd and /boot/$(LINUX_IMAGE_NAME). Signed-off-by: Thomas Petazzoni Acked-by: Samuel Martin Acked-by: "Yann E. MORIN" --- fs/iso9660/Config.in | 5 +++++ fs/iso9660/iso9660.mk | 11 ++++++++--- fs/iso9660/menu.lst | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in index 9d00ab8..111158b 100644 --- a/fs/iso9660/Config.in +++ b/fs/iso9660/Config.in @@ -13,6 +13,11 @@ if BR2_TARGET_ROOTFS_ISO9660 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU string "Boot menu.lst file" default "fs/iso9660/menu.lst" + help + Use this option to provide a custom Grub menu.lst file. Note + that the strings __KERNEL_PATH__ and __INITRD_PATH__ will + automatically be replaced by the path to the kernel and + initrd images respectively. endif diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk index b313c65..035561d 100644 --- a/fs/iso9660/iso9660.mk +++ b/fs/iso9660/iso9660.mk @@ -22,12 +22,14 @@ endif ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y) define ROOTFS_ISO9660_INITRD - $(SED) '/initrd/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst + $(SED) '/__INITRD_PATH__/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst endef else define ROOTFS_ISO9660_INITRD $(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \ - $(ROOTFS_ISO9660_TARGET_DIR)/initrd + $(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd + $(SED) "s%__INITRD_PATH__%/boot/initrd%" \ + $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst endef endif @@ -38,7 +40,10 @@ define ROOTFS_ISO9660_PREPARATION $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito $(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \ $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst - $(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ROOTFS_ISO9660_TARGET_DIR)/kernel + $(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \ + $(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME) + $(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \ + $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst $(ROOTFS_ISO9660_SPLASHSCREEN) $(ROOTFS_ISO9660_INITRD) endef diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst index fd5c76a..8e8309f 100644 --- a/fs/iso9660/menu.lst +++ b/fs/iso9660/menu.lst @@ -12,8 +12,8 @@ foreground 000000 background cccccc title Buildroot ISO9660 image -kernel /kernel -initrd /initrd +kernel __KERNEL_PATH__ +initrd __INITRD_PATH__ title Hard Drive (first partition) rootnoverify (hd0)