SVN: geninitrd/trunk/geninitrd
undefine
undefine at pld-linux.org
Sun Jan 27 23:08:06 CET 2008
Author: undefine
Date: Sun Jan 27 23:08:06 2008
New Revision: 9203
Modified:
geninitrd/trunk/geninitrd
Log:
- fixed indentation
Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd (original)
+++ geninitrd/trunk/geninitrd Sun Jan 27 23:08:06 2008
@@ -1520,7 +1520,7 @@
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 @@
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
More information about the pld-cvs-commit
mailing list