From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.reverze.net ([82.161.88.7] helo=fsm.reverze.net) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSmjW-00045l-OT for barebox@lists.infradead.org; Wed, 26 Mar 2014 12:15:04 +0000 Message-ID: <5332C4AF.4060009@reverze.net> Date: Wed, 26 Mar 2014 13:14:39 +0100 From: Michel Stam MIME-Version: 1.0 References: <20140326062619.GP17250@pengutronix.de> <20140326065734.GA18805@omega.Speedport_W_921V_1_24_000> <20140326113103.GA9427@omega.Speedport_W_921V_1_24_000> <20140326113300.GB9427@omega.Speedport_W_921V_1_24_000> <5332BF9F.8060308@reverze.net> <20140326115854.GA12190@omega.Speedport_W_921V_1_24_000> In-Reply-To: <20140326115854.GA12190@omega.Speedport_W_921V_1_24_000> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3733604535043237299==" Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: Can i access the barebox env from linux To: Alexander Aring Cc: barebox@lists.infradead.org, Ashutosh Singh This is a cryptographically signed message in MIME format. --===============3733604535043237299== Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000805070503090105090001" This is a cryptographically signed message in MIME format. --------------ms000805070503090105090001 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hey Alex, The current version? That is a library, quite ugly actually. LD_PRELOAD=3D/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=20 environment contains a /bin/init, then the file will be available from=20 /bin/init if the library is preloaded. Memory footprint is around=20 10kbyte RAM, or something like that. Its probably only usable for root,=20 as it requires read access to the block device, something you wouldn't=20 want to give all users. As a kernel module I would make it a proper filesystem so you can do=20 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 libr= ary >> 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 files= ystem >> 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 --------------ms000805070503090105090001 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIMmzCC BjQwggQcoAMCAQICAR4wDQYJKoZIhvcNAQEFBQAwfTELMAkGA1UEBhMCSUwxFjAUBgNVBAoT DVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNp Z25pbmcxKTAnBgNVBAMTIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA3 MTAyNDIxMDE1NVoXDTE3MTAyNDIxMDE1NVowgYwxCzAJBgNVBAYTAklMMRYwFAYDVQQKEw1T dGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRhbCBDZXJ0aWZpY2F0ZSBTaWdu aW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAxIFByaW1hcnkgSW50ZXJtZWRpYXRlIENs aWVudCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMcJg8zOLdgasSmkLhOr lr6KMoOMpohBllVHrdRvEg/q6r8jR+EK75xCGhR8ToREoqe7zM9/UnC6TS2y9UKTpT1v7RSM zR0t6ndl0TWBuUr/UXBhPk+Kmy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N0YXJ0Q29tIEx0ZC4xKzApBgNV BAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcxODA2BgNVBAMTL1N0YXJ0 Q29tIENsYXNzIDEgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xpZW50IENBAgMJaQ4wgacGCyqG SIb3DQEJEAILMYGXoIGUMIGMMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UE AxMvU3RhcnRDb20gQ2xhc3MgMSBQcmltYXJ5IEludGVybWVkaWF0ZSBDbGllbnQgQ0ECAwlp DjANBgkqhkiG9w0BAQEFAASCAQAUcYZSPew9azGEMqNfhKoNpW9OCtjUhinZqqXGnk7Gu5YH Y4t4rAAn5kzT8WbpGICpboKnv7rrWWKNN5DVE0X35aiD7RgK/0Ggywhh5slzI2JerRU+HcOO Zm/d8E8jhd+4kn6SL2dKNVMkBYdZdeHxcfahy6POSJxsw+ef0BhHrtAZiv/DBVGhl2koS4fI QHmjonZDrdsDGxv2y9GT+Dm92Yr9E6HNSajhORJkVNAm/skUrvCFg3wsGmb0hU/ZeModNMWa LcANDgxVT1xaUMzC85928wB5YJteS/nUPnyd4YcYCqJiwZ2iGutetyHU607fI613nyQSpAra 6Lwv36b6AAAAAAAA --------------ms000805070503090105090001-- --===============3733604535043237299== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============3733604535043237299==--