Skip to content

Commit

Permalink
Merge pull request #84 from herpiko/update4
Browse files Browse the repository at this point in the history
Add global environment variable. Minor fixes.
  • Loading branch information
herpiko authored Jul 26, 2016
2 parents 791705d + 19a4cdc commit 23cf76a
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 43 deletions.
2 changes: 1 addition & 1 deletion scripts/b-i-install-grub
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ else
BOOT_TARGET="--boot-directory=/target/boot"
fi
mount $EFI_PARTITION /target/boot/efi
OPT="--recheck --efi-directory=/target/boot/efi --root-directory=/target $BOOT_TARGET $DEVICE"
OPT="--recheck --bootloader-id=Xecure --efi-directory=/target/boot/efi --root-directory=/target $BOOT_TARGET $DEVICE"
# Expose it, for debugging purpose
echo $OPT
/usr/sbin/grub-install $OPT
Expand Down
5 changes: 3 additions & 2 deletions scripts/b-i-setup-fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ then
echo "/dev/mapper/lvm-swap none swap sw 0 0" >> $ROOTFS/target/etc/fstab
echo "$BOOT /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2" >> $ROOTFS/target/etc/fstab

# echo "Adding more module to initramfs"
# Adding more module to initramfs
echo "aes-i586" >> $ROOTFS/target/etc/initramfs-tools/modules
echo "dm-crypt" >> $ROOTFS/target/etc/initramfs-tools/modules
echo "dm-mod" >> $ROOTFS/target/etc/initramfs-tools/modules
echo "sha256" >> $ROOTFS/target/etc/initramfs-tools/modules


# Inject global envar
echo "CRYPTSETUP=y" >> $ROOTFS/target/etc/environment
fi

###### CLEAN UP PACKAGES
Expand Down
4 changes: 3 additions & 1 deletion scripts/b-i-wipe-disk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

DEVICE=$1

# Unmount existing the physical volumme
set +e
# Remove existing the root vg
dmsetup remove root
# Unmount existing the physical volumme
PREFIX=VGName
LVM=`pvdisplay | grep "VG Name" | tr -d '[[:space:]]' | sed "s/^$PREFIX//"`
/sbin/vgremove $LVM -f
Expand Down
2 changes: 1 addition & 1 deletion src/installer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public class Installation : GLib.Object {
Parted.get_devices (false); // re-read devices and partitions

Device dev_init = new Device.from_name(device_path);
uint64 start_after_esp_bios_grub = dev_init.initialize_esp_bios_grub();
uint64 start_after_esp_bios_grub = dev_init.initialize_esp_bios_grub(secureInstall);
if (advancedMode == true) {


Expand Down
11 changes: 9 additions & 2 deletions src/parted.vala
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,14 @@ public class Device : GLib.Object {
}
}

public uint64 initialize_esp_bios_grub () {
public uint64 initialize_esp_bios_grub (bool secureInstall) {
// TODO : Detect existing bios_grub partition
bool is_gpt = (disk.type.name == "gpt");
// if this is an uefi system and there is no partition
ArrayList<string> efi_partitions = EfiCollector.get_partitions ();
var start = (uint64) 1;
ArrayList<string> efipartitions = EfiCollector.get_partitions ();
if ((EfiCollector.is_efi_system () && efipartitions.is_empty) || emptyLabel == true || (is_gpt && efipartitions.is_empty)) {
if ((EfiCollector.is_efi_system () && efipartitions.is_empty) || emptyLabel == true || (is_gpt && efipartitions.is_empty) || secureInstall) {
stdout.printf ("Creating EFI partition in initialze_esp_bios\n");
var esp_fs = new Ped.FileSystemType("");
var esp_end = (uint64) ((start + (100 * 1024 * 1024))/ get_unit_size ());
Expand All @@ -425,6 +425,13 @@ public class Device : GLib.Object {
start = esp_end + get_unit_size ();
return start;
} else {
// For debugging purpose
stdout.printf ("Not creating any esp partition\n");
if (secureInstall) {
stdout.printf ("This is a secure installation\n");
} else {
stdout.printf ("This isn't a secure installation\n");
}
return 0;
}
}
Expand Down
Loading

0 comments on commit 23cf76a

Please sign in to comment.