From owner-freebsd-current@freebsd.org Wed Jun 17 18:56:41 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03C4D330046 for ; Wed, 17 Jun 2020 18:56:41 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0a-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nDnN0Rxlz4Ktn for ; Wed, 17 Jun 2020 18:56:39 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108158.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05HIWH0G001762; Wed, 17 Jun 2020 11:56:37 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by mx0a-00273201.pphosted.com with ESMTP id 31qknbrpvg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jun 2020 11:56:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nc/BMR0j+Oir8ri+aS3SxqWVKIfir5MdXf/LtRA209O67hFrIvnlaUQlfK1ecKGz1Z7THgbMcRSE6x19lje4YEsEoE7a/T6doWCk9doHNIIMgJIkGWu08YVGIxt7lfLVcTNP36r0nISLJOGMLtwiBA32NMs6aiKzfc/H2oSmtiWZ0DJk1EURms2yrFFEHpRiDB6NcyY/Wr+DofDz/YEadYTNWUlPYEfhmqL8iQTPS39VGzEiSNpiH2O/3j+g3S+PeFeQTEPk+wW4G3siWhrMzqLGygCjtYlBU6pJI58O99SoTpJgvP9cvSSLDrZXaUW9ZJ+L8Jdn7Yc5cTAfgohSdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3RC2+yNcLHNW+c8fpU8pQXN5C0EJ1FLP4Se/ewdiJxQ=; b=Gnq0Rmz5WuRlERjM9/j1+s8YZxlHIRgnVcWmlAh3sA4i32s57wtS5V15IAnja0kf1R/4qJCjDHAX2dgHxwu5ctcho24EamGBzZt0cW1WDzeJDIuYVuMTAHeY5f9Bq6QFKc3t0VAHQ56txuwB4PEfo7xJk/PRPqQJmJMLaASJZsOJxF84sik+s0/nftoNzvpK3uUTOWMpo0RzRggOFMaaegQeLKsauyAXsGePduOs6/gXZV1BrNETvvZpL1pdlPrN17S3l30heZ7hlOA1Rgx6lXhq9OgauFMBlhKwV56qXGA/1fOdMSVuwjZZ76xMYvUR2/hHepJa0uQKJa/BYs93gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.242.12) smtp.rcpttodomain=gndrsh.dnsmgr.net smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none Received: from CO1PR15CA0089.namprd15.prod.outlook.com (2603:10b6:101:20::33) by BN3PR05MB2625.namprd05.prod.outlook.com (2a01:111:e400:7bbd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.11; Wed, 17 Jun 2020 18:56:33 +0000 Received: from CO1NAM05FT041.eop-nam05.prod.protection.outlook.com (2603:10b6:101:20:cafe::e8) by CO1PR15CA0089.outlook.office365.com (2603:10b6:101:20::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Wed, 17 Jun 2020 18:56:33 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.242.12) smtp.mailfrom=juniper.net; gndrsh.dnsmgr.net; dkim=none (message not signed) header.d=none;gndrsh.dnsmgr.net; dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.242.12 as permitted sender) Received: from P-EXFEND-EQX-01.jnpr.net (66.129.242.12) by CO1NAM05FT041.mail.protection.outlook.com (10.152.96.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3109.9 via Frontend Transport; Wed, 17 Jun 2020 18:56:32 +0000 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 11:56:23 -0700 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 11:56:23 -0700 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 17 Jun 2020 11:56:23 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.50.162]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 05HIuMYl014590; Wed, 17 Jun 2020 11:56:22 -0700 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id 893F3AE9F; Wed, 17 Jun 2020 11:56:22 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 88C1CAE9E; Wed, 17 Jun 2020 11:56:22 -0700 (PDT) To: Warner Losh CC: "Rodney W. Grimes" , Miguel C , FreeBSD Current , Subject: Re: CTF: UEFI HTTP boot support In-Reply-To: References: <46934.1592351291@kaos.jnpr.net> <202006171752.05HHqo0E086454@gndrsh.dnsmgr.net> Comments: In-reply-to: Warner Losh message dated "Wed, 17 Jun 2020 12:06:27 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <45017.1592420182.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Wed, 17 Jun 2020 11:56:22 -0700 Message-ID: <48054.1592420182@kaos.jnpr.net> X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.242.12; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:P-EXFEND-EQX-01.jnpr.net; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(39860400002)(136003)(396003)(46966005)(7696005)(6916009)(7126003)(336012)(478600001)(8936002)(2906002)(26005)(5660300002)(70206006)(83380400001)(6266002)(81166007)(47076004)(316002)(186003)(82740400003)(70586007)(4326008)(107886003)(9686003)(82310400002)(55016002)(356005)(54906003)(8676002)(86362001); DIR:OUT; SFP:1102; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de61d37c-7431-4aa8-2e9c-08d812f026f3 X-MS-TrafficTypeDiagnostic: BN3PR05MB2625: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-Forefront-PRVS: 04371797A5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3oMN9TsitX+06CJDacC8tcH7gyeOCy/KY5lYDFCS3kS68CuZgkPOluk8upR/j6HJXSie5l1eclzdGd6f0ibg7TOnaasPsUDC8c2EgKhiFmJ5yieQA1tJLGWgP8Ps7idmr06KqSm9s5B7fRqWLqexK5xMYBVAGeBprfa2CXnBVYutKUbT77VLS5xPtx4xEbHsLEZswvRar8XU7HwxiWA+hUIWXvoCVMEeplxL1Wm1jrvSyGam5eESX3Zqgnrilo6n0bfUJrkigG/5QmLDlIt/fMMv+zxbb34cswLxngKqljlfVHyYYV7na6WxMke+tCLAIr3QINszS0yeiAJz7QxC2o6SqKKSFUF/AcgJRwBoTi4Fh4jCDdlURvcXFwP5EHjE/s/in3F4AElVS3d8OQRkoQ== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2020 18:56:32.6708 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de61d37c-7431-4aa8-2e9c-08d812f026f3 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.242.12]; Helo=[P-EXFEND-EQX-01.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR05MB2625 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-17_10:2020-06-17, 2020-06-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 suspectscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1011 adultscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 phishscore=0 malwarescore=0 cotscore=-2147483648 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006170143 X-Rspamd-Queue-Id: 49nDnN0Rxlz4Ktn X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.67 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017,juniper.net:s=selector1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:208.84.65.16]; NEURAL_HAM_LONG(-1.00)[-0.997]; MIME_GOOD(-0.10)[text/plain]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[juniper.net:+]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; NEURAL_HAM_SHORT(-1.58)[-1.580]; RCVD_IN_DNSWL_LOW(-0.10)[208.84.65.16:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:26211, ipnet:208.84.65.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_SEVEN(0.00)[11]; FREEMAIL_CC(0.00)[gndrsh.dnsmgr.net,gmail.com,freebsd.org,juniper.net] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 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: Wed, 17 Jun 2020 18:56:41 -0000 Warner Losh wrote: > > loader.conf says > > > > rootfs_load=3D"yes" > > rootfs_name=3D"contents.izo" > > rootfs_type=3D"md_image" > > vfs.root.mountfrom=3D"cd9660:/dev/md0.uzip" > > > > contents.izo is uzip'd contents.iso which file(1) > > describes as ISO 9660 CD-ROM filesystem data '' > > > > That's for normal boot, for the loader 'install' command > > it expects an uncompressed iso for rootfs. > = > Ok, now the puzzle is how much work to get from a stock FreeBSD .iso > image to something that works with this. Obviously we need a non-stock > /boot/loader.conf file, or to type some commands manually at a loader > prompt. I believe the stock GENERIC kernel has the md_root support > for this already, so it may not be that hard to do. So obviously we don't use the GENERIC kernel, but I don't think we have any magic except in 4th files and loader.conf and for the loader install command its all in the loader itself, and I've been keeping head up todate on recent fixes/improvements there since for UEFI I'm using loader.efi built from head. Oh and all the scripts run by init during boot are custom. > Looking at the code, I think MD_ROOT alone is insufficient here... > = > If there's no MD root provided, we look for the symbols mfs_root and > mfs_root_end, which I think means that rootfs_ in the above example > needs to be md_root_ instead so that we find it. FWIW our kernel options include options CD9660 options MD_ROOT options MD_ROOT_FSTYPE=3D\"cd9660\" > You may need to have a custom kernel with 'options MD_ROOT_READONLY' bec= ause isofs is read-only. > = > And there's a small chance you may need to define ROOTDEVNAME in the bui= ld as well to be "cd9660:/dev/md0.uzip" > Every time I do stuff like this I have to re-puzzle it out, alas, but > these should give you some guide posts. It should be better documented > in md(4), but isn't at the moment. = > = > I'd honestly try to get this setup working first loading all the files > off a local disk before layering in the networking on top of that. Agreed! Booting from say tftp://host/install.tar is far more fragile - the tar file needs to present all the files in correct order since we cannot seek backwards (much), and tftp sucks ;-) userboot is very handy for testing all this stuff, though building it to run on host (the way we do) seems broken in head. --sjg