From owner-svn-src-all@freebsd.org Thu Jun 4 16:46:14 2020 Return-Path: Delivered-To: svn-src-all@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 4002B329797 for ; Thu, 4 Jun 2020 16:46:14 +0000 (UTC) (envelope-from misho@elwix.org) Received: from mail.elwix.net (ns.aitbg.com [84.242.154.175]) by mx1.freebsd.org (Postfix) with ESMTP id 49dBVs1SY9z4GVb; Thu, 4 Jun 2020 16:46:12 +0000 (UTC) (envelope-from misho@elwix.org) Received: from t450.sof.cloudsigma.com.aitnet.org (unknown [87.246.28.119]) by mail.elwix.net (Postfix) with ESMTPSA id E9EE14A222F3; Thu, 4 Jun 2020 19:46:05 +0300 (EEST) Date: Thu, 4 Jun 2020 19:46:05 +0300 From: Michael Pounov To: ae@freebsd.org, svn-src-all@freebsd.org Subject: userboot.so can't open rootfs partition if you use raw BSD partitions directly on disk without any slices Message-Id: <20200604194605.fca76c6ac5f47b1d2d64e955@elwix.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-openbsd6.6) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49dBVs1SY9z4GVb X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of misho@elwix.org has no SPF policy when checking 84.242.154.175) smtp.mailfrom=misho@elwix.org X-Spamd-Result: default: False [2.82 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[elwix.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.39)[0.387]; NEURAL_SPAM_SHORT(0.15)[0.149]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.79)[0.787]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29580, ipnet:84.242.152.0/21, country:BG]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[87.246.28.119:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2020 16:46:14 -0000 Hi After upgrade from FreeBSD 12.0 to 12-STABLE of embedded image under BHyve guest I faced with bootloader issue. >From FreeBSD 12.1 till current version of FreeBFrom FreeBSD 12.1 till current version of FreeBSD. userboot.so loader haves issue with raw BSD partitions directly on disk without any PC slice schema aka MBR or GPT. Bug came after commit, when predefine constant values was replaced with macro definitions in userboot/main.c and common/disk.c. These two members of devsw structure d_slice and d_partition now have defined constants. One of them have different value from previous version of code. D_PARTWILD now have value -2, before that change dev.d_partition has 0. I didn't take easy step directly to change macro D_PARTWILD to 0, because I saw that uboot loader already used this macro. I made patch in common/disk.c file into disk_open() functionSD. userboot.so loader haves issue with raw BSD partitions directly on disk without any PC slice schema aka MBR or GPT. Bug came after commit, when predefine constant values was replaced with macro definitions in userboot/main.c and common/disk.c. These two members of devsw structure d_slice and d_partition now have defined constants. One of them have different value from previous version of code. D_PARTWILD now have value -2, before that change dev.d_partition has 0. I didn't take easy step directly to change macro D_PARTWILD to 0, because I saw that uboot loader already used this macro. I made patch in common/disk.c file into disk_open() function P.S. Patch was produced against base/head sources Regards Michael Pounov CloudSigma AG