commit
ecc2d27a18
@ -44,8 +44,10 @@ install:
|
|||||||
- hwclock
|
- hwclock
|
||||||
- services
|
- services
|
||||||
# - initramfs
|
# - initramfs
|
||||||
|
- localecfg
|
||||||
- grubcfg
|
- grubcfg
|
||||||
- grub
|
- grub
|
||||||
|
#- bootloader
|
||||||
- umount
|
- umount
|
||||||
|
|
||||||
# Phase 3 - postinstall.
|
# Phase 3 - postinstall.
|
||||||
|
@ -35,7 +35,7 @@ def detect_firmware_type():
|
|||||||
fw_type = 'efi'
|
fw_type = 'efi'
|
||||||
else:
|
else:
|
||||||
fw_type = 'bios'
|
fw_type = 'bios'
|
||||||
|
|
||||||
libcalamares.globalstorage.insert("firmwareType", fw_type)
|
libcalamares.globalstorage.insert("firmwareType", fw_type)
|
||||||
libcalamares.utils.debug("Firmware type: {!s}".format(fw_type))
|
libcalamares.utils.debug("Firmware type: {!s}".format(fw_type))
|
||||||
|
|
||||||
@ -51,6 +51,7 @@ def get_uuid():
|
|||||||
return partition["uuid"]
|
return partition["uuid"]
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def create_conf(uuid, conf_path):
|
def create_conf(uuid, conf_path):
|
||||||
distribution = libcalamares.job.configuration["distribution"]
|
distribution = libcalamares.job.configuration["distribution"]
|
||||||
kernel = libcalamares.job.configuration["kernel"]
|
kernel = libcalamares.job.configuration["kernel"]
|
||||||
@ -76,6 +77,7 @@ def create_conf(uuid, conf_path):
|
|||||||
f.write(l)
|
f.write(l)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
def create_fallback(uuid, fallback_path):
|
def create_fallback(uuid, fallback_path):
|
||||||
distribution = libcalamares.job.configuration["distribution"]
|
distribution = libcalamares.job.configuration["distribution"]
|
||||||
kernel = libcalamares.job.configuration["kernel"]
|
kernel = libcalamares.job.configuration["kernel"]
|
||||||
@ -143,8 +145,10 @@ def install_bootloader(boot_loader, fw_type):
|
|||||||
create_loader(loader_path)
|
create_loader(loader_path)
|
||||||
else:
|
else:
|
||||||
install_path = boot_loader["installPath"]
|
install_path = boot_loader["installPath"]
|
||||||
check_chroot_call([libcalamares.job.configuration["grubInstall"], install_path])
|
check_chroot_call(
|
||||||
check_chroot_call([libcalamares.job.configuration["grubMkconfig"], "-o", libcalamares.job.configuration["grubCfg"]])
|
[libcalamares.job.configuration["grubInstall"], install_path])
|
||||||
|
check_chroot_call([libcalamares.job.configuration[
|
||||||
|
"grubMkconfig"], "-o", libcalamares.job.configuration["grubCfg"]])
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
62
src/modules/localecfg/main.py
Normal file
62
src/modules/localecfg/main.py
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# encoding: utf-8
|
||||||
|
# === This file is part of Calamares - <http://github.com/calamares> ===
|
||||||
|
#
|
||||||
|
# Copyright 2014, Anke Boersma <demm@kaosx.us>
|
||||||
|
#
|
||||||
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Calamares is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
import libcalamares
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
""" Create locale """
|
||||||
|
|
||||||
|
us = '#en_US'
|
||||||
|
# locale = libcalamares.globalstorage.value("localeSetting")
|
||||||
|
locale = 'en_US.UTF-8'
|
||||||
|
|
||||||
|
install_path = libcalamares.globalstorage.value("rootMountPoint")
|
||||||
|
|
||||||
|
# run locale-gen if detected
|
||||||
|
if os.path.exists('/etc/locale.gen'):
|
||||||
|
shutil.copy2('%s/etc/locale.gen.bak' %
|
||||||
|
(install_path), '%s/etc/locale.gen' % (install_path))
|
||||||
|
|
||||||
|
text = []
|
||||||
|
with open("%s/etc/locale.gen" % install_path, "r") as gen:
|
||||||
|
text = gen.readlines()
|
||||||
|
|
||||||
|
# always enable en_US
|
||||||
|
with open("%s/etc/locale.gen" % install_path, "w") as gen:
|
||||||
|
for line in text:
|
||||||
|
if us in line and line[0] == "#":
|
||||||
|
# uncomment line
|
||||||
|
line = line[1:]
|
||||||
|
if locale in line and line[0] == "#":
|
||||||
|
# uncomment line
|
||||||
|
line = line[1:]
|
||||||
|
gen.write(line)
|
||||||
|
|
||||||
|
libcalamares.utils.chroot_call(['locale-gen'])
|
||||||
|
print('locale.gen done')
|
||||||
|
|
||||||
|
locale_conf_path = os.path.join(install_path, "etc/locale.conf")
|
||||||
|
with open(locale_conf_path, "w") as locale_conf:
|
||||||
|
locale_conf.write('LANG=%s\n' % locale)
|
||||||
|
|
||||||
|
return None
|
5
src/modules/localecfg/module.desc
Normal file
5
src/modules/localecfg/module.desc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
type: "job"
|
||||||
|
name: "localecfg"
|
||||||
|
interface: "python"
|
||||||
|
script: "main.py"
|
Loading…
Reference in New Issue
Block a user