9720 kernel: support for booting with cpio-based boot_archive

Review Request #1156 — Created Aug. 9, 2018 and submitted

tsoome
illumos-gate
9720
1189
d5eaf91...
general
In addition to booting with ufs and hsfs boot archives, this commit adds
support for cpio boot archives.  The archive itself can be compressed (since
loader decompresses the image before handing it to the kernel), but the
individual files must *not* be compressed.  Size-wise, the cpio archives
tend to be marginally smaller than the hsfs archives with identical files.

root@uefi-oi:/usr/bin# bootadm update-archive -fv
forced update of archive requested
cannot find: /etc/cluster/nodeid: No such file or directory
cannot find: /etc/devices/mdi_ib_cache: No such file or directory
cannot find: /etc/devices/retire_store: No such file or directory
mkisofs not found, creating cpio archive
updating /platform/i86pc/amd64/boot_archive
updating /platform/i86pc/boot_archive
45816 blocks
216968 blocks
root@uefi-oi:/usr/bin# reboot
Connection to uefi-oi.local closed by remote host.
Connection to uefi-oi.local closed.
Nazgul:~ tsoome$ ssh uefi-oi.local
Warning: No xauth data; using fake authentication data for X11 forwarding.
The Illumos Project     SunOS 5.11      illumos-gate    August 2018
tsoome@uefi-oi:~$ 
tsoome@uefi-oi:~$ cd /tmp
tsoome@uefi-oi:/tmp$ cp /platform/i86pc/amd64/boot_archive boot_archive.gz
tsoome@uefi-oi:/tmp$ gunzip boot_archive.gz 
filetsoome@uefi-oi:/tmp$ file boot_archive 
boot_archive:   ASCII cpio archive - CHR (-c) header
tsoome@uefi-oi:/tmp$
  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
danmcd
  1. 1.) Testing done?

    2.) Looks like you'll need to read usr/src/README.license-files and add appropriate entries.

    1. Yes indeed, I did overlook the license, thanks!

    2. All this THIRDPARTYLICENSE stuff looks like discrimination :D if you have external license, you get your name put into the package, while those with "usual" CDDL license aren't listed anywhere! And it really smells like Sun's legacy when you have the "core" license with Sun copyrights, and some external code where you provide both license text/copyright holders.

      Seriously though, can't we adopt what FreeBSD did instead - the SPDX-License-Identifier tags?

    3. There is much confusion about SPDX-License-Identifier tags btw, and anyhow all this license discussion is outside of the scope for this change.

    4. I'm not commenting on your change, anyhow.

    5. Yes, but it is good to get such matters to developers or advocates, otherwise we are just confusing readers here:)

  2. 
      
tsoome
citrus
  1. 
      
  2. usr/src/uts/common/krtld/bootrd_cpio.c (Diff revision 1)
     
     

    this comment does not reflect hat the code does

  3. usr/src/uts/common/krtld/bootrd_cpio.c (Diff revision 1)
     
     

    i can't see why this needs to be a doubly linked list. drop the prev?

    1. and use SLIST, yep.

  4. 
      
tsoome
citrus
  1. Thanks tsoome, happy with this now.
    Note that this was integrated into OmniOS a few weeks ago and testing there was positive. Although the cpio code is pretty sub-optimal on the face of it, the speed (from "mount" to "unmount" is pretty comparable with UFS and HSFS)

    1. np, I have been using this since Jeff wrote it:D except the SLIST change is really fresh, but it is trivial change anyhow.

  2. 
      
tsoome
ptribble
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...