Get some changes from Neon to make some of our awful hacks much cleaner.

ubuntu/focal
Simon Quigley 6 years ago
parent 912a94ead5
commit 88e201e0c8

@ -1,4 +1,5 @@
lubuntu/calamares.desktop etc/skel/Desktop/
lubuntu/calamares-logs-helper usr/bin/
lubuntu/branding/ etc/calamares/
lubuntu/modules/ etc/calamares/
lubuntu/settings.conf etc/calamares/

1
debian/changelog vendored

@ -2,6 +2,7 @@ calamares-settings-ubuntu (11) UNRELEASED; urgency=medium
* Add a machineid file.
* Ensure that /bin/bash is always the default shell.
* Clean up awful hacks.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 20 Jul 2018 09:43:15 -0500

@ -0,0 +1,24 @@
#!/bin/sh
set -ex
root=$1
install_dir=$root/var/log/installer
[ -d $install_dir ] || mkdir -p $install_dir
cp /home/neon/.cache/calamares/session.log $install_dir/debug
cp /cdrom/.disk/info $install_dir/media-info
cp /var/log/casper.log $install_dir/casper.log
cp /var/log/syslog $install_dir/syslog
gzip --stdout $root/var/lib/dpkg/status > $install_dir/initial-status.gz
# OEM id isn't a thing, when in OEM mode ubiquity would also archive that.
# https://github.com/calamares/calamares/issues/943
chmod -v 600 $install_dir/*
# Make these world readable, they can absolutely not contain anything relevant
# to security.
chmod -v 644 $install_dir/initial-status.gz
chmod -v 644 $install_dir/media-info

@ -0,0 +1,17 @@
# Workaround from ubiquity. Ubuntu's grub will want to look in EFI/ubuntu, so
# let's make sure it can find something there.
# This only copies the cfg and doesn't overwrite, this is specifically so
# this doesn't interfere with an Ubuntu installed on the system already.
---
dontChroot: false
timeout: 120
firmwareType:
efi:
# grub hack
- -mkdir /boot/efi/EFI/ubuntu
- -cp /boot/efi/EFI/lubuntu/grub.cfg /boot/efi/EFI/ubuntu/
# normal user setup
- -for i in `ls @@ROOT@@/home/`; do rm @@ROOT@@/home/$i/Desktop/calamares.desktop || exit 0; done
bios:
# normal user setup
- -for i in `ls @@ROOT@@/home/`; do rm @@ROOT@@/home/$i/Desktop/calamares.desktop || exit 0; done

@ -0,0 +1,17 @@
# Make sure the correct bootloader package is installed for EFI.
# Also pull in shim so secureboot has a chance at working.
---
firmwareType:
efi:
- command: apt-cdrom add -m -d=/media/cdrom/
timeout: 10
- command: apt-get update
timeout: 120
- command: apt install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict grub-efi-amd64-signed
timeout: 300
- command: apt install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict shim-signed
timeout: 300
- command: sed -i '/deb cdrom/d' /etc/apt/sources.list
timeout: 10
- command: apt-get update
timeout: 120

@ -0,0 +1,12 @@
---
dontChroot: true
timeout: 10
firmwareType:
efi:
- -cp /cdrom/casper/vmlinuz @@ROOT@@/boot/vmlinuz-$(uname -r)
- -cp /cdrom/casper/initrd @@ROOT@@/boot/initrd.img-$(uname -r)
- -mkdir -pv @@ROOT@@/media/cdrom
- -mount --bind /cdrom @@ROOT@@/media/cdrom
bios:
- -cp /cdrom/casper/vmlinuz @@ROOT@@/boot/vmlinuz-$(uname -r)
- -cp /cdrom/casper/initrd @@ROOT@@/boot/initrd.img-$(uname -r)

@ -0,0 +1,21 @@
extraMounts:
- device: proc
fs: proc
mountPoint: /proc
- device: sys
fs: sysfs
mountPoint: /sys
- device: /dev
mountPoint: /dev
options: bind
- device: tmpfs
fs: tmpfs
mountPoint: /run
- device: /run/udev
mountPoint: /run/udev
options: bind
extraMountsEfi:
- device: efivarfs
fs: efivarfs
mountPoint: /sys/firmware/efi/efivars

@ -1,6 +0,0 @@
dontChroot: true
timeout: 300
script:
- "cp /cdrom/casper/vmlinuz @@ROOT@@/boot/vmlinuz-$(uname -r)"
- "[ -d /sys/firmware/efi ] && mkdir -pv @@ROOT@@/media/cdrom && mount --bind /cdrom @@ROOT@@/media/cdrom && chroot @@ROOT@@ apt-cdrom add -m -d=/media/cdrom/ && chroot @@ROOT@@ sed -e '/deb http/ s/^#*/#/' -i /etc/apt/sources.list && chroot @@ROOT@@ apt update && chroot @@ROOT@@ apt -y install grub-efi && chroot @@ROOT@@ sed -i 's/#deb/deb/' /etc/apt/sources.list && sed -i '/deb cdrom/d' @@ROOT@@/etc/apt/sources.list && umount @@ROOT@@/media/cdrom && rmdir @@ROOT@@/media/cdrom || exit 0"
- "for i in `ls @@ROOT@@/home/`; do rm @@ROOT@@/home/$i/Desktop/calamares.desktop || exit 0; done"

@ -0,0 +1,5 @@
---
dontChroot: true
timeout: 30
script:
- calamares-logs-helper @@ROOT@@

@ -1,6 +1,20 @@
---
modules-search: [ local ]
instances:
- id: before_bootloader_mkdirs
module: contextualprocess
config: before_bootloader_mkdirs_context.conf
- id: before_bootloader
module: contextualprocess
config: before_bootloader_context.conf
- id: after_bootloader
module: contextualprocess
config: after_bootloader_context.conf
- id: logs
module: shellprocess
config: shellprocess_logs.conf
sequence:
- show:
- welcome
@ -22,12 +36,13 @@ sequence:
- displaymanager
- networkcfg
- hwclock
- services
- shellprocess
- initramfs
- grubcfg
- contextualprocess@before_bootloader_mkdirs
- contextualprocess@before_bootloader
- bootloader
- contextualprocess@after_bootloader
- packages
- shellprocess@logs
- umount
- show:
- finished

Loading…
Cancel
Save