pf-tools/pf-tools: 2 new changesets
parmelan-guest at users.alioth.debian.org
parmelan-guest at users.alioth.debian.org
Tue Oct 25 21:23:39 UTC 2011
details: http://hg.debian.org/hg/pf-tools/pf-tools/rev/475ebc3d5ff0
changeset: 1177:475ebc3d5ff0
user: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
date: Tue Oct 25 23:21:40 2011 +0200
description:
Work around Linux >= 2.6.39 adding a final slash to an NFS mount source in /proc/mounts
details: http://hg.debian.org/hg/pf-tools/pf-tools/rev/8e3d241625d9
changeset: 1178:8e3d241625d9
user: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
date: Tue Oct 25 23:23:05 2011 +0200
description:
__get_kpkg_from_kernel(): remove the hardcoded '-grsec' suffix.
diffstat:
lib/PFTools/Disk.pm | 5 +++++
lib/PFTools/Utils.pm | 32 +++++++-------------------------
t/20.files.t | 6 +++---
templates/standard-preseed | 2 +-
4 files changed, 16 insertions(+), 29 deletions(-)
diffs (111 lines):
diff -r f5200d50f352 -r 8e3d241625d9 lib/PFTools/Disk.pm
--- a/lib/PFTools/Disk.pm Thu Oct 13 15:09:40 2011 +0200
+++ b/lib/PFTools/Disk.pm Tue Oct 25 23:23:05 2011 +0200
@@ -125,6 +125,11 @@
next if $line =~ m/^$/;
my ( $src_mnt, $mnt_pt, $type, $opt_mnt, $dump, $pass )
= split /\s+/, $line;
+
+ # Linux >= 2.6.39 (or around) adds a slash at the end of an NFS
+ # mount source in /proc/mounts, we need to remove it.
+ $src_mnt =~ s{ / \z }{}xms;
+
push @{ $struct->{'__mnt_order'} }, $mnt_pt;
$struct->{$mnt_pt} = {
'source' => $src_mnt,
diff -r f5200d50f352 -r 8e3d241625d9 lib/PFTools/Utils.pm
--- a/lib/PFTools/Utils.pm Thu Oct 13 15:09:40 2011 +0200
+++ b/lib/PFTools/Utils.pm Tue Oct 25 23:23:05 2011 +0200
@@ -2058,43 +2058,25 @@
=head2 __get_kpkg_from_kernel( $pxefilename, $deploymode )
-This functions computes the name of the kernel package to install, base on the
+This functions computes the name of the kernel package to install, based on the
I<$pxefilename> and I<$deploymode> values.
-FIXME: the -grsec thing should be moved out of the pf-tools source code, to
-keep it generic.
-
=cut
sub __get_kpkg_from_kernel {
my ( $pxefilename, $deploymode ) = @_;
- # FIXME why special-case this to Ubuntu!?
- if ( $deploymode =~ m{ \A ubuntu }xms ) {
+ my $package_name;
+
+ if ( $deploymode =~ m{ \A (?: debian | ubuntu ) }xms ) {
my ($version) = $pxefilename =~ m{ vmlinuz-(.+) \z }xms;
- return "linux-image-$version";
- }
-
- # FIXME I think this special case should be moved out of the pf-tools
- # source code to keep it generic
- if ( $pxefilename =~ m{ pxe }xms ) {
- my ( $vm, $type, $pxe, $version, @append )
- = split qr{ [-] }xms, $pxefilename;
- return
- qq{linux-image-$version-$type-}
- . join( q{-}, @append )
- . q{-grsec};
+ $package_name = qq{linux-image-$version};
}
else {
- my ( $vm, $version, $type, $append_version )
- = split qr{ [-] }xms, $pxefilename;
- return
- qq{linux-image-$version-$type-}
- . $append_version
- . q{-grsec};
+ croak qq{ERROR: Unknown deploymode '$deploymode'};
}
- return;
+ return $package_name;
}
=head2 __get_md5sum_for_preseedfile( $filename, $pf_config )
diff -r f5200d50f352 -r 8e3d241625d9 t/20.files.t
--- a/t/20.files.t Thu Oct 13 15:09:40 2011 +0200
+++ b/t/20.files.t Tue Oct 25 23:23:05 2011 +0200
@@ -736,7 +736,7 @@
d-i partman/confirm boolean true
### Base system installation
-d-i base-installer/kernel/image string linux-image-2.6.26.5-universal-grm2.1.12-grsec
+d-i base-installer/kernel/image string linux-image-2.6.26.5-universal-grm2.1.12
### Account setup
d-i passwd/root-login boolean false
@@ -790,7 +790,7 @@
#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0)
### Post-install command before reboot
-d-i preseed/late_command string apt-install linux-image-2.6.26.5-universal-grm2.1.12-grsec ; apt-install nfs-common ; apt-install pf-tools ; in-target wget http://mirrors.private//path/to/some/script -O /tmp//path/to/some/script ; in-target sh /tmp//path/to/some/script
+d-i preseed/late_command string apt-install linux-image-2.6.26.5-universal-grm2.1.12 ; apt-install nfs-common ; apt-install pf-tools ; in-target wget http://mirrors.private//path/to/some/script -O /tmp//path/to/some/script ; in-target sh /tmp//path/to/some/script
### Finishing up the installation
# Avoid that last message about the install being complete.
@@ -876,7 +876,7 @@
LABEL install
\tkernel debian-installer/lenny/amd64/linux
-\tappend DEBCONF_PRIORITY=critical vga=normal auto=true initrd=debian-installer/lenny/amd64/initrd.gz interface=eth0 netcfg/no_default_route=true url=http://vip-deploy.vlan-systeme.private/preseed_cbv4-rdeploy01 url/checksum=aa03e0e1599f6da3149aa94027d116a0 -- default pci=bfsort
+\tappend DEBCONF_PRIORITY=critical vga=normal auto=true initrd=debian-installer/lenny/amd64/initrd.gz interface=eth0 netcfg/no_default_route=true url=http://vip-deploy.vlan-systeme.private/preseed_cbv4-rdeploy01 url/checksum=e09982b86a653dd4602033e14255f6a7 -- default pci=bfsort
LABEL linux
\tkernel vmlinuz-2.6.26.5-universal-grm2.1.12
diff -r f5200d50f352 -r 8e3d241625d9 templates/standard-preseed
--- a/templates/standard-preseed Thu Oct 13 15:09:40 2011 +0200
+++ b/templates/standard-preseed Tue Oct 25 23:23:05 2011 +0200
@@ -120,7 +120,7 @@
#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0)
### Post-install command before reboot
-d-i preseed/late_command string apt-install [% kernelpkg %] ; apt-install nfs-common ; apt-install pf-tools ; in-target wget http://mirrors.private/[% config_script %] -O /tmp/[% config_script %] ; in-target sh /tmp/[% config_script %]
+d-i preseed/late_command string apt-install [% kernelpkg %] ; apt-install nfs-common ; apt-install pf-tools ; in-target wget http://mirrors.private/[% config_script %] -O /tmp/[% config_script %] ; in-target sh /tmp/[% config_script %]
### Finishing up the installation
# Avoid that last message about the install being complete.
More information about the pf-tools-commits
mailing list