CN102419710A - Method for repairing Grub boot loader based on Anaconda - Google Patents

Method for repairing Grub boot loader based on Anaconda Download PDF

Info

Publication number
CN102419710A
CN102419710A CN 201010294581 CN201010294581A CN102419710A CN 102419710 A CN102419710 A CN 102419710A CN 201010294581 CN201010294581 CN 201010294581 CN 201010294581 A CN201010294581 A CN 201010294581A CN 102419710 A CN102419710 A CN 102419710A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
grub
boot loader
step
repair
configuration
Prior art date
Application number
CN 201010294581
Other languages
Chinese (zh)
Other versions
CN102419710B (en )
Inventor
兰雨晴
刘艳彬
夏颖
姜平
张永军
徐晓娟
朱中涛
杨建生
王建慧
甄东宇
Original Assignee
中标软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date

Links

Abstract

The invention relates to a method for repairing a Grub boot loader based on Anaconda installation program. In the invention, by abandoning the traditional method for repairing the Grub boot loader through a grubinstall command, the repairing of the Grub boot loader is realized by adding corresponding function module to the Anaconda installation program. In addition, according to the invention, an encryption function to the Grub boot loader is realized, kernel parameters are transmitted, and an installation position of the Grub boot loader can be customized. The method mainly comprises three steps of registering, configuring and repairing, and overcomes the defects of the prior art that the repairing of the Grub boot loader is incomplete, the operation steps are complicated, the requirements on the capability of an executor are high, an operation interface is unfriendly, and the like.

Description

基于Anaconda修复Grub引导装载程序的方法 Anaconda repair method based on the boot loader Grub

技术领域 FIELD

[0001] 本发明涉及一种修复Grub引导装载程序的方法,尤其是一种Linux系统下基于Anaconda修复Grub引导装载程序的方法。 [0001] The present invention relates to a method of repairing Grub boot loader, especially the method of repairing Anaconda Grub boot loader based on one kind of the Linux system.

背景技术 Background technique

[0002] 通常用户安装Linux操作系统都是将Grub安装在MBR上,但是,由于种种原因,例如在安装Linux的机器上再安装Windows操作系统或因为误操作清洗数据,可能会清除MBR 的数据,导致Linux系统无法找到Grub从而无法启动已安装的Linux系统。 [0002] Usually the user to install the Linux operating system is installed on the MBR Grub will, however, for various reasons, such as re-install the Windows operating system installed on a Linux machine or because of misuse of data cleansing, data may clear the MBR, Grub Linux system can not find the cause can not be started Linux system has been installed.

[0003] 目前主要的解决方案有以下三种方式: [0003] At present, the solution has the following three ways:

[0004] l)Linux 环境Live CD 修复Grub [0004] l) Linux Live CD environment to repair Grub

[0005] 目前主流的Linux操作系统如Ubuntu和!^edora系列都提供Live CD,通过Live CD提供的环境可以利用修复引导程序的命令修复之,其具体操作流程如图1所示; ! [0005] The current mainstream operating systems such as Linux and ^ edora Ubuntu Live CD series are available, the environment provided by the Live CD command may be utilized to fix the boot program of the repair, the specific operation process shown in Figure 1;

[0006] 2) Linux 环境rescue 模式修复Grub [0006] 2) Linux rescue mode environment to repair Grub

[0007] 在诸如RHEL5光盘启动时,提供了rescue模式用来修复已安装系统的错误,同样这种模式也可以修复Grub引导装载程序,其具体工作流程如图2所示; [0007] When the disc starts RHEL5 such as rescue mode is provided to fix the error has been installed in the system, this pattern may be the same repair Grub boot loader, the specific work flow shown in Figure 2;

[0008] 3) Windows 环境grub4dos 工具修复Grub [0008] 3) Windows environment grub4dos tool to repair Grub

[0009] Windows环境下,可以利用grub4dos工具进入Grub环境,通过相关命令和参数来修复Grub,其具体操作流程如图3所示。 [0009] Windows environment, you can use the tool into Grub grub4dos environment, through relevant commands and parameters to repair Grub, specific operation flow shown in Figure 3.

[0010] 目前普遍应用的解决方案就是以上三种方式。 [0010] solutions are currently widely used is more than three ways. 以上三种方式修复Grub引导装载程序的原理都是一样的,即通过运行外部命令——grubinstall来实现的,且都存在一个共同的问题:易用性差。 These three principle ways to repair Grub boot loader is the same, namely to achieve by running an external command --grubinstall, and there is a common problem: poor usability. 以上三种解决方案在易用性方面存在以下问题: These three solutions to the following problems in ease of use:

[0011] 1)修复Grub弓I导装载程序不完善 [0011] 1) I bow guide repair Grub loader imperfect

[0012] 现有技术方案只对Grub引导装载程序提供了基本的修复工作,仅仅完成了修复之后能够引导起操作系统,缺少通过传递参数实现自定义Grub引导装载程序的功能。 [0012] The prior art provides only a basic embodiment of the repair work Grub boot loader, only after completion of the repair can be guided from the operating system, the lack of customization Grub boot loader is achieved by passing parameters.

[0013] 2)操作步骤复杂 [0013] 2) Procedure complex

[0014] 通过以上的操作流程图可以看出,要完成Grub引导装载程序的修复至少需要5个复杂的步骤,且几乎每个步骤都需要输入一些命令和参数,输入不准确时还可能需要重新启动系统,带来不必要的麻烦。 [0014] can be seen from the above operational flow, to complete the repair Grub boot loader 5 requires at least a complex steps, and each step requires almost enter commands and parameters input inaccuracies may also involve re start system, cause unnecessary trouble.

[0015] 3)对实施者能力要求较高 [0015] 3) high capacity requirements of the implementer

[0016] 以上的方案要求实施者对Linux系统和Grub工作机制有比较深入的了解方可实施,而对于一般的Linux用户而言,这种修复方式是一种挑战。 [0016] perpetrators of the above program requirements and Grub Linux system work more in-depth understanding of the mechanism before implementation, but for the average Linux users, this repair method is a challenge.

[0017] 4)操作界面不友好 [0017] 4) unfriendly interface

[0018] 现有几种解决方案不是一个统一的软件或步骤修复Grub,故没有一个整套的软件界面供用户交互。 [0018] There are several solutions are not a unified software or steps to repair Grub, it is not a comprehensive set of software interface for user interaction. 用户只能通过编辑配置文件,并通过在终端以命令行的方式执行修复命令,为修复操作带来很大的不便。 Users can only edit the configuration file, and through the terminal to perform the repair command line commands a great deal of inconvenience for the repair operation.

[0019] 5)不能对Grub弓丨导装载程序加密[0020] 现有解决方案没有提供为Grub引导装载程序加密的方法,对于安全系数要求较高的系统来说存在安全隐患。 [0019] 5) can not encrypt Grub loader guide bow Shu [0020] Existing solutions do not provide a method for the encryption loader Grub guide, the safety factor required for higher security risk systems.

[0021] 6)不能为Grub引导装载程序传递内核参数 [0021] 6) can not be passed to the kernel parameter Grub bootloader

[0022] 现有解决方案不能传递内核参数,无法满足用户启动操作系统时按照自己的偏好或需求自定义操作系统弓I导的内核参数。 [0022] Existing solutions do not pass kernel parameters, kernel parameters can not meet the user starts the operating system according to their own preferences or demands I bow guide operating system customization.

[0023] 7)不能自定义Grub引导装载程序的安装位置 [0023] 7) Grub not customize the installation location of the boot loader

[0024] 现有解决方案不能自定义Grub引导装载程序的安装位置。 [0024] The existing solutions can not customize the installation location Grub boot loader. 现有解决方式只能将Grub引导装载程序安装到MBR,不支持安装到其他的分区。 Existing solutions can only install the Grub boot loader to MBR, it does not support installation to another partition. 不能满足用户自定义安装位置的需求。 You can not meet the needs of the user-defined installation position.

[0025] 本发明涉及到的相关技术术语的名词解释: [0025] The term & noun related art related to the present invention will be explained:

[0026] Grub =GNU GRUB (简称“GRUB”)是一个来自GNU项目的多操作系统启动程序。 [0026] Grub = GNU GRUB (referred to as "GRUB") is a multi-item from the GNU operating system boot program. GRUB 是多启动规范的实现,它允许用户可以在计算机内同时拥有多个操作系统,并在计算机启动时选择希望运行的操作系统。 GRUB is a multi-start implementation of the specification, which allows the user to have more than one operating system in the computer, and select the operating system you want to run when the computer starts. GRUB可用于选择操作系统分区上的不同内核,也可用于向这些内核传递启动参数。 GRUB on different cores may be used to select the operating system partition, boot parameters can also be used to transfer the cores.

[0027] MBR :全称为Master Boot Record,即硬盘的主引导记录。 [0027] MBR: called the Master Boot Record, i.e. hard disk master boot record.

[0028] Live⑶:即可以直接引导为可用Linux系统的⑶。 [0028] Live⑶: i.e. may be directly available to boot Linux system ⑶.

[0029] Linux的rescue模式=Linux的修复模式,可以直接从引导介质启动,进入修复已安装Linux操作系统的修复环境。 [0029] Linux rescue mode = Linux repair mode, you can start directly from the boot media, enter the Linux operating system to repair the repair environment installed.

[0030] grub4dos :grub4dos是一个优秀的双(多)系统引导软件,使用GRUB4D0S可以很方便的引导各种操作系统,比如DOS、Windows、Linux等。 [0030] grub4dos: grub4dos is an excellent double (multi) system boot software, use GRUB4D0S can easily boot various operating systems such as DOS, Windows, Linux and so on.

[0031] Anaconda安装程序:Anaconda是Red Hat Linux和Fedora的安装管理程式。 [0031] Anaconda installer: Anaconda is the Red Hat Linux and Fedora installation management program. 它以Python及C语言写成,以图形的PyGTK和文字的python-newt界面写成。 It is written in Python and C language to python-newt PyGTK interface graphics and text written. 它可以用来自动安装配置,使用户能够以最小的监督运行。 It can be used to automatically configure the installation, enabling a user to run with minimal supervision.

发明内容 SUMMARY

[0032] 本发明提供了一种与现有Grub引导装载程序修复技术不同的另一种修复技术, 即摒弃传统的使用grubinstall命令修复Grub引导装载程序,而是通过python程序调用Anaconda提供的程序接口,实现对Grub引导装载程序的修复。 [0032] The present invention provides a boot loader prior Grub repair technique to repair a different technique, i.e. instead of the traditional use grubinstall command to fix Grub boot loader, but Anaconda program interface calls provided by the program python and achieve repair of the Grub boot loader.

[0033] 本发明把修复Grub引导装载程序的新方法融入到Linux安装程序Anaconda中, 将其作为安装过程的若干步骤,为用户提供操作友好的交互界面和简洁易用的操作步骤, 使得用户能够快速、准确修复Grub引导装载程序。 [0033] The present invention is a new method to fix Grub boot loader into Linux installer Anaconda, the number of steps as the installation process, the user friendly interface to provide operation and simple and easy operation steps, so that the user can fast, accurate repair Grub boot loader.

[0034] 本发明采用的技术方案是:将修复Grub弓|导装载程序作为Linux操作系统安装程序Anaconda的一个功能模块来实现的。 [0034] aspect of the present invention is that: the bow repair Grub | loader code as a Linux operating system function module Anaconda installer to achieve. 这一方法的实现包括以下步骤: Achieving this method comprises the following steps:

[0035] 1)将修复Grub引导装载程序的步骤注册至Anaconda安装程序(步骤Si):定义修复Grub弓丨导装载程序各个步骤的执行顺序,在整个过程中起到了分配任务和向导的作用。 Step [0035] 1) The repair Grub boot loader is registered to The Anaconda installer (step Si): defined Remediation order of individual steps Grub bow Shu loader code, acts as a distribution of tasks and wizards throughout the process.

[0036] 2)实现修复类步骤(步骤S2),即修复Grub引导装载程序的程序类:定义启动Anaconda程序直至修复弓I导完成所需经历的所有步骤和一些初始化定义。 [0036] 2) Repair implement class (step S2), i.e. repair Grub boot loader classes: Anaconda defined start program guide bow I repair until all the steps required to complete and experienced some initial definitions.

[0037] 3)修复Grub引导装载程序配置,包括基本配置(步骤S3a)和高级配置(步骤S3b)。 [0037] 3) repair Grub boot loader configuration, comprising a basic configuration (step S3a), and advanced configuration (step S3b). 其中,基本配置选项(步骤S3a)包括Grub引导装载程序的标签,以及设置Grub引 Wherein the basic configuration options (step S3a) tag comprises Grub boot loader, and a primer set Grub

5导装载程序的密码;高级配置选项(步骤S3b)包括Grub引导装载程序的安装位置,是否使用LBA32,以及供用户输入内核参数的接口。 5 guiding loader password; advanced configuration options (step S3b) comprises a mounting position Grub boot loader, whether the LBA32, and user input interface for the kernel parameter.

[0038] 4)执行安装Grub引导装载程序(步骤S5),完成修复工作:将配置好的Grub引导装载程序安装在指定的位置,完成对受损Grub引导装载程序的配置修复工作。 [0038] 4) mounted Grub boot loader executed (step S5), the repair work is completed: the boot loader configured Grub installed at the specified location, complete restoration of the damaged configuration Grub boot loader.

[0039] 5)退出安装程序(步骤S6):修复Grub引导装载程序的善后处理工作。 [0039] 5) quit the installation process (step S6): Repair Grub boot loader rehabilitation work.

[0040] 本发明提供了一种自动化修复Grub引导装载程序的方法,克服了现有技术修复Grub引导装载程序操作步骤复杂、对实施者能力要求高、操作界面不友好、无法加密Grub 引导装载程序、无法为Grub传递内核参数、无法自定义Grub引导装载程序安装位置等缺陷,实现一种更易用、功能更完善的修复Grub引导装载程序的方法。 [0040] The present invention provides an automated method of repairing Grub boot loader, the prior art overcomes the repair Grub boot loader operation steps are complicated, high capacity requirements of the practitioner, friendly user interface, can not be encrypted boot loader Grub can not be easier to use one kind of Grub pass kernel parameters, can not customize the installation location Grub boot loader and other defects, to achieve, function better repair method Grub boot loader.

[0041] 本发明与现有技术相比在易用性和交互性方面有了很大的改进,主要体现在以下几个方面: [0041] The present invention as compared with the prior art a significant improvement in ease of use and interoperability, mainly in the following aspects:

[0042] 1)相对于现有技术的复杂操作,本发明为修复Grub引导装载程序提供了一个统一的工具,即将其集成至操作系统安装步骤中; [0042] 1) with respect to the complex operations of the prior art, the present invention provides a single tool to repair Grub boot loader, which is integrated into the operating system is about to mounting step;

[0043] 2)相比较现有技术没有提供交互界面,本发明为修复Grub引导装载程序提供了一个友好的图形化人机交互界面,方便用户操作; [0043] 2) as compared to the prior art does not provide an interactive interface, the present invention provides a friendly graphical human-machine interface for the repair Grub boot loader, user operation;

[0044] 3)相比较与现有技术,本发明提供的修复Grub引导装载程序的方法更简洁、更易操作,只需要经过选择修复、配置、确定三个步骤即可; [0044] 3) compared with the prior art, the present invention provides a method of repairing Grub boot loader shorter and easier to operate, repair just chosen, the configuration, three steps can be determined;

[0045] 4)相比较与现有技术,本发明提供的方法更易上手,对实施人员技术经验要求比较低,本发明提供了默认选项,即使不经过任何配置也能够完成Grub引导装载程序的修复工作; [0045] 4) Compared with the prior art, the present invention provides a method of more approachable, implementers of technical experience requirements is relatively low, the present invention provides a default option, even without any configuration can be completed repair Grub boot loader jobs;

[0046] 5)相对于现有技术,本发明对修复Grub引导装载程序的功能做了进一步完善,即实现Grub引导装载程序的高级配置,包括对Grub引导装载程序的加密保护、对Grub引导装载程序传递内核参数以及自定义Grub引导装载程序的安装位置。 [0046] 5) with respect to the prior art, the present invention is to repair Grub boot loader made to further improve the function, i.e. to realize advanced configuration Grub boot loader, including encryption of Grub boot loader, the boot loader to Grub program passes, and custom kernel parameters Grub boot loader is installed. 其中加密引导装载程序可以对操作系统进行加密保护,防止不允许启动操作系统的人非法启动系统;对Grub引导装载程序传递内核参数可以实现系统启动的自定义方式,如图形方式启动系统、屏蔽系统启动时的细节信息等;自定义Grub引导程序的安装位置可以自定义将Grub引导装载程序安装到MBR或分区头上。 Wherein the encrypted boot loader operating system may be encrypted, not allowed to start the operating system to prevent illegal start system; Grub bootloader to pass kernel parameters may be implemented to customize how the system startup, the system startup mode such as graphics, shielding system detailed information when starting; custom installation location Grub bootloader Grub can customize the boot loader or the MBR partition head.

附图说明 BRIEF DESCRIPTION

[0047] 图1为现有Linux环境Live CD修复Grub流程图; [0047] FIG. 1 is a conventional repair Grub Live CD Linux environment flowchart;

[0048] 图2为现有Linux环境rescue模式修复Grub流程图; [0048] FIG 2 is a conventional rescue mode Linux environment repair Grub flowchart;

[0049] 图3为现有Windows环境grub4dos工具修复Grub流程图; [0049] FIG. 3 is a conventional Windows environment grub4dos Grub flowchart repair tool;

[0050] 图4为本发明修复Grub引导装载程序流程图; [0050] FIG. 4 Grub fix a flow chart of the boot loader to the invention;

[0051] 图5为加密Grub引导装载程序流程图; [0051] FIG. 5 is a flowchart of the encryption Grub boot loader;

[0052] 图6为传递Grub引导装载程序内核参数流程图; [0052] FIG. 6 is transmitted Grub boot loader flowchart kernel parameters;

[0053] 图7为自定义Grub引导装载程序安装位置流程图。 [0053] FIG. 7 is a custom boot loader Grub flowchart installed position.

具体实施方式 Detailed ways

[0054] 为了使本发明所采用的技术、手段及其优点,现举优选实施例并配合附图详述如后,此仅供说明之用,在专利申请上并不受以下具体实施方式的限制。 [0054] In order that the present invention is employed in art, means and advantages thereof, is held with the accompanying drawings and the preferred embodiments as described later in detail, the purpose of illustration only, in the patent application is not subject to the following specific embodiments limit.

[0055] 本发明以Linux操作系统安装程序Anaconda为基础,将修复Grub引导装载程序的方法引入到Anaconda机制中来实现的。 [0055] The method of the present invention in the Linux operating system installation program Anaconda basis, boot loader will fix Grub Anaconda introduced into the mechanism to achieve. 本发明的交互界面包括图形界面和字符界面两种方式,分别对应于Anaconda安装程序的图形安装模式和字符安装模式。 Interface of the present invention includes a graphical interface and the interface characters in two ways, corresponding to the installation mode and character graphics mode installation Anaconda installer. 本发明的具体实施过程包括以下步骤: Specific embodiments of the present invention the process comprises the steps of:

[0056] 1)将修复Grub引导装载程序的步骤注册至Anaconda安装程序(步骤Si) Step [0056] 1) the boot loader will fix Grub to The Anaconda installer registered (step Si)

[0057] 这一步骤是实现在安装过程中修复Grub装载引导程序的前提,它定义了修复Grub弓丨导装载程序各个步骤的执行顺序,在整个过程中起到了分配任务和向导的作用。 [0057] This step is a prerequisite to achieve repair Grub bootloader loading during installation, it defines the order of individual steps performed to repair Grub loader guide arch Shu, distribution of tasks and acts as a guide during the entire process.

[0058] 在Anaconda程序中有个dispatch, py文件,该文件实现对安装步骤的调度和控制,它有一个列表类型的数据结构installSt印s,该数据结构定义了安装程序所有的安装步骤,即所有的安装步骤都必须注册到installSt印s才能在安装过程中被调度和执行。 [0058] There are in Anaconda program a dispatch, py file achieve scheduling and control of the installation procedure, it has a list of types of data structures installSt printed s, the data structure defining the installer all the installation steps, i.e. All installation steps must be registered to installSt India s in order to be scheduled and executed during the installation process. 注册修复Grub引导装载程序的步骤即是将其包含的所有步骤以installSt印s定义的格式添加到installSt印s列表中,installkps列表中包括前端步骤和后端步骤,其中前端步骤即可视化的提供与用户交互的步骤,后端步骤指在后台运行的步骤,不与用户交互。 Registering step Grub boot loader fix that is to add all of the steps comprising in installSt printed s defined format to installSt printed s list, installkps list includes a front step and rear step, wherein the front end of the step can be visualized to provide step user interaction, refer to step back end steps running in the background, without user interaction. 注册完Grub引导程序修复步骤后,这些步骤就具备了被Anaconda安装程序调度和执行的基本条件。 After registration Grub bootloader repair steps that have to be scheduled and basic conditions executed Anaconda installer.

[0059] 2)实现修复类步骤(步骤S》,即修复Grub引导装载程序的程序类 [0059] 2) Repair implement class (step S ", i.e. fix Grub boot loader program class

[0060] 修复Grub引导装载程序类继承了installclass. py文件中的BasehstallClass 类,该类定义了基本安装类。 [0060] Grub fix the boot loader class inherits installclass. BasehstallClass py class file, the class definition of the base class installation. 修复Grub引导装载程序类定义了启动Anaconda程序直至修复弓I导完成所需经历的所有步骤和一些初始化定义。 Repair Grub boot loader class defines the startup procedure until repair Anaconda I bow guide all the steps required to complete and experienced some initial definitions. 这些工作主要由其成员函数setSt印s 来做,该函数调用dispatch的接口函数setSt印List实现此功能。 The work is mainly a function of its members setSt India s do, the function call interface function setSt India List dispatch of this functionality.

[0061] 该步骤也可通过其他的方法实现之,例如通过创建函数调用dispatch的接口函数setSt印List实现,或通过其他的方式调用dispatch接口函数seUteplist实现。 [0061] This step can also be achieved by other means of, for example, by creating a function call dispatch interface function implemented setSt List printed, or dispatch call interface functions seUteplist achieved through other means.

[0062] 3)修复Grub引导装载程序配置,包括基本配置(步骤S3a)和高级配置(步骤S3b) [0062] 3) repair Grub boot loader configuration, comprising a basic configuration (step S3a), and advanced configuration (step S3b)

[0063] 基本配置选项(步骤S3a)包括Grub引导装载程序的标签,以及设置Grub引导装载程序的密码;高级配置选项(步骤S3b)包括Grub引导装载程序的安装位置,是否使用LBA32,以及供用户输入内核参数的接口。 [0063] The basic configuration options (step S3a) comprises Grub boot tag loader, and setting Grub boot code loader; advanced configuration options (step S3b) comprises Grub boot loader installed position, whether to use the LBA32, and for the user input interface kernel parameters. 用户在基本配置中选择是否进行高级配置(步骤S4),若高级配置开关打开则进入高级配置选项,否则跳过高级配置。 User to select whether advanced configuration (step S4) In a basic configuration, when the switch is open Advanced Configuration proceeds advanced configuration options, otherwise skip advanced configuration.

[0064] 配置修复Grub引导装载程序选项是与用户交互的部分,在Anaconda安装程序中, 与用户交互的界面包括图形界面和字符界面两种模式。 [0064] Grub boot loader configuration repair option is to interact with the user portion, the installation program Anaconda, interact with the user interface includes a graphical interface and character modes. 故配置Grub引导装载程序交互界面的实施需要实现图形模式界面和字符模式界面。 Therefore Grub boot loader configuration interface needs to implement embodiments of the graphics mode and character mode interface interface. 具体实施方式是分别创建图形界面配置类和字符界面配置类。 DETAILED DESCRIPTION respectively create graphical configuration interface configuration class and character classes. 图形化的基本配置类和高级配置类继承hstallWindow类,并实现其父类的接口。 Graphical basic configuration and advanced configuration class class inheritance hstallWindow class and implement the interface of its parent class. 在图形化配置类中用GTK编程实现图形化的交互界面,提供用户基本配置选项和高级配置选项,包括Grub引导程序标签、密码设置、引导程序安装位置、是否使用LBA32及内核参数等控件和说明;用snap编程实现字符界面,为用户提供基本配置选项和高级配置选项,实现和图形化模式下相同的字符控件和说明。 Configuration type used in the graphical programming GTK graphical interface, provides the user basic configuration options and advanced configuration options, including a boot program label Grub, password, boot program installation location, and whether the LBA32 kernel parameters and control instructions ; characters with snap programming interface to provide users with basic configuration options and advanced configuration options, the same character controls and instructions under implementation and graphical mode. 在用户完成配置后,将每个选项关联到与之对应的Grub相关参数,即为Grub引导装载程序设置参数值,完成修复Grub 引导装载程序的配置工作。 After the user has completed the configuration, the option to associate each Grub parameters corresponding thereto, i.e. the boot loader Grub the parameter value, the repair work is completed configuration Grub boot loader. [0065] 其中,本发明实现了Grub引导装载程序加密、为Grub引导装载程序传递内核参数、自定义Grub引导装载程序安装位置等功能。 [0065] wherein the present invention realizes encryption Grub boot loader, the boot loader is Grub pass kernel parameters, custom boot loader Grub installation location functions. 本发明举出如下具体实现方式: DETAILED present invention include the following ways:

[0066] 加密Grub引导装载程序如附图5所示:首先实现Grub引导装载程序加密的用户交互接口(步骤S311)。 [0066] Grub encrypted boot loader 5 as shown in the accompanying drawings: First, to achieve Grub boot loader encrypted user interactive interface (step S311). 后端程序获取加密口令(步骤S3U)后,为bootloader对象设置加密口令值(步骤S313),并将加密口令写入配置文件(步骤S314)。 After the rear end of the program encrypted password (step S3U), the encrypted password value set (step S313) as bootloader object and encrypted password to the configuration file (step S314). 待Grub引导装载程序修复完成后,重启系统,Grub会自动调用程序要求输入Grub密码。 After the Grub boot loader repair is complete, restart the system, the program will automatically call Grub Grub asked to enter a password.

[0067] 传递Grub弓丨导装载程序内核参数如附图6所示:在高级配置步骤提供用户输入的接口(步骤S321),供用户输入自定义的内核参数。 [0067] Grub transfer guide arch Shu loader kernel parameters as shown in Figure 6: the interface provides a user input (step S321), the user input for the custom kernel parameters in the Advanced Configuration step. 后端程序接收用户输入的内核参数值(步骤S32》,并格式化内核参数(步骤S32!3)。bootloader对象有内核参数的属性args, 将内核参数列表赋值给args属性(步骤S3M)。在安装修复Grub引导装载程序时,将这些内核参数写入到Grub引导装载程序的配置文件grub, conf (步骤S32Q。这样在用户使用Grub引导装载程序引导系统时,系统会以带有内核参数的方式引导。 Backend kernel parameter value received (step S32 "input by the user and kernel parameter format (step S32! 3) .bootloader kernel object has attributes args parameter, the parameter list is assigned to the kernel args attribute (step S3M). In when repair Grub boot loader installed, these parameters are written to Grub kernel boot loader configuration file grub, conf (step S32Q. Thus when the user uses Grub boot loader guidance systems, the system in a manner with the kernel parameter guide.

[0068] 自定义Grub引导装载程序安装位置如附图7所示:提供选择安装位置的用户接口(步骤S331),包括安装到MBR或安装到引导分区的第一个扇区。 [0068] Grub custom boot loader installed position as shown in Figure 7: Provides a user interface to select the mounting position (step S331), the MBR comprising or attached to the first sector of the boot partition. 后端程序获取位置信息(步骤S33》,并对bootloader对象的安装位置属性设置值(步骤S33!3),在之后执行安装修复Grub引导装载程序时,安装程序会依据该属性值,将Grub引导装载程序安装到指定的位置(步骤S334)。 Backend acquires position information (step S33 ", and the setting value (step S33 bootloader mounting position of the object property! 3), after performing the repair at Grub boot loader, the installation program attribute values ​​based on the guide Grub loader is mounted to the specified location (step S334).

[0069] 4)执行安装Grub弓丨导装载程序(步骤S5),完成修复工作 [0069] 4) the installation guide Grub bow Shu loader (step S5), the repair work is completed

[0070] 这一功能的实施是由instbootloader这一安装步骤完成的,它调用bootloader. PY的writeBootloader接口,根据安装Grub引导装载程序的配置参数,将配置好的Grub引导装载程序安装在指定的位置,完成对受损Grub引导装载程序的配置工作。 [0070] The function of this embodiment is mounted instbootloader this step is completed, it calls bootloader. PY writeBootloader of interfaces, depending on the configuration parameters Grub boot loader installed, configured to Grub boot loader installed in the specified position , complete the configuration of the damaged Grub boot loader.

[0071] 5)退出安装程序(步骤S6) [0071] 5) quit the installation process (step S6)

[0072] 完成修复Grub引导装载程序后退出安装程序,这一步是修复Grub引导装载程序的善后处理工作,根据Anaconda安装系统和升级系统的风格,修复引导装载程序也设计了修复引导成功后退出Anaconda安装程序或重启系统的选项,提供给用户退出Anaconda安装程序的交互界面,且该交互界面包含图形模式和字符模式两种。 [0072] to complete the repair to exit the installation program after the Grub boot loader, this step is to repair the rehabilitation work Grub boot loader, according to the style Anaconda installation system and upgrade the system, repair the boot loader also designed exit Anaconda after the repair guide successful option to install a program or reboot the system, available to the user exits the Anaconda installation program interface, and the interface includes graphical mode and character two modes.

Claims (10)

  1. 1. 一种Linux系统下基于Anaconda修复Grub引导装载程序的方法,其特征在于,将修复Grub引导装载程序作为Linux操作系统安装程序Anaconda的一个功能模块,通过python程序调用Anaconda所提供的程序接口,实现对Grub引导装载程序的修复。 A system based on the Linux boot loader Grub method Anaconda repair, characterized in that the boot loader will fix Grub as the Linux operating system installation Anaconda, a functional module, the program interface calls provided by Anaconda python program, achieve repair Grub boot loader.
  2. 2.如权利要求1所述的方法,其特征在于,所述方法包括以下步骤:1)注册修复步骤,将修复Grub引导装载程序的步骤注册至Anaconda安装程序;2)实现修复类步骤,即修复Grub引导装载程序的程序类;3)配置步骤,修复Grub引导装载程序配置;4)执行步骤,执行修复Grub引导装载程序。 2. The method according to claim 1, characterized in that the method comprises the following steps: 1) Registered repair step, the repair step Grub boot loader register to Anaconda installer; 2) implementation class repair steps, i.e. Grub class fix the boot loader; 3) a step configuration, repair Grub boot loader configuration; 4) step, performing a repair Grub boot loader.
  3. 3.如权利要求2所述的方法,其特征在于,所述步骤1)是将修复Grub引导装载程序包含的所有步骤以installSt印s定义的格式添加到installSt印s列表中,installkps列表中包括前端步骤和后端步骤,其中前端步骤为可视化的提供与用户交互的步骤,后端步骤指在后台运行的步骤,不与用户交互。 3. The method according to claim 2, wherein said step 1) is a repair Grub boot loader comprising all the steps of printing installSt s added to the list to India s installSt defined format, installkps list comprising step front end and a rear end step, wherein the front end of the step of the step of providing a visual user interaction, the rear end of the step means a step running in the background, without user interaction.
  4. 4.如权利要求2所述的方法,其特征在于,所述步骤2)是由成员函数setSteps 调用dispatch的接口函数setSt印List,或通过创建函数调用dispatch的接口函数setStepList实现定义启动Anaconda程序直至修复引导完成所需经历的所有步骤和初始化定义。 4. The method according to claim 2, wherein said step 2) is a member function call dispatch interface function setSteps setSt printing List, or in setStepList achieved by creating a custom boot Anaconda program interface function call dispatch function until repair guide through the steps and initial definition of the required experience.
  5. 5.如权利要求2所述的方法,其特征在于,所述步骤幻包括分别创建图形界面配置类和字符界面配置类,为用户提供基本配置选项和高级配置选项。 5. The method according to claim 2, characterized in that the phantom comprises the step of separately creating character classes and GUI configuration interface configuration class, to provide users with the basic configuration options and advanced configuration options.
  6. 6.如权利要求5所述的方法,其特征在于,所述基本配置选项包括Grub引导装载程序的标签,以及设置Grub引导装载程序的密码;所述高级配置选项包括设置Grub引导装载程序的安装位置,是否使用LBA32,以及供用户输入内核参数的接口;用户能在基本配置选项中选择是否进行高级配置,若高级配置开关打开则进入高级配置选项,否则跳过高级配置。 6. The method according to claim 5, characterized in that the basic configuration options include label Grub boot loader, a boot password and setting Grub loader; advanced configuration options include setting the Grub boot loader installed position, whether to use the LBA32, and user input interface for the kernel parameter; the user can select whether to perform advanced configuration options in the basic configuration, the switch configuration when advanced into the advanced configuration options are open, otherwise skip advanced configuration.
  7. 7.如权利要求6所述的方法,其特征在于:所述设置Grub引导装载程序的密码的具体方法包括:首先实现Grub引导装载程序加密的用户交互接口,由后端程序获取加密口令,为bootloader对象设置加密口令值,并将加密口令写入配置文件;所述供用户输入内核参数的接口可供用户输入自定义的内核参数,后端程序接收用户输入的内核参数值,并格式化该内核参数;bootloader对象具有内核参数的属性args,将该些内核参数列表赋值给args属性,在安装修复Grub弓丨导装载程序时,将这些内核参数写入到Grub引导装载程序的配置文件;所述设置Grub引导装载程序的安装位置的具体方法包括:提供选择安装位置的用户接口,包括安装到MBR或安装到引导分区的第一个扇区,由后端程序获取位置信息,并对bootloader对象的安装位置属性设置值,在执行安装修复Grub引导装载程序 7. The method according to claim 6, wherein: the specific method of password Grub the boot loader is provided comprising: first to achieve Grub boot loader encrypted user interactive interface, encrypted password by the backend, as bootloader target value set encryption password and the encrypted password to the configuration file; the kernel parameters for the input user interface for user input from the kernel parameters defined, the program receives the rear end of the kernel parameter values ​​entered by the user, and the format kernel parameters; args property objects having the bootloader kernel parameters, the list of kernel parameters assigned to these attributes args, when installing the repair Grub guide arch Shu loader, the kernel writes the parameters to Grub boot loader configuration file; the said boot mounting position provided Grub loader specific method comprising: providing a user interface to select the installation position, including the MBR or mounted to the first sector of the boot partition, by the backend application acquires position information, and the object bootloader property settings installation location, the installation in the repair Grub bootloader 程中,安装程序依据该属性值,将Grub引导装载程序安装到指定的位置。 Process, the installer according to the attribute value, the boot loader installed Grub to a specified location.
  8. 8.如权利要求5所述的方法,其特征在于,所述步骤3)的在用户完成配置后,将每个选项关联到与每个配置选项对应的Grub相关参数,即为Grub引导装载程序设置参数值,完成修复Grub引导装载程序的配置工作。 8. The method according to claim 5, wherein said step 3) after completion of the user configuration, the option to associate each Grub parameters corresponding to each configuration option, i.e. the boot loader Grub setting a parameter value, the repair work is completed configuration Grub boot loader.
  9. 9.如权利要求2所述的方法,其特征在于,所述步骤4)是由instbootloader函数调用bootloader. py的writeBootloader接口,根据安装Grub引导装载程序的配置参数将配置CN 102419710 A_权禾丨J 要求书_2/2页好的Grub引导装载程序安装在指定的位置,完成对受损Grub引导装载程序的配置工作。 9. The method according to claim 2, wherein said step 4) is invoked by the bootloader instbootloader function. Py writeBootloader of interfaces, depending on the configuration parameters mounted Grub boot loader configuration CN 102419710 A_ weights Wo Shu J claims _2 / 2 good Grub boot loader installed in the specified position, the configuration is completed damaged Grub boot loader.
  10. 10.如权利要求2所述的方法,其特征在于,所述方法还包括在完成修复Grub弓I导装载程序后退出安装程序的步骤。 10. The method according to claim 2, wherein said method further comprises the step of after completion of the repair Grub loader exit guide bow I installer.
CN 201010294581 2010-09-28 2010-09-28 Method for repairing Grub boot loader based on Anaconda CN102419710B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010294581 CN102419710B (en) 2010-09-28 2010-09-28 Method for repairing Grub boot loader based on Anaconda

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010294581 CN102419710B (en) 2010-09-28 2010-09-28 Method for repairing Grub boot loader based on Anaconda

Publications (2)

Publication Number Publication Date
CN102419710A true true CN102419710A (en) 2012-04-18
CN102419710B CN102419710B (en) 2014-05-28

Family

ID=45944131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010294581 CN102419710B (en) 2010-09-28 2010-09-28 Method for repairing Grub boot loader based on Anaconda

Country Status (1)

Country Link
CN (1) CN102419710B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6385766B1 (en) * 1999-05-20 2002-05-07 Dell Usa L.P. Method and apparatus for windows-based installation for installing software on build-to-order computer systems
CN1932765A (en) * 2005-09-15 2007-03-21 英业达股份有限公司 Method for setting operating system with additional drive program and structure
TW200823652A *

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200823652A *
US6385766B1 (en) * 1999-05-20 2002-05-07 Dell Usa L.P. Method and apparatus for windows-based installation for installing software on build-to-order computer systems
CN1932765A (en) * 2005-09-15 2007-03-21 英业达股份有限公司 Method for setting operating system with additional drive program and structure

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
白伸伸: "使用多重启动管理器GRUB引导Linux系统", 《甘肃科技纵横》, vol. 35, no. 6, 31 December 2007 (2007-12-31), pages 21 - 22 *

Also Published As

Publication number Publication date Type
CN102419710B (en) 2014-05-28 grant

Similar Documents

Publication Publication Date Title
US6222537B1 (en) User interface controls for a computer system
US6658622B1 (en) Self-diagnosing and self-correcting data entry components with dependency behavior
US6341359B1 (en) Self-diagnosing and self correcting data entry components
US20100287525A1 (en) Extension through visual reflection
US20050223373A1 (en) Method for updating the firmware of a device
US6910208B1 (en) System and method of providing replaceable and extensible user interface for the installation of a suite of applications
US20070271552A1 (en) System and method for packaging software
US20030191559A1 (en) System and method for generating a set of robot commands based on user entry events in a user interface
US20040153733A1 (en) Method and system for operating system recovery and method of using build-to-configuration mode to model computer system
US20060075359A1 (en) System and method for managing a floating window
US7197743B2 (en) Method for generating computer software for embedded systems
US20070245339A1 (en) Creating documentation screenshots on demand
US20110131398A1 (en) Generating device-specific configurations
US20050065993A1 (en) Job network configuration file creating device and creating method
US20030237026A1 (en) Target device-specific syntax and semantic analysis for a graphical program
US20070198996A1 (en) System and method for driving peripheral devices
US20070074184A1 (en) System and method for creating and using graphical object instances in a statechart environment
US20040098639A1 (en) Debugging kernel-loadable modules and suspending and replacing functions in non-microkernel operating systems
US20040193738A1 (en) System and method for configuring hardware devices using a menu for platforms with EFI and legacy option-roms
US20050091615A1 (en) Gui application development supporting device, gui display device, method, and computer program
US6473771B1 (en) Method of integrating application programs to form or modify suite, and a suite integration toolkit to perform same
US7562029B2 (en) Integrated project management and development environment for determining the time expended on project tasks
US20110072424A1 (en) System for creating virtual application, method for installing virtual application, method for calling native api and method for executing virtual application
CN101957793A (en) Android and android derivative system-oriented method for playing back software operation record
US20060123223A1 (en) Persistent memory manipulation using EFI

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model