From e9fccb120e4fadacec689cfc6a487e41c41923d6 Mon Sep 17 00:00:00 2001 From: Mike Hibler Date: Tue, 13 Aug 2013 13:30:53 -0600 Subject: [PATCH] Fix to handle 9.x and above kernels that use "ada" device names. We map them to their "formerly known as" ad names. --- install/newclient | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/install/newclient b/install/newclient index b155207ff..64bcec18a 100644 --- a/install/newclient +++ b/install/newclient @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (c) 2003-2012 University of Utah and the Flux Group. +# Copyright (c) 2003-2013 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -519,9 +519,27 @@ sub freebsd_get_disksize { while () { chomp; # - # Take the first of ad or da, whichever we find first + # FreeBSD 9.x and above have renamed IDE and SATA devs. + # Use the compat name for now. # - if (/^((ad|da|ar|aacd|amrd|mfid|mfisyspd)\d): (\d+)MB/) { + if (/^(ada\d+): (\d+)MB/) { + $diskdev = $1; + $disksize = $2; + next; + } + if (/^(ada\d+): Previously was known as (ad\d+)/) { + if (defined($disksize) && defined($diskdev) && $1 eq $diskdev) { + $diskdev = $2; + } else { + $diskdev = ""; + } + last; + } + + # + # Take the first disk of a recognized type + # + if (/^((ad|da|ar|aacd|amrd|mfid|mfisyspd)\d+): (\d+)MB/) { $diskdev = $1; $disksize = $3; last; -- GitLab