Received: from eggs.gnu.org ([2001:4830:134:3::10]:39190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YymnD-0006nx-Kp for qemu-devel@nongnu.org; Sat, 30 May 2015 15:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YymnA-0006Dx-Di for qemu-devel@nongnu.org; Sat, 30 May 2015 15:51:39 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:60208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YymnA-0006CS-4d for qemu-devel@nongnu.org; Sat, 30 May 2015 15:51:36 -0400 Message-ID: <556A14BB.3010703@vivier.eu> Date: Sat, 30 May 2015 21:51:23 +0200 From: Laurent Vivier MIME-Version: 1.0 References: <1433014102-19878-1-git-send-email-laurent@vivier.eu> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] scripts: update (rewrite) qemu-binfmt-conf.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Riku Voipio , QEMU Developers Le 30/05/2015 21:32, Peter Maydell a écrit : > On 30 May 2015 at 20:28, Laurent Vivier wrote: >> Orginal qemu-binfmt-conf.h is only able to write configuration >> into /proc/sys/fs/binfmt_misc, and the configuration is lost on reboot. >> >> This script can configure debian and systemd services to restore >> configuration on reboot. Moreover, it is able to manage binfmt >> credential and to configure the path of the interpreter. > > >> +i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00' >> +i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' >> +i386_family=i386 > > Personally I think it would be nice to store these in > update-binfmts(8) style format files rather than directly > in the script. That way we separate data from the > implementation, and it's convenient if you want to do > something else with the data than what the script does. To separate data and implementation was my idea 2 years ago: https://patchwork.ozlabs.org/patch/213887/ https://patchwork.ozlabs.org/patch/213886/ but it is easier to manage if all stuffs are in the same file. The first idea is to keep compatibility of the original script by adding only features. As I'd like to have a script working on debian/fedora(suse?)/generic, we must keep the base format as simple as possible. With this format, we are able to generate easily update-binfmts format, systemd-binfmt.service format or to write directly into /proc. Regards, Laurent