Skip to content

Commit

Permalink
Latest enchantments for EFI setup
Browse files Browse the repository at this point in the history
- Grow bios-boot partition to make room for EFI
- Set type to esp type in case efi is detected
- Rsync from mounted iso instead of live system
  • Loading branch information
mudler committed Feb 7, 2021
1 parent a4c8afa commit c49381e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: "unattended-install"
category: mocaccino
version: "0.13"
version: "0.14"

requires:
- name: gptfdisk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -e

DISTRO=/tmp/mnt/image

cat <<'EOF'
/~\
Expand Down Expand Up @@ -62,8 +62,8 @@ if [ -n "$ROOTFS_PACKAGES" ]; then
echo "Installing packages ${ROOTFS_PACKAGES}"
luet_install "${TARGET}" "$ROOTFS_PACKAGES"
else
echo "Rsyncing / to ${TARGET}"
rsync -aqz --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' / ${TARGET}
echo "Copying MocaccinoOS to ${TARGET}"
rsync -aqz --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' ${DISTRO}/ ${TARGET}
fi

if [ -n "$TO_REMOVE" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dd if=/dev/zero of=${INSTALL_DEVICE} bs=4M count=100

sgdisk \
-n 1:0:+128M -t 1:8300 -c 1:"linux-boot" \
-n 2:0:+32M -t 2:ef02 -c 2:"bios-boot" \
-n 2:0:+200M -t 2:ef02 -c 2:"bios-boot" \
-n 3:0:+1G -t 3:8200 -c 3:"swap" \
-n 4:0:0 -t 4:8300 -c 4:"linux-root" \
-p ${INSTALL_DEVICE}
Expand All @@ -32,6 +32,8 @@ sync
mkfs.ext2 ${INSTALL_DEVICE}1
mkfs.ext4 ${INSTALL_DEVICE}4
if [ -e "/sys/firmware/efi" ]; then
modprobe efivars
sgdisk -t 2:ef00 ${INSTALL_DEVICE}
mkfs.vfat ${INSTALL_DEVICE}2
fi
mkswap ${INSTALL_DEVICE}3 && swapon ${INSTALL_DEVICE}3
Expand Down

0 comments on commit c49381e

Please sign in to comment.