Skip to contentSkip to conversation

Select cpio_list or source directory for initramfs image [u]

PATCH In review Martin Schlemmer [c] 1 participant 3 messages Sep 26, 2004 – Oct 17, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Select cpio_list or source directory for initramfs image [u]

Hi,

Attached is a patch that adds CONFIG_INITRAMFS_SOURCE, enabling you to either specify a file as cpio_list, or a directory to generate a list from. It depreciate the INITRAMFS_LIST environment variable introduced not long ago.

There are some issues (suggestions/patches welcome) that I am not sure about:
1) I put the menu entry under block devices, but I am not sure if this is the correct location?
2) There might be a better (or more correct) way to do this with kbuild?
3) Variable names and especially help text needs some love.
4) I am not sure if I am duplicating work in progress?

I did add an inline version of the patch, but the new evo 2.0 is brain dead again concerning patches (yes, even with 'preformat'), so I attached it as well. Also, I have not signed it off, as this is more for review/comments.

Comments will be appreciated.

-----

drivers/block/Kconfig 2004-09-27 00:08:01.970645528 +0200 renamed from drivers/block/Kconfig 2004-09-24 02:20:02.000000000 +0200 +26 -0
diff -urpN -X dontdiff linux-2.6.9-rc2-mm2/drivers/block/Kconfig linux-2.6.9-rc2-mm2.az/drivers/block/Kconfig
@@ -348,6 +348,32 @@ config BLK_DEV_INITRD
          "real" root file system, etc. See <file:Documentation/initrd.txt>
          for details.
 
+config INITRAMFS_SOURCE
+       string "Source directory of cpio_list"
+       default ""
+       help
+         This can be set to either a directory containing files, etc to be
+         included in the initramfs archive, or a file containing newline
+         separated entries.
+
+         If it is a file, it should be in the following format:
+           # a comment
+           file <name> <location> <mode> <uid> <gid>
+           dir <name> <mode> <uid> <gid>
+           nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
+
+         Where:
+           <name>      name of the file/dir/nod in the archive
+           <location>  location of the file in the current filesystem
+           <mode>      mode/permissions of the file
+           <uid>       user id (0=root)
+           <gid>       group id (0=root)
+           <dev_type>  device type (b=block, c=character)
+           <maj>       major number of nod
+           <min>       minor number of nod
+
+       If you are not sure, leave it blank.
+
 config LBD
        bool "Support for Large Block Devices"
        depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
scripts/gen_initramfs_list.sh 2004-09-26 22:56:09.881182768 +0200 renamed from scripts/gen_initramfs_list.sh 1970-01-01 02:00:00.000000000 +0200 +84 -0

84 lines not on this page · raw message

usr/Makefile 2004-09-27 00:00:54.733595432 +0200 renamed from usr/Makefile 2004-09-26 23:04:47.648470176 +0200 +19 -1
diff -urpN -X dontdiff linux-2.6.9-rc2-mm2/usr/Makefile linux-2.6.9-rc2-mm2.az/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
 # If you want a different list of files in the initramfs_data.cpio
 # then you can either overwrite the cpio_list in this directory
 # or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
 
 # initramfs_data.o contains the initramfs_data.cpio.gz image.
 # The image is included using .incbin, a dependency which is not
@@ -23,6 +23,24 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 # Commented out for now
 # initramfs-y := $(obj)/root/hello
 
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+      cmd_gen_list = $(shell \
+        if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+         if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+           echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+         else \
+           echo 'echo Using shipped $@'; \
+         fi; \
+       elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+         echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+       else \
+         echo 'echo Using shipped $@'; \
+       fi)
+
+
+$(INITRAMFS_LIST): FORCE
+       $(call cmd,gen_list)
+
 quiet_cmd_cpio = CPIO    $@
       cmd_cpio = ./$< $(INITRAMFS_LIST) > $@
 

Regards,

Signature · 1 line
Martin Schlemmer
drivers/block/Kconfig +26 -0
diff -urpN -X dontdiff linux-2.6.9-rc2-mm2/drivers/block/Kconfig linux-2.6.9-rc2-mm2.az/drivers/block/Kconfig
@@ -348,6 +348,32 @@ config BLK_DEV_INITRD
 	  "real" root file system, etc. See <file:Documentation/initrd.txt>
 	  for details.
 
+config INITRAMFS_SOURCE
+	string "Source directory of cpio_list"
+	default ""
+	help
+	  This can be set to either a directory containing files, etc to be
+	  included in the initramfs archive, or a file containing newline
+	  separated entries.
+
+	  If it is a file, it should be in the following format:
+	    # a comment
+	    file <name> <location> <mode> <uid> <gid>
+	    dir <name> <mode> <uid> <gid>
+	    nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
+
+	  Where:
+	    <name>      name of the file/dir/nod in the archive
+	    <location>  location of the file in the current filesystem
+	    <mode>      mode/permissions of the file
+	    <uid>       user id (0=root)
+	    <gid>       group id (0=root)
+	    <dev_type>  device type (b=block, c=character)
+	    <maj>       major number of nod
+	    <min>       minor number of nod
+
+	If you are not sure, leave it blank.
+
 config LBD
 	bool "Support for Large Block Devices"
 	depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
scripts/gen_initramfs_list.sh +84 -0

84 lines not on this page · raw message

usr/Makefile +19 -1
diff -urpN -X dontdiff linux-2.6.9-rc2-mm2/usr/Makefile linux-2.6.9-rc2-mm2.az/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
 # If you want a different list of files in the initramfs_data.cpio
 # then you can either overwrite the cpio_list in this directory
 # or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
 
 # initramfs_data.o contains the initramfs_data.cpio.gz image.
 # The image is included using .incbin, a dependency which is not
@@ -23,6 +23,24 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 # Commented out for now
 # initramfs-y := $(obj)/root/hello
 
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+      cmd_gen_list = $(shell \
+        if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+	  if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+	    echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+	  else \
+	    echo 'echo Using shipped $@'; \
+	  fi; \
+	elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+	  echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+	else \
+	  echo 'echo Using shipped $@'; \
+	fi)
+	
+
+$(INITRAMFS_LIST): FORCE
+	$(call cmd,gen_list)
+
 quiet_cmd_cpio = CPIO    $@
       cmd_cpio = ./$< $(INITRAMFS_LIST) > $@
 
#1 lore raw

On Mon, 2004-09-27 at 00:47 +0200, Martin Schlemmer wrote:

Hi,

Quoted 14 lines

Attached is a patch that adds CONFIG_INITRAMFS_SOURCE, enabling you to either specify a file as cpio_list, or a directory to generate a list from. It depreciate the INITRAMFS_LIST environment variable introduced not long ago.

There are some issues (suggestions/patches welcome) that I am not sure about:
1) I put the menu entry under block devices, but I am not sure if this is the correct location?
2) There might be a better (or more correct) way to do this with kbuild?
3) Variable names and especially help text needs some love.
4) I am not sure if I am duplicating work in progress?

Quoted 7 lines

I did add an inline version of the patch, but the new evo 2.0 is brain dead again concerning patches (yes, even with 'preformat'), so I attached it as well. Also, I have not signed it off, as this is more for review/comments.

Comments will be appreciated.

Attached is a patch (also inline, but evo 2.0 seems to not get 'preformat' right anymore) that replaces select-cpio_list-or-source-directory-for-initramfs-image.patch in 2.6.9-rc4-mm1, including the indentation fix, as well as fix an issue reported by Esben Nielsen <[email protected]> as proposed by Sam Ravnborg (Should fix failing to build if $O is set).

I also moved initramfs_list to initramfs_list.shipped, to make sure we always have an 'fall back' list (say you unset CONFIG_INITRAMFS_SOURCE and deleted your custom list/directory, then building will not fail).

drivers/block/Kconfig +26 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/drivers/block/Kconfig linux-2.6.9-rc4-mm1/drivers/block/Kconfig
@@ -348,6 +348,32 @@ config BLK_DEV_INITRD
 	  "real" root file system, etc. See <file:Documentation/initrd.txt>
 	  for details.
 
+config INITRAMFS_SOURCE
+	string "Source directory of cpio_list"
+	default ""
+	help
+	  This can be set to either a directory containing files, etc to be
+	  included in the initramfs archive, or a file containing newline
+	  separated entries.
+
+	  If it is a file, it should be in the following format:
+	    # a comment
+	    file <name> <location> <mode> <uid> <gid>
+	    dir <name> <mode> <uid> <gid>
+	    nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
+
+	  Where:
+	    <name>      name of the file/dir/nod in the archive
+	    <location>  location of the file in the current filesystem
+	    <mode>      mode/permissions of the file
+	    <uid>       user id (0=root)
+	    <gid>       group id (0=root)
+	    <dev_type>  device type (b=block, c=character)
+	    <maj>       major number of nod
+	    <min>       minor number of nod
+
+	  If you are not sure, leave it blank.
+
 config LBD
 	bool "Support for Large Block Devices"
 	depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
scripts/gen_initramfs_list.sh +84 -0

84 lines not on this page · raw message

usr/Makefile +20 -1
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/Makefile linux-2.6.9-rc4-mm1/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
 # If you want a different list of files in the initramfs_data.cpio
 # then you can either overwrite the cpio_list in this directory
 # or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
 
 # initramfs_data.o contains the initramfs_data.cpio.gz image.
 # The image is included using .incbin, a dependency which is not
@@ -23,6 +23,25 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 # Commented out for now
 # initramfs-y := $(obj)/root/hello
 
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+      cmd_gen_list = $(shell \
+        if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+	  if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+	    echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+	  else \
+	    echo 'echo Using shipped $@'; \
+	    echo 'cp -f $(srctree)/$(CONFIG_INITRAMFS_SOURCE).shipped $@'; \
+	  fi; \
+	elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+	  echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+	else \
+	  echo 'echo Using shipped $@'; \
+	  echo 'cp -f $(srctree)/$(CONFIG_INITRAMFS_SOURCE).shipped $@'; \
+	fi)
+
+$(INITRAMFS_LIST): FORCE
+	$(call cmd,gen_list)
+
 quiet_cmd_cpio = CPIO    $@
       cmd_cpio = ./$< $(INITRAMFS_LIST) > $@
 
usr/initramfs_list +0 -5
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list linux-2.6.9-rc4-mm1/usr/initramfs_list
@@ -1,5 +0,0 @@
-# This is a very simple initramfs - mostly preliminary for future expansion
-
-dir /dev 0755 0 0
-nod /dev/console 0600 0 0 c 5 1
-dir /root 0700 0 0
usr/initramfs_list.shipped +5 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list.shipped linux-2.6.9-rc4-mm1/usr/initramfs_list.shipped
@@ -0,0 +1,5 @@
+# This is a very simple initramfs - mostly preliminary for future expansion
+
+dir /dev 0755 0 0
+nod /dev/console 0600 0 0 c 5 1
+dir /root 0700 0 0

Thanks,

Signature · 1 line
Martin Schlemmer
drivers/block/Kconfig +26 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/drivers/block/Kconfig linux-2.6.9-rc4-mm1/drivers/block/Kconfig
@@ -348,6 +348,32 @@ config BLK_DEV_INITRD
 	  "real" root file system, etc. See <file:Documentation/initrd.txt>
 	  for details.
 
+config INITRAMFS_SOURCE
+	string "Source directory of cpio_list"
+	default ""
+	help
+	  This can be set to either a directory containing files, etc to be
+	  included in the initramfs archive, or a file containing newline
+	  separated entries.
+
+	  If it is a file, it should be in the following format:
+	    # a comment
+	    file <name> <location> <mode> <uid> <gid>
+	    dir <name> <mode> <uid> <gid>
+	    nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
+
+	  Where:
+	    <name>      name of the file/dir/nod in the archive
+	    <location>  location of the file in the current filesystem
+	    <mode>      mode/permissions of the file
+	    <uid>       user id (0=root)
+	    <gid>       group id (0=root)
+	    <dev_type>  device type (b=block, c=character)
+	    <maj>       major number of nod
+	    <min>       minor number of nod
+
+	  If you are not sure, leave it blank.
+
 config LBD
 	bool "Support for Large Block Devices"
 	depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
scripts/gen_initramfs_list.sh +84 -0

84 lines not on this page · raw message

usr/Makefile +20 -1
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/Makefile linux-2.6.9-rc4-mm1/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
 # If you want a different list of files in the initramfs_data.cpio
 # then you can either overwrite the cpio_list in this directory
 # or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
 
 # initramfs_data.o contains the initramfs_data.cpio.gz image.
 # The image is included using .incbin, a dependency which is not
@@ -23,6 +23,25 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 # Commented out for now
 # initramfs-y := $(obj)/root/hello
 
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+      cmd_gen_list = $(shell \
+        if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+	  if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+	    echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+	  else \
+	    echo 'echo Using shipped $@'; \
+	    echo 'cp -f $(srctree)/$(CONFIG_INITRAMFS_SOURCE).shipped $@'; \
+	  fi; \
+	elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+	  echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+	else \
+	  echo 'echo Using shipped $@'; \
+	  echo 'cp -f $(srctree)/$(CONFIG_INITRAMFS_SOURCE).shipped $@'; \
+	fi)
+
+$(INITRAMFS_LIST): FORCE
+	$(call cmd,gen_list)
+
 quiet_cmd_cpio = CPIO    $@
       cmd_cpio = ./$< $(INITRAMFS_LIST) > $@
 
usr/initramfs_list +0 -5
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list linux-2.6.9-rc4-mm1/usr/initramfs_list
@@ -1,5 +0,0 @@
-# This is a very simple initramfs - mostly preliminary for future expansion
-
-dir /dev 0755 0 0
-nod /dev/console 0600 0 0 c 5 1
-dir /root 0700 0 0
usr/initramfs_list.shipped +5 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list.shipped linux-2.6.9-rc4-mm1/usr/initramfs_list.shipped
@@ -0,0 +1,5 @@
+# This is a very simple initramfs - mostly preliminary for future expansion
+
+dir /dev 0755 0 0
+nod /dev/console 0600 0 0 c 5 1
+dir /root 0700 0 0
#2 lore raw
Quoted 33 lines · Martin Schlemmer

On Mon, 2004-09-27 at 00:47 +0200, Martin Schlemmer wrote:

Hi,

Quoted 14 lines

Attached is a patch that adds CONFIG_INITRAMFS_SOURCE, enabling you to either specify a file as cpio_list, or a directory to generate a list from. It depreciate the INITRAMFS_LIST environment variable introduced not long ago.

There are some issues (suggestions/patches welcome) that I am not sure about:
1) I put the menu entry under block devices, but I am not sure if this is the correct location?
2) There might be a better (or more correct) way to do this with kbuild?
3) Variable names and especially help text needs some love.
4) I am not sure if I am duplicating work in progress?

Quoted 7 lines

I did add an inline version of the patch, but the new evo 2.0 is brain dead again concerning patches (yes, even with 'preformat'), so I attached it as well. Also, I have not signed it off, as this is more for review/comments.

Comments will be appreciated.

Attached is a patch (also inline, but evo 2.0 seems to not get 'preformat' right anymore) that replaces select-cpio_list-or-source-directory-for-initramfs-image.patch in 2.6.9-rc4-mm1, including the indentation fix, as well as fix an issue reported by Esben Nielsen <[email protected]> as proposed by Sam Ravnborg (Should fix failing to build if $O is set).

Quoted 4 lines

I also moved initramfs_list to initramfs_list.shipped, to make sure we always have an 'fall back' list (say you unset CONFIG_INITRAMFS_SOURCE and deleted your custom list/directory, then building will not fail).

Here is a working one tested on a clean tree - sorry for first boo-boo.

drivers/block/Kconfig +26 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/drivers/block/Kconfig linux-2.6.9-rc4-mm1/drivers/block/Kconfig
@@ -348,6 +348,32 @@ config BLK_DEV_INITRD
 	  "real" root file system, etc. See <file:Documentation/initrd.txt>
 	  for details.
 
+config INITRAMFS_SOURCE
+	string "Source directory of cpio_list"
+	default ""
+	help
+	  This can be set to either a directory containing files, etc to be
+	  included in the initramfs archive, or a file containing newline
+	  separated entries.
+
+	  If it is a file, it should be in the following format:
+	    # a comment
+	    file <name> <location> <mode> <uid> <gid>
+	    dir <name> <mode> <uid> <gid>
+	    nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
+
+	  Where:
+	    <name>      name of the file/dir/nod in the archive
+	    <location>  location of the file in the current filesystem
+	    <mode>      mode/permissions of the file
+	    <uid>       user id (0=root)
+	    <gid>       group id (0=root)
+	    <dev_type>  device type (b=block, c=character)
+	    <maj>       major number of nod
+	    <min>       minor number of nod
+
+	  If you are not sure, leave it blank.
+
 config LBD
 	bool "Support for Large Block Devices"
 	depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
scripts/gen_initramfs_list.sh +84 -0

84 lines not on this page · raw message

usr/Makefile +18 -1
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/Makefile linux-2.6.9-rc4-mm1/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
 # If you want a different list of files in the initramfs_data.cpio
 # then you can either overwrite the cpio_list in this directory
 # or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
 
 # initramfs_data.o contains the initramfs_data.cpio.gz image.
 # The image is included using .incbin, a dependency which is not
@@ -23,6 +23,23 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 # Commented out for now
 # initramfs-y := $(obj)/root/hello
 
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+      cmd_gen_list = $(shell \
+        if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+	  if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+	    echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+	  else \
+	    echo 'cp -f $(srctree)/$(INITRAMFS_LIST).shipped $@'; \
+	  fi; \
+	elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+	  echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+	else \
+	  echo 'cp -f $(srctree)/$(INITRAMFS_LIST).shipped $@'; \
+	fi)
+
+$(INITRAMFS_LIST): FORCE
+	$(call cmd,gen_list)
+
 quiet_cmd_cpio = CPIO    $@
       cmd_cpio = ./$< $(INITRAMFS_LIST) > $@
 
usr/initramfs_list +0 -5
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list linux-2.6.9-rc4-mm1/usr/initramfs_list
@@ -1,5 +0,0 @@
-# This is a very simple initramfs - mostly preliminary for future expansion
-
-dir /dev 0755 0 0
-nod /dev/console 0600 0 0 c 5 1
-dir /root 0700 0 0
usr/initramfs_list.shipped +5 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list.shipped linux-2.6.9-rc4-mm1/usr/initramfs_list.shipped
@@ -0,0 +1,5 @@
+# This is a very simple initramfs - mostly preliminary for future expansion
+
+dir /dev 0755 0 0
+nod /dev/console 0600 0 0 c 5 1
+dir /root 0700 0 0
Signature · 1 line
Martin Schlemmer
drivers/block/Kconfig +26 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/drivers/block/Kconfig linux-2.6.9-rc4-mm1/drivers/block/Kconfig
@@ -348,6 +348,32 @@ config BLK_DEV_INITRD
 	  "real" root file system, etc. See <file:Documentation/initrd.txt>
 	  for details.
 
+config INITRAMFS_SOURCE
+	string "Source directory of cpio_list"
+	default ""
+	help
+	  This can be set to either a directory containing files, etc to be
+	  included in the initramfs archive, or a file containing newline
+	  separated entries.
+
+	  If it is a file, it should be in the following format:
+	    # a comment
+	    file <name> <location> <mode> <uid> <gid>
+	    dir <name> <mode> <uid> <gid>
+	    nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
+
+	  Where:
+	    <name>      name of the file/dir/nod in the archive
+	    <location>  location of the file in the current filesystem
+	    <mode>      mode/permissions of the file
+	    <uid>       user id (0=root)
+	    <gid>       group id (0=root)
+	    <dev_type>  device type (b=block, c=character)
+	    <maj>       major number of nod
+	    <min>       minor number of nod
+
+	  If you are not sure, leave it blank.
+
 config LBD
 	bool "Support for Large Block Devices"
 	depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
scripts/gen_initramfs_list.sh +84 -0

84 lines not on this page · raw message

usr/Makefile +18 -1
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/Makefile linux-2.6.9-rc4-mm1/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
 # If you want a different list of files in the initramfs_data.cpio
 # then you can either overwrite the cpio_list in this directory
 # or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
 
 # initramfs_data.o contains the initramfs_data.cpio.gz image.
 # The image is included using .incbin, a dependency which is not
@@ -23,6 +23,23 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 # Commented out for now
 # initramfs-y := $(obj)/root/hello
 
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+      cmd_gen_list = $(shell \
+        if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+	  if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+	    echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+	  else \
+	    echo 'cp -f $(srctree)/$(INITRAMFS_LIST).shipped $@'; \
+	  fi; \
+	elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+	  echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+	else \
+	  echo 'cp -f $(srctree)/$(INITRAMFS_LIST).shipped $@'; \
+	fi)
+
+$(INITRAMFS_LIST): FORCE
+	$(call cmd,gen_list)
+
 quiet_cmd_cpio = CPIO    $@
       cmd_cpio = ./$< $(INITRAMFS_LIST) > $@
 
usr/initramfs_list +0 -5
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list linux-2.6.9-rc4-mm1/usr/initramfs_list
@@ -1,5 +0,0 @@
-# This is a very simple initramfs - mostly preliminary for future expansion
-
-dir /dev 0755 0 0
-nod /dev/console 0600 0 0 c 5 1
-dir /root 0700 0 0
usr/initramfs_list.shipped +5 -0
diff -urpN linux-2.6.9-rc4-mm1.orig/usr/initramfs_list.shipped linux-2.6.9-rc4-mm1/usr/initramfs_list.shipped
@@ -0,0 +1,5 @@
+# This is a very simple initramfs - mostly preliminary for future expansion
+
+dir /dev 0755 0 0
+nod /dev/console 0600 0 0 c 5 1
+dir /root 0700 0 0