initramfs: cleaned up 85/33485/1
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 12 Jan 2015 06:47:06 +0000 (15:47 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 12 Jan 2015 07:15:15 +0000 (16:15 +0900)
Using devtmpfs for populating /dev.
Removed pre-made dev nodes.
Removed pre-linked binaries to busybox.

Change-Id: I10be92fe41da52d3b8b05edbffd2a798a199b9ca
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
ramfs/busybox
ramfs/init
ramfs/initramfs

index dfe2d8f3eb11989aa162972836f43387283eefb8..e33255438e5eeecfae0696b5f4641c5d236db3c9 100755 (executable)
Binary files a/ramfs/busybox and b/ramfs/busybox differ
index 7e0cd17b3e57aeb58e6b9ece4a063097792c662f..5b8ed28f931aadb84f8574ac35ab3bfe56397199 100644 (file)
@@ -1,19 +1,35 @@
-#!/bin/sh
+#!/bin/busybox sh
 # SeokYeon Hwang (syeon.hwang@samsung.com)
 
-COLOR='\033[1;34m' # light blue
-NO_COLOR='\033[0m'
+COLOR_BLUE="\033[1;34m" # light blue
+COLOR_GREEN="\033[1;32m" # light green
+COLOR_RED="\033[1;31m" # light red
+NO_COLOR="\033[0m"
 
-echo -e "${COLOR}Mount proc filesystem${NO_COLOR}"
-mount -t proc proc /proc
+NEW_ROOT="/new_root"
 
-echo -e "${COLOR}Mount emulator image${NO_COLOR}"
-mount -o rw /dev/vda /new_root
+/bin/busybox mkdir -p /dev
+/bin/busybox mount -t devtmpfs devtmpfs /dev
 
-echo -e "${COLOR}Mount dev filesystem${NO_COLOR}"
-/bin/mkdir -p /new_root/dev
-/bin/mount -t devtmpfs devtmpfs /new_root/dev
-/bin/mkdir -p /new_root/sys
+exec &> /dev/console
 
-echo -e "${COLOR}Switching root${NO_COLOR}"
-exec switch_root -c /dev/console /new_root /sbin/init
+# for debugging...
+#/bin/busybox ls -la /dev >> /dev/console
+
+echo -e "${COLOR_GREEN}Preparing...${NO_COLOR}"
+/bin/busybox mkdir -p /proc
+/bin/busybox mount -t proc proc /proc
+/bin/busybox mkdir -p /sys
+/bin/busybox mount -t sysfs sys /sys
+
+# mount root...
+echo -e "${COLOR_GREEN}Mount image...${NO_COLOR}"
+/bin/busybox mount -o rw /dev/vda $NEW_ROOT
+
+# clean up...
+/bin/busybox umount /proc
+/bin/busybox umount /sys
+
+# switch root...
+echo -e "${COLOR_GREEN}Switching root...${NO_COLOR}"
+exec /bin/busybox switch_root -c /dev/console $NEW_ROOT /sbin/init
index 0a3a2b7f6419c46fedc6eeab591ae5865d9ac324..9541a86616798000d13d1b8f2281892dfd3db05f 100755 (executable)
@@ -1,31 +1,14 @@
 # SeokYeon Hwang (syeon.hwang@samsung.com)
 
-dir /dev 0755 0 0
-
-nod /dev/console 0600 0 0 c 5 1
-nod /dev/zero 0600 0 0 c 1 5
-nod /dev/mem 0600 0 0 c 1 1
-nod /dev/vda 0600 0 0 b 254 0
+# init script
+file /init ramfs/init 0755 0 0
 
-dir /root 0700 0 0
-dir /sbin 0755 0 0
+# busybox
 dir /bin 0755 0 0
-dir /new_root 0755 0 0
-dir /proc 0755 0 0
-
-file /sbin/v86d ramfs/v86d 0755 0 0
-file /init ramfs/init 0755 0 0
 file /bin/busybox ramfs/busybox 0755 0 0
 
-slink /bin/sh /bin/busybox 0755 0 0
-slink /sbin/init /bin/busybox 0755 0 0
-slink /bin/mount /bin/busybox 0755 0 0
-slink /bin/switch_root /bin/busybox 0755 0 0
-slink /bin/mkdir /bin/busybox 0755 0 0
-
-#slink /bin/insmod /bin/busybox 0755 0 0
-#slink /bin/cat /bin/busybox 0755 0 0
-#slink /bin/cp /bin/busybox 0755 0 0
-#slink /bin/mknod /bin/busybox 0755 0 0
-#slink /bin/ln /bin/busybox 0755 0 0
+# vesafb user driver
+# We don't use vesafb anymore, but it is useful for debugging.
+dir /sbin 0755 0 0
+file /sbin/v86d ramfs/v86d 0755 0 0