diff options
-rwxr-xr-x | artixinstall | 15 | ||||
-rwxr-xr-x | cryptinstall | 15 | ||||
-rwxr-xr-x | mkartix | 7 | ||||
-rwxr-xr-x | mkcryptartix | 11 |
4 files changed, 38 insertions, 10 deletions
diff --git a/artixinstall b/artixinstall index 6c4ea55..6fe1633 100755 --- a/artixinstall +++ b/artixinstall @@ -15,6 +15,7 @@ pacman -S --needed --noconfirm parted fzf # DRIVE=$1 +TARGET=$2 if [ -z "${DRIVE}" ]; then DRIVE="/dev/$(lsblk | grep disk | fzf --disabled | awk '{print $1}')" @@ -26,6 +27,18 @@ else PART_PREFIX="${DRIVE}" fi +if [ -z "${TARGET}" ]; then + echo -en "\e[1m\e[1;33mEnter GRUB target (commonly i386-pc): " + read TARGET + + echo -e "\e[0m" +fi + +if [ -z "${TARGET}" ]; then + echo -en "\e[1m\e[1;31mGRUB target must not be empty.\e[0m" + exit 1 +fi + parted -s ${DRIVE} mklabel msdos parted -s -a optimal ${DRIVE} mkpart primary ext4 0% 256MiB parted -s -a optimal ${DRIVE} mkpart primary btrfs 256MiB 100% @@ -47,7 +60,7 @@ rc-service ntpd start basestrap /mnt base base-devel openrc elogind-openrc vim man ntp ntp-openrc git basestrap /mnt linux linux-firmware -artix-chroot /mnt bash -c "curl -fsSL https://raw.githubusercontent.com/HimbeerserverDE/artixinstall/main/mkartix | sh -s -- ${DRIVE} ${PART_PREFIX}" +artix-chroot /mnt bash -c "curl -fsSL https://raw.githubusercontent.com/HimbeerserverDE/artixinstall/main/mkartix | sh -s -- ${DRIVE} ${PART_PREFIX} ${TARGET}" fstabgen -U /mnt >> /mnt/etc/fstab diff --git a/cryptinstall b/cryptinstall index b443abe..cac3acc 100755 --- a/cryptinstall +++ b/cryptinstall @@ -15,6 +15,7 @@ pacman -S --needed --noconfirm parted fzf # DRIVE=$1 +TARGET=$2 if [ -z "${DRIVE}" ]; then DRIVE="/dev/$(lsblk | grep disk | fzf --disabled | awk '{print $1}')" @@ -26,6 +27,18 @@ else PART_PREFIX="${DRIVE}" fi +if [ -z "${TARGET}" ]; then + echo -en "\e[1m\e[1;33mEnter GRUB target (commonly i386-pc): " + read TARGET + + echo -e "\e[0m" +fi + +if [ -z "${TARGET}" ]; then + echo -en "\e[1m\e[1;31mGRUB target must not be empty.\e[0m" + exit 1 +fi + # # Full Disk Encryption # @@ -61,7 +74,7 @@ rc-service ntpd start basestrap /mnt base base-devel openrc elogind-openrc vim man ntp ntp-openrc git basestrap /mnt linux linux-firmware -artix-chroot /mnt bash -c "curl -fsSL https://raw.githubusercontent.com/HimbeerserverDE/artixinstall/main/mkcryptartix | sh -s -- ${DRIVE} ${PART_PREFIX}" +artix-chroot /mnt bash -c "curl -fsSL https://raw.githubusercontent.com/HimbeerserverDE/artixinstall/main/mkcryptartix | sh -s -- ${DRIVE} ${PART_PREFIX} ${TARGET}" fstabgen -U /mnt >> /mnt/etc/fstab @@ -12,9 +12,10 @@ KEYMAP=$(get_cmdline keytable) DRIVE=$1 PART_PREFIX=$2 +TARGET=$3 -if [[ -z "${DRIVE}" ]] | [[ -z "${PART_PREFIX}" ]]; then - echo -e "\e[1m\e[1;31mUsage: mkartix <drive> <partition prefix>\e[0m" +if [[ -z "${DRIVE}" ]] | [[ -z "${PART_PREFIX}" ]] | [[ -z "${TARGET}" ]]; then + echo -e "\e[1m\e[1;31mUsage: mkartix <drive> <partition prefix> <target>\e[0m" exit 1 fi @@ -30,7 +31,7 @@ export LC_COLLATE="C" EOT pacman -S --needed --noconfirm btrfs-progs grub os-prober -grub-install --recheck ${DRIVE} +grub-install --recheck --target=${TARGET} ${DRIVE} grub-mkconfig -o /boot/grub/grub.cfg echo -en 'artix\nartix' | passwd diff --git a/mkcryptartix b/mkcryptartix index bd0d1e1..d32ca9c 100755 --- a/mkcryptartix +++ b/mkcryptartix @@ -12,9 +12,10 @@ KEYMAP=$(get_cmdline keytable) DRIVE=$1 PART_PREFIX=$2 +TARGET=$3 -if [[ -z "${DRIVE}" ]] | [[ -z "${PART_PREFIX}" ]]; then - echo -e "\e[1m\e[1;31mUsage: mkcryptartix <drive> <partition prefix>\e[0m" +if [[ -z "${DRIVE}" ]] | [[ -z "${PART_PREFIX}" ]] | [[ -z "${TARGET" ]]; then + echo -e "\e[1m\e[1;31mUsage: mkcryptartix <drive> <partition prefix> <target>\e[0m" exit 1 fi @@ -59,7 +60,7 @@ echo "artix" | cryptsetup -q luksAddKey ${PART_PREFIX}2 /crypto_keyfile.bin sed -i "s/FILES=()/FILES=(\/crypto_keyfile.bin)/" /etc/mkinitcpio.conf -grub-install --recheck ${DRIVE} +grub-install --recheck --target=${TARGET} ${DRIVE} grub-mkconfig -o /boot/grub/grub.cfg mkinitcpio -p linux @@ -99,8 +100,8 @@ cp -p /tmp/ckbcomp-bin/pkg/ckbcomp-bin/usr/bin/ckbcomp /usr/local/bin/ckbcomp grub-kbdcomp -o /boot/grub/keymap.gkb ${KEYMAP} (cd /boot/grub && tar cf memdisk.tar keymap.gkb) -grub-mkimage -p /boot/grub -c /boot/grub/grub-pre.cfg -o /boot/grub/i386-pc/core.img -O i386-pc -m /boot/grub/memdisk.tar disk biosdisk diskfilter luks2 part_msdos cryptodisk gcry_rijndael pbkdf2 gcry_sha256 ext2 memdisk tar at_keyboard keylayouts terminal -grub-bios-setup -d /boot/grub/i386-pc ${DRIVE} +grub-mkimage -p /boot/grub -c /boot/grub/grub-pre.cfg -o /boot/grub/${TARGET}/core.img -O ${TARGET} -m /boot/grub/memdisk.tar disk biosdisk diskfilter luks2 part_msdos cryptodisk gcry_rijndael pbkdf2 gcry_sha256 ext2 memdisk tar at_keyboard keylayouts terminal +grub-bios-setup -d /boot/grub/${TARGET} ${DRIVE} pacman -Rns --noconfirm libxkbcommon-x11 # Not needed by all users |