DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD Installation and Upgrading

NetBSD Installation and Upgrading Have trouble getting NetBSD on your toaster?

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th May 2018
BSD-user BSD-user is offline
New User
 
Join Date: Mar 2015
Posts: 9
Default [SOLVED] Can't get NetBSD off the ground (install woes)

I'm having a really tough time getting NetBSD installed. I consider myself an avid GNU/Linux user but I was interested in decentralising a bit due to potential issues and policy questions related to the Linux kernel (long story perhaps for another time).

Here is the partition layout I've been trying to implement with my install. This is in both MBR and UEFI cases.

wd0
|_ / (80GB, FFS)
|_ /boot/efi (2MB, msdos)
|_ cgd (remainder)
____|_ swap (16GB)
____|_ /var (1GB)
____|_ /home (remainder)

In the installer program I choose extended partitioning to set it up like this. I keep getting errors.

(1) In the MBR case I tried leaving 1MB of free space from start of the disk to the start of / partition. The installer then installs without error but the system doesn't boot. I already set wd0 as bootable.

(2) In the UEFI case (my preferred) I changed the partition layout to GPT and proceeded to mimic the layout above but I keep getting errors in the process when saving the layout. I get an immediate error after the first attempt at setting the crypto password. Is there some issue with using CGD and GPT?? Second where should the efi partition (formatted FAT) be mounted? I'm only guessing that it's /boot/efi.

Last edited by BSD-user; 10th May 2018 at 11:19 PM.
Reply With Quote
  #2   (View Single Post)  
Old 9th May 2018
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,129
Default

I used this Arch wiki to setup Arch/OpenBSD gpt/efi
https://wiki.archlinux.org/index.php...stem_Partition

Prior to dual booting I found this OpenBSD guide that I think should work for NetBSD (?8.0RC1) that has an EFI bootloader entry.
Reply With Quote
  #3   (View Single Post)  
Old 10th May 2018
BSD-user BSD-user is offline
New User
 
Join Date: Mar 2015
Posts: 9
Default

I was using 8_RC1 and I believe the installer to be faulty. I reverted to 7.1.2 and carried out the same operations albeit using MBR and it has worked smoothly.

Now there is another snag. When I setup cgd in the installer it hasn't put the paramsfile in /etc/cgd/. So where is the params file for the cgd that I already created?
Reply With Quote
  #4   (View Single Post)  
Old 10th May 2018
BSD-user BSD-user is offline
New User
 
Join Date: Mar 2015
Posts: 9
Default

The UEFI that you get in the instal medium is just for the install medium. If you're going to setup a system then AFAIS you have to go via the MBR route. Otherwise it appears as if some random collection of errors repeatedly get thrown at you by sysinst.

After carrying out the partitioning in sysinst the params file resides in /tmp of the install medium fs. You have to manually copy these files to /targetroot/etc/cgd. sysinst skips this vital step.
Reply With Quote
  #5   (View Single Post)  
Old 10th May 2018
BSD-user BSD-user is offline
New User
 
Join Date: Mar 2015
Posts: 9
Default

I have now managed to get a basic system running with cgd barr the root partition.
Reply With Quote
  #6   (View Single Post)  
Old 5th June 2018
Sensucht94's Avatar
Sensucht94 Sensucht94 is offline
Real Name: Paolo Vincenzo Olivo
Port Guard
 
Join Date: Oct 2017
Location: Rome
Posts: 23
Cool UEFI/GPT NetBSD Installation

Quote:
Originally Posted by BSD-user View Post
The UEFI that you get in the instal medium is just for the install medium. If you're going to setup a system then AFAIS you have to go via the MBR route. Otherwise it appears as if some random collection of errors repeatedly get thrown at you by sysinst.
I don't believe UEFI/GPT partioning is already implemented in the installer, you rather have to perform a manual installation. Here's more or less how I did around a year ago on -current.

#Partitioning
Code:
gpt destroy wd0
gpt create -f wd0
gpt add -a 2m -s 65536 -t efi -l "ESP" wd0
gpt add -a 2m -s 5g -t ffs -l "netbsd-root" wd0
gpt add -a 2m -s 8g -t swap -l "netbsd-swap" wd0
gpt add -a 2m -s 5g -t ffs -l "netbsd-var" wd0
gpt add -a 2m -s 20g -t ffs -l "netbsd-usr" wd0
gpt add -a 2m -t ffs -l "netbsd-home”
#Formatting
Code:
newfs_msdos -F 16 /dev/rwd0a
newfs -O 2 -/dev/rwd0b
newfs -O 2 /dev/rwd0d
newfs -O 2 /dev/rwd0e
newfs -O 2 /dev/rwd0f
swapctl -a -p 1 /dev/wd0c
#mount filesystems
Code:
 mount  /dev/wd0b /mnt
 cd /mnt 
 mkdir {var,usr,home}
 swapon /dev/wd0c
 mount /dev/wd0d /mnt/var
 mount /dev/wd0e /mnt/usr
 mount /dev/wd0f /mnt/home
#extract binary sets
Code:
cd  /mnt

for set in KERN-GENERIC base comp etc  games man misc modules tests text xbase xcomp xetc xfont xserver; do
    > tar -xzpf /amd64/binary/sets/$set.tgz
    >  done

mv  netbsd netbsd.gen && ln -fh netbsd.gen netbsd
#set up bootloader
Code:
 mount -t msdos /dev/wd0a /media
 mkdir -p  /media/EFI/boot
 cp /usr/mdec/*.efi /media/EFI/boot

 cat > /media/EFI/boot/boot.cfg << EOF
 > menu=Boot normally:rndseed /etc/entropy-file;boot hd0b:netbsd
 > menu=Boot single user:rndseed /etc/entropy-file;boot hd0b:netbsd -s
 > menu=Disable ACPI:rndseed /etc/entropy-file;boot hd0b:netbsd -2
 > menu=Disable ACPI and SMP:rndseed /etc/entropy-file;boot hd0b:netbsd -12
 > menu=Drop to boot prompt:prompt
 > default=1
 > timeout=5
 > clear=1
 > EOF	

 installboot -v /dev/rwd0b /mnt/usr/mdec/bootxx_ffsv2
#create devnodes
Code:
 cd /mnt/dev
 sh MAKEDEV all
#set up a chroot env
Code:
mkdir {kern,proc}
mount_kernfs  kernfs   /mnt/kern
mount_procfs  procfs   /mnt/proc
mount_tmpfs  tmpfs   /mnt/var/shm
mount_ptyfs  ptyfs   /mnt/dev/pts
chroot  /mnt su -
# vi /etc/fstab
Code:
/dev/wd0b               /       ffs     rw               1 1
/dev/wd0c               none    swap    sw,dp            0 0
/dev/wd0d               /usr    ffs     rw               1 2
/dev/wd0e             /var    ffs     rw               1 2
/dev/wd0f               /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                                      #type
#set root password
Code:
passwd root
# set keyboard layout
Code:
echo "encoding $layout" >> /etc/wscons.conf
#disable internal speaker beep
Code:
echo "setvar  wskbd   bell.volume     0"  >> /etc/wscons.conf
echo "setvar  wskbd   bell.pitch         0"  >> /etc/wscons.conf
#set timezone
Code:
ln -sf  /usr/share/zoneinfo/${region}/${state} /etc/localtime
#vi /etc/rc.conf
Code:
if [ -r /etc/defaults/rc.conf ]; then
        . /etc/defaults/rc.conf
fi
rc_configured=YES
hostname=$HOSTNAME
rtclocaltime=YES
wscons=YES
ifconfig_${wlan_interface}="dhcp"
wpa_supplicant=YES
wpa_supplicant_flags="-B -D bsd -i $wlan_interface -c /etc/wpa_supplicant.conf"
dhcpcd=YES
dhcpcd_flags="${dhcpd_flags} -b"
sshd=YES
ntpd=YES
xdm=NO
#system-wide locale settings
Code:
echo "export LANG=\"en_US.UTF-8\"" >> /etc/profile
echo "export LC_CTYPE=\"en_US.UTF-8\"" >> /etc/profile
echo "export LC_ALL=\"\"" >> /etc/profile
#vi /etc/resolv.conf
Code:
domain         $hostname.$domain.$extension
nameserver     8.8.8.8
# add your host's IP
Code:
echo "$my_ip         $hostname  $hostname.$domain.$extension" >> /etc/hosts
# vi /etc/wpa_supplicant.conf
Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
eapol_version=1
ap_scan=1
fast_reauth=1


network={
        ssid="my_ssid"
        scan_ssid=1
        psk="my_psk"
        key_mgmt=WPA-PSK
}
#make wpa_supplicant invoke dhcpcd instead of dhclient
Code:
sed -i 's/dhclient/dhcpcd/g' /etc/rc.d/wpa_supplicant
# enable networking
Code:
wpa_supplicant -B -D bsd -i $wlan_interface -c /etc/wpa_supplicant.conf"
dhcpcd
# fetch a pkgsrc tarball
Code:
ftp ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc-${release}/pkgsrc.tar.gz
tar -xzf pkgsrc.tar.gz -C /usr
rm pkgsrc.tar.gz
# vi /etc/mk.conf (some useful suggestions, see man mk.conf)
Code:
#ALLOW_VULNERABLE_PACKAGES=1
NO_PACKAGE+= RESTRICTED
PREFER_PKGSRC=yes
ACCEPTABLE_LICENSES+=vim-license rar-license unrar-license lame-license gnu-agpl-v3 esdl-license erlang-public-license openmotif-license 
PKG_OPTIONS.vim=perl
PYTHON_VERSION_DEFAULT=36
#USE_CPUFLAGS=1
#CFLAGS+= (see devel/cpuflags)


#install pkgin and update the binary package repo
Code:
cd /usr/pkgsrc/pkgtools/pkgin
make install clean clean-depends
echo "ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/${arch}/${version}/All" >> /usr/pkg/etc/pkgin/repositories.conf
pkgin update
#add a standard user
Code:
useradd -g wheel -G users -s /bin/${shell} -c "foo's real name" -m foo 
passwd foo
# exit chroot
Code:
exit
umount /media
umount -fR /mnt
Reboot & Enjoy

Note: this was quickly written relying on memory, any correction sincerely welcomed

Last edited by Sensucht94; 24th June 2018 at 01:48 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
install virtualbox on netbsd philo_neo71 NetBSD General 5 24th October 2014 10:44 PM
Netbsd install error bgpepi NetBSD Installation and Upgrading 2 9th November 2013 05:09 PM
How to install netbsd on ARM smartbook? gerionic NetBSD General 2 18th September 2011 06:37 PM
No Screen during NetBSD 5.0 install shep NetBSD Installation and Upgrading 7 16th October 2009 02:54 AM
Booting netBSD 5 install failed dk_zero-cool NetBSD Installation and Upgrading 10 5th May 2009 12:23 PM


All times are GMT. The time now is 02:54 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick