From: Kumba <kumba@gentoo.org>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH]: Rewrite of arch/mips/ramdisk/
Date: Sun, 14 Nov 2004 01:43:08 -0500 [thread overview]
Message-ID: <4196FE7C.9040309@gentoo.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
Attached is a patch for 2.6 that rewrites how embedded mips ramdisks are
merged into the kernel. It basically replicates the method used by 2.6's
initramfs (for linking in config.gz and such into the kernel, see the files in
usr/ in the source tree).
The upside of this is the resulting ramdisk.o file has all the correct ELF
flags, which is needed for the few o64 targets used (IP32, IP22), and it gets
built to the right ABI (avoiding the binutils error about mixing 32/64bit code).
Tested on Indy R5K, O2 R5K and Cobalt RaQ2.
--Kumba
--
"Such is oft the course of deeds that move the wheels of the world: small
hands do them because they must, while the eyes of the great are elsewhere."
--Elrond
[-- Attachment #2: mips-new-way-of-doing-ramdisks.patch --]
[-- Type: text/plain, Size: 1865 bytes --]
diff -Naurp linux-2.6.10-rc1.mips.orig/arch/mips/ramdisk/Makefile linux-2.6.10-rc1.mips.mod/arch/mips/ramdisk/Makefile
--- linux-2.6.10-rc1.mips.orig/arch/mips/ramdisk/Makefile 2004-06-08 16:41:55.000000000 -0400
+++ linux-2.6.10-rc1.mips.mod/arch/mips/ramdisk/Makefile 2004-11-13 17:16:59.124686128 -0500
@@ -2,19 +2,12 @@
# Makefile for a ramdisk image
#
+# Builds from ramdisk.S using .incbin
obj-y += ramdisk.o
-
-O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
+# Set the path accordingly
img := $(subst ",,$(CONFIG_EMBEDDED_RAMDISK_IMAGE))
-# add $(src) when $(img) is relative
img := $(subst $(src)//,/,$(src)/$(img))
-quiet_cmd_ramdisk = LD $@
-define cmd_ramdisk
- $(LD) $(LDFLAGS) -T $(src)/ld.script -b binary --oformat $(O_FORMAT) -o $@ $(img)
-endef
-
-$(obj)/ramdisk.o: $(img) $(src)/ld.script
- $(call cmd,ramdisk)
-
+# Pass the filename to ${AS}
+EXTRA_AFLAGS="-DMIPS_EMBEDDED_RAMDISK=\"$(img)\""
diff -Naurp linux-2.6.10-rc1.mips.orig/arch/mips/ramdisk/ld.script linux-2.6.10-rc1.mips.mod/arch/mips/ramdisk/ld.script
--- linux-2.6.10-rc1.mips.orig/arch/mips/ramdisk/ld.script 2001-11-13 00:35:54.000000000 -0500
+++ linux-2.6.10-rc1.mips.mod/arch/mips/ramdisk/ld.script 1969-12-31 19:00:00.000000000 -0500
@@ -1,9 +0,0 @@
-OUTPUT_ARCH(mips)
-SECTIONS
-{
- .initrd :
- {
- *(.data)
- }
-}
-
diff -Naurp linux-2.6.10-rc1.mips.orig/arch/mips/ramdisk/ramdisk.S linux-2.6.10-rc1.mips.mod/arch/mips/ramdisk/ramdisk.S
--- linux-2.6.10-rc1.mips.orig/arch/mips/ramdisk/ramdisk.S 1969-12-31 19:00:00.000000000 -0500
+++ linux-2.6.10-rc1.mips.mod/arch/mips/ramdisk/ramdisk.S 2004-11-13 17:17:59.825458208 -0500
@@ -0,0 +1,9 @@
+/*
+ * For a detailed explanation of this file and the
+ * commands, see usr/initramfs_data.S in the root
+ * of this source tree.
+ */
+
+.section .initrd,"a"
+.incbin MIPS_EMBEDDED_RAMDISK
+
next reply other threads:[~2004-11-14 6:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-14 6:43 Kumba [this message]
2004-11-14 8:52 ` [PATCH]: Rewrite of arch/mips/ramdisk/ Christoph Hellwig
2004-11-14 17:25 ` Kumba
2004-11-14 19:31 ` Kumba
2004-11-15 17:55 ` Ralf Baechle
2004-11-16 1:21 ` Kumba
2004-11-15 18:05 ` Christoph Hellwig
2004-11-17 13:17 ` Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4196FE7C.9040309@gentoo.org \
--to=kumba@gentoo.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.