Remove all files from /media/BEAGLEBONE

507 views
Skip to first unread message

khw...@gmail.com

unread,
Jul 24, 2013, 4:53:10 AM7/24/13
to beagl...@googlegroups.com
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

Anubhav Goel

unread,
Dec 15, 2014, 12:58:45 AM12/15/14
to beagl...@googlegroups.com, khw...@gmail.com
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

William Hermans

unread,
Dec 15, 2014, 1:27:33 AM12/15/14
to beagl...@googlegroups.com
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 . . .

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anubhav Goel

unread,
Dec 15, 2014, 1:48:39 AM12/15/14
to beagl...@googlegroups.com
Hi William,

Thanks for your quick response.

I cannot really move to the debian, as it has taken me a lot of effort :) , 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

You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/lqPrGitRgCk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

meino....@gmx.de

unread,
Dec 15, 2014, 1:58:13 AM12/15/14
to beagl...@googlegroups.com
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 <anub...@resonant-sys.com> [14-12-15 07:52]:
> Hi William,
>
> Thanks for your quick response.
>
> I cannot really move to the debian, as it has taken me a lot of effort :) ,
> 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
>
> On Mon, Dec 15, 2014 at 11:57 AM, William Hermans <yyr...@gmail.com> wrote:
> >
> > *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

Anubhav Goel

unread,
Dec 15, 2014, 2:03:17 AM12/15/14
to beagl...@googlegroups.com
Hi !

On Mon, Dec 15, 2014 at 12:27 PM, <meino....@gmx.de> wrote:
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.
m fstab shows:
rootfs               /                    auto       defaults              1  1
proc                 /proc                proc       defaults              0  0
devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
tmpfs                /tmp                 tmpfs      defaults              0  0

It doesnt have the mount command of boot.
Even if I were able to stop the boot, would that mean disabling access to the partition on windows desktop?  I do require the parition to appear on desktop when connected, but I dont want the user to access these critical files.
 

meino....@gmx.de

unread,
Dec 15, 2014, 2:16:09 AM12/15/14
to beagl...@googlegroups.com
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... ;)

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... :)
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 <anub...@resonant-sys.com> [14-12-15 08:04]:

William Hermans

unread,
Dec 15, 2014, 2:19:57 AM12/15/14
to beagl...@googlegroups.com
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 ).

Anubhav Goel

unread,
Dec 15, 2014, 2:20:47 AM12/15/14
to beagl...@googlegroups.com
Sorry about not putting more details :) , here they are :

On Mon, Dec 15, 2014 at 12:45 PM, <meino....@gmx.de> wrote:
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?
I boot from internal flash.

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

I dont know of the exact mechanism Windows is accessing the
partitions via USB...
Its the mini USB , that loads up the fat partition "Getting started with beagle...." , this is the place where I want to have my own bunch of files, and not the files placed by default (mlo/uenv etc).
 

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... :)
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..
I dont require web interface

William Hermans

unread,
Dec 15, 2014, 2:23:27 AM12/15/14
to beagl...@googlegroups.com
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 . . .

Anubhav Goel

unread,
Dec 15, 2014, 2:24:05 AM12/15/14
to beagl...@googlegroups.com
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 ?

William Hermans

unread,
Dec 15, 2014, 2:26:15 AM12/15/14
to beagl...@googlegroups.com
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.

William Hermans

unread,
Dec 15, 2014, 2:31:19 AM12/15/14
to beagl...@googlegroups.com
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 . . .

On Mon, Dec 15, 2014 at 12:28 AM, Anubhav Goel <anub...@resonant-sys.com> wrote:
:D .. I will take this advice , and soon move over to deb.

William Hermans

unread,
Dec 15, 2014, 2:36:37 AM12/15/14
to beagl...@googlegroups.com
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 :/

meino....@gmx.de

unread,
Dec 15, 2014, 2:38:19 AM12/15/14
to beagl...@googlegroups.com

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 <yyr...@gmail.com> [14-12-15 08:24]:

Anubhav Goel

unread,
Dec 15, 2014, 2:41:18 AM12/15/14
to beagl...@googlegroups.com
I can see that angstrom has really got to you :) , 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

Anubhav Goel

unread,
Dec 15, 2014, 2:46:19 AM12/15/14
to beagl...@googlegroups.com
On Mon, Dec 15, 2014 at 1:06 PM, William Hermans <yyr...@gmail.com> wrote:
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.

William Hermans

unread,
Dec 15, 2014, 2:47:14 AM12/15/14
to beagl...@googlegroups.com
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.

William Hermans

unread,
Dec 15, 2014, 2:49:12 AM12/15/14
to beagl...@googlegroups.com
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.

William Hermans

unread,
Dec 15, 2014, 2:57:32 AM12/15/14
to beagl...@googlegroups.com
Well, there is one more option I can think of. You would need a sdcard with some form of Linux on it, so you could reverse your changes back to the way they were.

I would be very careful if you go this route, and make absolutely positive you document each step as you do it. So you know how to fix it if and when it comes time.

Anubhav Goel

unread,
Dec 15, 2014, 3:08:48 AM12/15/14
to beagl...@googlegroups.com
i re-read this..
I can ofcourse connect to BB using either mini usb or ethernet - thats not a problem.

Here is my case :
- While I have the bbb to configure, I can do anything that i want with it.. changing configs etc... eventually, I give it to my end user , with a preloaded app, that runs and generates some reports.
- who will just use the miniusb to collect some reports from that port.

I cannot have alternate mechanisms to send deliver these reports - its just how it is :/

Going through g_multi options..

William Hermans

unread,
Dec 15, 2014, 3:27:08 AM12/15/14
to beagl...@googlegroups.com
g_mass_storage is probably where you will find most of your documentation concerning the mass storage portion of that device driver.

https://www.kernel.org/doc/Documentation/usb/mass-storage.txt

If this seems confusing I understand. But essentially g_multi provides drivers for

  1. g_ether
  2. g_serial
  3. g_mass, or g_mass_storage.

All in one driver. Since only one gadget driver can be loaded at any one time.

William Hermans

unread,
Dec 15, 2014, 3:40:24 AM12/15/14
to beagl...@googlegroups.com
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

I Actually ( personally ) have my rootfs on an NFS share . . . seems to be too difficult for most I guess. For me however it is great because I have 2-3 way to get at my root file system. At this moment my BBB has 147GB unused space this way ;)

I do agree though. Development should *not* be done on the eMMC.

Anyway long passed my bed time, and I'll be traveling tomorrow. Good luck !

Anubhav Goel

unread,
Dec 15, 2014, 3:52:44 AM12/15/14
to beagl...@googlegroups.com
thanks ! I am reading through it

Anubhav Goel

unread,
Dec 15, 2014, 2:29:00 AM12/15/14
to beagl...@googlegroups.com
:D .. I will take this advice , and soon move over to deb.
Reply all
Reply to author
Forward
0 new messages