From patchwork Fri Oct 6 11:42:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 9989029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F1C160247 for ; Fri, 6 Oct 2017 11:42:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6085A28CD7 for ; Fri, 6 Oct 2017 11:42:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5474D28D6E; Fri, 6 Oct 2017 11:42:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E360028CD7 for ; Fri, 6 Oct 2017 11:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751557AbdJFLmV (ORCPT ); Fri, 6 Oct 2017 07:42:21 -0400 Received: from forwardcorp1o.cmail.yandex.net ([37.9.109.47]:42382 "EHLO forwardcorp1o.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdJFLmV (ORCPT ); Fri, 6 Oct 2017 07:42:21 -0400 Received: from smtpcorp1o.mail.yandex.net (smtpcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::30]) by forwardcorp1o.cmail.yandex.net (Yandex) with ESMTP id 5D5C120ED5; Fri, 6 Oct 2017 14:42:19 +0300 (MSK) Received: from smtpcorp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtpcorp1o.mail.yandex.net (Yandex) with ESMTP id 5B5882440B76; Fri, 6 Oct 2017 14:42:19 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:40c:f1eb:8412:ce38:c408]) by smtpcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wq9xz1EAmv-gJxarJac; Fri, 06 Oct 2017 14:42:19 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1507290139; bh=zPTj0y2lLzvYCOcwx/uIA7ynuavqavWsfi+Kirlz/Eo=; h=Subject:From:To:Date:Message-ID; b=SHkCYLrNXR/Zvp1s3fvHICacGkMPdsQ777MjewnnJRJrAA8v7kYRztxy3/KX8R/+d koEeqDMNuh4XDCP5djYOseWtqUeEYV/q3Os0T6ZqnRIWDHo3KxZT3v2b8ibJci53Sw yX6V7ePfAy4bDhf5+n5kFhIpXgX3UE9KN71mXSB4= Authentication-Results: smtpcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH] block: add partition uuid into uevent as "PARTUUID" From: Konstantin Khlebnikov To: linux-block@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org Date: Fri, 06 Oct 2017 14:42:16 +0300 Message-ID: <150729013610.744480.1644359289262914898.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both most common formats have uuid in addition to partition name: GPT: standard uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx DOS: 4 byte disk signature and 1 byte partition xxxxxxxx-xx Tools from util-linux use the same notation for them. Signed-off-by: Konstantin Khlebnikov Reviewed-by: Kyle Fortin --- block/partition-generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/partition-generic.c b/block/partition-generic.c index 88c555db4e5d..8f8b580aee16 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -226,6 +226,8 @@ static int part_uevent(struct device *dev, struct kobj_uevent_env *env) add_uevent_var(env, "PARTN=%u", part->partno); if (part->info && part->info->volname[0]) add_uevent_var(env, "PARTNAME=%s", part->info->volname); + if (part->info && part->info->uuid[0]) + add_uevent_var(env, "PARTUUID=%s", part->info->uuid); return 0; }