• OpenBSD
  • OpenBSD installer shell "breakout"

  • Edited

With FreeBSD and NetBSD, I can enter the limited installer shell and manually change it into a live system with a basic X.org that's able to install packages.
But how can I do this in the OpenBSD installer? The environment is really limited. There's no mount_tmpfs or mount_mfs yet. I'm able to boot from a install iso and extract 1 executable from the base set archive into /tmp, but then we're out of memory.
I need RAM-based storage space that can be mounted over various default read-only system directories but how can I activate it in this minimal single-user shell? Because we're booted in a default kernel with enough RAM and all devices available, that should be possible but mount_tmpfs and mount_mfs aren't really informative about what they are still missing. Just nothing happens, afaik.

  • rvp replied to this.

    MG_ I need RAM-based storage space that can be mounted over various default read-only system directories but how can I activate it in this minimal single-user shell? Because we're booted in a default kernel with enough RAM and all devices available, that should be possible but mount_tmpfs and mount_mfs aren't really informative about what they are still missing. Just nothing happens, afaik.

    Neither the GENERIC kernel config, nor the ISO RAMDISK one have tmpfs compiled in (don't know why); and RAMDISK_CD doesn't even have mfs in it.

    I guess you'll have to compile a new ramdisk kernel with one of those and build a new cd image with /sbin/mount_mfs and/or /sbin/mount_tmpfs...

    • MG_ replied to this.
    • Jay likes this.
      • Edited

      rvp

      It works using a remote writeable nfs directory but I'm trying this on the official amd64 ISO.
      I was expecting a GENERIC kernel, but after preparing uname, I can see it's called RAMDISK_CD#326. So it is a ramdisk? They might have set the size to the actual content size + 300KB or so.
      And mount_tmpfs says nothing if the kernel doesn't support it? The executable exists in the ISO base.tgz but it says "operation not supported" on a GENERIC vm that I tried. Only the binary without /libexec and /usr/lib does nothing but exits with 0.

      • rvp replied to this.

        MG_ I was expecting a GENERIC kernel, but after preparing uname, I can see it's called RAMDISK_CD#326. So it is a ramdisk?

        Yes.

        MG_ And mount_tmpfs says nothing if the kernel doesn't support it? The executable exists in the ISO base.tgz but it says "operation not supported" on a GENERIC vm that I tried.

        tmpfs support was removed more than 8 years ago. Use mfs.

        Build a new ISO image with a RAMDISK_CD kernel with option MFS added, and a /sbin/mount_mfs binary.

        • Edited

        So, the installer ISO doesn't allow anything else than the installer activities. It feels like it's boarded up. Might be security. If someone leaves a disk with a full GENERIC kernel in the drive that's booted the next day, someone else could abuse the root privileges on that system...

        • rvp replied to this.

          MG_ Nah, just space constraints, I would think. If you're root and you have a CD-full of tarballs, you could build a kernel if you have a spare disk handy, then boot that.

          • MG_ replied to this.
            • Edited

            rvp Possible but not my goal. I'm just trying to make an automated custom installation that can be finished wiith a official release ISO of the 3 major BSD's. The RAMDISK_CD kernel can't be made capable to run X11 without rebooting?

            Why not recreate the required environment? The ISO contains the GENERIC kernel anyway but it doesn't reach login because various system directories are missing. What exactly sets the RAM limit of a RAMDISK_CD kernel? It doesn't seem necessary for anything. Workaround would be to complete the full installation procedure and do it again as "2nd phase", but then with a full kernel to enable X11.

            • rvp replied to this.

              MG_ The RAMDISK_CD kernel can't be made capable to run X11

              Don't think so--too many features compiled out.

              MG_ Why not recreate the required environment? The ISO contains the GENERIC kernel anyway

              Sure, you can do that too. create & format a partition somewhere, un-tar the GENERIC kernel and some binaries, then use the CDROM bootloader to boot from that.

              MG_ What exactly sets the RAM limit of a RAMDISK_CD kernel?

              See here.

              MG_ Workaround would be to complete the full installation procedure and do it again as "2nd phase", but then with a full kernel to enable X11.

              Seems simpler to rather build an ISO image with a GENERIC kernel and whatever additional stuff you want...

              • Edited

              The idea is that you can download an official ISO, enter the installer shell, prepare network and download and execute 1 script, that is the automated installation of a minimal X11 desktop. I have Free and Net reasonably working on various workstations and virtual machine hosts. They need improvements on hardware detection and configuration.
              OpenBSD seems to be getting more complex because it uses a different kernel with the installer ISO. This probably requires a reboot.
              I'm now looking for the setting that makes us only have 300KB RAM for some temporary files and hope it's not necessarily read-only. It seems to be set to only the max that the installer dialog can ever need. Probably for security reasons. A rootkit sneaking in a local system distribution. This way It can't be the official CDROM or someone messing around on the background during the installer run.

              • Edited

              Anyway, now trying to compile a GENERIC system in Qemu to see what's the difference with RAMDISK_CD and still needed to get a graphics screen. It can't be a lot more than RAM-based storage instead of a physucal target disk. We have network, storage devices and user management.