Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029AbdHNSHE (ORCPT ); Mon, 14 Aug 2017 14:07:04 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:26228 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750950AbdHNSHC (ORCPT ); Mon, 14 Aug 2017 14:07:02 -0400 X-IronPort-AV: E=Sophos;i="5.41,374,1498489200"; d="scan'208";a="254546986" From: Chris Brandt To: Nicolas Pitre CC: Alexander Viro , "linux-fsdevel@vger.kernel.org" , "linux-embedded@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 0/5] cramfs refresh for embedded usage Thread-Topic: [PATCH 0/5] cramfs refresh for embedded usage Thread-Index: AQHTEtdFT0/wwlN9sk6l1Kak7eVmpaKEGObggAAH1ICAAAY+sA== Date: Mon, 14 Aug 2017 18:01:54 +0000 Message-ID: References: <20170811192252.19062-1-nicolas.pitre@linaro.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chris.Brandt@renesas.com; x-originating-ip: [4.59.13.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SG2PR06MB1165;20:167MY5AZI5/O5azR2/2FiXbzgUW+ezm4RRDgrFfJmHfbKPu6jkGgC5VgTAFQ6ViYzxnyQOKNzrTEAyQ6udqbS5LT/sNjQ9r0ouJe8tlJiNn5vKWEwYkTEB2uUXQYB9H+kBKVSAxt7UDvmgfuoqdO2Iy3ILBt2w6XdtSWVoYcTz4= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: c97a9209-4cc2-45ea-c6cc-08d4e33e8c2e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SG2PR06MB1165; x-ms-traffictypediagnostic: SG2PR06MB1165: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SG2PR06MB1165;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SG2PR06MB1165; x-forefront-prvs: 039975700A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(199003)(189002)(24454002)(33656002)(2906002)(7736002)(3280700002)(25786009)(305945005)(86362001)(575784001)(4326008)(6436002)(81156014)(8676002)(6246003)(8936002)(68736007)(54906002)(110136004)(55016002)(81166006)(9686003)(76176999)(53936002)(99286003)(50986999)(478600001)(54356999)(105586002)(106356001)(97736004)(189998001)(101416001)(7696004)(6916009)(66066001)(2950100002)(5250100002)(5660300001)(229853002)(2900100001)(14454004)(74316002)(102836003)(3846002)(3660700001)(6506006)(72206003)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB1165;H:SG2PR06MB1165.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2017 18:01:54.4967 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1165 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7EI79AS024206 Content-Length: 2747 Lines: 58 On Monday, August 14, 2017, Nicolas Pitre wrote: > > I just applied the patches tried this simple test: > > - tested with a Renesas RZ/A1 (Cortex-A9...so it has an MMU). > > - I set the sticky bit for busybox before using mkcramfs > > You need the newer mkcramfs I linked to in the documentation. With it > you don't need to play tricks with the sticky bit anymore. However you > need to specify -X twice (or just once for no-MMU targets) and it will > make every ELF files XIPable automatically. OK. Now I am getting bigger images that makes me think all the ELF files are uncompressed. > > However, at this point I'm not sure how I can confirm that the XIP > > busybox actually executed as XIP or not. > > Just use busybox's built-in cat command and dump the content of > /proc/self/maps. You should see an offset that refers to a physical > address within your cramfs image for those segments marked read-only and > executable. It works! Pretty cool. $ /mnt/bin/busybox cat /proc/self/maps 00008000-000a1000 r-xp 1b005000 00:10 18192 /mnt/bin/busybox (my cramfs flash image is at physical address 0x1B000000) However, now with your mkcramfs tool, I can no longer mount my cramfs image as the rootfs on boot. I was able to do that before (ie, 30 minutes ago) when using the community mkcramfs (ie, 30 minutes ago). I get this: [ 1.712425] cramfs: checking physical address 0x1b000000 for linear cramfs image [ 1.720531] cramfs: linear cramfs image appears to be 15744 KB in size [ 1.728656] VFS: Mounted root (cramfs_physmem filesystem) readonly on device 0:12. [ 1.737062] devtmpfs: mounted [ 1.741139] Freeing unused kernel memory: 48K [ 1.745545] This architecture does not have kernel memory protection. [ 1.760381] Starting init: /sbin/init exists but couldn't execute it (error -22) [ 1.769685] Starting init: /bin/sh exists but couldn't execute it (error -14) [ 1.776956] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. [ 1.791192] CPU: 0 PID: 1 Comm: init Not tainted 4.13.0-rc1-00014-g53182a0b7245 #667 [ 1.798959] Hardware name: Generic R7S72100 (Flattened Device Tree) [ 1.805519] [] (unwind_backtrace) from [] (show_stack+0xb/0xc) [ 1.813228] [] (show_stack) from [] (panic+0x6f/0x18c) [ 1.820163] [] (panic) from [] (kernel_init+0x6b/0x98) [ 1.827078] [] (kernel_init) from [] (ret_from_fork+0x11/0x20) [ 1.834747] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. Chris