[Fai-commit] r5770 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Thu Apr 15 13:37:20 UTC 2010
Author: mt
Date: 2010-04-15 13:37:17 +0000 (Thu, 15 Apr 2010)
New Revision: 5770
Added:
branches/experimental/patches/setup-storage_parted2.2
Modified:
branches/experimental/patches/grub-pc
branches/experimental/patches/series
Log:
- updated grub-pc patch according to Waldemar's info
- added patch to avoid uninitialized variable warnings with parted 2.2
Modified: branches/experimental/patches/grub-pc
===================================================================
--- branches/experimental/patches/grub-pc 2010-04-13 19:48:46 UTC (rev 5769)
+++ branches/experimental/patches/grub-pc 2010-04-15 13:37:17 UTC (rev 5770)
@@ -1,7 +1,9 @@
-2009-04-29 Michael Tautschnig <mt at debian.org>
+2010-04-15 Michael Tautschnig <mt at debian.org>
* simple example: Added class GRUB_PC that installs and uses grub-pc instead
of grub, following the suggestions of Jean Spirat <jeanspirat at squirk.org>.
+ Thanks Waldemar Brodkorb <fai at waldemar-brodkorb.de> for more info and
+ debugging.
* Makefile: Make sure that all example scripts are executable
Index: trunk/Makefile
===================================================================
@@ -36,7 +38,7 @@
===================================================================
--- trunk.orig/examples/simple/scripts/GRUB_PC/10-setup
+++ trunk/examples/simple/scripts/GRUB_PC/10-setup
-@@ -2,8 +2,28 @@
+@@ -2,8 +2,32 @@
error=0 ; trap "error=$((error|1))" ERR
@@ -54,15 +56,19 @@
+# if class NOMBR is defined, write boot loader into root partition, not into mbr
+ifclass NOMBR && BOOT_DEVICE=$BOOT_PARTITION
+
-+$ROOTCMD grub-mkimage --output=/boot/grub/core.img lvm raid
++$ROOTCMD grub-mkimage --output=/boot/grub/core.img biosdisk part_msdos ext2 lvm raid
+$ROOTCMD update-grub
+
+for device in $BOOT_DEVICE; do
-+ grub_dev=$(device2grub $device)
-+ if [ -z "$grub_dev" ] ; then
-+ grub_dev=$(echo $device | sed 's#^/dev/##')
++ if echo $device | grep -q "^/dev/mapper/" ; then
++ grub_dev=$(echo $device | sed 's#^/dev/mapper/##')
++ else
++ grub_dev=$(device2grub $device)
++ if [ -z "$grub_dev" ] ; then
++ grub_dev=$(echo $device | sed 's#^/dev/##')
++ fi
+ fi
-+ $ROOTCMD /usr/sbin/grub-install --no-floppy --modules="lvm raid" "($grub_dev)"
++ $ROOTCMD /usr/sbin/grub-install --no-floppy --modules="biosdisk part_msdos ext2 lvm raid" "($grub_dev)"
+ $ROOTCMD /usr/sbin/grub-setup "($grub_dev)"
+done
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2010-04-13 19:48:46 UTC (rev 5769)
+++ branches/experimental/patches/series 2010-04-15 13:37:17 UTC (rev 5770)
@@ -10,3 +10,4 @@
setup-storage_resize2fs
setup-storage_always-format
setup-storage_package
+setup-storage_parted2.2
Added: branches/experimental/patches/setup-storage_parted2.2
===================================================================
--- branches/experimental/patches/setup-storage_parted2.2 (rev 0)
+++ branches/experimental/patches/setup-storage_parted2.2 2010-04-15 13:37:17 UTC (rev 5770)
@@ -0,0 +1,53 @@
+2010-04-15 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage/Volumes.pm: Fixed uninitialized variable warnings in parsing
+ output of parted 2.2.
+Index: trunk/lib/setup-storage/Volumes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Volumes.pm
++++ trunk/lib/setup-storage/Volumes.pm
+@@ -177,6 +177,23 @@
+ # 7 30450018816B 32547432959B 2097414144B logical ext3
+ # 8 32547465216B 82343278079B 49795812864B logical ext3
+ #
++# parted 2.2:
++# $ parted -s /dev/sda unit TiB print
++# Model: ATA VBOX HARDDISK (scsi)
++# Disk /dev/sda: 0.06TiB
++# Sector size (logical/physical): 512B/512B
++# Partition Table: msdos
++#
++# Number Start End Size Type File system Flags
++# 1 0.00TiB 0.00TiB 0.00TiB primary ext3 boot
++# 2 0.00TiB 0.00TiB 0.00TiB primary linux-swap(v1)
++# 3 0.00TiB 0.00TiB 0.00TiB primary ext3
++# 4 0.00TiB 0.06TiB 0.06TiB extended lba
++# 5 0.00TiB 0.00TiB 0.00TiB logical ext3
++# 6 0.00TiB 0.00TiB 0.00TiB logical ext3
++# 7 0.00TiB 0.00TiB 0.00TiB logical ext3
++# 8 0.00TiB 0.01TiB 0.00TiB logical ext3
++# 9 0.01TiB 0.06TiB 0.05TiB logical lvm
+
+ # As shown above, some entries may be blank. Thus the exact column starts
+ # and lengths must be parsed from the header line. This is stored in the
+@@ -249,9 +266,17 @@
+ # file system either
+ next if ($id eq "");
+
+- # extract the set of characters
+- $line =~ /^.{$fs_cols_before}(.{$fs_col_width})/;
+- my $fs = $1;
++ # extract the file system information
++ my $fs = "";
++ if (length ($line) > $fs_cols_before) {
++ if (length ($line) >= ($fs_cols_before + $fs_col_width)) {
++ $line =~ /^.{$fs_cols_before}(.{$fs_col_width})/;
++ $fs = $1;
++ } else {
++ $line =~ /^.{$fs_cols_before}(.+)$/;
++ $fs = $1;
++ }
++ }
+
+ # remove any trailing space
+ $fs =~ s/\s*$//g;
More information about the Fai-commit
mailing list