Skip to content

Instantly share code, notes, and snippets.

@Scott31393
Last active September 3, 2021 08:48
Show Gist options
  • Save Scott31393/ad8a89deda0db4eba8960fe8aabf05f5 to your computer and use it in GitHub Desktop.
Save Scott31393/ad8a89deda0db4eba8960fe8aabf05f5 to your computer and use it in GitHub Desktop.

Setup TFTP and NFS for Linux Kernel development (Ubuntu > 18.04)

Install TFTP packages:

$ sudo apt-get install tftp-hpa tftpd-hpa

Configuration

edit the file /etc/default/tftpd-hpa as the root user, and edit the line look like this:

TFTP_DIRECTORY="/usr/lib/tftpboot" change the dir to /srv/tftp

TFTP_DIRECTORY="/srv/tftp" Create and modify permissions on the TFTP root directory:

$ sudo mkdir /srv/tftp
$ sudo chown -R $(whoami) /srv/tftp

Restart the TFTP Services:

$ sudo service tftpd-hpa restart

Setup NFS

Install nfs:

$ sudo apt-get install nfs-kernel-server nfs-common

Create nfs folder: ( nfs-folder = targetfs )

$ mkdir <nfs-folder>
$ sudo chown nobody:nogroup <nfs-folder>

Edit the exports file and append to it the new setting:

$ sudo vim /etc/exports

Append the following lines:

<nfs-folder> *(rw,async,no_root_squash,no_subtree_check)

Update exports:

$ sudo exportfs -a
$ sudo /etc/init.d/nfs-kernel-server restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment