Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502064 - sys-kernel/dracut-036-r1 - /usr/bin/dracut: line 557: [: ==: unary operator expected
Summary: sys-kernel/dracut-036-r1 - /usr/bin/dracut: line 557: [: ==: unary operator e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amadeusz Żołnowski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-22 00:12 UTC by Erich Seifert
Modified: 2014-02-24 09:11 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Seifert 2014-02-22 00:12:03 UTC
Calling dracut to generate an initramfs produces the following log message before the regular output:

/usr/bin/dracut: line 557: [: ==: unary operator expected

As far as I can tell the cause of the error message didn't have any influence on the created images for me.

Reproducible: Always

Steps to Reproduce:
1. emerge sys-kernel/dracut
2. Call dracut to generate an initramfs, e.g.

# /usr/bin/dracut "" 3.13.4-gentoo
Actual Results:  
# /usr/bin/dracut "" 3.13.4-gentoo
/usr/bin/dracut: line 557: [: ==: unary operator expected
Executing: /usr/bin/dracut  3.13.4-gentoo
Could not find program "dhclient" required by network.
Could not find program "dhclient" required by network.
*** Including module: bash ***
*** Including module: caps ***
*** Including module: i18n ***
*** Including module: btrfs ***
*** Including module: kernel-modules ***
*** Including module: resume ***
*** Including module: rootfs-block ***
*** Including module: terminfo ***
*** Including module: udev-rules ***
Skipping udev rule: 91-permissions.rules
Skipping udev rule: 80-drivers-modprobe.rules
*** Including module: usrmount ***
*** Including module: base ***
*** Including module: fs-lib ***
*** Including module: shutdown ***
*** Including modules done ***
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
*** Resolving executable dependencies ***
*** Resolving executable dependencies done***
*** Pre-linking files ***
*** Pre-linking files done ***
*** Stripping files ***
*** Stripping files done ***
*** Store current command line parameters ***
*** Creating image file ***
*** Creating image file done ***

Expected Results:  
No error messages about syntax.

# emerge -pvq sys-kernel/dracut
[ebuild   R   ] sys-kernel/dracut-036-r1  USE="-debug (-selinux) -systemd"
Comment 1 Dennis Schridde 2014-02-22 10:51:42 UTC
It is parsing commandline arguments at that point, and someone forgot the quotes.

This patch fixes it:
--- dracut.orig 2014-02-22 11:50:21.885420684 +0100
+++ /usr/bin/dracut     2014-02-22 11:50:37.548960604 +0100
@@ -554,7 +554,7 @@
 # the old fashioned way
 
 while (($# > 0)); do
-    if [ ${1%%=*} == "++include" ]; then
+    if [ "${1%%=*}" == "++include" ]; then
         push include_src "$2"
         push include_target "$3"
         PARMS_TO_STORE+=" --include '$2' '$3'"
Comment 2 Alexander Tsoy 2014-02-22 11:12:17 UTC
Yes, this was already mentioned in another bug
https://bugs.gentoo.org/show_bug.cgi?id=501694#c1
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-02-23 17:07:24 UTC
Thanks!

+*dracut-036-r2 (23 Feb 2014)
+
+  23 Feb 2014; Amadeusz Żołnowski <aidecoe@gentoo.org> +dracut-036-r2.ebuild,
+  +files/036-0007-Added-missing-quotes.patch:
+  Fixed bug #502064 and bug #501566.
+
+  Commit on behalf of Alexander Tsoy <alexander@tsoy.me>.
+
Comment 4 Erich Seifert 2014-02-24 08:14:56 UTC
I'm sorry to reopen, but although the patch file exists now, it isn't in the patch list of dracut-036-r2.ebuild.
Comment 5 Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-02-24 09:11:42 UTC
(In reply to Erich Seifert from comment #4)
> I'm sorry to reopen, but although the patch file exists now, it isn't in the
> patch list of dracut-036-r2.ebuild.

I am sorry for my mistake. Thanks! :-)

+*dracut-036-r3 (24 Feb 2014)
+
+  24 Feb 2014; Amadeusz Żołnowski <aidecoe@gentoo.org> +dracut-036-r3.ebuild:
+  Added missing patch entry to the list.
+