-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap-VirtualBoxVM.sh
68 lines (51 loc) · 1.6 KB
/
bootstrap-VirtualBoxVM.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
# confirm you can access the internet
# current site chosen gives a 302 not a 200
# if [[ ! $(curl -I http://www.google.com/ | head -n 1) =~ "200 OK" ]]; then
# echo "Your Internet seems broken. Press Ctrl-C to abort or enter to continue."
# read
# fi
# make 2 partitions on the disk.
parted -s /dev/sda mktable msdos
parted -s /dev/sda mkpart primary 0% 100m
parted -s /dev/sda mkpart primary 100m 100%
# make filesystems
# /boot
mkfs.ext2 /dev/sda1
# /
mkfs.ext4 /dev/sda2
# set up /mnt
mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
# install base packages (take a coffee break if you have slow internet)
pacstrap /mnt base base-devel syslinux vim netctl net-tools dialog
# install syslinux
arch-chroot /mnt pacman -S syslinux
# generate fstab
genfstab -U -p /mnt >>/mnt/etc/fstab
# chroot
arch-chroot /mnt /bin/bash <<EOF
# set initial hostname
echo "archlinux-$(date -I)" >/etc/hostname
# set initial timezone to Europe/Brussels
ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime
# set initial locale
locale >/etc/locale.conf
echo "en_GB.UTF-8 UTF-8" >>/etc/locale.gen
echo "en_GB ISO-8859-1" >>/etc/locale.gen
echo "fr_BE.UTF-8 UTF-8" >>/etc/locale.gen
echo "fr_BE@euro ISO-8859-1" >>/etc/locale.gen
locale-gen
# set key map
echo "KEYMAP=be-latin1" >>/etc/vconsole.conf
# no modifications to mkinitcpio.conf should be needed
mkinitcpio -p linux
# install syslinux bootloader
syslinux-install_update -i -a -m
# set root password to "root"
echo root:root | chpasswd
# end section sent to chroot
EOF
# unmount
umount /mnt/{boot,}
echo "All Done! Unmount the CD image from the VM & type 'reboot'."