Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #!/bin/sh
  2. set -e
  3.  
  4. # File systems
  5. sgdisk --new 1::+1m --typecode 1:ef02 --new 2 /dev/sda
  6. mkfs.ext4 /dev/sda2
  7. mount /dev/sda2 /mnt
  8.  
  9. # Select a mirror
  10. cp /etc/pacman.d/mirrorlist /tmp/mirrorlist
  11. grep "\.jp" /tmp/mirrorlist > /etc/pacman.d/mirrorlist
  12.  
  13. # Install the base system
  14. pacstrap /mnt base grub
  15.  
  16. # Generate an fstab
  17. genfstab -U /mnt > /mnt/etc/fstab
  18.  
  19. #
  20. cat <<_END_> /mnt/setup.sh
  21. #!/bin/sh
  22. set -e
  23.  
  24. # locale
  25. sed -i -e 's/^#\(en_US\|ja_JP\)\(.UTF-8.*\)/\1\2/' /etc/locale.gen
  26. locale-gen
  27. echo LANG=en_US.UTF-8 > /etc/locale.conf
  28.  
  29. # Keymap
  30. echo KEYMAP=jp106 > /etc/vconsole.conf
  31.  
  32. # Time
  33. ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
  34. hwclock --systohc --utc
  35.  
  36. # Initramfs
  37. mkinitcpio -p linux
  38.  
  39. # Boot loader
  40. grub-install --recheck /dev/sda
  41. grub-mkconfig -o /boot/grub/grub.cfg
  42.  
  43. # Hostname
  44. echo arch > /etc/hostname
  45.  
  46. # Network
  47. systemctl enable dhcpcd.service
  48.  
  49. # Password
  50. echo root:root | chpasswd
  51. _END_
  52.  
  53. chmod +x /mnt/setup.sh
  54. arch-chroot /mnt /setup.sh
  55.  
  56. rm /mnt/setup.sh
  57.  
  58. umount -R /mnt
  59. #reboot
  60. poweroff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement