]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Add option to turn on/off prelinking
authorHarald Hoyer <harald@redhat.com>
Tue, 17 Sep 2013 17:23:20 +0000 (12:23 -0500)
committerHarald Hoyer <harald@redhat.com>
Tue, 17 Sep 2013 17:25:29 +0000 (12:25 -0500)
--prelink, --noprelink

do_prelink=[yes|no]

dracut.8.asc
dracut.conf.5.asc
dracut.sh

index ee9d8de2466c83d3bf13928e432b98744fd4eef1..76fc75c4cf10626bd381f58071191d99ea5274bd 100644 (file)
@@ -269,6 +269,12 @@ example:
 **--nostrip**::
     do not strip binaries in the initramfs
 
+**--prelink**::
+    prelink binaries in the initramfs (default)
+
+**--noprelink**::
+    do not prelink binaries in the initramfs
+
 **--hardlink**::
     hardlink files in the initramfs (default)
 
index a32516c49b6ac41f27209659f3f1ebd456f725b1..63991d4f9b1a59e166c2cd50f1cb3ddbe64cc501 100644 (file)
@@ -67,6 +67,9 @@ Configuration files must have the extension .conf; other extensions are ignored.
 *do_strip=*"__{yes|no}__"::
     Strip binaries in the initramfs (default=yes)
 
+*do_prelink=*"__{yes|no}__"::
+    Prelink binaries in the initramfs (default=yes)
+
 *hostonly=*"__{yes|no}__"::
     Host-Only mode: Install only what is needed for booting the local host
     instead of a generic host and generate host-specific configuration.
index 196b3ad41a8d9451b7096c8315022b87f0c37a20..177e66d50daf24baeac3b288703a3971d155df24 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -97,6 +97,8 @@ Creates initial ramdisk images for preloading modules
   --kernel-cmdline [PARAMETERS] Specify default kernel command line parameters
   --strip               Strip binaries in the initramfs
   --nostrip             Do not strip binaries in the initramfs
+  --prelink             Prelink binaries in the initramfs
+  --noprelink           Do not prelink binaries in the initramfs
   --hardlink            Hardlink files in the initramfs
   --nohardlink          Do not hardlink files in the initramfs
   --prefix [DIR]        Prefix initramfs files with [DIR]
@@ -315,6 +317,8 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
     --long kernel-cmdline: \
     --long strip \
     --long nostrip \
+    --long prelink \
+    --long noprelink \
     --long hardlink \
     --long nohardlink \
     --long noprefix \
@@ -394,6 +398,8 @@ while :; do
         --no-early-microcode) early_microcode_l="no";;
         --strip)       do_strip_l="yes";;
         --nostrip)     do_strip_l="no";;
+        --prelink)     do_prelink_l="yes";;
+        --noprelink)   do_prelink_l="no";;
         --hardlink)    do_hardlink_l="yes";;
         --nohardlink)  do_hardlink_l="no";;
         --noprefix)    prefix_l="/";;
@@ -651,6 +657,8 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
 [[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
 [[ $do_strip_l ]] && do_strip=$do_strip_l
 [[ $do_strip ]] || do_strip=yes
+[[ $do_prelink_l ]] && do_prelink=$do_prelink_l
+[[ $do_prelink ]] || do_prelink=yes
 [[ $do_hardlink_l ]] && do_hardlink=$do_hardlink_l
 [[ $do_hardlink ]] || do_hardlink=yes
 [[ $prefix_l ]] && prefix=$prefix_l
@@ -1251,18 +1259,20 @@ if [[ $kernel_only != yes ]]; then
     fi
 fi
 
-PRELINK_BIN="$(command -v prelink)"
-if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then
-    if [[ $DRACUT_FIPS_MODE ]]; then
-        dinfo "*** Installing prelink files ***"
-        inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache
-    else
-        dinfo "*** Pre-linking files ***"
-        inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
-        chroot "$initdir" "$PRELINK_BIN" -a
-        rm -f -- "$initdir/$PRELINK_BIN"
-        rm -fr -- "$initdir"/etc/prelink.*
-        dinfo "*** Pre-linking files done ***"
+if [[ $do_prelink == yes ]]; then
+    PRELINK_BIN="$(command -v prelink)"
+    if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then
+        if [[ $DRACUT_FIPS_MODE ]]; then
+            dinfo "*** Installing prelink files ***"
+            inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache
+        else
+            dinfo "*** Pre-linking files ***"
+            inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
+            chroot "$initdir" "$PRELINK_BIN" -a
+            rm -f -- "$initdir/$PRELINK_BIN"
+            rm -fr -- "$initdir"/etc/prelink.*
+            dinfo "*** Pre-linking files done ***"
+        fi
     fi
 fi