From nobody Tue Nov 7 00:26:42 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SPTYZ0Fgcz50qJF for ; Tue, 7 Nov 2023 00:26:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SPTYY0pMLz4fDB for ; Tue, 7 Nov 2023 00:26:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.167.51 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-507b96095abso6450568e87.3 for ; Mon, 06 Nov 2023 16:26:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699316814; x=1699921614; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VszrVOhzPViT42QNDJ7UOorcjGJ/7wEwGtZmjP78VZg=; b=MBsvP6ZF9Ox7gRr8XLsTHNC7PCdyD0zkg+eHOfdiKcnuV/pCg7XVT0CKZ8HUHOxfe3 9HHTiYDbnL7bDz5onNexou96Oi3JP/h1e8JBYpl1y7uSx/jmgWWzPK5okvHgNKFT86xB W8aAvsxJxXLhbDMlKqUYkvgGByyYvmRBoUSqjvgrqiI5OwfbEW/qc6kdjtB0cy/nBo0b hTjwZinKqrEDOUc5Xhix7fIAPJJCCt124JOQ46bqUfaLGDwH8RzIKoPc54H0QX9tcEmg +uoEcPP20wLFOVHmAaSfAAUNBbAwqPMxTe4Bo41bFDZVb0JVMWq9l7KlAsPrXCJETNdF apWQ== X-Gm-Message-State: AOJu0YwDQjFMl3c9WuLKHX3BGd5v5fUZdz7IN6unBz7JoQI+2WWvfBh5 PtAjVWq2gjwWAmV9kLWMtakvQxZv7RIQdrwRQNU= X-Google-Smtp-Source: AGHT+IEJanLp5XvqjHZpWn1cbXfU6iQ3O0+C/VxC3zLxbtCEybo3Bx9AgCFgbhLs3613O4Nez95hJZL7WgAgsA80A8o= X-Received: by 2002:a05:6512:2396:b0:503:343a:829f with SMTP id c22-20020a056512239600b00503343a829fmr30179203lfv.23.1699316814360; Mon, 06 Nov 2023 16:26:54 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <202310250103.39P13maS040503@gndrsh.dnsmgr.net> <93ae484b-0f67-4f8b-829d-f75162afd680@FreeBSD.org> In-Reply-To: From: Ed Maste Date: Mon, 6 Nov 2023 19:26:42 -0500 Message-ID: Subject: Re: Ventoy support To: Warner Losh Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.99)[-0.989]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.51:from]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.51:from]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[carpeddiem]; RCPT_COUNT_TWO(0.00)[2]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4SPTYY0pMLz4fDB X-Spamd-Bar: -- I've moved the Ventoy support discussion to the -hackers mailing list. On Thu, 26 Oct 2023 at 20:07, Ed Maste wrote: > > The second way is via block mapping, using some service to translate > offsets in the image file within the lower filesystem to physical > offsets in the underlying device. Linux has native support for this > via lvm2/dmsetup, and this is the mode that's used when I tried > booting a Ubuntu ISO via Ventoy. As it turns out NetBSD and > DragonflyBSD have a GPL'd lvm2 port, and presumably work the same way > with Ventoy. Ventoy's geom_ventoy FreeBSD kernel module works > similarly, just in a slightly hackish and Ventoy-specific way. I want to clarify one item here, because it has come up again. I've looked into how Ventoy operates, and it appears to require more than just including the (BSD licensed) geom_ventoy.ko in our releases. Ventoy stores the block mapping in the kernel module itself that it then injects into the ISO image. I think methods of supporting Ventoy, in order of "architectural elegance" are: 1. Mount the exFAT device and then mount the ISO image within. This unfortunately requires FUSE as we do not yet have kernel exFAT support. There's probably also a small performance penalty, but it shouldn't be a significant issue in the context of an installer. 2. Use a geom module that provides arbitrary block mapping, akin to one of the modes of Linux's lvm2. We do have a geom_linux_lvm module already, but I am not sure if it provides the required functionality. It may be that we can use it as-is, it may be that we can extend it to support what we need, or we could use geom_ventoy as a starting point for something new. 3. Include geom_ventoy in our tree (after code review) and find a way to have Ventoy write the mapping into it. I believe that helloSystem (a FreeBSD derivative, https://hellosystem.github.io/docs/) has already gone down this path, so the first step is to see what they've tried and what works for them.