]> code.ossystems Code Review - openembedded-core.git/commitdiff
update-rc.d: fix to handle priority numbers correctly
authorChen Qi <Qi.Chen@windriver.com>
Thu, 29 May 2014 01:50:53 +0000 (09:50 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 May 2014 15:31:22 +0000 (16:31 +0100)
The update-rc.d treated priority numbers begin with '0' as octal
numbers. This led to problems of update-rc.d being unable to handle
priorities like '08' or '09' correctly.

This patch fixes the above problem.

[YOCTO #6376]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch [new file with mode: 0644]
meta/recipes-core/update-rc.d/update-rc.d_0.7.bb

diff --git a/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch b/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch
new file mode 100644 (file)
index 0000000..85bc234
--- /dev/null
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Fix to handle priority numbers correctly.
+Previously, if the priority number is '08' or '09', for example,
+the script cannot handle them correctly as these numbers are treated
+as octal numbers.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ update-rc.d |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/update-rc.d b/update-rc.d
+index ec50d15..c70b859 100644
+--- a/update-rc.d
++++ b/update-rc.d
+@@ -205,7 +205,7 @@ case $1 in
+                               exit 1
+                       fi
+                       shift
+-                      NN=`printf %02d $1`
++                      NN=`printf %02d $(expr $1 + 0)`
+                       shift
+                       while [ "x$1" != "x." ]; do
+                               if [ $# -eq 0 ]; then
+-- 
+1.7.9.5
+
index 50dcaa2d3f65b30575336ecf5bdb527998dd8f75..c15cb78033779b3f1bbeeb21d66543ae63e65806 100644 (file)
@@ -13,6 +13,7 @@ SRCREV = "eca680ddf28d024954895f59a241a622dd575c11"
 SRC_URI = "git://github.com/philb/update-rc.d.git \
            file://add-verbose.patch \
            file://check-if-symlinks-are-valid.patch \
+           file://fix-to-handle-priority-numbers-correctly.patch \
           "
 
 S = "${WORKDIR}/git"