Home | History | Annotate | Line # | Download | only in conf
x86.conf revision 1.12
      1  1.12  christos # $NetBSD: x86.conf,v 1.12 2024/12/27 19:02:19 christos Exp $
      2   1.1  christos # x86 shared config
      3   1.1  christos #
      4   1.4  christos 
      5   1.1  christos image=$HOME/${board}.img
      6   1.4  christos MACHINE=${board}
      7   1.4  christos kernel=$src/sys/arch/${board}/compile/GENERIC/netbsd
      8   1.4  christos bootfile=$release/usr/mdec/boot
      9   1.1  christos 
     10   1.1  christos extra=8		# spare space
     11   1.1  christos size=0		# autocompute
     12   1.1  christos netbsdid=169
     13   1.5  christos init=63
     14   1.5  christos ffsoffset=${init}b
     15   1.2  christos 
     16   1.4  christos make_label() {
     17   1.1  christos 	# compute all sizes in terms of sectors
     18   1.9       rin 	local totalsize=$(( ${size} / 512 ))
     19   1.1  christos 
     20   1.5  christos 	local aoffset=${init}
     21   1.3  christos 	local asize=$(( ${totalsize} - ${aoffset} ))
     22   1.1  christos 
     23   1.1  christos 	local bps=512
     24   1.1  christos 	local spt=32
     25   1.1  christos 	local tpc=64
     26   1.1  christos 	local spc=2048
     27   1.1  christos 	local cylinders=$(( ${totalsize} / ${spc} ))
     28   1.1  christos 
     29   1.1  christos 	cat << EOF
     30   1.1  christos type: SCSI
     31   1.1  christos disk: STORAGE DEVICE
     32   1.1  christos label: fictitious
     33   1.1  christos flags: removable
     34   1.1  christos bytes/sector: ${bps}
     35   1.1  christos sectors/track: ${spt}
     36   1.1  christos tracks/cylinder: ${tpc}
     37   1.1  christos sectors/cylinder: ${spc}
     38   1.1  christos cylinders: ${cylinders}
     39   1.1  christos total sectors: ${totalsize}
     40   1.1  christos rpm: 3600
     41   1.1  christos interleave: 1
     42   1.1  christos trackskew: 0
     43   1.1  christos cylinderskew: 0
     44   1.1  christos headswitch: 0           # microseconds
     45   1.1  christos track-to-track seek: 0  # microseconds
     46   1.1  christos drivedata: 0 
     47   1.1  christos 
     48   1.1  christos 8 partitions:
     49   1.1  christos #     size         offset        fstype [fsize bsize cpg/sgs]
     50   1.1  christos  a:   ${asize}     ${aoffset}    4.2BSD  ${fsize} ${bsize} 0  # 
     51   1.1  christos  c:   ${totalsize} 0             unused      0     0          #
     52   1.1  christos  d:   ${totalsize} 0             unused      0     0          #
     53   1.1  christos EOF
     54   1.1  christos }
     55   1.1  christos 
     56   1.4  christos make_fstab() {
     57  1.12  christos 	make_fstab_default EFI
     58   1.1  christos }
     59   1.1  christos 
     60   1.4  christos customize() {
     61   1.1  christos 	cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
     62   1.1  christos 	if $minwrites; then
     63   1.1  christos 		mkdir ${mnt}/etc/postfix
     64   1.1  christos 		(umask 022
     65   1.1  christos 		sed -e 's/fifo/unix/' < ${release}/etc/postfix/master.cf > \
     66   1.1  christos 		    ${mnt}/etc/postfix/master.cf)
     67   1.1  christos 	fi
     68   1.1  christos 	cat >> ${mnt}/etc/rc.conf << EOF
     69   1.1  christos rc_configured=YES
     70   1.1  christos hostname=${board}
     71   1.1  christos sshd=YES
     72   1.1  christos dhcpcd=YES
     73   1.4  christos wscons=YES
     74   1.4  christos devpubd=YES
     75  1.11  riastrad certctl_init=YES
     76   1.1  christos EOF
     77   1.7     skrll 	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" \
     78   1.7     skrll 	    >> "$tmp/selected_sets"
     79   1.7     skrll 
     80   1.1  christos 	if [ ! -f ${release}/dev/MAKEDEV ]; then
     81   1.1  christos 		echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2
     82   1.1  christos 		exit 1
     83   1.1  christos 	fi
     84   1.1  christos 	echo "${bar} running MAKEDEV ${bar}"
     85   1.1  christos 	${HOST_SH} ${release}/dev/MAKEDEV -s all | sed -e 's:^\./:\./dev/:' \
     86   1.1  christos 	    >> "$tmp/selected_sets"
     87   1.1  christos }
     88   1.4  christos 
     89   1.4  christos populate() {
     90   1.4  christos 	if [ ! -f ${kernel} ]; then
     91   1.4  christos 		echo ${PROG}: Missing ${kernel} 1>&2
     92   1.4  christos 		exit 1
     93   1.4  christos 	fi
     94   1.4  christos 
     95   1.4  christos 	echo "${bar} installing kernel ${bar}"
     96   1.4  christos 	cp ${kernel} ${mnt}/netbsd
     97   1.4  christos 	if [ ! -f ${bootfile} ]; then
     98   1.4  christos 		echo ${PROG}: Missing ${bootfile} 1>&2
     99   1.4  christos 		exit 1
    100   1.4  christos 	fi
    101   1.8       kre 	cp ${bootfile} ${mnt}/boot ||
    102   1.8       kre 	    fail "copy of ${bootfile} to ${mnt}/boot failed"
    103   1.6     skrll 
    104   1.6     skrll 	echo "./netbsd type=file uname=root gname=wheel mode=0755" \
    105   1.6     skrll 	    >> "$tmp/selected_sets"
    106   1.6     skrll 	echo "./boot type=file uname=root gname=wheel mode=0444" \
    107   1.6     skrll 	    >> "$tmp/selected_sets"
    108   1.4  christos }
    109