[readonly/geninitrd: 550/1068] - fixed indentation
draenog
draenog at pld-linux.org
Sat Nov 2 19:58:39 CET 2013
commit 675e6f410ddcffec80cc8322f6ddda3778793cf5
Author: undefine <undefine at pld-linux.org>
Date: Sun Jan 27 22:08:06 2008 +0000
- fixed indentation
svn-id: @9203
geninitrd | 54 +++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index a30fed8..47f28ea 100755
--- a/geninitrd
+++ b/geninitrd
@@ -1520,7 +1520,7 @@ initrd_gen_blkid()
add_linuxrc <<-'EOF'
device=/dev/no_partition_found
label="$(echo "$CMDLINE" | busybox awk '/root=LABEL=/ { gsub(/.*root=/,NIL,$0); gsub(/ .*/,NIL,$0); print $0; } ')"
- root="$(/bin/blkid -t $label -o device -l |busybox awk '/dev/ { gsub(/\/dev\//,NIL,$0); print $0; } ' )"
+ [ -n $label ] && root="$(/bin/blkid -t $label -o device -l | busybox awk '/dev/ { gsub(/\/dev\//,NIL,$0); print $0; } ' )"
[ -n "$root" ] && device=/dev/$root
EOF
}
@@ -1990,35 +1990,35 @@ if [ "$INITRDFS" = "initramfs" ]; then
add_linuxrc <<-'EOF'
[ -z "$device" ] && device=/dev/no_partition_found
if [ "$device" = '/dev/no_partition_found' ]; then
- eval "$(busybox awk -v c="$CMDLINE" '
- BEGIN {
- num_pattern_short = "[0-9a-f][0-9a-f][0-9a-f]";
- num_pattern = "[0-9a-f]" num_pattern_short;
- dev_pattern = "[hms][a-z][a-z]([0-9])+";
- partition = "no_partition_found";
- min = -1; maj = -1;
-
- gsub(/.*root=/,NIL,c);
- gsub(/ .*/,NIL,c);
-
- sub("^0x", "", c);
- if (c ~ "^" num_pattern_short "$") sub("^", "0", c);
- if (c ~ "^" num_pattern "$") {
- maj = sprintf("%s",substr(c,1,2));
- min = sprintf("%s",substr(c,3));
+ eval "$(busybox awk -v c="$CMDLINE" '
+ BEGIN {
+ num_pattern_short = "[0-9a-f][0-9a-f][0-9a-f]";
+ num_pattern = "[0-9a-f]" num_pattern_short;
+ dev_pattern = "[hms][a-z][a-z]([0-9])+";
+ partition = "no_partition_found";
+ min = -1; maj = -1;
+
+ gsub(/.*root=/,NIL,c);
+ gsub(/ .*/,NIL,c);
+
+ sub("^0x", "", c);
+ if (c ~ "^" num_pattern_short "$") sub("^", "0", c);
+ if (c ~ "^" num_pattern "$") {
+ maj = sprintf("%s",substr(c,1,2));
+ min = sprintf("%s",substr(c,3));
+ }
+ if (c ~ "^\/dev\/" dev_pattern "$") sub("^/dev/","", c);
+ if (c ~ "^" dev_pattern "$") partition = c;
}
- if (c ~ "^\/dev\/" dev_pattern "$") sub("^/dev/","", c);
- if (c ~ "^" dev_pattern "$") partition = c;
- }
- $4 ~ partition { maj = $1; min = $2; }
- $1 ~ maj && $2 ~ min { partition = $4; }
+ $4 ~ partition { maj = $1; min = $2; }
+ $1 ~ maj && $2 ~ min { partition = $4; }
- END {
- print sprintf("device=/dev/%s\nmaj=%s\nmin=%s",
- partition, maj, min);
- }
- ' /proc/partitions)"
+ END {
+ print sprintf("device=/dev/%s\nmaj=%s\nmin=%s",
+ partition, maj, min);
+ }
+ ' /proc/partitions)"
fi
if [ "$device" != '/dev/no_partition_found' -a ! -b $device ]; then
mknod $device b $maj $min
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090
More information about the pld-cvs-commit
mailing list