Home | History | Annotate | Line # | Download | only in bootblk
      1  1.10       chs #	$NetBSD: genfth.cf,v 1.10 2022/11/17 06:40:39 chs Exp $
      2   1.1       mrg 
      3   1.1       mrg #
      4   1.1       mrg # Copyright (c) 1997 The NetBSD Foundation, Inc.
      5   1.1       mrg # All rights reserved.
      6   1.1       mrg #
      7   1.1       mrg # This code is derived from software contributed to The NetBSD Foundation
      8   1.1       mrg # by Christos Zoulas.
      9   1.1       mrg #
     10   1.1       mrg # Redistribution and use in source and binary forms, with or without
     11   1.1       mrg # modification, are permitted provided that the following conditions
     12   1.1       mrg # are met:
     13   1.1       mrg # 1. Redistributions of source code must retain the above copyright
     14   1.1       mrg #    notice, this list of conditions and the following disclaimer.
     15   1.1       mrg # 2. Redistributions in binary form must reproduce the above copyright
     16   1.1       mrg #    notice, this list of conditions and the following disclaimer in the
     17   1.1       mrg #    documentation and/or other materials provided with the distribution.
     18   1.1       mrg #
     19   1.1       mrg # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.1       mrg # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.1       mrg # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.1       mrg # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.1       mrg # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.1       mrg # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.1       mrg # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.1       mrg # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.1       mrg # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.1       mrg # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.1       mrg # POSSIBILITY OF SUCH DAMAGE.
     30   1.1       mrg #
     31   1.1       mrg # Copyright (c) 1992, 1993
     32   1.1       mrg #	The Regents of the University of California.  All rights reserved.
     33   1.1       mrg #
     34   1.1       mrg # This software was developed by the Computer Systems Engineering group
     35   1.1       mrg # at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
     36   1.1       mrg # contributed to Berkeley.
     37   1.1       mrg #
     38   1.1       mrg # All advertising materials mentioning features or use of this software
     39   1.1       mrg # must display the following acknowledgement:
     40   1.1       mrg #	This product includes software developed by the University of
     41   1.1       mrg #	California, Lawrence Berkeley Laboratory.
     42   1.1       mrg #
     43   1.1       mrg # Redistribution and use in source and binary forms, with or without
     44   1.1       mrg # modification, are permitted provided that the following conditions
     45   1.1       mrg # are met:
     46   1.1       mrg # 1. Redistributions of source code must retain the above copyright
     47   1.1       mrg #    notice, this list of conditions and the following disclaimer.
     48   1.1       mrg # 2. Redistributions in binary form must reproduce the above copyright
     49   1.1       mrg #    notice, this list of conditions and the following disclaimer in the
     50   1.1       mrg #    documentation and/or other materials provided with the distribution.
     51   1.1       mrg # 3. All advertising materials mentioning features or use of this software
     52   1.1       mrg #    must display the following acknowledgement:
     53   1.1       mrg #	This product includes software developed by the University of
     54   1.1       mrg #	California, Berkeley and its contributors.
     55   1.1       mrg # 4. Neither the name of the University nor the names of its contributors
     56   1.1       mrg #    may be used to endorse or promote products derived from this software
     57   1.1       mrg #    without specific prior written permission.
     58   1.1       mrg #
     59   1.1       mrg # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     60   1.1       mrg # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     61   1.1       mrg # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     62   1.1       mrg # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     63   1.1       mrg # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     64   1.1       mrg # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     65   1.1       mrg # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     66   1.1       mrg # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     67   1.1       mrg # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     68   1.1       mrg # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     69   1.1       mrg # SUCH DAMAGE.
     70   1.1       mrg #
     71   1.1       mrg #	@(#)genassym.c	8.1 (Berkeley) 6/11/93
     72   1.1       mrg #
     73   1.1       mrg 
     74   1.1       mrg include <sys/param.h>
     75   1.1       mrg include <sys/time.h>
     76   1.1       mrg include <ufs/ufs/dinode.h>
     77   1.1       mrg include <ufs/ufs/dir.h>
     78   1.1       mrg include <ufs/ffs/fs.h>
     79   1.4    martin include <dev/raidframe/raidframevar.h>
     80   1.1       mrg 
     81   1.1       mrg #
     82   1.1       mrg # ufs sizing constants
     83   1.1       mrg #
     84   1.1       mrg define	dev_bsize	DEV_BSIZE
     85   1.1       mrg define	maxbsize	MAXBSIZE
     86   1.2  christos define	bbsize		BBSIZE
     87   1.2  christos define	sbsize		SBLOCKSIZE
     88   1.2  christos define	bboff		BBOFF
     89   1.3        he define	sboff		SBLOCK_UFS1
     90   1.2  christos define	bblock		BBLOCK
     91   1.2  christos # XXX: Will not work for UFS2!
     92   1.2  christos define	sblock		SBLOCK_UFS1
     93   1.1       mrg 
     94   1.4    martin # RAID1 boot support
     95   1.4    martin define	rf_protected	RF_PROTECTED_SECTORS
     96   1.4    martin 
     97   1.1       mrg #
     98   1.1       mrg # ufs superblock
     99   1.1       mrg #
    100   1.1       mrg struct	fs
    101   1.1       mrg member	fs_magic
    102   1.1       mrg member	fs_bsize
    103   1.3        he member	fs_old_npsect
    104   1.3        he member	fs_old_nsect
    105   1.3        he member	fs_old_interleave
    106   1.3        he member	fs_old_postblformat
    107   1.3        he member	fs_old_nrpos
    108   1.3        he member	fs_old_inodefmt
    109   1.1       mrg member	fs_maxfilesize
    110   1.1       mrg member	fs_qbmask
    111   1.1       mrg member	fs_qfmask
    112   1.1       mrg member	fs_bmask
    113   1.1       mrg member	fs_fmask
    114   1.1       mrg member	fs_ipg
    115   1.1       mrg member	fs_fpg
    116   1.1       mrg member	fs_inopb
    117   1.1       mrg member	fs_fragshift
    118   1.1       mrg member	fs_bshift
    119   1.1       mrg member	fs_fshift
    120   1.3        he member	fs_old_cgoffset
    121   1.3        he member	fs_old_cgmask
    122   1.1       mrg member	fs_dblkno
    123   1.1       mrg member	fs_iblkno
    124   1.1       mrg member	fs_sblkno
    125   1.1       mrg member	fs_cblkno
    126   1.1       mrg member  fs_fsbtodb
    127   1.1       mrg member	fs_nindir
    128   1.1       mrg member	fs_frag
    129   1.1       mrg member	fs_maxsymlinklen
    130   1.1       mrg 
    131   1.1       mrg #
    132   1.3        he # ufs1 dinode
    133   1.1       mrg #
    134   1.3        he struct	ufs1_dinode
    135   1.7       eeh member	di1_size	di_size
    136   1.7       eeh member	di1_mode	di_mode
    137   1.7       eeh member	di1_db		di_db
    138   1.7       eeh member	di1_ib		di_ib
    139   1.7       eeh 
    140   1.7       eeh #
    141   1.7       eeh # ufs2 dinode
    142   1.7       eeh #
    143   1.7       eeh struct	ufs2_dinode
    144   1.7       eeh member	di2_size	di_size
    145   1.7       eeh member	di2_mode	di_mode
    146   1.7       eeh member	di2_db		di_db
    147   1.7       eeh member	di2_ib		di_ib
    148   1.1       mrg 
    149   1.1       mrg #
    150   1.1       mrg # ufs direct
    151   1.1       mrg #
    152   1.1       mrg struct	direct
    153   1.1       mrg member	d_ino
    154   1.1       mrg member	d_reclen
    155   1.1       mrg #member	d_type		# notused
    156   1.1       mrg member	d_namlen
    157   1.1       mrg member	d_name
    158   1.1       mrg 
    159   1.7       eeh define	fs1_magic_value	FS_UFS1_MAGIC
    160   1.7       eeh define	fs2_magic_value	FS_UFS2_MAGIC
    161  1.10       chs define	fs2ea_magic_value FS_UFS2EA_MAGIC
    162   1.1       mrg define	fs_42postblfmt	FS_42POSTBLFMT
    163   1.1       mrg define	fs_44inodefmt	FS_44INODEFMT
    164   1.8  dholland define	ndaddr		UFS_NDADDR
    165   1.8  dholland define	niaddr		UFS_NIADDR
    166   1.8  dholland define	rootino		UFS_ROOTINO
    167   1.1       mrg define	ifmt		IFMT
    168   1.1       mrg define	ifdir		IFDIR
    169   1.2  christos define	iflnk		IFLNK
    170