From owner-freebsd-current@freebsd.org Thu Sep 28 15:54:40 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CC73E0205A for ; Thu, 28 Sep 2017 15:54:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C6F7639F7 for ; Thu, 28 Sep 2017 15:54:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id g32so1967367ioj.2 for ; Thu, 28 Sep 2017 08:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=yLU/+AMqWcX6f8k5wRj5w4i64L3FUVYyEFhp3UzxKlE=; b=JF9A2WfXb8xasi2fhJ7hGawuNRca8r8YX7uMrOPrhZ6o6ukoTvZWSP6rAFj1PKa2sN 2q5OwLfodpgMq6ha4Px8rU9NhQfEbxxWkJQyIc3Lv+HtIIRP77RgPbSgV9dyWwbVYCs+ 0mRJvd/oq92qQPPWKFbN7FjZeuNN+WjclCz0z9up5ICt5qMttstglw23EhVbf5FzXphO cwvSraFUISr9PF799cq3QG/zgVe7xGEmf1sCiURBznjanoqevJjQXMDlu+8xgDMgRw/V hE+PEtnXH+f3P61yvQa+NaRaLlWeM4Jk1MncJtUbUqygjwyC8vM8/SNTtFzDBpHeD4hs essg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=yLU/+AMqWcX6f8k5wRj5w4i64L3FUVYyEFhp3UzxKlE=; b=V+jNbqELk6Mso4KRkSyUEQn/2C8IaDa5Hu/6AUBPZUSeu7810ubsTtqnrJCsTbAxr8 0x+BYQsK8fpRCHZsjrDQxOUXc5nJF0OAmx02Jn+/zY+RmPNoshdU5odPRAkzpfNY+MZw 9tTn/eFmOT0xPcRbWFZ6/eUbsTLwHtIaGzgTvgcbE5zKiAZjgfH1CSolfwESfpRaGBnN ATYwSqw3c9759pNfzN8i4wGsNXz1UgQ0XaYBsrwAKbvhVbXNz9aRJRyMwce5cuduYJnd Pz8UCY7EAV/2Qr0K7PXwv80BLGbw34H+F6D0y+y+vvpPBAGsLnrV4YY5GzRQTqj40Wlq DixA== X-Gm-Message-State: AMCzsaWOgj4+Z97P0OX8fATC+sfsnDTf6dUerG5V1xkiIq9kgbW09yJR Jn+8acA6QIWZxkFiREGcTiyJmO1c8y32iqwrokWRTVgr X-Google-Smtp-Source: AOwi7QAygVBtJELqmM19Asa9sv3PaCL9jdH11CPFw7mTNn1CbuN4zMUHWiEixysClrLB6bgQlPMNuYEm+TUgbwZyvs4= X-Received: by 10.107.185.7 with SMTP id j7mr8296608iof.221.1506614078557; Thu, 28 Sep 2017 08:54:38 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.2.194 with HTTP; Thu, 28 Sep 2017 08:54:37 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:191c:5e93:2feb:3c70] In-Reply-To: References: From: Warner Losh Date: Thu, 28 Sep 2017 09:54:37 -0600 X-Google-Sender-Auth: DH4my3dQIc3FrbPHp6BEdKKmQpY Message-ID: Subject: Re: How do GEOM_PART_* options configure geom_part_* modules?? To: Nick Hibma Cc: FreeBSD Current Mailing List Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2017 15:54:40 -0000 On Thu, Sep 28, 2017 at 9:31 AM, Nick Hibma wrote: > I created a new kernel config file from scratch, wondered what the > GEOM_PART_MBR option and friends were doing, search for them, didn't find > them in the tree, and deleted them from my config. But... de resulting disk > image didn't boot, because of the fact that it didn't recognise the MBR > partitions (it only had a single diskid entry on the mount-root prompt). > > Can anyone explain to me how these kernel options work, as in: they are > defined in kernel configs and as a consequence in opt_geom.h, but how are > they actually used to select which geom_part_* modules/kernel parts to > build? I thought these options were translated to stuff that cpp would use, > but there are not uses of for example GEOM_PART_MBR anywhere for example! > The module always build them because they are listed in the module's Makefile. The kernel only sometimes does. Here's the key lines from conf/files: files:geom/geom_bsd_enc.c optional geom_bsd | geom_part_bsd files:geom/part/g_part_apm.c optional geom_part_apm files:geom/part/g_part_bsd.c optional geom_part_bsd files:geom/part/g_part_bsd64.c optional geom_part_bsd64 files:geom/part/g_part_ebr.c optional geom_part_ebr files:geom/part/g_part_gpt.c optional geom_part_gpt files:geom/part/g_part_ldm.c optional geom_part_ldm files:geom/part/g_part_mbr.c optional geom_part_mbr files:geom/part/g_part_vtoc8.c optional geom_part_vtoc8 which turn on/off which files get included. config "helpfully" convers the upper case options to lower case for this. Warner Warner > The only thing I was able to come up with, but could not figure out, was > FEATURE() doing some magic. > > Thanks in advance for any pointers! > > Nick Hibma > nick@van-laarhoven.org > > -- Open Source: We stand on the shoulders of giants. > > > % grep -r GEOM_PART_ /usr/src/sys/ | grep -Ev '/conf/.*options' > /usr/src/sys/geom/part/g_part_mbr.c: "GEOM_PART_MBR Master Boot > Record"); > /usr/src/sys/geom/part/g_part_ldm.c: "GEOM_PART_LDM Logical Disk > Manager"); > /usr/src/sys/geom/part/g_part_ldm.c: * XXX: We use some knowledge > about GEOM_PART_GPT internal > /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT) > /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT > /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT) > /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT) > /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT) > /usr/src/sys/geom/part/g_part_ebr.c:#if defined(GEOM_PART_EBR_COMPAT) > /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT > /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT > /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT > /usr/src/sys/geom/part/g_part_ebr.c:#ifndef GEOM_PART_EBR_COMPAT > /usr/src/sys/geom/part/g_part.h:#ifndef _GEOM_PART_H_ > /usr/src/sys/geom/part/g_part.h:#define _GEOM_PART_H_ > /usr/src/sys/geom/part/g_part.h:#endif /* !_GEOM_PART_H_ */ >