NetBSD Problem Report #54582
From www@netbsd.org Sat Sep 28 03:24:12 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 0C5787A1F2
for <gnats-bugs@gnats.NetBSD.org>; Sat, 28 Sep 2019 03:24:11 +0000 (UTC)
Message-Id: <20190928032410.B859E7A245@mollari.NetBSD.org>
Date: Sat, 28 Sep 2019 03:24:10 +0000 (UTC)
From: isaki@pastel-flower.jp
Reply-To: isaki@pastel-flower.jp
To: gnats-bugs@NetBSD.org
Subject: sysinst cannot find disklabel on 9.0_BETA/x68k
X-Send-Pr-Version: www-1.0
>Number: 54582
>Category: install
>Synopsis: sysinst cannot find disklabel on 9.0_BETA/x68k
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: martin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 28 03:25:00 +0000 2019
>Closed-Date: Sat Apr 25 03:35:26 +0000 2020
>Last-Modified: Sat Apr 25 03:35:26 +0000 2020
>Originator: Tetsuya Isaki
>Release: 9.0_BETA
>Organization:
>Environment:
NetBSD/x68k 9.0_BETA (20190913)
>Description:
On 9.0_BETA/x68k, sysinst cannot find disklabel so that upgrade
installation fails.
NetBSD-9.0_BETA Install System
==> b: Upgrade NetBSD on a hard disk
Ok, let's upgrade NetBSD on your hard disk. ...
==> b: Yes
On which disk do you want to upgrade NetBSD?
==> b: sd0 (2.0G)
No root partition defined. Cannot continue
Hit enter to continue
x68k kernel has used Human68k partition if BSD partition is empty for
long time. Human68k is X680x0's native OS.
But 9.0 sysinst only reads BSD disklabel directly on raw disk image
and does not fallback to MD partition like kernel does.
According to sys/arch/x68k/include/disklabel.h,
BSD disklabel exists at +64 bytes offset from beginning of the disk and
Human68k partition exists at +2048 bytes offset from beginning.
In fact, my disk which is installed 8.0 (or prior release) has Human68k
partition and no BSD disklabel.
# dd if=/dev/rsd0c bs=1024 count=3 | hexdump -C
:
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000400 60 00 00 0c 6d 62 6f 6f 74 20 30 2e 31 00 4f fb |`...mboot 0.1.O.|
:
00000800 58 36 38 4b 00 00 00 20 00 1f fc 00 00 1f fc 00 |X68K... ........|
00000810 42 53 44 20 66 66 73 20 00 00 00 20 00 1f b8 00 |BSD ffs ... ....|
00000820 42 53 44 20 73 77 61 70 02 1f b8 20 00 00 43 e0 |BSD swap... ..C.|
00000830 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
*
>How-To-Repeat:
Boot 9.0_BETA/x68k sysinst and try upgrade installation.
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: install-manager->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Sat, 28 Sep 2019 06:30:59 +0000
Responsible-Changed-Why:
Take
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: install/54582: sysinst cannot find disklabel on 9.0_BETA/x68k
Date: Sat, 28 Sep 2019 08:34:28 +0200
On Sat, Sep 28, 2019 at 03:25:00AM +0000, isaki@pastel-flower.jp wrote:
> On which disk do you want to upgrade NetBSD?
> ==> b: sd0 (2.0G)
Please show the output of:
disklabel -r sd0
when running from the install media (either via Ctrl-Z or by going to
the Utilities/Run /bin/sh menu) and the same output from the booted
(old) system, plus the contents of /etc/fstab.
You are doing this update natively, on the x68k system?
Thanks!
Martin
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: install/54582: sysinst cannot find disklabel on 9.0_BETA/x68k
Date: Sat, 28 Sep 2019 08:39:03 +0200
On Sat, Sep 28, 2019 at 03:25:00AM +0000, isaki@pastel-flower.jp wrote:
> x68k kernel has used Human68k partition if BSD partition is empty for
> long time. Human68k is X680x0's native OS.
> But 9.0 sysinst only reads BSD disklabel directly on raw disk image
> and does not fallback to MD partition like kernel does.
The problem here is that sysinst needs to find out what kind of partioning
scheme is used (and deal properly). We can either disable that test
for x68k and always assume disklabel or the kernel emulation of it, or
we can add Human68k partition support now as an alternative scheme (quite
easily; will do that for amiga and apple partitioning schemes too).
Is there a description of how Human68k partitions look on disk somewhere?
Martin
From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: gnats-bugs@netbsd.org
Cc: martin@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: install/54582: sysinst cannot find disklabel on 9.0_BETA/x68k
Date: Sat, 28 Sep 2019 20:55:43 +0900
At Sat, 28 Sep 2019 06:35:01 +0000 (UTC),
Martin Husemann wrote:
> > On which disk do you want to upgrade NetBSD?
> > ==> b: sd0 (2.0G)
>
> Please show the output of:
>
> disklabel -r sd0
>
> when running from the install media (either via Ctrl-Z or by going to
> the Utilities/Run /bin/sh menu) and the same output from the booted
> (old) system, plus the contents of /etc/fstab.
Boot from installation floppy.
# disklabel -r sd0
[ 15.0214130] sd0: fabricating a geometry
disklabel: could not read existing label
Boot from sd0 (old system).
# uname -srm
NetBSD 7.2 x68k
# disklabel -r sd0
disklabel: could not read existing label
# cat /etc/fstab
/dev/sd0a / ffs rw 1 1
/dev/sd0b none swap sw,dp 0 0
kernfs /kern kernfs rw
ptyfs /dev/pts ptyfs rw
procfs /proc procfs rw
#
> You are doing this update natively, on the x68k system?
(sorry if my translation and understanding is not correct)
I always use sysinst upgrade install on x68k.
Thanks,
---
Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: martin@netbsd.org
Cc: gnats-bugs@netbsd.org, isaki@pastel-flower.jp, tsutsui@ceres.dti.ne.jp
Subject: Re: install/54582: sysinst cannot find disklabel on 9.0_BETA/x68k
Date: Sat, 28 Sep 2019 21:04:24 +0900
> The problem here is that sysinst needs to find out what kind of partioning
> scheme is used (and deal properly). We can either disable that test
> for x68k and always assume disklabel or the kernel emulation of it, or
> we can add Human68k partition support now as an alternative scheme (quite
> easily; will do that for amiga and apple partitioning schemes too).
I'm afraid several other ports also have the similar issue
(i.e. no on-disk bsddisklabel data, but the kernel converts
their native OS labels to bsddisklabel in readdisklabel(9)).
- sys/dev/sun/disksubr.c:
disklabel_sun_to_bsd() converts SunOS label
- sys/arch/amiga/amiga/disksubr.c:
readdisklabel(9) handles RDB
- sys/arch/atai/atari/disksubr.c:
ahdi_label() converts AHDI label (optional)
- sys/arch/luna68k/luna68k/disksubr.c
disklabel_om_to_bsd() converts UniOS lavel (similar to SunOS one)
- sys/arch/mac68k/mac68k/disksubr.c:
read_mac_label() converts Apple Partition Map
I have not checked if writedisklabel(9) always writes
BSD disklabel or converted one in all cases, though..
---
Izumi Tsutsui
From: Martin Husemann <martin@duskware.de>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: martin@netbsd.org, gnats-bugs@netbsd.org, isaki@pastel-flower.jp
Subject: Re: install/54582: sysinst cannot find disklabel on 9.0_BETA/x68k
Date: Sat, 28 Sep 2019 14:18:00 +0200
On Sat, Sep 28, 2019 at 09:04:24PM +0900, Izumi Tsutsui wrote:
> I'm afraid several other ports also have the similar issue
> (i.e. no on-disk bsddisklabel data, but the kernel converts
> their native OS labels to bsddisklabel in readdisklabel(9)).
>
> - sys/dev/sun/disksubr.c:
> disklabel_sun_to_bsd() converts SunOS label
> - sys/arch/amiga/amiga/disksubr.c:
> readdisklabel(9) handles RDB
> - sys/arch/atai/atari/disksubr.c:
> ahdi_label() converts AHDI label (optional)
> - sys/arch/luna68k/luna68k/disksubr.c
> disklabel_om_to_bsd() converts UniOS lavel (similar to SunOS one)
> - sys/arch/mac68k/mac68k/disksubr.c:
> read_mac_label() converts Apple Partition Map
Yes, I am aware of most of them and will address them soon. Sun works (as
the sunlabel qualifies as a disklabel), amiga and mac* need special handling
that I am working on. Will put the others on the TODO list and get at them
afterwards.
Martin
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/54582 CVS commit: src/usr.sbin/sysinst
Date: Mon, 9 Dec 2019 19:16:54 +0000
Module Name: src
Committed By: martin
Date: Mon Dec 9 19:16:54 UTC 2019
Modified Files:
src/usr.sbin/sysinst: README.md_defs disklabel.c partitions.c
partitions.h
src/usr.sbin/sysinst/arch/x68k: md.h
Log Message:
PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/README.md_defs
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/x68k/md.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/54582 CVS commit: [netbsd-9] src/usr.sbin/sysinst
Date: Tue, 17 Dec 2019 09:44:52 +0000
Module Name: src
Committed By: msaitoh
Date: Tue Dec 17 09:44:52 UTC 2019
Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c defs.h disklabel.c
disks.c gpt.c label.c main.c mbr.c msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl partitions.c partitions.h partman.c wskbd.c
src/usr.sbin/sysinst/arch/alpha [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/amiga [netbsd-9]: md.h
src/usr.sbin/sysinst/arch/arc [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/cobalt [netbsd-9]: md.c md.h
src/usr.sbin/sysinst/arch/emips [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/evbarm [netbsd-9]: md.c menus.md.en
menus.md.es menus.md.fr menus.md.pl
src/usr.sbin/sysinst/arch/ews4800mips [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/hp300 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mipsco [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mvme68k [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/pmax [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/prep [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c md.h
Log Message:
Pull up following revision(s) (requested by martin in ticket #560):
usr.sbin/sysinst/partitions.h: revision 1.11
usr.sbin/sysinst/defs.h: revision 1.49
usr.sbin/sysinst/mbr.c: revision 1.23
usr.sbin/sysinst/msg.mi.en: revision 1.26
usr.sbin/sysinst/disks.c: revision 1.58
usr.sbin/sysinst/arch/evbarm/menus.md.pl: revision 1.2
usr.sbin/sysinst/msg.mi.es: revision 1.20
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.9
usr.sbin/sysinst/gpt.c: revision 1.13
usr.sbin/sysinst/arch/evbarm/md.c: revision 1.10
usr.sbin/sysinst/arch/arc/md.c: revision 1.10
usr.sbin/sysinst/disklabel.c: revision 1.18
usr.sbin/sysinst/bsddisklabel.c: revision 1.33
usr.sbin/sysinst/disklabel.c: revision 1.19
usr.sbin/sysinst/main.c: revision 1.19
usr.sbin/sysinst/partman.c: revision 1.45
usr.sbin/sysinst/arch/alpha/md.c: revision 1.7
usr.sbin/sysinst/msg.mi.de: revision 1.19
usr.sbin/sysinst/arch/evbarm/menus.md.en: revision 1.2
usr.sbin/sysinst/arch/x68k/md.h: revision 1.4
usr.sbin/sysinst/arch/x68k/md.c: revision 1.9
usr.sbin/sysinst/arch/evbarm/menus.md.es: revision 1.2
usr.sbin/sysinst/wskbd.c: revision 1.4
usr.sbin/sysinst/label.c: revision 1.15
usr.sbin/sysinst/arch/amiga/md.h: revision 1.5
usr.sbin/sysinst/label.c: revision 1.16
usr.sbin/sysinst/arch/hp300/md.c: revision 1.9
usr.sbin/sysinst/arch/emips/md.c: revision 1.8
usr.sbin/sysinst/label.c: revision 1.17
usr.sbin/sysinst/arch/pmax/md.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.6
usr.sbin/sysinst/arch/prep/md.c: revision 1.10
usr.sbin/sysinst/arch/mipsco/md.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.7
usr.sbin/sysinst/partitions.c: revision 1.8
usr.sbin/sysinst/arch/ews4800mips/md.c: revision 1.5
usr.sbin/sysinst/disklabel.c: revision 1.20
usr.sbin/sysinst/arch/evbarm/menus.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.fr: revision 1.24
usr.sbin/sysinst/disklabel.c: revision 1.21
usr.sbin/sysinst/partitions.h: revision 1.9
usr.sbin/sysinst/msg.mi.pl: revision 1.27
usr.sbin/sysinst/disklabel.c: revision 1.22
usr.sbin/sysinst/disklabel.c: revision 1.23
usr.sbin/sysinst/arch/i386/md.c: revision 1.27
usr.sbin/sysinst/disklabel.c: revision 1.24
usr.sbin/sysinst/disklabel.c: revision 1.25
usr.sbin/sysinst/arch/cobalt/md.h: revision 1.5
usr.sbin/sysinst/disklabel.c: revision 1.26
usr.sbin/sysinst/disklabel.c: revision 1.27
usr.sbin/sysinst/partitions.h: revision 1.10
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.10
PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.
Get rid of the evbarm preliminary menu: do not bother to ask the user
whether this is a RPi - query the FDT instead.
PR 54065: add optional "old compat" variant of ext2fs in file system
type selection and use that as default for the cobalt boot file system.
For now rely on the kernel mapping native RDB partitions.
Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.
Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)
Fix inverted comparison
Do not try to change the keyboard layout if we are not running on the
console.
When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.
Remove bogus assert.
When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.
Adapt MD parts to changes in get_fs_part_type (pass partition type).
If a fictious label has no RAW_PART assume there is no valid disk label.
Pass proper track size when initializing the default alignment - this is
important with sunlabels.
Fix overlapping partitions display
Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.
Do not show disklabel command invocation by default (only if there are
errors).
After installing boot blocks with RUN_NO_CLEAR (and handling the
potential errors) make sure to clear the stdscreen.
To generate a diff of this commit:
cvs rdiff -u -r1.23.2.7 -r1.23.2.8 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.42.2.4 -r1.42.2.5 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10.2.6 -r1.10.2.7 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.44.2.11 -r1.44.2.12 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.6.2.6 -r1.6.2.7 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.17.2.1 -r1.17.2.2 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.19.2.3 -r1.19.2.4 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.13.2.4 -r1.13.2.5 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.5 -r1.19.2.6 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.4 -r1.14.2.5 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.5 -r1.17.2.6 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.5 -r1.20.2.6 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.4.2.4 -r1.4.2.5 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.41.2.2 -r1.41.2.3 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/usr.sbin/sysinst/wskbd.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/alpha/md.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/usr.sbin/sysinst/arch/amiga/md.h
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/usr.sbin/sysinst/arch/cobalt/md.h
cvs rdiff -u -r1.7 -r1.7.2.1 src/usr.sbin/sysinst/arch/emips/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.1 -r1.1.30.1 src/usr.sbin/sysinst/arch/evbarm/menus.md.en \
src/usr.sbin/sysinst/arch/evbarm/menus.md.es \
src/usr.sbin/sysinst/arch/evbarm/menus.md.fr \
src/usr.sbin/sysinst/arch/evbarm/menus.md.pl
cvs rdiff -u -r1.4 -r1.4.2.1 src/usr.sbin/sysinst/arch/ews4800mips/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/hp300/md.c
cvs rdiff -u -r1.20.2.3 -r1.20.2.4 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/mipsco/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/mvme68k/md.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/pmax/md.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.sbin/sysinst/arch/x68k/md.c
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 src/usr.sbin/sysinst/arch/x68k/md.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 21 Apr 2020 17:12:29 +0000
State-Changed-Why:
Is martin's fix sufficient? thanks!
State-Changed-From-To: feedback->closed
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Sat, 25 Apr 2020 03:35:26 +0000
State-Changed-Why:
It works. Thank you for fix.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.