11.2Sandvar/* $NetBSD: README,v 1.2 2021/08/17 22:00:31 andvar Exp $ */ 21.1Sfredette 31.1SfredetteThe sun bootblocks are split into two parts: a small 1st-level program that 41.1Sfredettegets written right after the superblock in a partition (and is hence limited 51.1Sfredettein size to SBSIZE - DEV_BSIZE bytes), and a 2nd-level program that resides 61.1Sfredettein the filesystem proper. 71.1Sfredette 81.1SfredetteThe 1st-level program is loaded into memory by the PROM. It loads the second 91.1Sfredettestage program from a set of filesystem block numbers that are hard-coded 101.1Sfredetteinto it by the `installboot' program. The prototype code for the 1st-level 111.1Sfredettebootblocks are in `bootxx'. 121.1Sfredette 131.1SfredetteThe 2nd-level program (`ufsboot') is normally installed in the root FS 141.1Sfredetteas `/ufsboot'. It uses the device drivers in the PROM and the stand-alone 151.1Sfredettefilesystem code in `libsa.a' to locate and load the kernel. 161.1Sfredette 171.1SfredetteUse the following command to install the 1st-level bootblocks in the 181.1Sfredetteroot filesystem (on `sd0a') using the file `/boot' as the second level 191.1Sfredetteboot program: 201.1Sfredette 211.1Sfredette mount /dev/sd0a /mnt 221.1Sfredette cd /usr/mdec 231.1Sfredette cp -p ufsboot /mnt/ufsboot 241.1Sfredette sync ; sleep 1 ; sync 251.1Sfredette ./installboot -v /mnt/ufsboot bootxx /dev/rsd0a 261.1Sfredette 271.1SfredetteThe above only works with securelevel <= 0 (see init.8 manual). 281.1Sfredette 291.1SfredetteStatus: 301.1Sfredette 311.1Sfredettenetboot works. 321.1Sfredette 331.1Sfredettebootxx, installboot are tested and working. It would be nice if 341.1Sfredetteinstallboot would find the inumber for the 2nd stage boot program 351.1Sfredettewithout having the filesystem mounted so this command can work 361.2Sandvarwith securelevel==1 (the default). Doing this requires adding 371.1Sfredettecode to read and do a directory lookup in the root... 381.1Sfredette 39