Remove all files from /media/BEAGLEBONE

Hi all,

I am building a few prototype with Beaglebone Black. I want to let the user to plug into the mini-USB port from a PC and copy a output file I stored in /media/BEAGLEBONE. However, I don’t want user to see all the documentation and tutorial of the BBB. It seems like BBB will copy all these files during reboot.

I wonder if I can configure it without copying these files during reboot? or I can configure a different directory to show up while user plug in the mini-USB cable? I can control where the output file go in my program. Many thanks for any guidance.

Kenny Lau

Hi Kenny,

I have the same requirement, were you able to get any workaround to this ?

I looked into bbb to find any default locations , like /boot/uEnv.txt … but it doesnt work , if I delete the file from media , but the /boot/uenv.txt file is not picked up.
I was unable to find any other place to store the mlo & img files either.

My users may accidentally delete the mlo/uboot/uenv files, if presented over their desktop.

Regards,
Anubhav

My users may accidentally delete the mlo/uboot/uenv files, if presented over their desktop.

There are a few ways to deal with this*.* Just do not mount the boot loader partition. Would probably be the easiest for you. If you want to do what I would consider “the right way”, then put a modern Debian build from Robert on it, and that whole partition will not exist, and the bootloader files will be in a hole in the first 1M of the block device.

Aside from that, I do not think FAT/FAT32 partitions can be used with Linux permissions. However, you may be able to make the partition read only. Not sure on this, but if you’re teaching students about he hardware / software. This may be preferable.

Personally, I think “hiding” the files in the first 1M of disk space is the best way. Heck I’ve been using Linux for years, and I honestly have no idea how to reverse / mess that up. Eventually I’ll have to read up on it myself, as it’s pretty neat . . .

Hi William,

Thanks for your quick response.

I cannot really move to the debian, as it has taken me a lot of effort :slight_smile: , to understand my way around angstrom… it will be very steep curve for me as of now.

I was thinking, is there no way to create a new vfat partition on bbb, and expose that on the thumbdrive, and let this default one just remain unmounted ?

I will readup on the read-only part.

Can you point me to some info on how/when does this partition get loaded ? do we have some sort of hook that can be utilized ?

Can I not place the mlo/ig& env files at a place where its picked by bbb , but not exposed over thumbdrive ?

Regards
Anubhav

Hi Anubhav,

do not move uEnv.txt, the U-Boot image and the kernel images
around. Due to the limited technical possibilities of the very early
boot stages, these files are exspected to be at certain physical
place on the flash memory.

Instead edit /etc/fstab and remove the mount command of /boot.
Do a backup first.

Best regards,
Meino

Anubhav Goel <anubhavg@resonant-sys.com> [14-12-15 07:52]:

Hi !

Hi Anubhav,

one thing I did not know about your system is: Are you using
an SDcard to boot from or do you boot from the internal flash
memory?

"Critical files" are more than only those under /boot.
Delete /sbin/init and your system will hang shortly after
the kernel is running... :wink:

I dont know of the exact mechanism Windows is accessing the
partitions via USB...

After plugging in the BBB via USB to a Windows PC...do you access
the files in question via WEB interface (browser) or "low level"
via Windows explorer (NOT Internet Explorer or such alike) ...
that is...there must be "something" on you PC which enables
Windows to read ext4fs formatted partitions...

If it is a WEB interface you use...I am out of bussiness here,
since I am by no means a WEB-stuff guru... :slight_smile:
But I /think/ (read: Dont know for sure) that must be file
which configures the running webserver on the BBB to export
parts of the filesystem to the calling browser on the Windows
PC. This file is, what you want to edit..

Good luck!
Best
Meino

Anubhav Goel <anubhavg@resonant-sys.com> [14-12-15 08:04]:

Ok, so I do not know where the module “g_multi” is loaded from on angstrom, but g_multi is a USB to Serial, ethernet, and mass storage device. You should search the web on g_mass_storage to understand how the parameters work with g_multi . .

So anyway, g_multi is caled similar to this:

modprobe g_multi file=/dev/mmsclk01p1

This is how the device is shared out over USB. So, you may be able point the file location to /dev/null ( never tried it ), or create an empty directory somewhere. And point it to that. If Neithe fo those work for you, then get rid of g_multi, and use g_ether instead ( assuming you do not need Serial too ).

Sorry about not putting more details :slight_smile: , here they are :

Anubhav,

By the way, Linux is Linux, is Linux. Angstrom is in round about way even based on Debian. Through Open Zaurus . . .Anyway, you’re going to find it more, and more difficult moving on with Angstrom I think . . .

that sounds good!.. i shall try it and report back.

One point , how do I disable the default mechanism of loading the thumbdrive ? i.e. , there must be some place/sh where these commands are getting executed ? can you point me to them ?

No idea, I got rid of Angstrom the first week after receiving my Beaglebone blacks. Angstrom was too much of a pain in my backside to even want to bother with it.

:smiley: … I will take this advice , and soon move over to deb.

I just looked it up on the web and what I found seemed to indicate that the modules file is the same as debian in:

/etc/modules

If it is not loaded from in there then i could not say. Could be a service file run at boot time, or . …yeah see I would not even know where to look on Angstrom . . .

Ok, so lets backup some. If you’re only connected through the USB cable via USBnet, then you would have a problem with this.

However if you can connect to your BBB via ethernet, then you could remove the module, and reload it with new parameters to make sure you changes work, before you apply them permanently.

I keep forgetting to mention “little” things like this, because well, i never have that problem, I can always get into my BBB one way another . . . others however may not be able to :confused:

Hi,

I throw away Angstrom and moved to Gentoo after a few updates
complete scrambled Angstrom...
Consider to boot from SDcard, because it can be "edited"
via an USB cardreader on the PC and can be replaced if
weared out (flash has a limited count of write cycles).
If the internal flash is damaged, you a solder iron,
VERY good eyes and a very very steady hand....

Only my two cents,...

Best
Meino

William Hermans <yyrkoon@gmail.com> [14-12-15 08:24]:

I can see that angstrom has really got to you :slight_smile: , but it gave me support with qt when i needed it , and deb (i dont know bout now) was not having support (like a few months back).

So its like a old friend with a lot of problems (audio - but i figured it out)…

I am almost done with the project and only a few hiccups remain, hence trying to get this to work within angstrom

Ok, so lets backup some. If you're only connected through the USB cable
via USBnet, then you would have a problem with this.

However if you can connect to your BBB via ethernet, then you could remove
the module, and reload it with new parameters to make sure you changes
work, before you apply them permanently.

I dont connect to bbb via ether net port, I connect using mini USB , the

serial and ethernet(rndis) functions are not important to me - over the
miniusb.

My experiences with Angstrom were very bad. I’ve been using Debian since the mid 90’s off and on, and I did not know where anything was on Angstrom. Couple that with the the fact that stuff like dropbear would get a corrupted file related to ssh and not let you in . . .yeah I just got rid of it so . . .

After I shook my Debian “rust” off, I was able to very quickly use Roberts instructions to cross compile my own kernel, used his barefs rootfs, and had a system running in less than 100M size. Now days, I’m up to around 180M size ( a little less ) running Nodejs + express + socket.io for a web appliance type application.

So now that I am familiar with Debian again, my workflow is rather fluid. Not many problems, and when they do arise, I am more able to deal with them quickly. Without, my own system fighting against me every step of the way . . .

Anyway, everyone uses what they like best, and that has been my own personal experiences. You mileage may vary.

I dont connect to bbb via ether net port, I connect using mini USB , the serial and ethernet(rndis) functions are not important to me - over the miniusb.

Then you’re “dead in the water” as you can not unload the module while you’re using it. Then even if you did manage to do so, you would lose connection to your device and have no way to fix it. Until you reset the device.