2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A/* Walk children of 'devpath', calling hook for each. */ 2N/A/* Iterate through all device aliases. This function can be used to 2N/A find a device of a specific type. */ 2N/A /* Find the first property. */ 2N/A /* The property `name' is a special case we should skip. */ 2N/A /* Sun's OpenBoot often doesn't zero terminate the device alias 2N/A strings, so we will add a NULL byte at the end explicitly. */ 2N/A /* NAND device don't have device_type property. */ 2N/A/* Get the device arguments of the Open Firmware node name `path'. */ 2N/A/* Get the device path of the Open Firmware node name `path'. */ 2N/A /* Try to find an alias for this device. */ 2N/A char type[
64];
/* XXX check size. */ 2N/A /* We need to know what type of device it is in order to parse the full 2N/A file path properly. */ 2N/A "device %s lacks a device_type property",
device);
2N/A /* Shouldn't happen. */ 2N/A /* The syntax of the device arguments is defined in the CHRP and PReP 2N/A IEEE1275 bindings: "[partition][,[filename]]". */ 2N/A /* Make sure filepath has leading backslash. */ 2N/A /* Shouldn't happen. */ 2N/A /* Consistently provide numbered partitions to GRUB. 2N/A OpenBOOT traditionally uses alphabetical partition 2N/A/* Convert a device name from IEEE1275 syntax to GRUB syntax. */ 2N/A /* GRUB partition 1 is OF partition 0. */ 2N/A/* Resolve aliases. */ 2N/A for (i = 0; i <
2; i++)
2N/A /* Shouldn't reach here. */