PDA

View Full Version : Who creates the tftpboot directory?



rutileblue
09-07-08, 12:36 PM
I've noticed that when I include the tftpd package in PADS, the Warp does create a tftpboot directory. Unfortunately, it is not linked to the persistent file system, so anything I put in there gets erased when the unit reboots.

I've added a 'ln -s' command to the S99tftpd script. But I've noticed the '/tftpboot' directory has already been created by the time this script is executed.

So, the first question, mostly stemming from my ignorance of linux, is who creates that directory and when?

The second question is more of an enhancement request -- basically, it seems like the tftpboot directory should always be backed by the persistent storage, so could the PADS scripts/make files be modified to do that for me?

Thank you!

skar
09-08-08, 09:09 AM
You are absolutely correct, the tftpboot directory should be created in persistent and then linked to with it's start up script. The reason your soft link is not working at the moment is that the tftpboot directory is part of your root filesystem and is created when the uRamdisk image is expanded.

There are two things you need to do to fix this. First, we need to update the tftpd.mk file to create the directories correctly. In this file under the the tftpd: make directive you will see

mkdir -p $(TARGET_DIR)/tftpboot

change this to:

mkdir -p $(PERSISTENT_STORAGE)/tftpboot

Now the second thing to do is to create a link to this folder from the proper location. You can either modify the init script for tftpd as you did or create it as part of your image. To make it part of your image, after the mkdir line we just added, add the following:

cd $(TARGET_DIR); ln -sf persistent/tftpboot tftpboot

You will have to do a clean to make sure your old /tftpboot directory is gone in your image, do these two changes, remake tftpd and then remake your image.