From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Rrh7i-0007Aw-IN for mharc-grub-devel@gnu.org; Sun, 29 Jan 2012 21:37:38 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrh7e-00079h-U5 for grub-devel@gnu.org; Sun, 29 Jan 2012 21:37:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrh7d-0003ff-O5 for grub-devel@gnu.org; Sun, 29 Jan 2012 21:37:34 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrh7d-0003fa-Fj for grub-devel@gnu.org; Sun, 29 Jan 2012 21:37:33 -0500 Received: by wibhj13 with SMTP id hj13so3681784wib.0 for ; Sun, 29 Jan 2012 18:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=mcNPPFeYaVSdxaGoWI4yPPV0tZjqzuaPOr9aOQBjUG4=; b=W3yfLWBmtOeHVdezq7Xvkn7RDVkU+bDz4Se6leZsGRrkhGe1L8OQQWdZ3VF8RDK7Rt VAJpCdcQuawa4FHunz2XPxD0ZdcIFzWBaOgbkmo4qwgFnEOJtW2on4GKzEDMt1Fufs+S 5pPyfiknXUrcIlhWKGRcjJBbrnpwZpF8i7oRk= Received: by 10.180.103.97 with SMTP id fv1mr24626189wib.17.1327891052271; Sun, 29 Jan 2012 18:37:32 -0800 (PST) Received: from fedora.x201.phnet (7-77.203-62.cust.bluewin.ch. [62.203.77.7]) by mx.google.com with ESMTPS id dw7sm12527171wib.4.2012.01.29.18.37.30 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jan 2012 18:37:31 -0800 (PST) Message-ID: <4F260269.10201@gmail.com> Date: Mon, 30 Jan 2012 03:37:29 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: The development of GRUB 2 Subject: grub-install revamp Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 02:37:36 -0000 Hello, all. It was a Robert's idea of having grub-install to install all available (as in: the ones which were make install'ed) ports in a single grub-install w/o having to keep and run one grub-install per port. This has an advantage of making the disk bootable in various ways including ability to move it from one computer to another. The first problem is the files collision. To resolve this the modification will be to load modules from $prefix/$cpu-$platform/$modname.mod. Also 2 new script constants will be defined: $cpu and $platform. The problem then is that different firmwares require different kind of arrangements in order to be bootable. i386-pc requires 55AA signature, some code in MBR and embedding zone. A dummy msdos active partition is required on some systems. *-efi require files on ESP and some nvram entries i386-qemu, i386-coreboot, i386-qemu_mips and loongsoon-firmware are firmware ports and we don't use grub-install for those but grub-mkstandalone. i386-multiboot just has to be readable by whatever is a coreboot payload. mipsel-loongson has to be on ext2 msdos partition. sparc64 requires SUN partition map and the code in sector 1 Powerpc (Apple) requires a file on HFS and nvram modification PowerPC (IBM) uses PreP partition ARC uses a special entry in the dvh partition table I have no idea what i386-ieee1275 requires but I guess it's a fat partition with special file + nvram modification. So I propose following strategy: grub-install does the following platform-specific installations: - if /boot/efi is on fat, copy grub to /boot/efi/efi/$boot_id/grub[ia32|x64|ia64].efi (replace $boot_id and grub with boot if --removable is specified) and update nvram if no --removable is specified and currently running EFI version matches the installed one. - if /boot/mac is on HFS or HFS+, create there a structure recognized by both PPC and Intel macs and update nvram if architecture matches - If /boot/ext2 is on ext*, put mipsel-loongson and i386-multiboot there. - If /boot/olpc is on fat, install i386-ieee1275 there and update nvram if architecture matches. - For every argument that is an msdos or gpt disk, install i386-pc bootsector. - For every argument that is a sun disk, install sun bootsector. - For every argument that is a dvh disk, install mips-arc. - For every argument that is a prep partition install powerpc-ieee1275 While the copying to partitions is harmless and updating nvram is done only if architecture and platform matches, the disk operations may be harmful. While none of the current 4 configuration usually come in contradictory combinations, it's possible to purposedly create a disk of multiple types and it will confuse this logic. Also if we throw e.g. hppa into the mix which requires just a signature on bytes 0-1 and some info in 0xf4-0xff then we can't know if msdos disk is for BIOS or hppa install. So we need a way to specify them more precisely. PreP and ARC came in only after 1.99 so we can make them accept only the new way whatever it will be. In case of old way we can easily distinguish sparc64-ieee1275 and i386-pc with e.g. uname -i. I propose either of: --device-bios=/dev/xyz --device-sun=/dev/xyz --device-arc=/dev/xyz --device-prep=/dev/xyz Or: bios:/dev/xyz sun:/dev/xyz arc:/dev/xyz prep:/dev/xyz Also it may happen that installation of some port is undesirable. So we need options --install-only=... --exclude=... Any further ideas? -- Regards Vladimir 'φ-coder/phcoder' Serbinenko