Kaydet (Commit) 6b525c00 authored tarafından sulincix's avatar sulincix

fix more bug and add more bug

üst a11ba831
......@@ -498,68 +498,13 @@ class InstallerEngine:
our_current += 1
self.update_progress(our_current, our_total, False,
False, ("Setting keyboard options"))
consolefh = open("/target/etc/default/console-setup", "r")
newconsolefh = open("/target/etc/default/console-setup.new", "w")
for line in consolefh:
line = line.rstrip("\r\n")
if(line.startswith("XKBMODEL=")):
newconsolefh.write("XKBMODEL=\"%s\"\n" %
self.setup.keyboard_model)
elif(line.startswith("XKBLAYOUT=")):
newconsolefh.write("XKBLAYOUT=\"%s\"\n" %
self.setup.keyboard_layout)
elif(line.startswith("XKBVARIANT=") and self.setup.keyboard_variant is not None and self.setup.keyboard_variant != ""):
newconsolefh.write("XKBVARIANT=\"%s\"\n" %
self.setup.keyboard_variant)
else:
newconsolefh.write("%s\n" % line)
consolefh.close()
newconsolefh.close()
self.do_run_in_chroot("rm /etc/default/console-setup")
self.do_run_in_chroot(
"mv /etc/default/console-setup.new /etc/default/console-setup")
consolefh = open("/target/etc/default/keyboard", "r")
newconsolefh = open("/target/etc/default/keyboard.new", "w")
for line in consolefh:
line = line.rstrip("\r\n")
if(line.startswith("XKBMODEL=")):
newconsolefh.write("XKBMODEL=\"%s\"\n" %
self.setup.keyboard_model)
elif(line.startswith("XKBLAYOUT=")):
newconsolefh.write("XKBLAYOUT=\"%s\"\n" %
self.setup.keyboard_layout)
elif(line.startswith("XKBVARIANT=") and self.setup.keyboard_variant is not None and self.setup.keyboard_variant != ""):
newconsolefh.write("XKBVARIANT=\"%s\"\n" %
self.setup.keyboard_variant)
elif(line.startswith("XKBOPTIONS=")):
newconsolefh.write("XKBOPTIONS=grp:ctrls_toggle")
else:
newconsolefh.write("%s\n" % line)
consolefh.close()
newconsolefh.close()
self.do_run_in_chroot("rm /etc/default/keyboard")
self.do_run_in_chroot(
"mv /etc/default/keyboard.new /etc/default/keyboard")
if self.setup.luks:
self.do_run_in_chroot(
"echo aes-i586 >> /etc/initramfs-tools/modules")
self.do_run_in_chroot(
"echo aes_x86_64 >> /etc/initramfs-tools/modules")
self.do_run_in_chroot(
"echo dm-crypt >> /etc/initramfs-tools/modules")
self.do_run_in_chroot(
"echo dm-mod >> /etc/initramfs-tools/modules")
self.do_run_in_chroot("echo xts >> /etc/initramfs-tools/modules")
with open("/target/etc/default/grub.d/61_live-installer.cfg", "w") as f:
f.write("#! /bin/sh\n")
f.write("set -e\n\n")
f.write('GRUB_CMDLINE_LINUX="cryptdevice=%s:lvmlmde root=/dev/mapper/lvmlmde-root resume=/dev/mapper/lvmlmde-swap"\n' %
self.auto_root_physical_partition)
self.do_run_in_chroot(
"echo \"power/disk = shutdown\" >> /etc/sysfs.d/local.conf")
#TODO:keyboard layout support openrc
#newconsolefh = open("/etc/conf.d/keymaps", "w")
#newconsolefh.write("XKBMODEL=\"%s\"\n" % self.setup.keyboard_model)
#newconsolefh.write("keymap=\"%s\"\n" % self.setup.keyboard_layout)
#if(self.setup.keyboard_variant is not None and self.setup.keyboard_variant != ""):
# newconsolefh.write("extended_keymaps=\"%s\"\n" % self.setup.keyboard_variant)
#newconsolefh.close()
# write MBR (grub)
print(" --> Configuring Grub")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment