dracut/suse_host_only
Raymond Wooninck 3210e44b88 Accepting request 201877 from home:trenn:dracut_test
- Add ACPI table override ability
- Adjust mkinitrd-dracut.sh to SUSE mkinitrd:
  <none> : Before gives a "usage" error -> now scans /boot for kernels
           and builds corresponding inirtrds for them
  -i -k  : Pass a list of kernels and initrd targets
           (not sure it was worth the hassle to be able to pass)
  -b     : Boot directory to search for kernel images
  -d     : Change root file system. Not tested whether dracut's behavior
           matches exactly what our mkinitrd does.
  -s     : Dummy (should even be obsolete in latest mkinitrd)
- Write caller and used parameters to syslog if mkinitrd is called.
  So that those can easily be fixed and checked for correctness.
  This should get reverted again before a bigger release.

OBS-URL: https://build.opensuse.org/request/show/201877
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=56
2013-10-02 12:32:19 +00:00

65 lines
1.9 KiB
Plaintext

mkinitrd-dracut.sh: Build host images for default_kernel_images and -i/-k paths
default_kernel_images and -i/-k paths are new (SuSE) code paths and
would have resulted in usage errors before.
There we want to build host only images for faster building and
smaller images.
Also force creation (overriding) of initrd images in these code paths.
Signed-off-by: Thomas Renninger <trenn@suse.de>
diff --git a/mkinitrd-dracut.sh b/mkinitrd-dracut.sh
index f7b53f1..a1519ea 100755
--- a/mkinitrd-dracut.sh
+++ b/mkinitrd-dracut.sh
@@ -3,6 +3,8 @@ kver=$(uname -r)
boot_dir="/boot"
quiet=0
+host_only=0
+force=0
error() { echo "$@" >&2; }
@@ -104,7 +106,8 @@ default_kernel_images() {
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
-
+ host_only=1
+ force=1
}
while (($# > 0)); do
@@ -119,8 +122,8 @@ while (($# > 0)); do
--version)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
- -v|--verbose) dracut_args="${dracut_args} -v";;
- -f|--force) dracut_args="${dracut_args} -f";;
+ -v|--verbose) dracut_args="${dracut_args} -v --keep";;
+ -f|--force) force=1;;
--preload) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--image-version) img_vers=yes;;
@@ -164,6 +167,8 @@ while (($# > 0)); do
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
+ host_only=1
+ force=1
;;
-i) read_arg initrd_images "$@" || shift $?
for initrd_image in $initrd_images;do
@@ -188,6 +193,9 @@ done
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )
+[[ $host_only == 1 ]] && dracut_args="${dracut_args} -H"
+[[ $force == 1 ]] && dracut_args="${dracut_args} -f"
+
echo "Creating: target|kernel|dracut args|basicmodules "
for ((i=0 ; $i<${#targets[@]} ; i++)); do