Use the special device name "ROOT." in /etc/fstab not just on the arm

images, but also on the bootable disk images of other ports, so that
they can be booted from differently named devices.  Merge the i386 and
amd64 -live-sd0root and -live-wd0root images into a single live image
per port, bootable both from usb media and in qemu.  Drop the -xx0root
suffixes from image names as they are no longer meaningful.
This commit is contained in:
gson 2018-12-15 18:03:16 +00:00
parent 92d227ffa8
commit c2b3070712
21 changed files with 37 additions and 86 deletions

View File

@ -1,10 +1,9 @@
# $NetBSD: Makefile,v 1.9 2017/09/18 14:42:16 joerg Exp $ # $NetBSD: Makefile,v 1.10 2018/12/15 18:03:16 gson Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
INSTIMGBASE= NetBSD-${DISTRIBVER}-amd64-install # gives ${IMGBASE}.img INSTIMGBASE= NetBSD-${DISTRIBVER}-amd64-install # gives ${IMGBASE}.img
BOOTDISK= sd0 # for USB flash etc.
INSTIMAGEMB?= 1450 # for all installation binaries INSTIMAGEMB?= 1450 # for all installation binaries
PRIMARY_BOOT= bootxx_ffsv1 PRIMARY_BOOT= bootxx_ffsv1

View File

@ -1,8 +1,7 @@
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:29 tsutsui Exp $ # $NetBSD: Makefile,v 1.2 2018/12/15 18:03:17 gson Exp $
SUBDIR= SUBDIR=
SUBDIR+= emuimage SUBDIR+= emuimage
SUBDIR+= usbimage
TARGETS+= release live_image TARGETS+= release live_image

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:29 tsutsui Exp $ # $NetBSD: Makefile.liveimage,v 1.2 2018/12/15 18:03:17 gson Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK?= wd0 # for emulators
PRIMARY_BOOT= bootxx_ffsv1 PRIMARY_BOOT= bootxx_ffsv1
SECONDARY_BOOT= boot SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= # unnecessary SECONDARY_BOOT_ARG= # unnecessary

View File

@ -1,10 +1,8 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:32 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:17 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-amd64-live-wd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-amd64-live # gives ${IMGBASE}.img
BOOTDISK= wd0 # for QEMU etc. USBIMAGEMB?= 1536 # 2GB USB flash memories aren't 2GiB
.if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif
.include "${.CURDIR}/../Makefile.liveimage" .include "${.CURDIR}/../Makefile.liveimage"

View File

@ -1,11 +0,0 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:32 tsutsui Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-amd64-live-sd0root # gives ${IMGBASE}.img
USBIMAGEMB?= 1536 # 2GB USB flash memories aren't 2GiB
BOOTDISK= sd0 # for USB flash etc.
LIVEIMAGEMB= ${USBIMAGEMB}
OMIT_SWAPIMG= yes # no need to write swap
.include "${.CURDIR}/../Makefile.liveimage"

View File

@ -1,10 +1,9 @@
# $NetBSD: Makefile,v 1.5 2018/03/28 22:38:47 joerg Exp $ # $NetBSD: Makefile,v 1.6 2018/12/15 18:03:17 gson Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
INSTIMGBASE= NetBSD-${DISTRIBVER}-amd64-uefi-install # gives ${IMGBASE}.img INSTIMGBASE= NetBSD-${DISTRIBVER}-amd64-uefi-install # gives ${IMGBASE}.img
BOOTDISK= dk1 # unused (use GUID)
INSTIMAGEMB?= 1550 # for all installation binaries INSTIMAGEMB?= 1550 # for all installation binaries
PRIMARY_BOOT= bootxx_ffsv1 PRIMARY_BOOT= bootxx_ffsv1

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.bootimage,v 1.8 2018/11/19 20:05:37 aymeric Exp $ # $NetBSD: Makefile.bootimage,v 1.9 2018/12/15 18:03:17 gson Exp $
# #
# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved.
# #
@ -34,9 +34,6 @@
# Basename of the image # Basename of the image
# #
# Optional variables: # Optional variables:
# BOOTDISK
# device name of target bootable disk specified in /etc/fstab
# (default: sd0)
# USE_MBR # USE_MBR
# set yes if target disk image requires MBR partition # set yes if target disk image requires MBR partition
# (default: no) # (default: no)
@ -158,7 +155,6 @@ RM?= rm
# #
# common definitions for image # common definitions for image
# #
BOOTDISK?= sd0
USE_MBR?= no USE_MBR?= no
USE_GPT?= no USE_GPT?= no
USE_SUNLABEL?= no USE_SUNLABEL?= no
@ -276,22 +272,21 @@ ${TARGETFS}: prepare_md_post pre-targetfs
.if ${USE_GPT} != "no" .if ${USE_GPT} != "no"
.if ${OMIT_SWAPIMG} == "no" .if ${OMIT_SWAPIMG} == "no"
${TOOL_SED} \ ${TOOL_SED} \
-e "s/\/dev\/@@BOOTDISK@@a/NAME=${BOOTDISK_UUID}/" \ -e "s/ROOT.a/NAME=${BOOTDISK_UUID}/" \
-e "s/\/dev\/@@BOOTDISK@@b/NAME=${SWAPDISK_UUID}/" \ -e "s/ROOT.b/NAME=${SWAPDISK_UUID}/" \
< ${FSTAB_IN} > ${WORKFSTAB} < ${FSTAB_IN} > ${WORKFSTAB}
.else .else
${TOOL_SED} \ ${TOOL_SED} \
-e "s/\/dev\/@@BOOTDISK@@a/NAME=${BOOTDISK_UUID}/" \ -e "s/ROOT.a/NAME=${BOOTDISK_UUID}/" \
-e "/@@BOOTDISK@@b/d" \ -e "/ROOT.b/d" \
< ${FSTAB_IN} > ${WORKFSTAB} < ${FSTAB_IN} > ${WORKFSTAB}
.endif .endif
.else # USE_GPT == "no" .else # USE_GPT == "no"
.if ${OMIT_SWAPIMG} == "no" .if ${OMIT_SWAPIMG} == "no"
${TOOL_SED} "s/@@BOOTDISK@@/${BOOTDISK}/" < ${FSTAB_IN} > ${WORKFSTAB} ${TOOL_SED} < ${FSTAB_IN} > ${WORKFSTAB}
.else .else
${TOOL_SED} \ ${TOOL_SED} \
-e "s/@@BOOTDISK@@/${BOOTDISK}/" \ -e "/ROOT.b/d" \
-e "/@@BOOTDISK@@b/d" \
< ${FSTAB_IN} > ${WORKFSTAB} < ${FSTAB_IN} > ${WORKFSTAB}
.endif .endif
.endif # USE_GPT != "no" .endif # USE_GPT != "no"

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.bootimage,v 1.19 2018/11/19 20:05:37 aymeric Exp $ # $NetBSD: Makefile.bootimage,v 1.20 2018/12/15 18:03:17 gson Exp $
# #
# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved.
# #
@ -34,9 +34,6 @@
# Basename of the image # Basename of the image
# #
# Optional variables: # Optional variables:
# BOOTDISK
# device name of target bootable disk specified in /etc/fstab
# (default: sd0)
# USE_MBR # USE_MBR
# set yes if target disk image requires MBR partition # set yes if target disk image requires MBR partition
# (default: no) # (default: no)
@ -148,7 +145,6 @@ RM?= rm
# #
# common definitions for image # common definitions for image
# #
BOOTDISK?= sd0
USE_MBR?= no USE_MBR?= no
USE_SUNLABEL?= no USE_SUNLABEL?= no
INSTALLBOOT_AFTER_DISKLABEL?= no INSTALLBOOT_AFTER_DISKLABEL?= no
@ -247,7 +243,7 @@ ${TARGETFS}: prepare_md_post
${INSTALL} ${COPY} -m 0644 ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR} ${INSTALL} ${COPY} -m 0644 ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR}
.endif .endif
@echo Preparing /etc/fstab ... @echo Preparing /etc/fstab ...
${TOOL_SED} "s/@@BOOTDISK@@/${BOOTDISK}/" < ${FSTAB_IN} > ${WORKFSTAB} ${TOOL_SED} < ${FSTAB_IN} > ${WORKFSTAB}
${INSTALL} ${COPY} -m 0644 ${WORKFSTAB} ${WORKDIR}/etc/fstab ${INSTALL} ${COPY} -m 0644 ${WORKFSTAB} ${WORKDIR}/etc/fstab
@echo Setting rc_configured=YES in /etc/rc.conf ... @echo Setting rc_configured=YES in /etc/rc.conf ...
${TOOL_SED} "s/rc_configured=NO/rc_configured=YES/" \ ${TOOL_SED} "s/rc_configured=NO/rc_configured=YES/" \

View File

@ -1,5 +1,5 @@
/dev/@@BOOTDISK@@a / ffs rw 1 1 ROOT.a / ffs rw 1 1
/dev/@@BOOTDISK@@b none none sw 0 0 ROOT.b none none sw 0 0
ptyfs /dev/pts ptyfs rw 0 0 ptyfs /dev/pts ptyfs rw 0 0
kernfs /kern kernfs rw,noauto 0 0 kernfs /kern kernfs rw,noauto 0 0
procfs /proc procfs rw,noauto 0 0 procfs /proc procfs rw,noauto 0 0

View File

@ -1,2 +1,2 @@
/dev/@@BOOTDISK@@a / ffs rw 1 1 ROOT.a / ffs rw 1 1
tmpfs /tmp tmpfs rw 0 0 tmpfs /tmp tmpfs rw 0 0

View File

@ -1,10 +1,9 @@
# $NetBSD: Makefile,v 1.12 2018/10/30 20:18:30 christos Exp $ # $NetBSD: Makefile,v 1.13 2018/12/15 18:03:17 gson Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
INSTIMGBASE= NetBSD-${DISTRIBVER}-i386-install # gives ${IMGBASE}.img INSTIMGBASE= NetBSD-${DISTRIBVER}-i386-install # gives ${IMGBASE}.img
BOOTDISK= sd0 # for USB flash etc.
INSTIMAGEMB?= 1450 # for all installation binaries INSTIMAGEMB?= 1450 # for all installation binaries
PRIMARY_BOOT= bootxx_ffsv1 PRIMARY_BOOT= bootxx_ffsv1

View File

@ -1,8 +1,7 @@
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ # $NetBSD: Makefile,v 1.2 2018/12/15 18:03:17 gson Exp $
SUBDIR= SUBDIR=
SUBDIR+= emuimage SUBDIR+= emuimage
SUBDIR+= usbimage
TARGETS+= release live_image TARGETS+= release live_image

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ # $NetBSD: Makefile.liveimage,v 1.2 2018/12/15 18:03:17 gson Exp $
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK?= wd0 # for emulators
PRIMARY_BOOT= bootxx_ffsv1 PRIMARY_BOOT= bootxx_ffsv1
SECONDARY_BOOT= boot SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= # unnecessary SECONDARY_BOOT_ARG= # unnecessary

View File

@ -1,10 +1,8 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:17 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-i386-live-wd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-i386-live # gives ${IMGBASE}.img
BOOTDISK= wd0 # for QEMU etc. EMUIMAGEMB?= 1536 # 2GB USB flash memories aren't 2GiB
.if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif
.include "${.CURDIR}/../Makefile.liveimage" .include "${.CURDIR}/../Makefile.liveimage"

View File

@ -1,11 +0,0 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-i386-live-sd0root # gives ${IMGBASE}.img
USBIMAGEMB?= 1536 # 2GB USB flash memories aren't 2GiB
BOOTDISK= sd0 # for USB flash etc.
LIVEIMAGEMB= ${USBIMAGEMB}
OMIT_SWAPIMG= yes # no need to write swap
.include "${.CURDIR}/../Makefile.liveimage"

View File

@ -1,11 +1,10 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:17 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-pmax-live-sd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-pmax-live # gives ${IMGBASE}.img
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK= sd0
.if defined(EMUIMAGEMB) .if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif .endif

View File

@ -1,11 +1,10 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:17 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-sparc-live-sd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-sparc-live # gives ${IMGBASE}.img
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK= sd0
.if defined(EMUIMAGEMB) .if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif .endif

View File

@ -1,12 +1,10 @@
# $NetBSD: Makefile,v 1.4 2015/03/22 14:02:15 tsutsui Exp $ # $NetBSD: Makefile,v 1.5 2018/12/15 18:03:18 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-sparc64-live-sd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-sparc64-live # gives ${IMGBASE}.img
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK= sd0 # for QEMU
#BOOTDISK= wd0 # for Ultra5/10 image?
.if defined(EMUIMAGEMB) .if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif .endif

View File

@ -1,11 +1,10 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:18 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-sun2-live-sd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-sun2-live # gives ${IMGBASE}.img
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK= sd0
.if defined(EMUIMAGEMB) .if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif .endif

View File

@ -1,11 +1,10 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:18 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-sun3-live-sd0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-sun3-live # gives ${IMGBASE}.img
.include <bsd.own.mk> .include <bsd.own.mk>
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK= sd0
.if defined(EMUIMAGEMB) .if defined(EMUIMAGEMB)
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
.endif .endif

View File

@ -1,13 +1,12 @@
# $NetBSD: Makefile,v 1.3 2012/11/03 14:25:33 tsutsui Exp $ # $NetBSD: Makefile,v 1.4 2018/12/15 18:03:18 gson Exp $
LIVEIMGBASE= NetBSD-${DISTRIBVER}-vax-live-ra0root # gives ${IMGBASE}.img LIVEIMGBASE= NetBSD-${DISTRIBVER}-vax-live # gives ${IMGBASE}.img
.include <bsd.own.mk> .include <bsd.own.mk>
EMUIMAGEMB?= 1024 # ra0 can't handle 2GB image EMUIMAGEMB?= 1024 # ra0 can't handle 2GB image
KERN_SET= kern-GENERIC KERN_SET= kern-GENERIC
BOOTDISK= ra0
LIVEIMAGEMB= ${EMUIMAGEMB} LIVEIMAGEMB= ${EMUIMAGEMB}
PRIMARY_BOOT= xxboot PRIMARY_BOOT= xxboot
#SECONDARY_BOOT= # boot is extracted from base.tgz #SECONDARY_BOOT= # boot is extracted from base.tgz