From: Michel Stam <michel@reverze.net>
To: Alexander Aring <alex.aring@gmail.com>
Cc: barebox@lists.infradead.org, Ashutosh Singh <embedded.ashu@gmail.com>
Subject: Re: Can i access the barebox env from linux
Date: Wed, 26 Mar 2014 13:14:39 +0100 [thread overview]
Message-ID: <5332C4AF.4060009@reverze.net> (raw)
In-Reply-To: <20140326115854.GA12190@omega.Speedport_W_921V_1_24_000>
[-- Attachment #1.1: Type: text/plain, Size: 1502 bytes --]
Hey Alex,
The current version? That is a library, quite ugly actually.
LD_PRELOAD=/lib/LIBRARY /command/to/execute
The preload overrides the libc calls to open/read/write files.
The command can then access the environment sector, read only. If the
environment contains a /bin/init, then the file will be available from
/bin/init if the library is preloaded. Memory footprint is around
10kbyte RAM, or something like that. Its probably only usable for root,
as it requires read access to the block device, something you wouldn't
want to give all users.
As a kernel module I would make it a proper filesystem so you can do
something like mount /dev/blockdev /path -t bbfs.
That kernel driver will probably be a long-term project, though.
Cheers,
Michel
On 03/26/2014 12:58 PM, Alexander Aring wrote:
> On Wed, Mar 26, 2014 at 12:53:03PM +0100, Michel Stam wrote:
>> In case anyone is interested; for a barebox x86 project I wrote a library
>> that overrides fopen/fclose/open/close/etc a while back, which allows read
>> access to the environment sector if properly configured. I managed to get it
>> working on arm/mips with mtdblock as well.
>>
>> In the near future I'd like to write a kernel driver to read the filesystem
>> properly, this was more of an experiment.
>>
> How does it work? As a kernel module, as registered filesystem under
> /proc/filesystems ?
>
> With fuse as userspace filesystem?
>
> Or like the inotify solution?
>
> - Alex
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4278 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-03-26 12:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-26 5:55 Ashutosh Singh
2014-03-26 6:26 ` Sascha Hauer
2014-03-26 6:57 ` Alexander Aring
2014-03-26 11:14 ` Ashutosh Singh
2014-03-26 11:31 ` Alexander Aring
2014-03-26 11:33 ` Alexander Aring
2014-03-26 11:53 ` Michel Stam
2014-03-26 11:58 ` Alexander Aring
2014-03-26 12:14 ` Michel Stam [this message]
[not found] ` <CA+dawz2HSTYcR4Lv_0Q_ECELh2i9kq6vnZTEdnD8e+qu4pyamA@mail.gmail.com>
[not found] ` <20140328091854.GA20774@omega.Speedport_W_921V_1_24_000>
[not found] ` <CA+dawz3gfhFv3mtAOjXVoooE5WqJb6sH1qbMmPw--OD-p_N4Qg@mail.gmail.com>
[not found] ` <20140328095241.GB21559@omega.Speedport_W_921V_1_24_000>
2014-03-31 0:12 ` Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5332C4AF.4060009@reverze.net \
--to=michel@reverze.net \
--cc=alex.aring@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=embedded.ashu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox