master - thin: rename function
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2dae78b722cff6...
Commit: 2dae78b722cff63eb6e11aa6cedad1ee3545871b
Parent: 1d7b2715e51b399dd275a832f488cd712b044844
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 23 11:47:10 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 23 14:19:17 2014 +0100
thin: rename function
Rename pool_can_resize_metadata() to more reusable
thin_pool_feature_supported() which could be queried
for mutiple different features.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 4 ++--
lib/metadata/metadata-exported.h | 2 +-
lib/metadata/thin_manip.c | 4 ++--
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 73f716c..e491ed8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Rename internal pool_can_resize_metadata() to thin_pool_feature_supported().
Issue error if libbblkid detects signature and fails to return offset/length.
Update autoconf config.guess/sub to 2014-01-01.
Online thin pool metadata resize requires 1.10 kernel thin pool target.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 07ee764..6333ef6 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3469,7 +3469,7 @@ static int _adjust_policy_params(struct cmd_context *cmd,
return_0;
if ((PERCENT_0 < percent && percent <= PERCENT_100) &&
(percent > policy_threshold)) {
- if (!pool_can_resize_metadata(lv)) {
+ if (!thin_pool_feature_supported(lv, THIN_FEATURE_METADATA_RESIZE)) {
log_error_once("Online metadata resize for %s/%s is not supported.",
lp->vg_name, lp->lv_name);
return 0;
@@ -3535,7 +3535,7 @@ static int _lvresize_poolmetadata_prepare(struct cmd_context *cmd,
lp->poolmetadataextents = 0;
- if (!pool_can_resize_metadata(pool_lv)) {
+ if (!thin_pool_feature_supported(pool_lv, THIN_FEATURE_METADATA_RESIZE)) {
log_error("Support for online metadata resize not detected.");
return 0;
}
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 52a1c4c..6e7987d 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -674,7 +674,7 @@ uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
struct logical_volume *find_pool_lv(const struct logical_volume *lv);
int pool_is_active(const struct logical_volume *pool_lv);
-int pool_can_resize_metadata(const struct logical_volume *pool_lv);
+int thin_pool_feature_supported(const struct logical_volume *pool_lv, int feature);
int update_pool_lv(struct logical_volume *lv, int activate);
int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profile,
int passed_args, int *chunk_size_calc_method,
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 00647cc..92c4177 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -206,7 +206,7 @@ int pool_is_active(const struct logical_volume *lv)
return 0;
}
-int pool_can_resize_metadata(const struct logical_volume *lv)
+int thin_pool_feature_supported(const struct logical_volume *lv, int feature)
{
static unsigned attr = 0U;
struct lv_segment *seg;
@@ -225,7 +225,7 @@ int pool_can_resize_metadata(const struct logical_volume *lv)
return 0;
}
- return (attr & THIN_FEATURE_METADATA_RESIZE) ? 1 : 0;
+ return (attr & feature) ? 1 : 0;
}
int pool_below_threshold(const struct lv_segment *pool_seg)
10 years, 3 months
master - missed pool_manip.c
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1d7b2715e51b39...
Commit: 1d7b2715e51b399dd275a832f488cd712b044844
Parent: 998af1a4fbf82cb9d5a2ba0c3c547ede39466a28
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 23 09:56:17 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 23 09:57:22 2014 +0100
missed pool_manip.c
Seems like this file is missing from the thin_manip move.
Make the tree compilable again.
---
lib/metadata/pool_manip.c | 305 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 305 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
new file mode 100644
index 0000000..a36c0c7
--- /dev/null
+++ b/lib/metadata/pool_manip.c
@@ -0,0 +1,305 @@
+/*
+ * Copyright (C) 2013-2014 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This file holds common pool functions.
+ */
+
+#include "lib.h"
+#include "activate.h"
+#include "locking.h"
+#include "metadata.h"
+#include "segtype.h"
+#include "lv_alloc.h"
+#include "defaults.h"
+#include "display.h"
+
+int attach_pool_metadata_lv(struct lv_segment *pool_seg,
+ struct logical_volume *metadata_lv)
+{
+ if (!seg_is_thin_pool(pool_seg)) {
+ log_error(INTERNAL_ERROR
+ "Unable to attach pool metadata LV to %s segtype.",
+ pool_seg->segtype->ops->name(pool_seg));
+ return 0;
+ }
+ pool_seg->metadata_lv = metadata_lv;
+ metadata_lv->status |= THIN_POOL_METADATA;
+ lv_set_hidden(metadata_lv);
+
+ return add_seg_to_segs_using_this_lv(metadata_lv, pool_seg);
+}
+
+int attach_pool_data_lv(struct lv_segment *pool_seg,
+ struct logical_volume *pool_data_lv)
+{
+ if (!seg_is_thin_pool(pool_seg)) {
+ log_error(INTERNAL_ERROR
+ "Unale to attach pool data LV to %s segtype.",
+ pool_seg->segtype->ops->name(pool_seg));
+ return 0;
+ }
+
+ if (!set_lv_segment_area_lv(pool_seg, 0, pool_data_lv,
+ 0, THIN_POOL_DATA))
+ return_0;
+
+ pool_seg->lv->status |= THIN_POOL;
+ lv_set_hidden(pool_data_lv);
+
+ return 1;
+}
+
+int attach_pool_lv(struct lv_segment *seg,
+ struct logical_volume *pool_lv,
+ struct logical_volume *origin,
+ struct logical_volume *merge_lv)
+{
+ if (!seg_is_thin_volume(seg)) {
+ log_error(INTERNAL_ERROR "Unable to attach pool to %s/%s"
+ " that is thin volume.",
+ pool_lv->vg->name, seg->lv->name);
+ return 0;
+ }
+
+ seg->pool_lv = pool_lv;
+ seg->origin = origin;
+ seg->lv->status |= THIN_VOLUME;
+
+ if (origin && !add_seg_to_segs_using_this_lv(origin, seg))
+ return_0;
+
+ if (!add_seg_to_segs_using_this_lv(pool_lv, seg))
+ return_0;
+
+ if (merge_lv) {
+ if (origin != merge_lv) {
+ if (!add_seg_to_segs_using_this_lv(merge_lv, seg))
+ return_0;
+ }
+
+ init_snapshot_merge(seg, merge_lv);
+ }
+
+ return 1;
+}
+
+int detach_pool_lv(struct lv_segment *seg)
+{
+ struct lv_thin_message *tmsg, *tmp;
+ struct seg_list *sl, *tsl;
+ int no_update = 0;
+
+ if (!seg->pool_lv) {
+ log_error(INTERNAL_ERROR
+ "No pool associated with %s LV, %s.",
+ seg->segtype->ops->name(seg), seg->lv->name);
+ return 0;
+ }
+
+ if (!lv_is_thin_pool(seg->pool_lv)) {
+ log_error(INTERNAL_ERROR
+ "Cannot detach pool from LV %s.",
+ seg->lv->name);
+ return 0;
+ }
+
+ /* Drop any message referencing removed segment */
+ dm_list_iterate_items_safe(tmsg, tmp, &(first_seg(seg->pool_lv)->thin_messages)) {
+ switch (tmsg->type) {
+ case DM_THIN_MESSAGE_CREATE_SNAP:
+ case DM_THIN_MESSAGE_CREATE_THIN:
+ if (tmsg->u.lv == seg->lv) {
+ log_debug_metadata("Discarding message for LV %s.",
+ tmsg->u.lv->name);
+ dm_list_del(&tmsg->list);
+ no_update = 1; /* Replacing existing */
+ }
+ break;
+ case DM_THIN_MESSAGE_DELETE:
+ if (tmsg->u.delete_id == seg->device_id) {
+ log_error(INTERNAL_ERROR "Trying to delete %u again.",
+ tmsg->u.delete_id);
+ return 0;
+ }
+ break;
+ default:
+ log_error(INTERNAL_ERROR "Unsupported message type %u.", tmsg->type);
+ break;
+ }
+ }
+
+ if (!detach_thin_external_origin(seg))
+ return_0;
+
+ if (!attach_pool_message(first_seg(seg->pool_lv),
+ DM_THIN_MESSAGE_DELETE,
+ NULL, seg->device_id, no_update))
+ return_0;
+
+ if (!remove_seg_from_segs_using_this_lv(seg->pool_lv, seg))
+ return_0;
+
+ if (seg->origin &&
+ !remove_seg_from_segs_using_this_lv(seg->origin, seg))
+ return_0;
+
+ /* If thin origin, remove it from related thin snapshots */
+ /*
+ * TODO: map removal of origin as snapshot lvconvert --merge?
+ * i.e. rename thin snapshot to origin thin origin
+ */
+ dm_list_iterate_items_safe(sl, tsl, &seg->lv->segs_using_this_lv) {
+ if (!seg_is_thin_volume(sl->seg) ||
+ (seg->lv != sl->seg->origin))
+ continue;
+
+ if (!remove_seg_from_segs_using_this_lv(seg->lv, sl->seg))
+ return_0;
+ /* Thin snapshot is now regular thin volume */
+ sl->seg->origin = NULL;
+ }
+
+ seg->lv->status &= ~THIN_VOLUME;
+ seg->pool_lv = NULL;
+ seg->origin = NULL;
+
+ return 1;
+}
+
+struct lv_segment *find_pool_seg(const struct lv_segment *seg)
+{
+ struct lv_segment *pool_seg;
+
+ pool_seg = get_only_segment_using_this_lv(seg->lv);
+
+ if (!pool_seg) {
+ log_error("Failed to find pool_seg for %s", seg->lv->name);
+ return NULL;
+ }
+
+ if (!seg_is_thin_pool(pool_seg)) {
+ log_error("%s on %s is not a pool segment.",
+ pool_seg->lv->name, seg->lv->name);
+ return NULL;
+ }
+
+ return pool_seg;
+}
+
+int create_pool(struct logical_volume *pool_lv,
+ const struct segment_type *segtype,
+ struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size)
+{
+ const struct segment_type *striped;
+ struct logical_volume *meta_lv, *data_lv;
+ struct lv_segment *seg;
+ char name[NAME_LEN];
+
+ if (pool_lv->le_count) {
+ log_error(INTERNAL_ERROR "Pool %s has already extents.",
+ pool_lv->name);
+ return 0;
+ }
+
+ /* LV is not yet a pool, so it's extension from lvcreate */
+ if (!(striped = get_segtype_from_string(pool_lv->vg->cmd, "striped")))
+ return_0;
+
+ if (activation() && segtype->ops->target_present &&
+ !segtype->ops->target_present(pool_lv->vg->cmd, NULL, NULL)) {
+ log_error("%s: Required device-mapper target(s) not "
+ "detected in your kernel.", segtype->name);
+ return 0;
+ }
+
+ /* Metadata segment */
+ if (!lv_add_segment(ah, stripes, 1, pool_lv, striped, 1, 0, 0))
+ return_0;
+
+ if (!activation())
+ log_warn("WARNING: Pool %s is created without initialization.",
+ pool_lv->name);
+ else {
+ if (!vg_write(pool_lv->vg) || !vg_commit(pool_lv->vg))
+ return_0;
+
+ /*
+ * If killed here, only the VISIBLE striped pool LV is left
+ * and user could easily remove it.
+ *
+ * FIXME: implement lazy clearing when activation is disabled
+ */
+ /* pool_lv is a new LV so the VG lock protects us */
+ if (!activate_lv_local(pool_lv->vg->cmd, pool_lv) ||
+ /* Clear 4KB of metadata device for new thin-pool. */
+ !wipe_lv(pool_lv, (struct wipe_params) { .do_zero = 1 })) {
+ log_error("Aborting. Failed to wipe pool metadata %s.",
+ pool_lv->name);
+ goto bad;
+ }
+ }
+
+ if (dm_snprintf(name, sizeof(name), "%s_%s", pool_lv->name,
+ "tmeta") < 0) {
+ log_error("Name is too long to be a pool name.");
+ goto bad;
+ }
+
+ if (!(meta_lv = lv_create_empty(name, NULL, LVM_READ | LVM_WRITE,
+ ALLOC_INHERIT, pool_lv->vg)))
+ goto_bad;
+
+ if (!move_lv_segments(meta_lv, pool_lv, 0, 0))
+ goto_bad;
+
+ /* Pool data segment */
+ if (!lv_add_segment(ah, 0, stripes, pool_lv, striped, stripe_size, 0, 0))
+ goto_bad;
+
+ if (!(data_lv = insert_layer_for_lv(pool_lv->vg->cmd, pool_lv,
+ pool_lv->status,
+ "_tdata")))
+ goto_bad;
+
+ seg = first_seg(pool_lv);
+ /* Drop reference as attach_pool_data_lv() takes it again */
+ if (!remove_seg_from_segs_using_this_lv(data_lv, seg))
+ goto_bad;
+
+ seg->segtype = segtype; /* Set as thin_pool segment */
+
+ if (!attach_pool_data_lv(seg, data_lv))
+ goto_bad;
+
+ if (!attach_pool_metadata_lv(seg, meta_lv))
+ goto_bad;
+
+ return 1;
+
+bad:
+ if (activation()) {
+ if (deactivate_lv_local(pool_lv->vg->cmd, pool_lv)) {
+ log_error("Aborting. Could not deactivate pool %s.",
+ pool_lv->name);
+ return 0;
+ }
+ if (!lv_remove(pool_lv) ||
+ !vg_write(pool_lv->vg) || !vg_commit(pool_lv->vg))
+ log_error("Manual intervention may be required to "
+ "remove abandoned LV(s) before retrying.");
+ }
+
+ return 0;
+}
10 years, 3 months
master - Misc: Change name of lvcreate_params field - s/create_thin_pool/create_pool/
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=998af1a4fbf82c...
Commit: 998af1a4fbf82cb9d5a2ba0c3c547ede39466a28
Parent: 5590448c320eb76789110546cdea47dd1d7a97b3
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Jan 22 10:30:55 2014 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Jan 22 10:30:55 2014 -0600
Misc: Change name of lvcreate_params field - s/create_thin_pool/create_pool/
In preparation for other segment types that create and use "pools", we
s/create_thin_pool/create_pool/. This way it is not awkward when creating
a cachepool, for example, to use "create_thin_pool".
---
lib/metadata/lv_manip.c | 2 +-
lib/metadata/metadata-exported.h | 2 +-
liblvm/lvm_lv.c | 2 +-
tools/lvcreate.c | 36 ++++++++++++++++++------------------
4 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index f45c89f..07ee764 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6227,7 +6227,7 @@ struct logical_volume *lv_create_single(struct volume_group *vg,
struct logical_volume *lv;
/* Create thin pool first if necessary */
- if (lp->create_thin_pool) {
+ if (lp->create_pool) {
if (!seg_is_thin_pool(lp) &&
!(lp->segtype = get_segtype_from_string(vg->cmd, "thin-pool")))
return_0;
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 8e36891..52a1c4c 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -731,7 +731,7 @@ struct lvcreate_params {
/* flags */
int snapshot; /* snap */
int thin; /* thin */
- int create_thin_pool; /* thin */
+ int create_pool; /* thin */
int zero; /* all */
int wipe_signatures; /* all */
int major; /* all */
diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c
index 3b0e18d..9f3a9c6 100644
--- a/liblvm/lvm_lv.c
+++ b/liblvm/lvm_lv.c
@@ -507,7 +507,7 @@ static int _lv_set_pool_params(struct lvcreate_params *lp,
lp->pool = pool;
- lp->create_thin_pool = 1;
+ lp->create_pool = 1;
lp->segtype = get_segtype_from_string(vg->cmd, "thin-pool");
lp->stripes = 1;
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index d0ca7bc..c8206ca 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -333,7 +333,7 @@ static int _update_extents_params(struct volume_group *vg,
lp->extents = lp->extents - size_rest;
}
- if (lp->create_thin_pool) {
+ if (lp->create_pool) {
if (!update_pool_params(vg, lp->target_attr, lp->passed_args,
lp->extents, vg->extent_size,
&lp->thin_chunk_size_calc_policy,
@@ -392,9 +392,9 @@ static int _read_size_params(struct lvcreate_params *lp,
/* If size/extents given with thin, then we are creating a thin pool */
if (seg_is_thin(lp) && (arg_count(cmd, size_ARG) || arg_count(cmd, extents_ARG)))
- lp->create_thin_pool = 1;
+ lp->create_pool = 1;
- if (!lp->create_thin_pool && arg_count(cmd, poolmetadatasize_ARG)) {
+ if (!lp->create_pool && arg_count(cmd, poolmetadatasize_ARG)) {
log_error("--poolmetadatasize may only be specified when allocating the thin pool.");
return 0;
}
@@ -665,7 +665,7 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
/* Persistent minor */
if (arg_count(cmd, persistent_ARG)) {
- if (lp->create_thin_pool && !lp->thin) {
+ if (lp->create_pool && !lp->thin) {
log_error("--persistent is not permitted when creating a thin pool device.");
return 0;
}
@@ -779,7 +779,7 @@ static int _lvcreate_params(struct lvcreate_params *lp,
log_error("Snapshots are incompatible with thin_pool segment_type.");
return 0;
}
- lp->create_thin_pool = 1;
+ lp->create_pool = 1;
}
if (seg_is_thin_volume(lp))
@@ -895,7 +895,7 @@ static int _lvcreate_params(struct lvcreate_params *lp,
if (!_lvcreate_name_params(lp, cmd, &argc, &argv) ||
!_read_size_params(lp, lcp, cmd) ||
!get_stripe_params(cmd, &lp->stripes, &lp->stripe_size) ||
- (lp->create_thin_pool &&
+ (lp->create_pool &&
!get_pool_params(cmd, NULL, &lp->passed_args,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size, &lp->discards,
@@ -920,12 +920,12 @@ static int _lvcreate_params(struct lvcreate_params *lp,
if (!(lp->segtype = get_segtype_from_string(cmd, "snapshot")))
return_0;
- } else if (!lp->create_thin_pool && arg_count(cmd, chunksize_ARG)) {
+ } else if (!lp->create_pool && arg_count(cmd, chunksize_ARG)) {
log_error("--chunksize is only available with snapshots and thin pools.");
return 0;
}
- if (lp->create_thin_pool) {
+ if (lp->create_pool) {
/* TODO: add lvm.conf default y|n */
lp->poolmetadataspare = arg_int_value(cmd, poolmetadataspare_ARG,
DEFAULT_POOL_METADATA_SPARE);
@@ -974,7 +974,7 @@ static int _check_thin_parameters(struct volume_group *vg, struct lvcreate_param
struct lv_list *lvl;
unsigned i;
- if (!lp->thin && !lp->create_thin_pool && !lp->snapshot) {
+ if (!lp->thin && !lp->create_pool && !lp->snapshot) {
log_error("Please specify device size(s).");
return 0;
}
@@ -984,7 +984,7 @@ static int _check_thin_parameters(struct volume_group *vg, struct lvcreate_param
return 0;
}
- if (!lp->create_thin_pool) {
+ if (!lp->create_pool) {
static const int _argname[] = {
alloc_ARG,
chunksize_ARG,
@@ -1060,14 +1060,14 @@ static int _validate_internal_thin_processing(const struct lvcreate_params *lp)
/*
The final state should be one of:
- thin create_thin_pool snapshot origin pool
- 1 1 0 0 y/n - create new pool and a thin LV in it
- 1 0 0 0 y - create new thin LV in existing pool
- 0 1 0 0 y/n - create new pool only
- 1 0 1 1 y - create thin snapshot of existing thin LV
+ thin create_pool snapshot origin pool
+ 1 1 0 0 y/n - create new pool and a thin LV in it
+ 1 0 0 0 y - create new thin LV in existing pool
+ 0 1 0 0 y/n - create new pool only
+ 1 0 1 1 y - create thin snapshot of existing thin LV
*/
- if (!lp->create_thin_pool && !lp->pool) {
+ if (!lp->create_pool && !lp->pool) {
log_error(INTERNAL_ERROR "--thinpool not identified.");
r = 0;
}
@@ -1077,7 +1077,7 @@ static int _validate_internal_thin_processing(const struct lvcreate_params *lp)
r = 0;
}
- if (!lp->thin && !lp->create_thin_pool && !lp->snapshot) {
+ if (!lp->thin && !lp->create_pool && !lp->snapshot) {
log_error(INTERNAL_ERROR "Failed to identify what type of thin target to use.");
r = 0;
}
@@ -1126,7 +1126,7 @@ int lvcreate(struct cmd_context *cmd, int argc, char **argv)
if (seg_is_thin(&lp) && !_validate_internal_thin_processing(&lp))
goto_out;
- if (lp.create_thin_pool) {
+ if (lp.create_pool) {
if (!handle_pool_metadata_spare(vg, lp.poolmetadataextents,
lp.pvh, lp.poolmetadataspare))
goto_out;
10 years, 3 months
master - Misc: Move some thin pool functions to a new file
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5590448c320eb7...
Commit: 5590448c320eb76789110546cdea47dd1d7a97b3
Parent: 2b9d25133e3dfa0f95f838a75a682e5195110684
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Jan 22 10:11:29 2014 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Jan 22 10:11:29 2014 -0600
Misc: Move some thin pool functions to a new file
Functions that handle set-up, tear-down and creation of thin pool
volumes will be more generally applicable when more targets exist
that make use of device-mapper's persistent data format. One of
these targets is the dm-cache target. I've selected some functions
that will be useful for the cache segment type to be moved, since
they will no longer be thin pool specific but are more broadly
useful to any segment type that makes use of a 'pool' LV.
---
lib/Makefile.in | 1 +
lib/metadata/thin_manip.c | 241 ---------------------------------------------
2 files changed, 1 insertions(+), 241 deletions(-)
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 8fdc194..c3ace5f 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -88,6 +88,7 @@ SOURCES =\
metadata/merge.c \
metadata/metadata.c \
metadata/mirror.c \
+ metadata/pool_manip.c \
metadata/pv.c \
metadata/pv_manip.c \
metadata/pv_map.c \
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index e12a8ad..00647cc 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -21,15 +21,6 @@
#include "defaults.h"
#include "display.h"
-int attach_pool_metadata_lv(struct lv_segment *pool_seg, struct logical_volume *metadata_lv)
-{
- pool_seg->metadata_lv = metadata_lv;
- metadata_lv->status |= THIN_POOL_METADATA;
- lv_set_hidden(metadata_lv);
-
- return add_seg_to_segs_using_this_lv(metadata_lv, pool_seg);
-}
-
int detach_pool_metadata_lv(struct lv_segment *pool_seg, struct logical_volume **metadata_lv)
{
struct logical_volume *lv = pool_seg->metadata_lv;
@@ -48,117 +39,6 @@ int detach_pool_metadata_lv(struct lv_segment *pool_seg, struct logical_volume *
return 1;
}
-int attach_pool_data_lv(struct lv_segment *pool_seg, struct logical_volume *pool_data_lv)
-{
- if (!set_lv_segment_area_lv(pool_seg, 0, pool_data_lv, 0, THIN_POOL_DATA))
- return_0;
-
- pool_seg->lv->status |= THIN_POOL;
- lv_set_hidden(pool_data_lv);
-
- return 1;
-}
-
-int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv,
- struct logical_volume *origin, struct logical_volume *merge_lv)
-{
- seg->pool_lv = pool_lv;
- seg->lv->status |= THIN_VOLUME;
- seg->origin = origin;
-
- if (origin && !add_seg_to_segs_using_this_lv(origin, seg))
- return_0;
-
- if (!add_seg_to_segs_using_this_lv(pool_lv, seg))
- return_0;
-
- if (merge_lv) {
- if (origin != merge_lv) {
- if (!add_seg_to_segs_using_this_lv(merge_lv, seg))
- return_0;
- }
-
- init_snapshot_merge(seg, merge_lv);
- }
-
- return 1;
-}
-
-int detach_pool_lv(struct lv_segment *seg)
-{
- struct lv_thin_message *tmsg, *tmp;
- struct seg_list *sl, *tsl;
- int no_update = 0;
-
- if (!seg->pool_lv || !lv_is_thin_pool(seg->pool_lv)) {
- log_error(INTERNAL_ERROR "Cannot detach pool from non-thin LV %s",
- seg->lv->name);
- return 0;
- }
-
- /* Drop any message referencing removed segment */
- dm_list_iterate_items_safe(tmsg, tmp, &(first_seg(seg->pool_lv)->thin_messages)) {
- switch (tmsg->type) {
- case DM_THIN_MESSAGE_CREATE_SNAP:
- case DM_THIN_MESSAGE_CREATE_THIN:
- if (tmsg->u.lv == seg->lv) {
- log_debug_metadata("Discarding message for LV %s.",
- tmsg->u.lv->name);
- dm_list_del(&tmsg->list);
- no_update = 1; /* Replacing existing */
- }
- break;
- case DM_THIN_MESSAGE_DELETE:
- if (tmsg->u.delete_id == seg->device_id) {
- log_error(INTERNAL_ERROR "Trying to delete %u again.",
- tmsg->u.delete_id);
- return 0;
- }
- break;
- default:
- log_error(INTERNAL_ERROR "Unsupported message type %u.", tmsg->type);
- break;
- }
- }
-
- if (!detach_thin_external_origin(seg))
- return_0;
-
- if (!attach_pool_message(first_seg(seg->pool_lv),
- DM_THIN_MESSAGE_DELETE,
- NULL, seg->device_id, no_update))
- return_0;
-
- if (!remove_seg_from_segs_using_this_lv(seg->pool_lv, seg))
- return_0;
-
- if (seg->origin &&
- !remove_seg_from_segs_using_this_lv(seg->origin, seg))
- return_0;
-
- /* If thin origin, remove it from related thin snapshots */
- /*
- * TODO: map removal of origin as snapshot lvconvert --merge?
- * i.e. rename thin snapshot to origin thin origin
- */
- dm_list_iterate_items_safe(sl, tsl, &seg->lv->segs_using_this_lv) {
- if (!seg_is_thin_volume(sl->seg) ||
- (seg->lv != sl->seg->origin))
- continue;
-
- if (!remove_seg_from_segs_using_this_lv(seg->lv, sl->seg))
- return_0;
- /* Thin snapshot is now regular thin volume */
- sl->seg->origin = NULL;
- }
-
- seg->lv->status &= ~THIN_VOLUME;
- seg->pool_lv = NULL;
- seg->origin = NULL;
-
- return 1;
-}
-
int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type,
struct logical_volume *lv, uint32_t delete_id,
int no_update)
@@ -372,26 +252,6 @@ int pool_below_threshold(const struct lv_segment *pool_seg)
return 1;
}
-struct lv_segment *find_pool_seg(const struct lv_segment *seg)
-{
- struct lv_segment *pool_seg;
-
- pool_seg = get_only_segment_using_this_lv(seg->lv);
-
- if (!pool_seg) {
- log_error("Failed to find pool_seg for %s", seg->lv->name);
- return NULL;
- }
-
- if (!seg_is_thin_pool(pool_seg)) {
- log_error("%s on %s is not a pool segment",
- pool_seg->lv->name, seg->lv->name);
- return NULL;
- }
-
- return pool_seg;
-}
-
struct logical_volume *find_pool_lv(const struct logical_volume *lv)
{
struct lv_segment *seg;
@@ -443,107 +303,6 @@ uint32_t get_free_pool_device_id(struct lv_segment *thin_pool_seg)
return max_id;
}
-int create_pool(struct logical_volume *pool_lv, const struct segment_type *segtype,
- struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size)
-{
- const struct segment_type *striped;
- struct logical_volume *meta_lv, *data_lv;
- struct lv_segment *seg;
- char name[NAME_LEN];
-
- if (pool_lv->le_count) {
- /* FIXME move code for manipulation from lv_manip.c */
- log_error(INTERNAL_ERROR "Pool %s has already extents.", pool_lv->name);
- return 0;
- }
-
- /* LV is not yet a pool, so it's extension from lvcreate */
- if (!(striped = get_segtype_from_string(pool_lv->vg->cmd, "striped")))
- return_0;
-
- if (activation() && segtype->ops->target_present &&
- !segtype->ops->target_present(pool_lv->vg->cmd, NULL, NULL)) {
- log_error("%s: Required device-mapper target(s) not "
- "detected in your kernel.", segtype->name);
- return 0;
- }
-
- /* Metadata segment */
- if (!lv_add_segment(ah, stripes, 1, pool_lv, striped, 1, 0, 0))
- return_0;
-
- if (!activation())
- log_warn("WARNING: Pool %s is created without initialization.", pool_lv->name);
- else {
- if (!vg_write(pool_lv->vg) || !vg_commit(pool_lv->vg))
- return_0;
-
- /*
- * If killed here, only the VISIBLE striped pool LV is left
- * and user could easily remove it.
- *
- * FIXME: implement lazy clearing when activation is disabled
- */
- /* pool_lv is a new LV so the VG lock protects us */
- if (!activate_lv_local(pool_lv->vg->cmd, pool_lv) ||
- /* Clear 4KB of metadata device for new thin-pool. */
- !wipe_lv(pool_lv, (struct wipe_params) { .do_zero = 1 })) {
- log_error("Aborting. Failed to wipe pool metadata %s.",
- pool_lv->name);
- goto bad;
- }
- }
-
- if (dm_snprintf(name, sizeof(name), "%s_tmeta", pool_lv->name) < 0) {
- log_error("Name is too long to be a pool name.");
- goto bad;
- }
-
- if (!(meta_lv = lv_create_empty(name, NULL, LVM_READ | LVM_WRITE,
- ALLOC_INHERIT, pool_lv->vg)))
- goto_bad;
-
- if (!move_lv_segments(meta_lv, pool_lv, 0, 0))
- goto_bad;
-
- /* Pool data segment */
- if (!lv_add_segment(ah, 0, stripes, pool_lv, striped, stripe_size, 0, 0))
- goto_bad;
-
- if (!(data_lv = insert_layer_for_lv(pool_lv->vg->cmd, pool_lv,
- pool_lv->status, "_tdata")))
- goto_bad;
-
- seg = first_seg(pool_lv);
- /* Drop reference as attach_pool_data_lv() takes it again */
- if (!remove_seg_from_segs_using_this_lv(data_lv, seg))
- goto_bad;
-
- if (!attach_pool_data_lv(seg, data_lv))
- goto_bad;
-
- if (!attach_pool_metadata_lv(seg, meta_lv))
- goto_bad;
-
- seg->segtype = segtype; /* Set as thin_pool segment */
-
- return 1;
-
-bad:
- if (activation()) {
- if (deactivate_lv_local(pool_lv->vg->cmd, pool_lv)) {
- log_error("Aborting. Could not deactivate pool %s.",
- pool_lv->name);
- return 0;
- }
- if (!lv_remove(pool_lv) || !vg_write(pool_lv->vg) || !vg_commit(pool_lv->vg))
- log_error("Manual intervention may be required to remove "
- "abandoned LV(s) before retrying.");
- }
-
- return 0;
-}
-
int update_pool_lv(struct logical_volume *lv, int activate)
{
int monitored;
10 years, 3 months
master - wiping: issue error if libblkid detects signature and fails to return offset/length
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2b9d25133e3dfa...
Commit: 2b9d25133e3dfa0f95f838a75a682e5195110684
Parent: cb595a5a13134cd3c12559e5e3b69f4ecf667c18
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 22 16:26:49 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 22 16:29:52 2014 +0100
wiping: issue error if libblkid detects signature and fails to return offset/length
We need both offset and length when trying to wipe detected signatures.
The libblkid can fail so it's good to have an error message issued for
this state instead of being silent (libblkid does not issue any error
messages here). We just issued "stack" here before but that was not
quite useful if some error occurs...
---
WHATS_NEW | 1 +
lib/device/dev-type.c | 24 ++++++++++++++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bbf736e..73f716c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Issue error if libbblkid detects signature and fails to return offset/length.
Update autoconf config.guess/sub to 2014-01-01.
Online thin pool metadata resize requires 1.10 kernel thin pool target.
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 78b093c..e67169b 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -452,6 +452,8 @@ out:
static int _blkid_wipe(blkid_probe probe, struct device *dev, const char *name,
int exclude_lvm_member, int yes, force_t force)
{
+ static const char* msg_failed_offset = "Failed to get offset of the %s signature on %s.";
+ static const char* msg_failed_length = "Failed to get length of the %s signature on %s.";
const char *offset = NULL, *type = NULL, *magic = NULL,
*usage = NULL, *label = NULL, *uuid = NULL;
loff_t offset_value;
@@ -461,13 +463,23 @@ static int _blkid_wipe(blkid_probe probe, struct device *dev, const char *name,
if (exclude_lvm_member &&
(!strcmp(type, "LVM1_member") || !strcmp(type, "LVM2_member")))
return 1;
- if (!blkid_probe_lookup_value(probe, "SBMAGIC_OFFSET", &offset, NULL) &&
- blkid_probe_lookup_value(probe, "SBMAGIC", &magic, &len))
- return_0;
+ if (blkid_probe_lookup_value(probe, "SBMAGIC_OFFSET", &offset, NULL)) {
+ log_error(msg_failed_offset, type, name);
+ return 0;
+ }
+ if (blkid_probe_lookup_value(probe, "SBMAGIC", &magic, &len)) {
+ log_error(msg_failed_length, type, name);
+ return 0;
+ }
} else if (!blkid_probe_lookup_value(probe, "PTTYPE", &type, NULL)) {
- if (!blkid_probe_lookup_value(probe, "PTMAGIC_OFFSET", &offset, NULL) &&
- blkid_probe_lookup_value(probe, "PTMAGIC", &magic, &len))
- return_0;
+ if (blkid_probe_lookup_value(probe, "PTMAGIC_OFFSET", &offset, NULL)) {
+ log_error(msg_failed_offset, type, name);
+ return 0;
+ }
+ if (blkid_probe_lookup_value(probe, "PTMAGIC", &magic, &len)) {
+ log_error(msg_failed_length, type, name);
+ return 0;
+ }
usage = "partition table";
} else
return_0;
10 years, 3 months
master - coverity: check return value of dev_close in dev_get_block_size()
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cb595a5a13134c...
Commit: cb595a5a13134cd3c12559e5e3b69f4ecf667c18
Parent: 34e6d59bba1507141a72c644d7d96e173b09fa19
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 22 16:20:09 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 22 16:20:09 2014 +0100
coverity: check return value of dev_close in dev_get_block_size()
---
lib/device/dev-io.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index 82cc2fc..6697456 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -178,8 +178,8 @@ int dev_get_block_size(struct device *dev, unsigned int *physical_block_size, un
*physical_block_size = (unsigned int) dev->phys_block_size;
*block_size = (unsigned int) dev->block_size;
out:
- if (needs_open)
- dev_close(dev);
+ if (needs_open && !dev_close(dev))
+ stack;
return r;
}
10 years, 3 months
master - WHATS_NEW: be more specific about cryptsetup version that sets the udev flags
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=34e6d59bba1507...
Commit: 34e6d59bba1507141a72c644d7d96e173b09fa19
Parent: 36a09cf463b68cc56330db43d44e02932c12251b
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 22 15:48:40 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 22 15:48:40 2014 +0100
WHATS_NEW: be more specific about cryptsetup version that sets the udev flags
---
WHATS_NEW_DM | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 40c371b..5aa3892 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,6 +1,6 @@
Version 1.02.85 -
===================================
- Drop cryptsetup specific rules from 10-dm.rules - cryptsetup sets them.
+ Drop cryptsetup rules from 10-dm.rules - cryptsetup >= 1.1.3 sets them.
Version 1.02.84 - 20th January 2014
===================================
10 years, 3 months
master - udev: drop cryptsetup specific rules from 10-dm.rules
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=36a09cf463b68c...
Commit: 36a09cf463b68cc56330db43d44e02932c12251b
Parent: d2956f0a594c0522de925ab3ca47a56a5a09a2c7
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 22 15:15:02 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 22 15:18:57 2014 +0100
udev: drop cryptsetup specific rules from 10-dm.rules
These udev flags are set directly in cryptsetup for some
time now so there's no need to have it in our rules then.
See also:
https://code.google.com/p/cryptsetup/source/detail?spec=svn4f14b43a3d3e73...
---
WHATS_NEW_DM | 1 +
udev/10-dm.rules.in | 2 --
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 448a7f0..40c371b 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.85 -
===================================
+ Drop cryptsetup specific rules from 10-dm.rules - cryptsetup sets them.
Version 1.02.84 - 20th January 2014
===================================
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index f7088f1..2755530 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -123,8 +123,6 @@ ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", ENV{DM_NAME}=="?*", SYMLINK+="(DM_DIR)/
# We have to ignore further rule application for inappropriate events
# and devices. But still send the notification if cookie exists.
ENV{DM_UUID}=="mpath-?*", ENV{DM_ACTION}=="PATH_FAILED", GOTO="dm_disable"
-ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="dm_disable"
-ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="dm_disable"
# Avoid processing and scanning a DM device in the other (foreign)
# rules if it is in suspended state. However, we still keep 'disk'
10 years, 3 months
master - autoconf: Update config.guess/sub to 2014-01-01.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d2956f0a594c05...
Commit: d2956f0a594c0522de925ab3ca47a56a5a09a2c7
Parent: efe36fcd43f243de5cdd5838c284b0e5a24ac893
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Jan 21 22:00:15 2014 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Jan 21 22:00:15 2014 +0000
autoconf: Update config.guess/sub to 2014-01-01.
---
WHATS_NEW | 1 +
autoconf/config.guess | 415 ++++++++++++++++++++++++++++---------------------
autoconf/config.sub | 288 ++++++++++++++++++++++------------
3 files changed, 430 insertions(+), 274 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a5e58b5..bbf736e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Update autoconf config.guess/sub to 2014-01-01.
Online thin pool metadata resize requires 1.10 kernel thin pool target.
Version 2.02.105 - 20th January 2014
diff --git a/autoconf/config.guess b/autoconf/config.guess
index dc84c68..4438cd7 100755
--- a/autoconf/config.guess
+++ b/autoconf/config.guess
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2009-11-20'
+timestamp='2014-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2009-11-20'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <config-patches(a)gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.gu...
+#
+# Please send patches with a ChangeLog entry to config-patches(a)gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@@ -180,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
@@ -201,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -223,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -394,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@@ -480,8 +501,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -494,7 +515,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -551,7 +572,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -594,52 +615,52 @@ EOF
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -730,22 +751,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@@ -769,14 +790,14 @@ EOF
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -788,30 +809,35 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
@@ -848,15 +874,22 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -866,52 +899,56 @@ EOF
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
+ esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -930,51 +967,63 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
or32:Linux:*:*)
- echo or32-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
+ echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -983,11 +1032,11 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@@ -1019,7 +1068,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1047,13 +1096,13 @@ EOF
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
- exit ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1088,8 +1137,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@@ -1132,10 +1181,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel(a)ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel(a)ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes(a)openmarket.com>.
# How about differentiating between stratus architectures? -djm
@@ -1161,11 +1210,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1178,6 +1227,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1204,19 +1256,31 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1230,7 +1294,10 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1275,13 +1342,13 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@@ -1299,11 +1366,11 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
@@ -1321,11 +1388,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
diff --git a/autoconf/config.sub b/autoconf/config.sub
index 2a55a50..092cff0 100755
--- a/autoconf/config.sub
+++ b/autoconf/config.sub
@@ -1,38 +1,31 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2009-11-20'
+timestamp='2014-01-01'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches(a)gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches(a)gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -75,8 +68,7 @@ Report bugs and patches to <config-patches(a)gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,13 +115,18 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -152,12 +149,12 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
- -bluegene*)
- os=-cnk
+ -bluegene*)
+ os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
@@ -173,10 +170,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -221,6 +218,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
@@ -245,20 +248,28 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
- | c4x | clipper \
+ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -276,34 +287,45 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
- | nios | nios2 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | or32 \
+ | open8 \
+ | or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
- | rx \
+ | rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
- | v850 | v850e \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | picochip)
- # Motorola 68HC11/12.
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@@ -313,6 +335,21 @@ case $basic_machine in
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -327,25 +364,31 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -363,29 +406,34 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
- | nios-* | nios2-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* | rx-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
| tron-* \
| ubicom32-* \
- | v850-* | v850e-* | vax-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
@@ -410,7 +458,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@@ -480,11 +528,20 @@ case $basic_machine in
basic_machine=powerpc-ibm
os=-cnk
;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
- cegcc)
+ cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
@@ -516,7 +573,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@@ -674,7 +731,6 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@@ -732,11 +788,15 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
@@ -771,10 +831,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -839,6 +907,12 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -921,9 +995,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@@ -948,7 +1023,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -1017,6 +1096,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
@@ -1073,20 +1155,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
tile*)
- basic_machine=tile-unknown
+ basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@@ -1156,6 +1226,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
@@ -1253,11 +1326,11 @@ esac
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ -auroraux)
+ os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1281,20 +1354,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1341,7 +1415,7 @@ case $os in
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
@@ -1390,7 +1464,7 @@ case $os in
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
@@ -1426,15 +1500,14 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1457,10 +1530,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
@@ -1472,8 +1545,23 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1493,14 +1581,11 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
;;
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
@@ -1509,6 +1594,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or1k-*)
+ os=-elf
+ ;;
or32-*)
os=-coff
;;
@@ -1527,7 +1615,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
10 years, 3 months
master - tests: more testing for online thin metadata resize
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=efe36fcd43f243...
Commit: efe36fcd43f243de5cdd5838c284b0e5a24ac893
Parent: 22d9daff12b73e72f520ea70f416e1d3057ae740
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 21 10:04:23 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 21 13:53:10 2014 +0100
tests: more testing for online thin metadata resize
Some more tests for online resize, but it's still disabled
by default, since kernel doesn't work yet for this feature.
---
test/shell/lvextend-thin-metadata-dmeventd.sh | 72 +++++++++++++++++++++++++
test/shell/lvresize-thin-metadata.sh | 26 +++++----
2 files changed, 87 insertions(+), 11 deletions(-)
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
new file mode 100644
index 0000000..4b4ee30
--- /dev/null
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Test autoextension of thin metadata volume
+. lib/test
+
+meta_percent_() {
+ get lv_field $vg/pool metadata_percent | cut -d. -f1
+}
+
+wait_for_change_() {
+ # dmeventd only checks every 10 seconds :(
+ for i in $(seq 1 15) ; do
+ test "$(meta_percent_)" != "$1" && return
+ sleep 1
+ done
+
+ return 1 # timeout
+}
+
+#
+# Temporary solution to create some occupied thin metadata
+# This heavily depends on thin metadata output format to stay as is.
+# Currently it expects 2MB thin metadata and 200MB data volume size
+# Argument specifies how many devices should be created.
+fake_metadata_() {
+ echo '<superblock uuid="" time="1" transaction="0" data_block_size="128" nr_data_blocks="3200">'
+ for i in $(seq 1 $1)
+ do
+ echo ' <device dev_id="'$i'" mapped_blocks="785" transaction="0" creation_time="0" snap_time="1">'
+ echo ' <range_mapping origin_begin="0" data_begin="0" length="37" time="0"/>'
+ echo ' </device>'
+ done
+ echo "</superblock>"
+}
+
+aux have_thin 1 10 0 || skip
+
+aux prepare_dmeventd
+
+aux lvmconf "activation/thin_pool_autoextend_percent = 10" \
+ "activation/thin_pool_autoextend_threshold = 70"
+
+aux prepare_pvs 3 256
+
+vgcreate -s 1M $vg $(cat DEVICES)
+
+# Testing dmeventd autoresize
+lvcreate -L200M -V1G -n thin -T $vg/pool
+lvcreate -L2M -n $lv1 $vg
+
+# Prepare some fake metadata prefilled to ~81% (>70%)
+fake_metadata_ 400 >data
+
+thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
+vgchange -an $vg
+# Swap volume with restored fake metadata
+lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
+
+vgchange -ay $vg
+
+# Check dmeventd resizes metadata
+pre=$(meta_percent_)
+wait_for_change_ $pre
diff --git a/test/shell/lvresize-thin-metadata.sh b/test/shell/lvresize-thin-metadata.sh
index 16a7500..e62d8b6 100644
--- a/test/shell/lvresize-thin-metadata.sh
+++ b/test/shell/lvresize-thin-metadata.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2013 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2013-2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -11,31 +11,35 @@
. lib/test
-aux have_thin 9 9 0 || skip
+aux have_thin 1 10 0 || skip
-aux prepare_pvs 3 256
+aux prepare_pvs 3 1256
vgcreate -s 1M $vg $(cat DEVICES)
for deactivate in true false; do
- lvcreate -l1 -T $vg/pool
-
- test $deactivate && lvchange -an $vg
-
+# Create some thin volumes
+ lvcreate -L20 -V30 -n $lv1 -T $vg/pool
+ lvcreate -s $vg/$lv1
# Confirm we have basic 2M metadata
check lv_field $vg/pool_tmeta size "2.00m"
- lvresize --poolmetadata +2 $vg/pool
+ test $deactivate && lvchange -an $vg
+ lvresize --poolmetadata +2M $vg/pool
# Test it's been resized to 4M
check lv_field $vg/pool_tmeta size "4.00m"
-# TODO: Add more tests when kernel is fixed
- lvresize --alloc anywhere --poolmetadata +256 $vg/pool
+ lvresize --poolmetadata +256M $vg/pool
+ check lv_field $vg/pool_tmeta size "260.00m"
+
+ lvresize --poolmetadata +3G $vg/pool
+ check lv_field $vg/pool_tmeta size "3.25g"
vgchange -an $vg
vgchange -ay $vg
-# TODO: Make a full metadata device and test dmeventd support
+# TODO: Add more tests
+
lvremove -ff $vg
done
10 years, 3 months