Kaydet (Commit) 237b8e57 authored tarafından sulincix's avatar sulincix

remove debian-like stuff

üst 35dd925d
...@@ -294,9 +294,9 @@ class InstallerWindow: ...@@ -294,9 +294,9 @@ class InstallerWindow:
self.wizard_pages[self.PAGE_USER] = WizardPage( self.wizard_pages[self.PAGE_USER] = WizardPage(
("User account"), "avatar-default-symbolic", ("Who are you?")) ("User account"), "avatar-default-symbolic", ("Who are you?"))
self.wizard_pages[self.PAGE_TYPE] = WizardPage( self.wizard_pages[self.PAGE_TYPE] = WizardPage(
("Installation Type"), "drive-harddisk-system-symbolic", ("Where do you want to install LMDE?")) ("Installation Type"), "drive-harddisk-system-symbolic", ("Where do you want to install Sulin?"))
self.wizard_pages[self.PAGE_PARTITIONS] = WizardPage( self.wizard_pages[self.PAGE_PARTITIONS] = WizardPage(
("Partitioning"), "drive-harddisk-system-symbolic", ("Where do you want to install LMDE?")) ("Partitioning"), "drive-harddisk-system-symbolic", ("Where do you want to install Sulin?"))
self.wizard_pages[self.PAGE_ADVANCED] = WizardPage( self.wizard_pages[self.PAGE_ADVANCED] = WizardPage(
("Advanced options"), "preferences-system-symbolic", "Configure the boot menu") ("Advanced options"), "preferences-system-symbolic", "Configure the boot menu")
self.wizard_pages[self.PAGE_OVERVIEW] = WizardPage( self.wizard_pages[self.PAGE_OVERVIEW] = WizardPage(
...@@ -315,9 +315,9 @@ class InstallerWindow: ...@@ -315,9 +315,9 @@ class InstallerWindow:
# Welcome page # Welcome page
self.builder.get_object("label_welcome1").set_text( self.builder.get_object("label_welcome1").set_text(
("Welcome to the LMDE Installer.")) ("Welcome to the Sulin Installer."))
self.builder.get_object("label_welcome2").set_text( self.builder.get_object("label_welcome2").set_text(
("This program will ask you some questions and set up LMDE on your computer.")) ("This program will ask you some questions and set up Sulin on your computer."))
# Language page # Language page
self.language_column.set_title(("Language")) self.language_column.set_title(("Language"))
...@@ -357,7 +357,7 @@ class InstallerWindow: ...@@ -357,7 +357,7 @@ class InstallerWindow:
self.builder.get_object("label_automated").set_text( self.builder.get_object("label_automated").set_text(
("Automated Installation")) ("Automated Installation"))
self.builder.get_object("label_automated2").set_text( self.builder.get_object("label_automated2").set_text(
("Erase a disk and install LMDE on it.")) ("Erase a disk and install Sulin on it."))
self.builder.get_object("label_disk").set_text(("Disk:")) self.builder.get_object("label_disk").set_text(("Disk:"))
self.builder.get_object("label_encrypt").set_text( self.builder.get_object("label_encrypt").set_text(
("Encrypt the operating system")) ("Encrypt the operating system"))
...@@ -370,7 +370,7 @@ class InstallerWindow: ...@@ -370,7 +370,7 @@ class InstallerWindow:
self.builder.get_object("label_manual").set_text( self.builder.get_object("label_manual").set_text(
("Manual Partitioning")) ("Manual Partitioning"))
self.builder.get_object("label_manual2").set_text( self.builder.get_object("label_manual2").set_text(
("Manually create, resize or choose partitions for LMDE.")) ("Manually create, resize or choose partitions for Sulin."))
self.builder.get_object("label_badblocks").set_text( self.builder.get_object("label_badblocks").set_text(
("Fill the disk with random data")) ("Fill the disk with random data"))
self.builder.get_object("check_badblocks").set_tooltip_text( self.builder.get_object("check_badblocks").set_tooltip_text(
......
...@@ -112,63 +112,6 @@ class InstallerEngine: ...@@ -112,63 +112,6 @@ class InstallerEngine:
os.system("mv /target/etc/resolv.conf /target/etc/resolv.conf.bk") os.system("mv /target/etc/resolv.conf /target/etc/resolv.conf.bk")
os.system("cp -f /etc/resolv.conf /target/etc/resolv.conf") os.system("cp -f /etc/resolv.conf /target/etc/resolv.conf")
kernelversion = subprocess.getoutput("uname -r")
os.system(
"cp /run/live/medium/live/vmlinuz /target/boot/vmlinuz-%s" % kernelversion)
found_initrd = False
for initrd in ["/run/live/medium/live/initrd.img", "/run/live/medium/live/initrd.lz"]:
if os.path.exists(initrd):
os.system("cp %s /target/boot/initrd.img-%s" %
(initrd, kernelversion))
found_initrd = True
break
if not found_initrd:
print("WARNING: No initrd found!!")
if self.setup.grub_device and self.setup.gptonefi:
print(" --> Installing signed boot loader")
os.system("mkdir -p /target/debs")
os.system(
"cp /run/live/medium/pool/main/g/grub2/grub-efi* /target/debs/")
os.system(
"cp /run/live/medium/pool/main/g/grub-efi-amd64-signed/* /target/debs/")
os.system("cp /run/live/medium/pool/main/s/shim*/* /target/debs/")
self.do_run_in_chroot("dpkg -i /debs/*")
os.system("rm -rf /target/debs")
print(" --> Installing microcode packages")
os.system("mkdir -p /target/debs")
os.system(
"cp /run/live/medium/pool/non-free/i/intel-microcode/* /target/debs/")
os.system(
"cp /run/live/medium/pool/non-free/a/amd64-microcode/* /target/debs/")
os.system("cp /run/live/medium/pool/contrib/i/iucode-tool/* /target/debs/")
self.do_run_in_chroot("dpkg -i /debs/*")
os.system("rm -rf /target/debs")
# Detect cdrom device
# TODO : properly detect cdrom device
# Mount it
# os.system("mkdir -p /target/media/cdrom")
# if (int(os.system("mount /dev/sr0 /target/media/cdrom"))):
# print " --> Failed to mount CDROM. Install will fail"
# self.do_run_in_chroot("apt-cdrom -o Acquire::cdrom::AutoDetect=false -m add")
# remove live-packages (or w/e)
print(" --> Removing live packages")
our_current += 1
self.update_progress(our_current, our_total, False,
False, ("Removing live configuration (packages)"))
with open("/run/live/medium/live/filesystem.packages-remove", "r") as fd:
line = fd.read().replace('\n', ' ')
self.do_run_in_chroot(
"apt-get remove --purge --yes --force-yes %s" % line)
# remove live leftovers
self.do_run_in_chroot("rm -rf /etc/live")
self.do_run_in_chroot("rm -rf /lib/live")
# add new user # add new user
print(" --> Adding new user") print(" --> Adding new user")
our_current += 1 our_current += 1
...@@ -588,54 +531,6 @@ class InstallerEngine: ...@@ -588,54 +531,6 @@ class InstallerEngine:
os.system("ln -s /usr/share/zoneinfo/%s /target/etc/localtime" % os.system("ln -s /usr/share/zoneinfo/%s /target/etc/localtime" %
self.setup.timezone) self.setup.timezone)
# localizing
print(" --> Localizing packages")
self.update_progress(our_current, our_total, False,
False, ("Localizing packages"))
if self.setup.language != "en_US":
os.system("mkdir -p /target/debs")
language_code = self.setup.language
if "_" in self.setup.language:
language_code = self.setup.language.split("_")[0]
l10ns = subprocess.getoutput(
"find /run/live/medium/pool | grep 'l10n-%s\\|hunspell-%s'" % (language_code, language_code))
for l10n in l10ns.split("\n"):
os.system("cp %s /target/debs/" % l10n)
self.do_run_in_chroot("dpkg -i /debs/*")
os.system("rm -rf /target/debs")
if os.path.exists("/etc/linuxmint/info"):
# drivers
print(" --> Installing drivers")
self.update_progress(our_current, our_total,
False, False, ("Installing drivers"))
# Broadcom
drivers = subprocess.getoutput("mint-drivers")
if "broadcom-sta-dkms" in drivers:
try:
os.system("mkdir -p /target/debs")
os.system(
"cp /run/live/medium/pool/non-free/b/broadcom-sta/*.deb /target/debs/")
self.do_run_in_chroot("dpkg -i /debs/*")
self.do_run_in_chroot("modprobe wl")
os.system("rm -rf /target/debs")
except:
print("Failed to install Broadcom drivers")
# NVIDIA
driver = "./resources/nvidia-driver.tar.gz"
if os.path.exists(driver):
if "install-nvidia" in subprocess.getoutput("cat /proc/cmdline"):
print(" --> Installing NVIDIA driver")
try:
self.do_run_in_chroot("tar zxvf %s" % driver)
self.do_run_in_chroot(
"DEBIAN_FRONTEND=noninteractive dpkg -i --force-depends nvidia-driver/*.deb")
self.do_run_in_chroot("rm -rf nvidia-driver")
except Exception as e:
print(("Failed to install NVIDIA driver: ", e))
# set the keyboard options.. # set the keyboard options..
print(" --> Setting the keyboard") print(" --> Setting the keyboard")
our_current += 1 our_current += 1
...@@ -685,10 +580,6 @@ class InstallerEngine: ...@@ -685,10 +580,6 @@ class InstallerEngine:
self.do_run_in_chroot( self.do_run_in_chroot(
"mv /etc/default/keyboard.new /etc/default/keyboard") "mv /etc/default/keyboard.new /etc/default/keyboard")
# Perform OS adjustments
if os.path.exists("/target/usr/lib/linuxmint/mintSystem/mint-adjust.py"):
self.do_run_in_chroot(
"/usr/lib/linuxmint/mintSystem/mint-adjust.py")
if self.setup.luks: if self.setup.luks:
self.do_run_in_chroot( self.do_run_in_chroot(
...@@ -717,9 +608,6 @@ class InstallerEngine: ...@@ -717,9 +608,6 @@ class InstallerEngine:
print(" --> Running grub-install") print(" --> Running grub-install")
self.do_run_in_chroot("grub-install --force %s" % self.do_run_in_chroot("grub-install --force %s" %
self.setup.grub_device) self.setup.grub_device)
# Remove memtest86+ package (it provides multiple memtest unwanted grub entries)
self.do_run_in_chroot(
"apt-get remove --purge --yes --force-yes memtest86+")
# fix not add windows grub entry # fix not add windows grub entry
self.do_run_in_chroot("update-grub") self.do_run_in_chroot("update-grub")
self.do_configure_grub(our_total, our_current) self.do_configure_grub(our_total, our_current)
...@@ -732,25 +620,6 @@ class InstallerEngine: ...@@ -732,25 +620,6 @@ class InstallerEngine:
"WARNING: The grub bootloader was not configured properly! You need to configure it manually.")) "WARNING: The grub bootloader was not configured properly! You need to configure it manually."))
break break
# recreate initramfs (needed in case of skip_mount also, to include things like mdadm/dm-crypt/etc in case its needed to boot a custom install)
print(" --> Configuring Initramfs")
our_current += 1
self.do_run_in_chroot("/usr/sbin/update-initramfs -t -u -k all")
self.do_run_in_chroot(
"/usr/share/debian-system-adjustments/systemd/adjust-grub-title")
kernelversion = subprocess.getoutput("uname -r")
self.do_run_in_chroot(
"/usr/bin/sha1sum /boot/initrd.img-%s > /var/lib/initramfs-tools/%s" % (kernelversion, kernelversion))
# Clean APT
print(" --> Cleaning APT")
our_current += 1
self.update_progress(our_current, our_total, True,
False, ("Cleaning APT"))
os.system("chroot /target/ /bin/sh -c \"dpkg --configure -a\"")
self.do_run_in_chroot(
"sed -i 's/^deb cdrom/#deb cdrom/' /etc/apt/sources.list")
self.do_run_in_chroot("apt-get -y --force-yes autoremove")
# now unmount it # now unmount it
print(" --> Unmounting partitions") print(" --> Unmounting partitions")
...@@ -797,18 +666,8 @@ class InstallerEngine: ...@@ -797,18 +666,8 @@ class InstallerEngine:
False, ("Checking bootloader")) False, ("Checking bootloader"))
print(" --> Checking Grub configuration") print(" --> Checking Grub configuration")
time.sleep(5) time.sleep(5)
found_entry = False
if os.path.exists("/target/boot/grub/grub.cfg"): if os.path.exists("/target/boot/grub/grub.cfg"):
self.do_run_in_chroot( return True
"/usr/share/debian-system-adjustments/systemd/adjust-grub-title")
grubfh = open("/target/boot/grub/grub.cfg", "r")
for line in grubfh:
line = line.rstrip("\r\n")
if ("menuentry" in line and ("class linuxmint" in line or "Linux Mint" in line or "LMDE" in line)):
found_entry = True
print(" --> Found Grub entry: %s " % line)
grubfh.close()
return (found_entry)
else: else:
print("!No /target/boot/grub/grub.cfg file found!") print("!No /target/boot/grub/grub.cfg file found!")
return False return False
......
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