Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- set -e
- # File systems
- sgdisk --new 1::+1m --typecode 1:ef02 --new 2 /dev/sda
- mkfs.ext4 /dev/sda2
- mount /dev/sda2 /mnt
- # Select a mirror
- cp /etc/pacman.d/mirrorlist /tmp/mirrorlist
- grep "\.jp" /tmp/mirrorlist > /etc/pacman.d/mirrorlist
- # Install the base system
- pacstrap /mnt base grub
- # Generate an fstab
- genfstab -U /mnt > /mnt/etc/fstab
- #
- cat <<_END_> /mnt/setup.sh
- #!/bin/sh
- set -e
- # locale
- sed -i -e 's/^#\(en_US\|ja_JP\)\(.UTF-8.*\)/\1\2/' /etc/locale.gen
- locale-gen
- echo LANG=en_US.UTF-8 > /etc/locale.conf
- # Keymap
- echo KEYMAP=jp106 > /etc/vconsole.conf
- # Time
- ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
- hwclock --systohc --utc
- # Initramfs
- mkinitcpio -p linux
- # Boot loader
- grub-install --recheck /dev/sda
- grub-mkconfig -o /boot/grub/grub.cfg
- # Hostname
- echo arch > /etc/hostname
- # Network
- systemctl enable dhcpcd.service
- # Password
- echo root:root | chpasswd
- _END_
- chmod +x /mnt/setup.sh
- arch-chroot /mnt /setup.sh
- rm /mnt/setup.sh
- umount -R /mnt
- #reboot
- poweroff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement