From 2b98caa2c4fa3e4890f3a272fa43326861e16e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 9 Oct 2015 15:54:59 +0300 Subject: init: fix bootchart --- bootchartd.in | 21 +++++++++------------ features.d/bootchart.files | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bootchartd.in b/bootchartd.in index c4daa35..55a0883 100755 --- a/bootchartd.in +++ b/bootchartd.in @@ -46,7 +46,7 @@ do_logging() # Enable process accounting if configured if [ "$PROCESS_ACCOUNTING" = "yes" ]; then [ -e kernel_pacct ] || : > kernel_pacct - accton kernel_pacct + accton kernel_pacct > /dev/null fi # open file descriptors @@ -98,7 +98,7 @@ do_logging() i=$(($i + 1)) done - [ -e kernel_pacct ] && accton + [ -e kernel_pacct ] && accton off > /dev/null } # Stop the boot logger. The lock file is removed to force the loggers in @@ -151,19 +151,18 @@ finalize() # Package log files tar -zcf "$BOOTLOG_DEST" header $pacct *.log - rm "$LOGDIR"/* - rmdir "$LOGDIR" + rm -rf "$LOGDIR" } case "$1" in start-initfs) NEWROOT="$2" + mkdir -p "$LOGDIR" ( cleanup=true trap "not_stop_logging=false" USR1 trap "cleanup=false; not_stop_logging=false" USR2 - mkdir "$LOGDIR" cd "$LOGDIR" do_logging if $cleanup; then @@ -171,18 +170,16 @@ start-initfs) finalize fi ) & - echo $! > $LOGDIR/bootchart.pid + echo $! > "$LOGDIR"/bootchart.pid ;; stop-initfs) NEWROOT="$2" - - cd "$LOGDIR" - mkdir "$NEWROOT$LOGDIR" - cp /sbin/bootchartd $NEWROOT/sbin - PID=`cat bootchart.pid` + [ -x "$NEWROOT"/sbin/bootchartd ] || cp -a /sbin/bootchartd "$NEWROOT"/sbin + rm -rf "$NEWROOT/$LOGDIR" + PID=$(cat "$LOGDIR"/bootchart.pid) kill -USR2 $PID wait $PID - mv * "$NEWROOT$LOGDIR" + mv "$LOGDIR" "$NEWROOT" ;; start-rootfs) ( diff --git a/features.d/bootchart.files b/features.d/bootchart.files index 8adf4df..6f28294 100644 --- a/features.d/bootchart.files +++ b/features.d/bootchart.files @@ -1,3 +1,4 @@ +/sbin/bootchartd /usr/bin/ac /usr/bin/last /usr/bin/lastcomm @@ -5,4 +6,3 @@ /usr/sbin/dump-acct /usr/sbin/accton /usr/sbin/sa - -- cgit v1.2.3 From 230641798db191ca70f954aa4946512da206d7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 13 Oct 2015 09:56:40 +0300 Subject: init: remove unneeded openrc upgrade actions they in fact are harmful, hwdrivers is not needed or even wanted if using eudev. these were only needed for upgrade path from alpine 1.9.x which is no longer supported. --- initramfs-init.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/initramfs-init.in b/initramfs-init.in index 70bcab9..e9cdfe0 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -728,11 +728,6 @@ if [ -f $sysroot/etc/fstab ]; then relocate_alpine_mnt "$sysroot"/etc/fstab fi -# in case we upgrade we might need those: -rc_add hwdrivers sysinit -rc_add modloop sysinit - - # hack so we get openrc pkgs="$pkgs alpine-base" -- cgit v1.2.3 From 24a0ee3dbd482199a82872a5a2e6192a2c873fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 19 Oct 2015 10:20:17 +0300 Subject: init: fix tmpfs install during tmpfs install, some package scripts and triggers may require access to /dev, /proc or /sys. make sure those are bind mounted to have them available. they are later on move mounted to the new root. --- initramfs-init.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/initramfs-init.in b/initramfs-init.in index e9cdfe0..af6cfe9 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -773,11 +773,16 @@ if [ "$KOPT_keep_apk_new" != yes ]; then apkflags="$apkflags --clean-protected" [ -n "$ovlfiles" ] && apkflags="$apkflags --overlay-from-stdin" fi +mkdir -p $sysroot/sys $sysroot/proc $sysroot/dev +mount -o bind /sys $sysroot/sys +mount -o bind /proc $sysroot/proc +mount -o bind /dev $sysroot/dev if [ -n "$ovlfiles" ]; then apk add --root $sysroot $repo_opt $apkflags $pkgs <$ovlfiles else apk add --root $sysroot $repo_opt $apkflags $pkgs fi +umount $sysroot/sys $sysroot/proc $sysroot/dev eend $? # unmount ovl mount if needed -- cgit v1.2.3 From fc85d55cb38725841e73fcd790989b81e8e3e147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 19 Oct 2015 10:21:45 +0300 Subject: init: remove support for old apk package files remove support for /etc/lbu/packages.list (pre historic times) and /var/lib/apk/world (historic times). upgrade from versions using these files is no longer supported. --- initramfs-init.in | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/initramfs-init.in b/initramfs-init.in index af6cfe9..83cdafe 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -662,12 +662,7 @@ if [ -f "$ovl" ]; then eend $? $errstr || ovlfiles= # hack, incase /root/.ssh was included in apkovl [ -d "$sysroot/root" ] && chmod 700 "$sysroot/root" - pkgs="$pkgs $(sed 's/\#.*//' $sysroot/etc/lbu/packages.list 2>/dev/null)" - pkgs="$pkgs $(cat $sysroot/var/lib/apk/world \ - $sysroot/etc/apk/world 2>/dev/null)" - # clean up after upgrade - rm -f $sysroot/etc/lbu/packages.list \ - $sysroot/var/lib/apk/world + pkgs="$pkgs $(cat $sysroot/etc/apk/world 2>/dev/null)" # fix up inittab from pre openrc times (alpine v1.8) if [ -f "$sysroot"/etc/inittab ]; then -- cgit v1.2.3 From 8ee8b56d49f9a54a9af63c39f7915feebec0e67c Mon Sep 17 00:00:00 2001 From: Christian Kampka Date: Sun, 11 Oct 2015 16:49:56 +0200 Subject: features: virtio: Include virtio_net drivers --- features.d/virtio.modules | 1 + 1 file changed, 1 insertion(+) diff --git a/features.d/virtio.modules b/features.d/virtio.modules index fa74c10..b0e6c22 100644 --- a/features.d/virtio.modules +++ b/features.d/virtio.modules @@ -1,2 +1,3 @@ kernel/drivers/block/virtio* kernel/drivers/virtio +kernel/drivers/net/virtio_net* -- cgit v1.2.3 From 3c0420ee47d4389f4e6b8faeb109b0901835898f Mon Sep 17 00:00:00 2001 From: Christian Kampka Date: Sun, 11 Oct 2015 17:50:07 +0200 Subject: mkinitfs: features should be read from $basedir if set --- mkinitfs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitfs.in b/mkinitfs.in index d2a7890..14c728f 100755 --- a/mkinitfs.in +++ b/mkinitfs.in @@ -184,7 +184,7 @@ done shift $(( $OPTIND - 1 )) . $(readlink -f "$config") -features_dir=${features_dir:-"$sysconfdir/features.d"} +features_dir=${features_dir:-"${basedir%/:-}/${sysconfdir#/}/features.d"} [ -n "$myfeatures" ] && features="$myfeatures" if [ -n "$list_features" ]; then -- cgit v1.2.3