NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-hp300/54455 (hp300 ISO should be encapsulated in LIF to bebootable)
The following reply was made to PR port-hp300/54455; it has been noted by GNATS.
From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: port-hp300/54455 (hp300 ISO should be encapsulated in LIF to bebootable)
Date: Sat, 18 May 2024 13:47:45 +0900
> I've also pushed all commits with full logs to my github:
> https://github.com/tsutsui/netbsd-src/compare/689d5906...tsutsui:netbsd-src:tsutsui-hp300-cdboot-rebase
Needs more changes after several tests:
- Fix builds in SMALLPROG && !NO_STAGE2 && !hp300 && !macppc case.
- Omit cd9660 support in SMALLPROG (for installation programs) case.
diff --git a/usr.sbin/installboot/Makefile b/usr.sbin/installboot/Makefile
index 324ae24bddb9..56c70f79241b 100644
--- a/usr.sbin/installboot/Makefile
+++ b/usr.sbin/installboot/Makefile
@@ -69,7 +69,9 @@ SRCS+= ffs_bswap.c
#SRCS+= ext2fs.c ext2fs_bswap.c
.endif
-.if !empty(ARCH_FILES:C/(hp300|macppc)/cd9660/:Mcd9660.c)
+.if !empty(ARCH_FILES:C/(hp300|macppc)/cd9660/:Mcd9660.c) && \
+ !defined(SMALLPROG)
+CPPFLAGS+= -DSUPPORT_CD9660
SRCS+= cd9660.c cd9660_util.c
.if !make(obj) && !make(clean) && !make(cleandir)
diff --git a/usr.sbin/installboot/arch/hp300.c b/usr.sbin/installboot/arch/hp300.c
index 56cf9de18f07..1f782a48511a 100644
--- a/usr.sbin/installboot/arch/hp300.c
+++ b/usr.sbin/installboot/arch/hp300.c
@@ -88,8 +88,10 @@ hp300_setboot(ib_params *params)
int i;
unsigned int secsize = HP300_SECTSIZE;
uint64_t boot_size, boot_offset;
+#ifdef SUPPORT_CD9660
uint32_t nblk;
ib_block *blocks;
+#endif
struct disklabel *label;
assert(params != NULL);
@@ -107,6 +109,7 @@ hp300_setboot(ib_params *params)
goto done;
}
+#ifdef SUPPORT_CD9660
if (params->stage2 != NULL) {
/*
* Use contiguous blocks of SYS_BOOT in the target filesystem
@@ -162,7 +165,9 @@ hp300_setboot(ib_params *params)
params->filesystem);
}
- } else if (params->flags & IB_APPEND) {
+ } else
+#endif
+ if (params->flags & IB_APPEND) {
if (!S_ISREG(params->fsstat.st_mode)) {
warnx(
"`%s' must be a regular file to append a bootstrap",
@@ -218,6 +223,7 @@ hp300_setboot(ib_params *params)
}
}
+#ifdef SUPPORT_CD9660
if (params->stage2 != NULL) {
/* Use bootstrap file in the target filesystem. */
bootstrap = mmap(NULL, bootstrap_size,
@@ -227,7 +233,9 @@ hp300_setboot(ib_params *params)
warn("mmapping `%s'", params->filesystem);
goto done;
}
- } else {
+ } else
+#endif
+ {
/* Use bootstrap specified as stage1. */
bootstrap_size = params->s1stat.st_size;
bootstrap = mmap(NULL, bootstrap_size,
@@ -270,6 +278,7 @@ hp300_setboot(ib_params *params)
goto done;
}
+#ifdef SUPPORT_CD9660
if (params->stage2 != NULL) {
/*
* Bootstrap in the target filesystem is used.
@@ -278,6 +287,7 @@ hp300_setboot(ib_params *params)
retval = 1;
goto done;
}
+#endif
/* Write files to BOOT partition */
offset = boot_offset <= HP300_SECTSIZE * 16 ? HP300_SECTSIZE * 16 : 0;
diff --git a/usr.sbin/installboot/fstypes.c b/usr.sbin/installboot/fstypes.c
index 4bb720be6b5a..3f5b2ac80448 100644
--- a/usr.sbin/installboot/fstypes.c
+++ b/usr.sbin/installboot/fstypes.c
@@ -58,11 +58,13 @@ struct ib_fs fstypes[] = {
.match = raid_match,
.findstage2 = ffs_findstage2
},
+#ifdef SUPPORT_CD9660
{
.name = "cd9660",
.match = cd9660_match,
.findstage2 = cd9660_findstage2
},
+#endif
/* raw_match() always matches, so raw should be at the end. */
{
.name = "raw",
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index