[arch-projects] [mkinitcpio][PATCH 06/12] functions: remove add_device

Dave Reisner d at falconindy.com
Thu Jun 9 16:10:00 EDT 2011


This was only ever used in the base layout, and it's not needed.
devices will be present if we're using devtmpfs, and created for us by
init if we mount on tmpfs.

Also, this is part of our move towards using bsdcpio instead of
gen_init_cpio, and as a side effect we can no longer support this. Any
devices that need to be created should be done so by the runtime hooks,
not the install time hooks.

Signed-off-by: Dave Reisner <d at falconindy.com>
---
 functions    |   17 -----------------
 install/base |    5 -----
 2 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/functions b/functions
index c0c0a78..dba647a 100644
--- a/functions
+++ b/functions
@@ -102,23 +102,6 @@ add_dir ()
     fi
 }
 
-# add_device /dev/foo type major minor [permissions]
-add_device ()
-{
-    if [ $# -ge 4 ]; then
-        local perms
-        perms="${5:-644}"
-        if ! grep -q "nod ${1}" "${FILELIST}"; then
-            add_dir $(get_dirname "${1}")
-            msg "  adding node ${1}"
-            echo "nod ${1} ${perms} 0 0 ${2} ${3} ${4}" >> "${FILELIST}"
-        fi
-    else
-        err "invalid device node format: $@"
-        return 1
-    fi
-}
-
 # what the hell does this do?
 add_symlink ()
 {
diff --git a/install/base b/install/base
index 87d789d..bd1349b 100644
--- a/install/base
+++ b/install/base
@@ -14,11 +14,6 @@ build()
     add_dir "/usr/sbin"
     add_dir "/run"
 
-    add_device "/dev/null" c 1 3
-    add_device "/dev/zero" c 1 5
-    add_device "/dev/console" c 5 1
-    add_device "/dev/mem" c 1 1
-
     add_binary /lib/initcpio/busybox /bin/busybox
     add_binary /sbin/modprobe
     add_binary /sbin/blkid
-- 
1.7.5.4



More information about the arch-projects mailing list