- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm running uClinux on the DE2 board. I've added detail in my design to include an SD card. I mount the SD card in the rc file. This allows me to easily add user files the the uClinux file system. However, I currently have to copy the files to /bin in order to run them. How do I add the path to the SD card (/mnt/sd) to my $PATH at startup?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is your shell?
For bash, the files .bashrc or .bash_profile (something like that) get sourced at startup, so you can put export PATH=$PATH:/mnt/sd/bin in that file. Or you can first check if /mnt/sd/bin exists ... if [ -e /mnt/sd/bin ]; then export PATH=$PATH:/mnt/sd/bin fi; (No guarantees that this is valid bash code, you can Google for the correct syntax) Cheers, Dave- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the default uClinux w NIOS2 shell, sash. I tried to include bash via make menuconfig but it wouldn't make. I don't think it has been ported for use with NIOS??? Not sure if .sashrc and/or .sash_profile exist and if they do, where to find them.?? Any more help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Traditionally /etc/profile and $HOME/.profile are run (sourced) for login shells.
Not sure of the pedigree oh 'sash', might be based on 'ash'. The scripts it runs at startup, and the order, are only likely to be obtainable from specifc documentation or reading the C source for the shell itself. The kernels default $PATH might also be settable - but again that is kernel/OS dependant.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, dsl.
I'll dig into the sash c code as I cannot locate any decent documentation regarding the shell. Do you have any more detail on how to set the kernels default path?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got it!
- changed env[1] = "PATH=/bin:/usr/bin/etc/:..." in /uCliunx-dist/user/init/simpleinit.c Thanks again for you suggestions.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Modifying standard programs certainly is not the recommended way, even if it of course does work. I am certain that any shell supports setting exported environment strings in the init script, and that it does support automatically calling an init script.
I did try this with (AFAI remember) sash and mash on NIOS (and of course with bash on PC). -Michael- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree, modifying standard code is generally a bad idea, which is why I didn't mess with sash.c (even though that works too!!)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page