Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

NetBSD 8.0_RC1 (May 22 build) install on GPT/UEFI system



Saw the traffic about doing an install on a GPT/UEFI system that referenced the setup I’d used and posted about a year ago.  It worked back then.

So I dug out my old script, updated it to do an install of NetBSD 8.0_RC1 on a system with GPT disk layout and UEFI booting.  The script put everything on the newly formatted disk and it all looked correct, so I tried booting and I’m getting:

efi: systbl at pa cad2ef18
uvm_fault …
fatal page fault in supervisor mode …

What’s interesting is when the banner came up it showed total memory of 527 MB with 487 MB available.  This system actually has 8 Gig of RAM.

So, has anyone tried doing an install of the May 22nd build on a system with GPT disk layout and UEFI booting?  Was it successful?

And, does anyone have a clue what could be happening here?  Is it possible my system has a totally screwed up setup for UEFI?

Thanks,
-bob

Oh, If anyone would be interested, here’s the script I used:

#!/bin/csh
#
# Set install parameters
#
set ver = 8.0
set net = wm0
set dsk = wd0
#
# NOTE: You MUST use the uefi-install image for this to work properly.
#  But, when you boot this image after placing it on a USB stick it
#  will create two wedges for what's on the USB.  Therefore the wedge
#  references in this script are "off by 2" to account for this.  If
#  you attempt this with the non-uefi-install image it will fail for
#  two reasons.  First the wedge numbering won't be correct and second
#  the kernel file loaded into your new disk won't boot properly since
#  it knows nothing about how to obtain information from the EFI, it
#  assumes a BIOS instead.
#
# Installs NetBSD onto $dsk as a UEFI bootable disk
#	Download the USB install image - NetBSD-$ver-amd64-uefi-install.img.gz
#	Unpack the instlal image
#		gunzip NetBSD-$ver-amd64-uefi-install.img.gz
#	Place the image on a USB stick
#		dd if=NetBSD-$ver-amd64-uefi-install.img of=/dev/rsd0d bs=32k
#	Mount the USB
#		mount /dev/dk1 /mnt
#	Copy this script to the USB filesystem
#		cp <this script> /mnt/uefi_install
#		chmod +x /mnt/uefi_install
#	Boot up the target system from the USB stick
#	Exit the sysinst to get a command line prompt
#	Invoke this script to install onto the $dsk disk
#		./uefi_install
#
# Create the GPT segments
#
echo "Creating GPT segments on $dsk disk"
gpt destroy $dsk
dd if=/dev/zero of=/dev/r${dsk}d count=1000
gpt create -f $dsk
gpt add -s 131072 -t efi -l "EFI System" $dsk
gpt add -s 524288 -t ffs -l "NetBSD-root" $dsk
gpt add -s 524288 -t swap -l "NetBSD-swap" $dsk
gpt add -s 32768000 -t ffs -l "NetBSD-var" $dsk
gpt add -s 32768000 -t ffs -l "NetBSD-usr" $dsk
gpt add -s 32768000 -t ffs -l "NetBSD-home" $dsk
gpt add -t windows -l “unallocated" $dsk
gpt show -l $dsk
#
# Initialize the NetBSD wedges
#
echo "Initializing new disk wedges"
newfs_msdos /dev/rdk2
newfs /dev/rdk3
newfs /dev/rdk5
newfs /dev/rdk6
newfs /dev/rdk7
#
# Mount the new filesystems
#
echo "Mounting new target disk wedges"
mount /dev/dk3 /targetroot
cd /target root
mkdir var usr home cdrom kern mnt proc
mount /dev/dk5 /targetroot/var
mount /dev/dk6 /targetroot/usr
mount /dev/dk7 /targetroot/home
#
# Load NetBSD
#
echo "Loading kernel(s) to new disk"
cd /targetroot
cp /amd64/binary/kernel/netbsd-GENERIC.gz .
cp /amd64/binary/kernel/netbsd-XEN3_DOM0.gz .
gunzip netbsd-GENERIC.gz
mv netbsd-GENERIC netbsd
echo "Loading base"
tar -xzpf /amd64/binary/sets/base.tgz
echo "Loading comp"
tar -xzpf /amd64/binary/sets/comp.tgz
echo "Loading etc"
tar -xzpf /amd64/binary/sets/etc.tgz
echo "Loading games"
tar -xzpf /amd64/binary/sets/games.tgz
echo "Loading man"
tar -xzpf /amd64/binary/sets/man.tgz
echo "Loading misc"
tar -xzpf /amd64/binary/sets/misc.tgz
echo "Loading modules"
tar -xzpf /amd64/binary/sets/modules.tgz
echo "Loading text"
tar -xzpf /amd64/binary/sets/text.tgz
echo "Loading xbase"
tar -xzpf /amd64/binary/sets/xbase.tgz
echo "Loading xcomp"
tar -xzpf /amd64/binary/sets/xcomp.tgz
echo "Loading xetc"
tar -xzpf /amd64/binary/sets/xetc.tgz
echo "Loading xfont"
tar -xzpf /amd64/binary/sets/xfont.tgz
echo "Loading xserver"
tar -xzpf /amd64/binary/sets/xserver.tgz
#
# Make devices
#
echo "Making devices in new system"
cd /targetroot/dev
sh ./MAKEDEV all
#
# Create the target system's fstab
#
echo "Creating fstab for new system"
cd /targetroot/etc
cat >fstab <<END
# NetBSD /targetroot/etc/fstab
# See /usr/share/examples/fstab/ for more examples.
NAME=NetBSD-root  /       ffs     rw               1 1
NAME=NetBSD-swap  none    swap    sw,dp            0 0
NAME=NetBSD-usr   /usr    ffs     rw               1 2
NAME=NetBSD-var   /var    ffs     rw               1 2
NAME=NetBSD-home  /home   ffs     rw               1 2
kernfs            /kern   kernfs  rw
ptyfs             /dev/pts        ptyfs   rw
procfs            /proc   procfs  rw
/dev/cd0a         /cdrom  cd9660  ro,noauto
tmpfs             /var/shm        tmpfs   rw,-m1777,-sram%25
END
#
# Adjust /etc/rc.conf to come up in multi-user mode with a network
#
echo "Adjusting rc.conf so system comes up multiuser"
sed 's/rc_configured=NO/rc_configured=YES/' <rc.conf >x
mv x rc.conf
echo "random_file=/etc/entropy-file" >>rc.conf
echo “hostname=bandit” >>rc.conf
echo "dpcpcd=YES" >>rc.conf
echo “dhcpcd_flags=\”-qM $net\” ” >>rc.conf
echo "sshd=YES" >>rc.conf
echo "xdm=YES" >>rc.conf
echo "wscons=YES" >>rc.conf
#
# Set timezone for system
#
echo "Setting timezone to Central"
cd /targetroot/etc
rm localtime
ln -s ../usr/share/zoneinfo/America/Chicago localtime
#
# Install the loaders
#
echo "Installing EFI loaders"
mount_msdos -l /dev/dk2 /mnt2
mkdir -p /mnt2/EFI/boot
cp /targetroot/usr/mdec/*.efi /mnt2/EFI/boot/
#
# Install pkgin and update packages database
#
#echo “Installing pkgin”
#dhcpc -n $net
#pkg_add http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/${ver}/All/pkgin
#/targetroot/usr/bin/pkgin -y update
#
# Unmount the target filesystems
#
echo “Unmounting target filesystems”
cd /
umount /targetroot/home
umount /targetroot/usr
umount /targetroot/var
umount /targetroot
#
# System should be bootable at this point.
#
echo "Complete.  System should be bootable at this point."



Home | Main Index | Thread Index | Old Index