[Fai-commit] r5531 - people/michael/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Thu Oct 15 07:40:48 UTC 2009
Author: mt
Date: 2009-10-15 07:40:48 +0000 (Thu, 15 Oct 2009)
New Revision: 5531
Added:
people/michael/experimental/patches/setup-storage_document-caveats
people/michael/experimental/patches/setup-storage_fai-vol-id
people/michael/experimental/patches/setup-storage_hide-udevsettle
people/michael/experimental/patches/setup-storage_no-cylinder-boundaries
Modified:
people/michael/experimental/patches/grub-pc
people/michael/experimental/patches/logtail
people/michael/experimental/patches/series
Log:
Added several setup-storage related minor fixes, updated patches to match
current trunk, fixed typo in grub-pc patch
Modified: people/michael/experimental/patches/grub-pc
===================================================================
--- people/michael/experimental/patches/grub-pc 2009-10-14 13:13:57 UTC (rev 5530)
+++ people/michael/experimental/patches/grub-pc 2009-10-15 07:40:48 UTC (rev 5531)
@@ -30,7 +30,7 @@
-lilo grub-
+lilo grub- grub-pc-
+
-+PACKAGES aptitude GRUB
++PACKAGES aptitude GRUB_PC
+grub-pc grub- lilo-
Index: trunk/examples/simple/scripts/GRUB_PC/10-setup
===================================================================
Modified: people/michael/experimental/patches/logtail
===================================================================
--- people/michael/experimental/patches/logtail 2009-10-14 13:13:57 UTC (rev 5530)
+++ people/michael/experimental/patches/logtail 2009-10-15 07:40:48 UTC (rev 5531)
@@ -6,7 +6,7 @@
===================================================================
--- trunk.orig/bin/fai
+++ trunk/bin/fai
-@@ -283,6 +283,9 @@
+@@ -280,6 +280,9 @@
mkdir -p $LOGDIR
ln -snf $action-$fai_rundate $LOGDIR/../last-$action
ln -snf $action-$fai_rundate $LOGDIR/../last
@@ -45,11 +45,11 @@
+ fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- wait_for_jobs() {
-@@ -428,6 +432,7 @@
+ jobsrunning() {
+@@ -422,6 +426,7 @@
+ task_savelog() {
- mkdir -p $FAI_ROOT/var/lib/fai
- mkdir -p $FAI_ROOT/var/log/fai
+ mkdir -p $FAI_ROOT/var/{lib,log}/fai
+ rm -f /var/run/fai/kern.log.offset
fai-savelog -l
[ -f $LOGDIR/FAI_CLASSES ] && cp -pu $LOGDIR/FAI_CLASSES $FAI_ROOT/var/lib/fai
Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series 2009-10-14 13:13:57 UTC (rev 5530)
+++ people/michael/experimental/patches/series 2009-10-15 07:40:48 UTC (rev 5531)
@@ -8,3 +8,7 @@
bugfix-481871
bugfix-479537
setup-storage_full-crypto-support
+setup-storage_no-cylinder-boundaries
+setup-storage_hide-udevsettle
+setup-storage_fai-vol-id
+setup-storage_document-caveats
Added: people/michael/experimental/patches/setup-storage_document-caveats
===================================================================
--- people/michael/experimental/patches/setup-storage_document-caveats (rev 0)
+++ people/michael/experimental/patches/setup-storage_document-caveats 2009-10-15 07:40:48 UTC (rev 5531)
@@ -0,0 +1,50 @@
+2009-10-14 Michael Tautschnig <mt at debian.org>
+
+ * MT: sync changelog, 3.2.23 already contains entry about bootable!
+ * setup-storage/Parser.pm: Removed "mark / as bootable" code
+ * man/setup-storage.8: Document possible problems with previous software RAID
+ partitions and missing bootable flags.
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm
+@@ -529,12 +529,6 @@
+ } else {
+ $FAI::partition_pointer->{encrypt} = 0;
+ }
+- if ($FAI::device =~ /^PHY_(.+)$/ &&
+- -1 == $FAI::configs{$FAI::device}{bootable} &&
+- $FAI::partition_pointer->{mountpoint} eq "/") {
+- $FAI::configs{$FAI::device}{bootable} =
+- $FAI::partition_pointer->{number};
+- }
+ }
+
+ name: m{^([^/,\s\-]+)}
+Index: trunk/man/setup-storage.8
+===================================================================
+--- trunk.orig/man/setup-storage.8
++++ trunk/man/setup-storage.8
+@@ -416,6 +416,22 @@
+ .sp
+ .fi
+ .PP
++.SH CAVEATS
++.IP \(bu
++Partition UUID cannot be obtained: In case a partition was previously used as
++part of a software RAID volume and now is intended as swap space, udev fails
++when asked for a UUID. This happens because mkswap does not overwrite the
++previous RAID superblock. You can remove it using mdadm --zero-superblock
++<device>.
++.IP \(bu
++Machine does not boot because not partition is marked as bootable: If the
++bootable option is not specified, not partition will be marked as such. Modern
++BIOSes don't seem to require such markers anymore, but for some systems it may
++still be necessary. Previous versions of setup-storage by default marked the
++partition mounting / as bootable, but this is not a sane default for all cases.
++If you want to be sure not boot failures happen because of a missing bootable
++marker, explicitly set the bootable option. Of course, there are lots of other
++reasons why a system may fail to boot.
+ .SH SEE ALSO
+ This program is part of FAI (Fully Automatic Installation).
+ The FAI homepage is http://www.informatik.uni-koeln.de/fai.
Added: people/michael/experimental/patches/setup-storage_fai-vol-id
===================================================================
--- people/michael/experimental/patches/setup-storage_fai-vol-id (rev 0)
+++ people/michael/experimental/patches/setup-storage_fai-vol-id 2009-10-15 07:40:48 UTC (rev 5531)
@@ -0,0 +1,93 @@
+2009-10-14 Michael Tautschnig <mt at debian.org>
+
+ * fai-vol_id: New wrapper around udev's vol_id or blkid, whichever is
+ available
+ * setup-storage/Fstab.pm: Use fai-vol_id
+Index: trunk/lib/fai-vol_id
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ trunk/lib/fai-vol_id
+@@ -0,0 +1,48 @@
++#! /bin/bash
++
++# Copyright (c) 2009 by Michael Tautschnig <mt at debian.org>
++
++udev_vol_id="/lib/udev/vol_id"
++udev_blkid="/sbin/blkid"
++
++get_uuid() {
++ if [ -z $udev_vol_id ] ; then
++ $udev_blkid -s UUID -o value $1
++ exit $?
++ fi
++
++ /lib/udev/vol_id -u $1
++ exit $?
++}
++# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++get_label() {
++ if [ -z $udev_vol_id ] ; then
++ $udev_blkid -s LABEL -o value $1
++ exit $?
++ fi
++
++ /lib/udev/vol_id -l $1
++ exitcode=$?
++ if [ $exitcode -eq 0 -o $exitcode -eq 3 ] ; then
++ exitcode=0
++ fi
++ exit $exitcode
++}
++# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++
++# main program
++
++if [ ! -e $udev_vol_id ] ; then
++ udev_vol_id=""
++ if [ ! -e $udev_blkid ] ; then
++ "Neither udev vol_id nor blkid found!"
++ exit 1
++ fi
++fi
++
++while getopts ul opt ; do
++ case "$opt" in
++ u) shift ; get_uuid $1 ;;
++ l) shift ; get_label $1 ;;
++ esac
++done
+Index: trunk/lib/setup-storage/Fstab.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Fstab.pm
++++ trunk/lib/setup-storage/Fstab.pm
+@@ -94,7 +94,7 @@
+ # or labels, use these if available
+ my @uuid = ();
+ &FAI::execute_ro_command(
+- "/lib/udev/vol_id -u $device_name", \@uuid, 0);
++ "/usr/lib/fai/fai-vol_id -u $device_name", \@uuid, 0);
+
+ # every device must have a uuid, otherwise this is an error (unless we
+ # are testing only)
+@@ -107,8 +107,7 @@
+ # ok here
+ my @label = ();
+ &FAI::execute_ro_command(
+- "( /lib/udev/vol_id -l $device_name ; exc=\$? ; if [ \$exc -eq 3 ] ;" .
+- " then exit 0 ; else exit \$exc ; fi )", \@label, 0);
++ "/usr/lib/fai/fai-vol_id -l $device_name", \@label, 0);
+
+ # using the fstabkey value the desired device entry is defined
+ if ($key_type eq "uuid") {
+Index: trunk/debian/fai-client.install
+===================================================================
+--- trunk.orig/debian/fai-client.install
++++ trunk/debian/fai-client.install
+@@ -10,6 +10,7 @@
+ usr/lib/fai/prcopyleft
+ usr/lib/fai/get-config-dir*
+ usr/lib/fai/fai-divert
++usr/lib/fai/fai-vol_id
+ usr/bin/device2grub
+ usr/bin/fai-class
+ usr/bin/fai-debconf
Added: people/michael/experimental/patches/setup-storage_hide-udevsettle
===================================================================
--- people/michael/experimental/patches/setup-storage_hide-udevsettle (rev 0)
+++ people/michael/experimental/patches/setup-storage_hide-udevsettle 2009-10-15 07:40:48 UTC (rev 5531)
@@ -0,0 +1,48 @@
+2009-10-14 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage, setup-storage/Exec.pm: Hide udevsettle call
+Index: trunk/bin/setup-storage
+===================================================================
+--- trunk.orig/bin/setup-storage
++++ trunk/bin/setup-storage
+@@ -192,11 +192,14 @@
+ $FAI::udev_settle = "udevadm settle --timeout=10" if (&FAI::in_path("udevadm"));
+ $FAI::udev_settle = "udevsettle --timeout=10" if (&FAI::in_path("udevsettle"));
+ defined($FAI::udev_settle) or die "Failed to find determine a proper way to tell udev to settle; is udev installed?";
+-&FAI::execute_with_udevsettle($FAI::commands{$_}{cmd}) foreach (&numsort(keys %FAI::commands));
++foreach (&numsort(keys %FAI::commands)) {
++ `$FAI::udev_settle`;
++ &FAI::execute_command($FAI::commands{$_}{cmd});
++}
+
+ # generate the proposed fstab contents
+ # wait for udev to set up all devices
+-&FAI::execute_with_udevsettle("true");
++`$FAI::udev_settle`;
+ my @fstab = &FAI::generate_fstab(\%FAI::configs);
+
+ # print fstab
+Index: trunk/lib/setup-storage/Exec.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Exec.pm
++++ trunk/lib/setup-storage/Exec.pm
+@@ -237,19 +237,6 @@
+ }
+ return "";
+ }
+-################################################################################
+-#
+-# @brief Execute a command as in execute_command, but prefix it with udevsettle
+-#
+-# @return the identifier of the error
+-#
+-################################################################################
+-sub execute_with_udevsettle {
+- my ($command, $stdout, $stderr) = @_;
+- defined ($FAI::udev_settle) or &FAI::internal_error("udev settle command not defined");
+- return &execute_command("$FAI::udev_settle && $command", $stdout,
+- $stderr);
+-}
+
+ ################################################################################
+ #
Added: people/michael/experimental/patches/setup-storage_no-cylinder-boundaries
===================================================================
--- people/michael/experimental/patches/setup-storage_no-cylinder-boundaries (rev 0)
+++ people/michael/experimental/patches/setup-storage_no-cylinder-boundaries 2009-10-15 07:40:48 UTC (rev 5531)
@@ -0,0 +1,69 @@
+2009-10-14 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage/Sizes.pm: Align partition sizes to sectors on all disk labels,
+ dropping DOS cylinder-alignment.
+Index: trunk/lib/setup-storage/Sizes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Sizes.pm
++++ trunk/lib/setup-storage/Sizes.pm
+@@ -559,23 +559,9 @@
+ $FAI::configs{$config}{partitions}{$part_id}{start_byte} =
+ $next_start;
+
+- # the end may need some alignment, depending on the disk label
++ # partitions must end at sector boundary
+ my $end_byte = $next_start + $start - 1;
+-
+- # on msdos, ensure that the partition ends at a cylinder boundary
+- if ($FAI::configs{$config}{disklabel} eq "msdos") {
+- $end_byte -=
+- ($end_byte + 1) % ($current_disk->{sector_size} *
+- $current_disk->{bios_sectors_per_track} *
+- $current_disk->{bios_heads});
+- }
+-
+- # on gpt, ensure that the partition ends at a sector boundary
+- if ($FAI::configs{$config}{disklabel} eq "gpt" ||
+- $FAI::configs{$config}{disklabel} eq "gpt-bios") {
+- $end_byte -=
+- ($end_byte + 1) % $current_disk->{sector_size};
+- }
++ $end_byte -= ($end_byte + 1) % $current_disk->{sector_size};
+
+ # set $start and $end to the effective values
+ $start = $end_byte - $next_start + 1;
+@@ -646,13 +632,9 @@
+ my $next_start = 0;
+
+ if ($FAI::configs{$config}{disklabel} eq "msdos") {
+- # on msdos disk labels, the first partitions starts at head #1
+- $next_start = $current_disk->{bios_sectors_per_track} *
+- $current_disk->{sector_size};
+-
+ # the MBR requires space, too
+- $min_req_total_space += $current_disk->{bios_sectors_per_track} *
+- $current_disk->{sector_size};
++ $next_start = $current_disk->{sector_size};
++ $min_req_total_space += $current_disk->{sector_size};
+
+ } elsif ($FAI::configs{$config}{disklabel} eq "gpt") {
+ # on GPT-EFI disk labels the first 34 and last 33 sectors must be left alone
+@@ -665,13 +647,12 @@
+ $min_req_total_space += (34 + 33) * $current_disk->{sector_size};
+
+ } elsif ($FAI::configs{$config}{disklabel} eq "gpt-bios") {
+- # on BIOS-style disk labels, the first partitions starts at head #1
+- $next_start = $current_disk->{bios_sectors_per_track} *
+- $current_disk->{sector_size};
+-
+ # the MBR requires space, too
+- $min_req_total_space += $current_disk->{bios_sectors_per_track} *
+- $current_disk->{sector_size};
++ $next_start = $current_disk->{sector_size};
++ $min_req_total_space += $current_disk->{sector_size};
++ # not too sure whether this is needed: standard GPT partition table space
++ $next_start += 33 * $current_disk->{sector_size};
++ $min_req_total_space += 33 * $current_disk->{sector_size};
+
+ # apparently parted insists in having some space left at the end too
+ # modify the disk to claim the space for the second partition table
More information about the Fai-commit
mailing list