NetBSD Problem Report #55058

From tsutsui@ceres.dti.ne.jp  Sun Mar  8 12:22:45 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
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 1D2AC1A9217
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  8 Mar 2020 12:22:45 +0000 (UTC)
Message-Id: <202003081222.028CMYwp003429@ceres.dti.ne.jp>
Date: Sun, 8 Mar 2020 21:22:34 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: 9.0 sysinst does not handle a boot partition for luna68k
X-Send-Pr-Version: 3.95

>Number:         55058
>Category:       install
>Synopsis:       9.0 sysinst does not handle a boot partition for luna68k
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    martin
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 08 12:25:00 +0000 2020
>Closed-Date:    
>Last-Modified:  Mon Aug 21 11:10:01 +0000 2023
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: NetBSD 9.0 (INSTALL) #0: Fri Feb 14 00:06:28 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/luna68k/compile/INSTALL

Architecture: m68k
Machine: luna68k
>Description:
LUNA machines require an old 4.4BSD derived FFS partition to
load bootstrap loader on its firmware so prior sysinst for
NetBSD/luna68k creates a boot partition on partition d:
 https://nxr.netbsd.org/xref/src/usr.sbin/sysinst/arch/luna68k/md.h?r=1.1#46
---
     40 /*
     41  * Symbolic names for disk partitions
     42  */
     43 #define PART_ROOT	PART_A
     44 #define PART_SWAP	PART_B
     45 #define PART_RAW	PART_C
     46 #define PART_BOOT	PART_D
     47 #define PART_USR	PART_G	/* Can be after PART_FIRST_FREE */
     48 #define PART_FIRST_FREE	PART_E
---

On NetBSD/luna68k 9.0 there is no loger "PART_BOOT" like options
in md.h:
 https://nxr.netbsd.org/xref/src/usr.sbin/sysinst/arch/luna68k/md.h?r=1.3
---
     44 #define PART_BOOT	(8 * MEG)	/* for a.out kernel and boot */
     45 #define PART_BOOT_TYPE	FS_BSDFFS
     46 #define	PART_BOOT_SUBT	1		/* old 4.3BSD UFS */
---

In "Set sizes of NetBSD partitions" sysinst seems to try create
the boot partition at the top of the disk:
---

 You can now change the sizes for the system partitions.  The default is to
 allocate all the space to the root file system.  However, you may wish to
 have separate /usr (additional system files), /var (log files etc) or /home
 (users' home directories) file systems.

 Free space will be added to the partition marked with a '+'.

       Size (sec)                            Filesystem
       ----------------------------------- - --------------------
   >a: 16384                                 (Other: FFS)
    b: 131072 (232442)                     + /
    c: 0                                     <swap>
    d: 0                                     /tmp (mfs)
    e: 0                                     /usr
    f: 0                                     /var
       ----------------------------------- - --------------------
    h: Add a user defined partition
    i: Clone external partition(s)
    j: Change input units (sectors/cylinders/MB/GB)
    x: Go on.  Free space 101370 sec.
---
and no swap space is allocated by default.

After that, the disklabel editor shows:
---

 We now have your disklabel partitions for sd0 below.  This is your last   
 chance to change them. 

 Flags: (I)nstall, (N)ewfs.  Total size: 121M, free: 512B

     Start (sec)    End (sec)   Size (sec)  FS type Flag Filesystem
    ------------ ------------ ------------ -------- ---- ----------------
 a:            0        16383        16384      FFS IN
 b:            0       248825       248826 Whole disk
 c:        16385       248825       232441   4.2BSD N    /
    ------------ ------------ ------------ -------- ---- ----------------
 e: Change input units (sectors/cylinders/MB/GB)
 f: Edit name of the disk
 g: Clone external partition(s)
 h: Cancel
>x: Partition sizes ok

---
As shown above, partition "a" is boot,
partition "b" is whole disk (i.e. no swap),
and partition "c" is root partition.

Note there is no choise to "add a partiton" here
so no way to add a swap partition.

>How-To-Repeat:
Install NetBSD/luna68k 9.0 via sysinst.

Whole sysinst log is attached:
---

 NetBSD/luna68k 9.0

 This menu-driven tool is designed to help you install NetBSD to a hard disk,
 or upgrade an existing NetBSD system, with a minimum of work.
 In the following menus type the reference letter (a, b, c, ...) to select an
 item, or type CTRL+N/CTRL+P to select the next/previous item.
 The arrow keys and Page-up/Page-down may also work.
 Activate the current selection from the menu by typing the enter key.


 Thank you for using NetBSD!

                NetBSD-9.0 Install System                     

               >a: Install NetBSD to hard disk                
                b: Upgrade NetBSD on a hard disk              
                c: Re-install sets or install additional sets 
                d: Reboot the computer                        
                e: Utility menu                               
                f: Config menu                                
                x: Exit Install System                        



---

 You have chosen to install NetBSD on your hard disk.  This will change
 information on your hard disk.  You should have made a full backup before
 this procedure!  This procedure will do the following things:
                 a) Partition your disk
                 b) Create new BSD file systems
                 c) Load and install distribution sets
                 d) Some initial system configuration

 (After you enter the partition information but before your disk is changed,
 you will have the opportunity to quit this procedure.)

 Shall we continue?

                                Yes or no?    

                                a: No         
                               >b: Yes        

---


 On which disk do you want to install NetBSD?



                           Available disks          

                          >a: sd0 (121M)            
                           b: sd1 (30G)                                       
                           c: Extended partitioning 
                           x: Exit                  

---

 You can use a simple editor to set the sizes of the NetBSD partitions, or
 apply the default partition sizes and contents.

 You will then be given the opportunity to change any of the partition
 details.

 The NetBSD (or free) part of your disk (sd0) is 121M.

 A full installation requires at least 942M without X and at least 1192M if
 the X sets are included.


                      What would you like to do?        

                     >a: Set sizes of NetBSD partitions 
                      b: Use default partition sizes    

---

 You can now change the sizes for the system partitions.  The default is to
 allocate all the space to the root file system.  However, you may wish to
 have separate /usr (additional system files), /var (log files etc) or /home
 (users' home directories) file systems.

 Free space will be added to the partition marked with a '+'.

       Size (sec)                            Filesystem
       ----------------------------------- - --------------------
    a: 16384                                 (Other: FFS)
    b: 131072 (232442)                     + /
    c: 0                                     <swap>
    d: 0                                     /tmp (mfs)
    e: 0                                     /usr
    f: 0                                     /var
       ----------------------------------- - --------------------
    h: Add a user defined partition
    i: Clone external partition(s)
    j: Change input units (sectors/cylinders/MB/GB)
   >x: Go on.  Free space 101370 sec.


---

 We now have your disklabel partitions for sd0 below.  This is your last   
 chance to change them. 

 Flags: (I)nstall, (N)ewfs.  Total size: 121M, free: 512B

     Start (sec)    End (sec)   Size (sec)  FS type Flag Filesystem
    ------------ ------------ ------------ -------- ---- ----------------
 a:            0        16383        16384      FFS IN
 b:            0       248825       248826 Whole disk
 c:        16385       248825       232441   4.2BSD N    /
    ------------ ------------ ------------ -------- ---- ----------------
 e: Change input units (sectors/cylinders/MB/GB)
 f: Edit name of the disk
 g: Clone external partition(s)
 h: Cancel
>x: Partition sizes ok

---


>Fix:
Not sure.

src/usr.sbin/sysinst/README.md_defs says:
> The boot partition is always inserted at the front of the suggested default
> partitions, to cope with firmwares that may not be able to load from the
> whole disk.

I'm not sure what "the suggested default partitions" mean here,
but at least this is not neccesary for luna68k.

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: install-manager->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Sun, 08 Mar 2020 12:40:42 +0000
Responsible-Changed-Why:
my bug


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: install/55058: 9.0 sysinst does not handle a boot partition for
	 luna68k
Date: Fri, 23 Dec 2022 22:37:57 +0900

 >Synopsis:       9.0 sysinst does not handle a boot partition for luna68k

 Still happens on 10.0_BETA and easily reproducible on nono emulator.

 (build and install pkgsrc/emulators/nono)
 echo 'vmtype = luna' > nono.cfg
 echo 'hostnet-driver = none' >> nono.cfg
 ftp https://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-10/latest/luna68k/binary/kernel/netbsd-INSTALL.gz
 gunzip netbsd-INSTALL.gz
 dd if=/dev/zero of=hdd.img bs=1m count=1024
 nono
 (^C or quit by [File]->[Exit] menu once after NVRAM.DAT is created)
 nono -f -c nono.cfg -V spc0-id6-image=hd,hdd.img -X netbsd-INSTALL

 (type enter on "Terminal type? [vt100]")
 (type "i" on "(I)nstall, (S)hell or (H)alt ?")
 (sysinst will start)

 "a: Install NetBSD to hard disk"
 "b: Yes"
 "a: sd0 (1.0G, NONO SCSIHD)"
 "a: Set sizes of NetBSD partitions"

 Then it shows:

 ---

  You can now change the sizes for the system partitions.  The default is to
  allocate all the space to the root file system.  However, you may wish to
  have separate /usr (additional system files), /var (log files etc) or /home
  (users' home directories) file systems.

  Free space will be added to the partition marked with a '+'.

        Size (sec)                            Filesystem
        ----------------------------------- - --------------------
    >a: 16384                                 (Other: FFS <Boot>)
     b: 593920 (2015232)                    + /
     c: 65536                                 <swap>
     d: 0                                     /tmp (mfs)
     e: 0                                     /usr
     f: 0                                     /var
        ----------------------------------- - --------------------
     h: Add a user defined partition
     i: Change input units (sectors/cylinders/MB/GB)
     x: Go on.  Free space 1421312 sec.

 ---

 Here, the original intention is (on netbsd-8 and prior):
  - /boot partition for PROM to load bootloader is partition d:
    and its size is 8MB at offset 0
  - root partition is located after the d: (boot) partition

 But it looks the newer sysinst editor has no way to allocate
 partition d: before partition a:?

 After selecting "x: Go on.  Free space 1421312 sec." it shows:

 ---

  We now have your disklabel partitions for sd0 below.  This is your last   
  chance to change them. 

  Flags: (I)nstall, (N)ewfs.  Total size: 1024M, free: 0B

      Start (sec)    End (sec)   Size (sec)  FS type Flag Filesystem
     ------------ ------------ ------------ -------- ---- ----------------
  a:            0        16383        16384      FFS N
  b:      2031616      2097151        65536     swap
  c:            0      2097151      2097152 Whole disk
  d:        16384      2031615      2015232      FFS IN   /
     ------------ ------------ ------------ -------- ---- ----------------
  f: Change input units (sectors/cylinders/MB/GB)
  g: Edit name of the disk
  h: Cancel
 >x: Partition sizes ok

 ---

 Still no way to specify /boot partition at offset 0 as d: partition.

 ---
 Izumi Tsutsui

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55058 CVS commit: src/usr.sbin/sysinst/arch/luna68k
Date: Fri, 6 Jan 2023 18:14:56 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jan  6 18:14:56 UTC 2023

 Modified Files:
 	src/usr.sbin/sysinst/arch/luna68k: md.c md.h

 Log Message:
 PR 55058: force the boot partition to sd0d, so our root partitions becomes
 sd0a again.


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/arch/luna68k/md.c
 cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/arch/luna68k/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->needs-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Tue, 10 Jan 2023 14:00:23 +0000
State-Changed-Why:
Confirmed fixed on HEAD.
netbsd-9 and netbsd-10 need fixes.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55058 CVS commit: [netbsd-10] src/usr.sbin/sysinst/arch/luna68k
Date: Mon, 21 Aug 2023 11:05:54 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Aug 21 11:05:54 UTC 2023

 Modified Files:
 	src/usr.sbin/sysinst/arch/luna68k [netbsd-10]: md.c md.h

 Log Message:
 Pull up following revision(s) (requested by tsutsui in ticket #331):

 	usr.sbin/sysinst/arch/luna68k/md.c: revision 1.11
 	usr.sbin/sysinst/arch/luna68k/md.h: revision 1.7

 PR 55058: force the boot partition to sd0d, so our root partitions becomes
 sd0a again.


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.10.2.1 src/usr.sbin/sysinst/arch/luna68k/md.c
 cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/sysinst/arch/luna68k/md.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.