[arch-projects] [MKINITCPIO][PATCH 1/2] Fix save build directory with presets
Current behaviour of -s option of mkinitcpio is bad when presets are used. mkinitcpio saves main process build directory which is always empty when preset option is used. mkinitcpio doesn't save preset sub processes build directories which is the expected behaviour. This patch fix the two previous points by: - inherit -s parameter inside preset sub processes. - force main process (in case of preset) to clean build directory Signed-off-by: Sebastien Luttringer <seblu@seblu.net> --- mkinitcpio | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 49dabbd..f48a26d 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -64,7 +64,7 @@ cleanup () { if [[ $TMPDIR ]]; then if (( $SAVELIST )); then - msg "build directory saved in %s" "$TMPDIR" + msg "Build directory saved in %s" "$TMPDIR" else rm -rf "$TMPDIR" fi @@ -198,6 +198,7 @@ if [[ $PRESET ]]; then # Use -b, -m and -v options specified earlier declare -a preset_mkopts preset_cmd [[ $BASEDIR ]] && preset_mkopts+=(-b "$BASEDIR") + (( SAVELIST )) && preset_mkopts+=(-s) (( QUIET )) || preset_mkopts+=(-v) # Build all images . "$PRESET" @@ -237,7 +238,8 @@ if [[ $PRESET ]]; then msg2 "${preset_cmd[*]}" "$0" "${preset_cmd[@]}" done - cleanup 0 + # Main process never needs to keep build directory + SAVELIST=0 cleanup 0 else die "Preset not found: \`%s'" "$PRESET" fi -- Sebastien "Seblu" Luttringer
This allow initcpio to boot vm which use virtio as network/disk backend. Signed-off-by: Sebastien Luttringer <seblu@seblu.net> --- install/virtio | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) create mode 100644 install/virtio diff --git a/install/virtio b/install/virtio new file mode 100644 index 0000000..67bcb3c --- /dev/null +++ b/install/virtio @@ -0,0 +1,16 @@ +#!/bin/bash + +build() { + MODULES="$(checked_modules 'virtio_\(blk\|pci\)')" +} + +help () +{ + cat<<HELPEOF +This hook loads the necessary modules for a virtio root device. +Detection will take place at runtime. To minimize the modules +in the image, add the autodetect hook too. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: -- Sebastien "Seblu" Luttringer
participants (1)
-
Sebastien Luttringer