Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 56855 Details for
Bug 89683
patch to improve make.conf marking, and add an option to install a precompiled kernel
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
expand the previous patch to include also addition for installing a precompiled kernel
gli.patch (text/plain), 9.09 KB, created by
Marko Djukic
on 2005-04-21 10:46:43 UTC
(
hide
)
Description:
expand the previous patch to include also addition for installing a precompiled kernel
Filename:
MIME Type:
Creator:
Marko Djukic
Created:
2005-04-21 10:46:43 UTC
Size:
9.09 KB
patch
obsolete
>Index: GLIArchitectureTemplate.py >=================================================================== >RCS file: /var/cvsroot/gentoo/src/installer/src/GLIArchitectureTemplate.py,v >retrieving revision 1.97 >diff -u -r1.97 GLIArchitectureTemplate.py >--- GLIArchitectureTemplate.py 17 Apr 2005 05:57:11 -0000 1.97 >+++ GLIArchitectureTemplate.py 21 Apr 2005 17:34:39 -0000 >@@ -163,14 +163,14 @@ > if not file[i][0] == '#': > file[i] = '#' + file[i] > >- file.append('\n# Added by GLI\n') >- commentprefix = "" >- if newvalues[key] == "COMMENT" or newvalues[key] == "##comment##": >- commentprefix = "#" >- if quotes_around_value: >- file.append(commentprefix + key + delimeter + '"' + newvalues[key] + '"\n') >+ if key == "SPACER": >+ file.append('\n') >+ elif key == "COMMENT" or key == "##comment##": >+ file.append('# ' + newvalues[key] + '\n') >+ elif quotes_around_value: >+ file.append(key + delimeter + '"' + newvalues[key] + '"\n') > else: >- file.append(commentprefix + key + delimeter + newvalues[key]+'\n') >+ file.append(key + delimeter + newvalues[key]+'\n') > > f = open(filename,'w') > f.writelines(file) >@@ -349,7 +349,11 @@ > def configure_make_conf(self): > # Get make.conf options > options = self._install_profile.get_make_conf() >- >+ >+ if options.keys(): >+ self._edit_config(self._chroot_dir + "/etc/make.conf", {"SPACER": ""}) >+ self._edit_config(self._chroot_dir + "/etc/make.conf", {"COMMENT": "GLI additions ===>"}) >+ > # For each configuration option... > for key in options.keys(): > >@@ -357,6 +361,9 @@ > self._edit_config(self._chroot_dir + "/etc/make.conf", {key: options[key]}) > self._logger.log("Make.conf configured") > >+ if options.keys(): >+ self._edit_config(self._chroot_dir + "/etc/make.conf", {"COMMENT": "<=== End GLI additions"}) >+ > ## > # This will get/update the portage tree. If you want to snapshot or mount /usr/portage use "custom". > def install_portage_tree(self): >@@ -446,6 +453,7 @@ > ## > # Fetches desired kernel sources, unless you're using a livecd-kernel in which case it does freaky stuff. > def emerge_kernel_sources(self): >+ self._logger.log("Starting emerge_kernel") > > kernel_pkg = self._install_profile.get_kernel_source_pkg() > # if kernel_pkg: >@@ -509,12 +517,7 @@ > self._logger.log("Genkernel emerged. Beginning kernel compile.") > # Null the genkernel_options > genkernel_options = "" >- >- # If the uri for the kernel config is not null, then >- if kernel_config_uri != "": >- GLIUtility.get_uri(kernel_config_uri, self._chroot_dir + "/root/kernel_config") >- genkernel_options = genkernel_options + " --kernel-config=/root/kernel_config" >- >+ > # Decide whether to use bootsplash or not > if self._install_profile.get_kernel_bootsplash(): > genkernel_options = genkernel_options + " --bootsplash" >@@ -567,7 +570,28 @@ > exitstatus = GLIUtility.spawn("rm "+self._chroot_dir+"/root/kernel_script") > #it's not important if this fails. > self._logger.log("Custom kernel complete") >- >+ >+ >+ ## >+ # Installs an already compiled kernel, fetching it from a given URI and >+ # optionally an initrd and the bootloader configuration. >+ def install_kernel(self): >+ self._logger.log("Installing precompiled kernel") >+ >+ # Get the uri to the compiled kernel >+ kernel_compiled_uri = self._install_profile.get_kernel_compiled_uri() >+ if kernel_compiled_uri == "": >+ raise GLIException("KernelInstallError", 'fatal', 'install_kernel', "No specified uri from where to install the kernel!") >+ >+ self._logger.log("Found compiled kernel uri " + kernel_compiled_uri) >+ # Copy the kernel tarball to /mnt/gentoo/tmp for extraction. We use >+ # this temp directory since the current ramdisk /tmp may get quickly >+ # filled up. >+ if (GLIUtility.fetch_and_unpack_tarball(kernel_compiled_uri, self._chroot_dir, temp_directory=self._chroot_dir + "/tmp")) == False: >+ raise GLIException("KernelInstallError", 'fatal', 'install_kernel', "Could not fetch the precompiled kernel!") >+ self._logger.log(kernel_compiled_uri + " was unpacked into " + self._chroot_dir + ".") >+ >+ > ## > # Installs and sets up logging daemon on the new system. adds to runlevel too. > def install_logging_daemon(self): >Index: GLIInstallProfile.py >=================================================================== >RCS file: /var/cvsroot/gentoo/src/installer/src/GLIInstallProfile.py,v >retrieving revision 1.43 >diff -u -r1.43 GLIInstallProfile.py >--- GLIInstallProfile.py 14 Apr 2005 18:35:38 -0000 1.43 >+++ GLIInstallProfile.py 21 Apr 2005 17:34:40 -0000 >@@ -40,6 +40,7 @@ > parser.addHandler('gli-profile/cron-daemon', self.set_cron_daemon_pkg) > parser.addHandler('gli-profile/root-pass-hash', self.set_root_pass_hash) > parser.addHandler('gli-profile/kernel-config', self.set_kernel_config_uri) >+ parser.addHandler('gli-profile/kernel-compiled', self.set_kernel_compiled_uri) > parser.addHandler('gli-profile/domainname', self.set_domainname) > parser.addHandler('gli-profile/portage-snapshot', self.set_portage_tree_snapshot_uri) > parser.addHandler('gli-profile/time-zone', self.set_time_zone) >@@ -74,6 +75,7 @@ > self._boot_loader_pkg = "" > self._kernel_modules = [] > self._kernel_config_uri = "" >+ self._kernel_compiled_uri = "" > self._bootloader_kernel_args = "" > self._kernel_initrd = True > self._kernel_bootsplash = False >@@ -255,6 +257,30 @@ > > ## > # Brief description of function >+ def get_kernel_compiled_uri(self): >+ "returns kernel_compiled_uri" >+ return self._kernel_compiled_uri >+ >+ ## >+ # Brief description of function >+ # @param xml_path Used internally by the XML parser. Should be None when calling directly >+ # @param kernel_config_uri Parameter description >+ # @param xml_attr Parameter description >+ def set_kernel_compiled_uri(self, xml_path, kernel_compiled_uri, xml_attr): >+ "kernel_compiled_uri is a string that is the path to the compiled kernel tarball file you wish to use. The tarball should contain both the kernel and the initrd, as well as any kernel modules. Can also be a http:// or ftp:// path." >+ >+ # Check type >+ if type(kernel_compiled_uri) != str: >+ raise GLIException("KernelCompiledURIError", 'fatal', 'set_kernel_compiled_uri', "Must be a string!") >+ >+ # Check validity (now done in the FE) >+ #if not (kernel_config_uri): >+ # raise GLIException("KernelCompiledURIError", 'fatal', 'set_kernel_config_uri', "Empty Kernel URI!") >+ >+ self._kernel_compiled_uri = kernel_compiled_uri >+ >+ ## >+ # Brief description of function > def get_bootloader_kernel_args(self): > "returns kernel arguments" > return self._bootloader_kernel_args >@@ -841,6 +867,7 @@ > 'boot-loader_mbr': self.get_boot_loader_mbr, > 'boot-loader': self.get_boot_loader_pkg, > 'kernel-config': self.get_kernel_config_uri, >+ 'kernel-compiled': self.get_kernel_compiled_uri, > 'kernel-initrd': self.get_kernel_initrd, > 'bootloader-kernel-args': self.get_bootloader_kernel_args, > 'kernel-bootsplash': self.get_kernel_bootsplash, >Index: GLIUtility.py >=================================================================== >RCS file: /var/cvsroot/gentoo/src/installer/src/GLIUtility.py,v >retrieving revision 1.48 >diff -u -r1.48 GLIUtility.py >--- GLIUtility.py 14 Apr 2005 15:44:03 -0000 1.48 >+++ GLIUtility.py 21 Apr 2005 17:34:40 -0000 >@@ -441,7 +441,8 @@ > tarball_filename = tarball_uri.split("/")[-1] > > # Get the tarball >- get_uri(tarball_uri, temp_directory + "/" + tarball_filename) >+ if (get_uri(tarball_uri, temp_directory + "/" + tarball_filename)) == 0: >+ return False > > # Reset tar options > tar_options = "xv" >@@ -462,7 +463,7 @@ > exitstatus = spawn("tar -" + tar_options + " -f " + temp_directory + "/" + tarball_filename + " -C " + target_directory, display_on_tty8=True, logfile="/tmp/compile_output.log", append_log=True) # change this to the logfile variable > > if not exitsuccess(exitstatus): >- raise GLIException("UnpackTarballError", 'fatal', 'fetch_and_unpack_tarball',"Could not unpack tarball!") >+ raise GLIException("UnpackTarballError", 'fatal', 'fetch_and_unpack_tarball', "Could not unpack tarball!") > > > def generate_random_password(): >Index: tests/install.py >=================================================================== >RCS file: /var/cvsroot/gentoo/src/installer/src/tests/install.py,v >retrieving revision 1.5 >diff -u -r1.5 install.py >--- tests/install.py 8 Jan 2005 09:35:01 -0000 1.5 >+++ tests/install.py 21 Apr 2005 17:34:40 -0000 >@@ -21,6 +21,7 @@ > print "\ttimezone set timezone" > print "\temerge_kernel install the kernel sources" > print "\tbuild_kernel build the kernel" >+ print "\tinstall_kernel install just the kernel" > print "\tlogger install logger" > print "\tcrond install cron daemon" > print "\tfstools install filesystem tools" >@@ -68,6 +69,7 @@ > 'timezone': archtemplate.set_timezone, > 'emerge_kernel': archtemplate.emerge_kernel_sources, > 'build_kernel': archtemplate.build_kernel, >+ 'install_kernel': archtemplate.install_kernel, > 'logger': archtemplate.install_logging_daemon, > 'crond': archtemplate.install_cron_daemon, > 'fstools': archtemplate.install_filesystem_tools,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 89683
:
56686
|
56855
|
57287
|
57383