summaryrefslogtreecommitdiff
path: root/initramfs-init
diff options
context:
space:
mode:
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"