37 lines
940 B
Bash
Executable File
37 lines
940 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
DRIVE=/dev/nvme1n1
|
|
bs=2048 # 4096
|
|
#VERSION=42
|
|
MOUNTPOINT=/mnt/gentoo
|
|
|
|
sgdisk --zap-all ${DRIVE}
|
|
sgdisk -o ${DRIVE}
|
|
sgdisk -a ${bs} -n 1:0:+1G --typecode=1:ef00 ${DRIVE}
|
|
sgdisk -a ${bs} -n 2:0:+8G --typecode=2:8200 ${DRIVE}
|
|
sgdisk -a ${bs} --largest-new=3 --typecode=3:8300 ${DRIVE}
|
|
|
|
mkfs.vfat ${DRIVE}p1
|
|
mkswap --force ${DRIVE}p2
|
|
mkfs.xfs -f ${DRIVE}p3
|
|
|
|
mount ${DRIVE}p3 ${MOUNTPOINT}
|
|
mkdir ${MOUNTPOINT}/{boot,dev,sys,proc,run}
|
|
mkdir ${MOUNTPOINT}/boot/efi
|
|
mount ${DRIVE}p1 ${MOUNTPOINT}/boot/efi
|
|
|
|
# mount --bind /dev ${MOUNTPOINT}/dev
|
|
# mount --bind /sys ${MOUNTPOINT}/sys
|
|
# mount --bind /proc ${MOUNTPOINT}/proc
|
|
# mount --bind /run ${MOUNTPOINT}/run
|
|
|
|
mount --types proc /proc ${MOUNTPOINT}/proc
|
|
mount --rbind /sys ${MOUNTPOINT}/sys
|
|
mount --make-rslave ${MOUNTPOINT}/sys
|
|
mount --rbind /dev ${MOUNTPOINT}/dev
|
|
mount --make-rslave ${MOUNTPOINT}/dev
|
|
mount --bind /run ${MOUNTPOINT}/run
|
|
mount --make-slave ${MOUNTPOINT}/run
|