summaryrefslogtreecommitdiff
path: root/initramfs-init
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-03-03 19:43:26 +0200
committerTimo Teras <timo.teras@iki.fi>2009-03-03 19:43:26 +0200
commit8fb3af8d05555bc4a8206b7f524826bad77ad948 (patch)
treea2b3c1d86852c5f6a084944a6e436e7a19759bec /initramfs-init
parentcd5e0181517577a0c15d8f474a464f7464230080 (diff)
downloadabuild-8fb3af8d05555bc4a8206b7f524826bad77ad948.tar.gz
abuild-8fb3af8d05555bc4a8206b7f524826bad77ad948.tar.bz2
abuild-8fb3af8d05555bc4a8206b7f524826bad77ad948.tar.xz
abuild-8fb3af8d05555bc4a8206b7f524826bad77ad948.zip
initramfs: process accounting & misc fixes
enable bootchartd to use kernel process accounting for noticing all processes. also fix various little bits around the initramfs init.
Diffstat (limited to 'initramfs-init')
-rwxr-xr-xinitramfs-init19
1 files changed, 11 insertions, 8 deletions
diff --git a/initramfs-init b/initramfs-init
index 4bd64df..0ddf10d 100755
--- a/initramfs-init
+++ b/initramfs-init
@@ -9,7 +9,7 @@ SINGLEMODE=no
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# needed devs
-mknod /dev/null c 1 3
+[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
# basic mounts
mount -t proc -o noexec,nosuid,nodev proc /proc
@@ -73,7 +73,7 @@ done
# start bootcharting if wanted
if [ -n "$KOPT_chart" ]; then
ebegin "Starting bootchart logging"
- /sbin/bootchartd init "$NEWROOT"
+ /sbin/bootchartd start-initfs "$NEWROOT"
eend 0
fi
@@ -90,7 +90,6 @@ dmesg -n 1
# setup /dev
ebegin "Starting mdev"
mount -t tmpfs -o exec,nosuid,mode=0755 mdev /dev
-mknod -m 666 /dev/null c 1 3
ln -s sr0 /dev/cdrom
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
mdev -s
@@ -183,12 +182,15 @@ mkdir -p /etc/apk
for i in $ALPINE_MNT/packages/*; do
echo $i >> /etc/apk/repositories
done
+if [ -n "$KOPT_chart" ]; then
+ pkgs="$pkgs acct"
+fi
apk add --root /newroot --initdb --quiet --progress $pkgs >/dev/null
eend $?
# kill .apk-new files
if [ -z "$KOPT_keep_apk_new" ]; then
- find /newroot/etc -name '*.apk-new' | xargs rm
+ find /newroot/etc -name '*.apk-new' | xargs rm -f
fi
# copy alpine release info
@@ -200,10 +202,11 @@ if ! [ -f $NEWROOT/etc/apk/repositories ]; then
cp /etc/apk/repositories $NEWROOT/etc/apk/repositories
fi
-# newroot is done, signal bootchartd to relocate there
-# if bootcharting is done
+# setup bootchart for switch_root
+chart_init=""
if [ -n "$KOPT_chart" ]; then
- killall -USR2 bootchartd
+ /sbin/bootchartd stop-initfs "$NEWROOT"
+ chart_init="/sbin/bootchartd start-rootfs"
fi
# switch over to new root
@@ -218,7 +221,7 @@ sync
ln -sf /.modloop/modules $NEWROOT/lib/modules
echo ""
if [ -x $NEWROOT/sbin/init ]; then
- exec /bin/busybox switch_root $NEWROOT /sbin/init $KOPT_init_args
+ exec /bin/busybox switch_root $NEWROOT $chart_init /sbin/init $KOPT_init_args
fi
echo "initramfs emergency recovery shell launched"