Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Makefile ROMFS with subfolders

Altera_Forum
Honored Contributor II
1,685 Views

Is there a way to modify the location of the files in the vendors folder? 

 

i have differnt Image configurations and i want to make sub folders so that i don't lose the overview. 

something like: 

 

$(ROMFSINST) /home/ /home/user/nios2-linux/uClinux-dist/vendors/Altera/nios2/sub-folder/application 

 

is not working and i don't understand the shellscript used for it. 

 

mfg Sven
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
955 Views

Maybe an easy way to do this is to create symlinks for the actual files/directories at the places of the standard files/directories. 

 

-Michaerl
0 Kudos
Altera_Forum
Honored Contributor II
955 Views

that would be like to copy the files to the romfs on my on ? 

Or could i use the symlink within my makefile?
0 Kudos
Altera_Forum
Honored Contributor II
955 Views

When reading the file, a (sym)link is like a copy. But writing a modification into any link of the file changes the original. Deleting a symlink does not affect the other symlinks or the original. Deleting the original file makes the symlink a not working "orphan".  

 

There also are "hardlinks" that work similar, but here all links (including the original) are equal. Deleting one of them does not impact any other. Deleting the last hardlinkt deletes the file's data. 

 

With Linux you everywhere can use (sym)links instead of files or directories. The application does not notice this, unless it is explicitly programmed to tell symlinks from files or directories. Make, gcc, ... will not tell symlinks from files. 

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
955 Views

i found an easy way to do it 

 

within the makefile it's just like this: 

$(ROMFSINST) ../../Altera/nios2/sub-folder/application /home/application 

 

i tried it the wrong way 

 

is there a folder or a file where the sym-link is saved? 

it'd like to switch the ../../Altera/nios/sub-folder/ with a symlink like $(SUB_FOLDER)
0 Kudos
Altera_Forum
Honored Contributor II
955 Views

 

--- Quote Start ---  

a symlink like $(SUB_FOLDER) 

--- Quote End ---  

 

This is not a symlink. A symlink is done by the Linux file system. see  

http://en.wikipedia.org/wiki/symlink

Michael
0 Kudos
Altera_Forum
Honored Contributor II
955 Views

$(SUB_FOLDER) is just a variable in the makefile. Using the working structure above, in the makefile: 

 

SUB_FOLDER = "../../Altera/nios2/sub-folder/application" 

... 

$(ROMFSINST) $(SUB_FOLDER) /home/application 

 

However, this is a much different method than the one proposed by mschnell. The symlink is not 'in' the makefile. Basically, you set up the structure that you want in the file system, and you create a symbolic link from 'their' folder to 'yours'. That way you don't mess with their structure (could give you a big headache later if you don't document the changes properly).  

 

Although your method might work, I wouldn't mess around too much with the Makefile...
0 Kudos
Reply