tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Tools mkhybrid(8) for mac68k/macppc ISO9660/HFS install ISO images



Hi,

As you guys have seen here last weekend, I've added
"cd9660 fs support" to installboot(8) for hp300 bootable
CD image support.

As the next project, I've also revived my old private project to
"use old mkhybrid(8) as a build tool to create ISO9660/HFS hybrid
 CD ISO images for mac68k and macppc".


# Background

- NetBSD/mac68k needs to be installed on or booted from MacOS,
  so NetBSD installation CD media should be created as an
  ISO9660/HFS hybrid image, to make MacOS recognizes various
  our MacOS tools on the install CD.

- Some macppc machines (with OpenFirmware 1.x and 2.x) require
  special data structures like the Apple partition map in the CD,
  and currently only mkisofs (and mkhybrid, an old fork of mkisofs)
  can handle such Apple specific specific boot structures (AFAIK).

- Some newer macppc machines (OpenFirmware 3.x) might also require
  Apple specific structures to recoginze bootloaders in the CD image.
  (but I'm not sure)

- It may be a hard work and unlikely to add HFS and Apple partition
  map support to our native makefs(8) tools, just to create ISO
  images for the old Macs.

- Currently release builds require an external (pkgsrc) mkisofs(8)
  tool to create usable mac68k and bootable macppc installcd images,
  but such external tools often updated their options and behaviors
  and we had to catch up them in our Makefiles.
  (though the cdrtools project seems inactive nowadays)

- As noted above newer mkisofs(8) is a part of cdrtools, and
  cdrtools-2.01 (and later) use their own "Schily make" to
  handle machine dependent environments like GNU configure.
  However, the smake and its Makefiles are too complicated
  to manage them in our NetBSD's src/tools infrastructures.

- mkhybrid(8) was an old fork of mkisofs(8) that added support
  for the Apple specific features (HFS and partition map etc.)
  and it used old GNU autoconf (around 2.12).
  OpenBSD has used it to build their ISO images, including macppc.


# Overview of "tools mkhybrid"

See README.md in my github tree:
 https://github.com/tsutsui/netbsd-src/blob/tsutsui-tools-mkhybrid-rebase/external/gpl2/mkhybrid/README.md

```

# tools'fied mkhybrid to build HFS/ISO9660 hybrid image for mac68k and macppc

(See src/distrib/cdrom/README how to fetch set binaries and build iso images)

## What's this?

This external/gpl2/mkhybrid provides tools'fied mkhybrid(8) to build
HFS/ISO9660 hybrid CD images for mac68k and macppc install media,
based on mkhybrid 1.12b5.1 in OpenBSD 7.3:
 http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/gnu/usr.sbin/mkhybrid/src/

## Changes from OpenBSD's one

- pull sources in OpenBSD's src/gnu/usr.sbin/mkhybrid/src except libfile
  into NetBSD's src/external/gpl2/mkhybrid/dist
  (unnecessary files for tools builds are not imported)
- pull 2 clause BSD licensed libfile sources from upstream cdrtools-3.01
- pull Makefile in OpenBSD's src/gnu/usr.sbin/mkhybrid/mkhybrid
  into NetBSD's src/external/gpl2/mkhybrid/bin
- src/external/gpl2/mkhybrid/bin is prepared to build tools version
  in src/tools/mkhybrid using src/tools/Makefile.host
- tweak configure to pull several header files for NetBSD tools builds
- appease various dumb warnings
- pull -hide-rr-moved option from upstream mkisofs-1.13
- pull -graft-points option from upstream mkisofs-1.13 and cdrtools-2.01
- pull malloc related fixes in tree.c from upstream cdrtools-2.01

## Current status

- builds on NetBSD, ubuntu, and Cygwin hosts are tested

See github commit logs and diffs for more details.
 https://github.com/tsutsui/netbsd-src/commits/tsutsui-tools-mkhybrid-rebase/

## TODO

- add support to specify permissions via mtree-specfiles
  as native makefs(8) for non-root build

```

More detailed diffs and commits are on my github:
 https://github.com/tsutsui/netbsd-src/compare/c05c85b7...tsutsui-tools-mkhybrid-rebase
 

Note GNU configure is not used on tools/mkhybrid build, but
tools/mkhybrid builds and works even on ubuntu 22.04.4 LTS,
and and even on the latest Cygwin 3.5.3 on Windows 10.

I've also confirmed "macppccd-current.iso" built on the Cygwin
can boot on my old Apus 2000 (with OpenFiwmare 2.0).

This tools mkhybrid is built only on mac68k and macppc
and used only to build iso-image, so I hope it won't break
other ports.


# Future works

- Currently a special "mapppc_installboot" tool is necessary to
  make macppc install CD ISO bootable, in the "old CD method"
  described in src/distrib/cdrom directory.

  This old macppc_installboot tool (written by me) should be merged
  into MI src/usr.sbin/installboot to build a macppc installcd iso
  on "build.sh iso-image" target and to abandon the old method.

  However, it also requires more work and cleanups around Apple
  partition map stuff in src/usr.sbin/installboot/arch/macppc.c.

- As noted in the above TODO, we should handle owner/group/permission
  and timestamp etc. in the target ISO images to full reproducible
  builds as our makefs(8) does, but it should be a future work because
  currently used pkgsrc mkisofs(8) doesn't handle them either.


I believe it's a better strategy to "drop pkgsrc mkisofs(8) and
 use a (dumb and old but) own build tool," even if it isn't perfect.

Comments?

Thanks,
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index