-
Notifications
You must be signed in to change notification settings - Fork 0
/
archinit.sh
executable file
·94 lines (81 loc) · 2.05 KB
/
archinit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
BL=$(tput bold) # 굵게
NRM=$(tput sgr0) # 일반글씨
RW="\033[41;37m" # 빨간색 배경 글씨
NRW="\033[0m" #일반 배경 글씨
function becho {
>&2 echo -n "$BL$1$NRM"
echo ""
}
function ach {
>&2 arch-chroot /mnt $1
echo ""
}
becho "1. Make Partition Table... "
becho "-1. Select Disk ex)sda / nvme0n1"
becho "**************************"
lsblk
becho "**************************"
echo -n " > "; read "seldisk"
cfdisk /dev/$seldisk
becho "-2. Format ex)sda1 / nvme0n1p1"
becho "***** [/boot] *****"
lsblk
becho "**************************"
echo -n " > "; read "selboot"
mkfs.xfs -f /dev/$selboot
echo ""
becho "***** [/boot/efi] *****"
lsblk
becho "**************************"
echo -n " > "; read "selefi"
mkfs.vfat -F32 /dev/$selefi
echo ""
becho "***** [/] *****"
lsblk
becho "**************************"
echo -n " > "; read "selroot"
mkfs.xfs -f /dev/$selroot
echo ""
becho "***** [swap] *****"
lsblk
becho "**************************"
becho "If you do not need a swap partition, enter n or N"
echo -n " > "; read "selswap"
if [ $selswap = "n" -o $selswap = "N" ]; then
echo "Pass"
else
mkswap /dev/$selswap
swapon /dev/$selswap
fi
echo ""
becho "-3 Mount"
becho "Mount root"
mount /dev/$selroot /mnt
becho "Mount /boot"
mkdir /mnt/boot
mount /dev/$selboot /mnt/boot
becho "Mount /boot/efi"
mkdir /mnt/boot/efi
mount /dev/$selefi /mnt/boot/efi
echo ""
becho "2. Init System"
pacstrap /mnt base linux-zen linux-zen-headers linux-firmware nano networkmanager base-devel man-db man-pages texinfo dosfstools e2fsprogs
genfstab -U /mnt >> /mnt/etc/fstab
echo ""
becho "3. Copy for setting on chroot"
becho "Type ./archset.sh"
becho "When Finish, Type exit"
if [ -f ./archset.sh ]; then
cp ./archset.sh /mnt
arch-chroot /mnt
else
pacman -S wget
wget https://raw.githubusercontent.com/kimlulz/lulzarch/main/archset.sh
cp ./archset.sh /mnt
arch-chroot /mnt
fi
#arch-chroot /mnt /archset.sh
becho "Unmount..."
umount -lr /mnt
becho "Finished!!"