install.sh
Finished up root/march-chroot.sh Fixed up arguments root/march-reboot.sh Fixed up arguments
This commit is contained in:
26
install.sh
26
install.sh
@@ -70,6 +70,7 @@ Mandatory arguments:
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Programming error"
|
||||
exit 3
|
||||
@@ -80,16 +81,16 @@ Mandatory arguments:
|
||||
# partition 1: 1MiB -> 500MiB FAT32
|
||||
# partition 2: 500MiB -> 3GiB swap
|
||||
# partition 3: 3GiB -> .. ext4
|
||||
parted $d mklabel gpt mkpart primary fat32 1MiB 512 mkpart primary linux-swap 500MiB 3GiB mkpart primary ext4 3GiB 100% set 1 esp on -s
|
||||
parted $device mklabel gpt mkpart primary fat32 1MiB 512 mkpart primary linux-swap 500MiB 3GiB mkpart primary ext4 3GiB 100% set 1 esp on -s
|
||||
|
||||
if [ -b "$d\p1" ]; then
|
||||
bootpart=$d\p1
|
||||
swappart=$d\p2
|
||||
rootpart=$d\p3
|
||||
if [ -b "$device\p1" ]; then
|
||||
bootpart=$device\p1
|
||||
swappart=$device\p2
|
||||
rootpart=$device\p3
|
||||
else
|
||||
bootpart=$d\1
|
||||
swappart=$d\2
|
||||
rootpart=$d\3
|
||||
bootpart=$device\1
|
||||
swappart=$device\2
|
||||
rootpart=$device\3
|
||||
fi
|
||||
|
||||
mkfs.vfat $bootpart
|
||||
@@ -113,14 +114,13 @@ pacstrap /mnt base base-devel linux linux-firmware
|
||||
genfstab -U /mnt >> /mnt/etc/fstab
|
||||
|
||||
|
||||
cp $CWD/etc/systemd/system/march.service /mnt/etc/systemd/system/march.service
|
||||
cp $CWD/root/march-chroot.sh /mnt/root/arch-chroot.sh
|
||||
cp $CWD/root/march-reboot.sh /mnt/root/arch-reboot.sh
|
||||
cp $CWD/etc/systemd/system/march.service /mnt/etc/syslll/system/march.service
|
||||
cp $CWD/root/march-chroot.sh /mnt/root/march-chroot.sh
|
||||
cp $CWD/root/march-reboot.sh /mnt/root/march-reboot.sh
|
||||
chmod +x /mnt/root/arch-chroot.sh
|
||||
chmod +x /mnt/root/arch-reboot.sh
|
||||
|
||||
arch-chroot /mnt /root/march-chroot.sh -t $t-l $l-h $h-u $u-s $s
|
||||
sed -i "s/arch-reboot.sh/\0 -u $u-s $s/" /mnt/etc/systemd/system/march.service
|
||||
arch-chroot /mnt /root/march-chroot.sh -t $timezone -l $locale -h $hostname -u $username -s $sudogrp
|
||||
|
||||
umount $bootpart
|
||||
swapoff $swappart
|
||||
|
||||
@@ -7,8 +7,8 @@ if [[ ${PIPESTATUS[0]} -ne 4 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPTIONS=tlhus
|
||||
LONGOPTS=timezone,locale,hostname,username,sudogrp
|
||||
OPTIONS=t:l:h:u:s:
|
||||
LONGOPTS=timezone:,locale:,hostname:,username:,sudogrp:
|
||||
|
||||
! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@")
|
||||
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
|
||||
@@ -46,6 +46,25 @@ while true; do
|
||||
sudogrp="$2"
|
||||
shift 2
|
||||
;;
|
||||
--help)
|
||||
echo "
|
||||
Usage: ./install.sh -d [DEVICE] -t [/usr/share/zoneinfo/REGION/CITY] -l [LOCALE] -h [HOSTNAME] -u [USER] -s [SUDO]
|
||||
A small script to automate my archlinux configuration.
|
||||
|
||||
Mandatory arguments:
|
||||
-t | --timezone Your timezone according to /usr/share/zoneinfo/ e.g. "/usr/share/zoneinfo/Europe/Berlin"
|
||||
-l | --locale Your locale according to /etc/locale.gen e.g. "en_US.UTF-8 UTF-8"
|
||||
-h | --hostname Name for your machine e.g. "ArchLinux"
|
||||
-u | --username Your username e.g. "foo"
|
||||
-s | --sudogrp Name of the sudogrp
|
||||
-h | --help This here.
|
||||
"
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Programming error"
|
||||
exit 3
|
||||
@@ -82,7 +101,7 @@ linux /vmlinuz-linux
|
||||
initrd /initramfs-linux.img
|
||||
options rw cryptdevice=$(blkid $rootpart | cut -d" " -f2 | tr -d \"):cryptroot root=$cryptroot i8042.noloop i8042.nomux i8042.nopnp i8042.reset" > /boot/loader/entries/arch.conf
|
||||
|
||||
sed -i "s/"
|
||||
sed -i "s/arch-reboot.sh/\0 -u $u-s $s/" /etc/systemd/system/march.service
|
||||
|
||||
systemctl enable march.service
|
||||
systemctl enable dhcpcd.service
|
||||
|
||||
@@ -43,6 +43,10 @@ while true; do
|
||||
sudogrp="$2"
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Programming error"
|
||||
exit 3
|
||||
|
||||
Reference in New Issue
Block a user