From bfcd75107ef0e3866e4df812d5987770c669e332 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 31 Aug 2018 15:30:43 -0400 Subject: [PATCH] Add 01x scripts --- sh/011-hwclock | 25 +++++++++++++++++++++++++ sh/012-hostname | 16 ++++++++++++++++ sh/013-localization | 23 +++++++++++++++++++++++ sh/014-systemd | 14 ++++++++++++++ sh/015-pacman | 11 +++++++++++ 5 files changed, 89 insertions(+) create mode 100644 sh/011-hwclock create mode 100644 sh/012-hostname create mode 100644 sh/013-localization create mode 100644 sh/014-systemd create mode 100644 sh/015-pacman diff --git a/sh/011-hwclock b/sh/011-hwclock new file mode 100644 index 0000000..7e3b39b --- /dev/null +++ b/sh/011-hwclock @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Set your timezone and update the hardware clock, assuming +# it is currently set to UTC. Note that if you want to use +# multiple operating systems on the same hardware, you +# shouldn't do this. +# +# Check whether or not your hardware clock (RTC) is localtime: +# timedatectl | grep local +# +# Change hardware clock to localtime: +# timedatectl set-local-rtc 1 +# +# Change hardware clock back to UTC: +# timedatectl set-local-rtc 0 +# +# Note that RTC (the hardware clock) stands for "Real Time Clock" +# +# https://wiki.archlinux.org/index.php/Installation_guide + +set -xe + +arch-chroot /mnt ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime + +arch-chroot /mnt hwclock --systohc diff --git a/sh/012-hostname b/sh/012-hostname new file mode 100644 index 0000000..6b6c49b --- /dev/null +++ b/sh/012-hostname @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Set the hostname in all the necessary places. +# +# Note that if your system has a permanent IP address, that +# should be used instead of 127.0.0.1. +# +# https://wiki.archlinux.org/index.php/Installation_guide + +set -xe + +$HOSTNAME = "arch" + +echo "$HOSTNAME" > /mnt/etc/hostname +echo "127.0.1.1 $HOSTNAME.localdomain $HOSTNAME" >> /mnt/etc/hosts + diff --git a/sh/013-localization b/sh/013-localization new file mode 100644 index 0000000..5209c3f --- /dev/null +++ b/sh/013-localization @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Set the language to English and use the en_US.UTF-8 locale. +# Then, generate it. +# +# Next, explicitly set the keymap to US. +# +# Note that we also change the terminal font to a bigger one +# (terminus-font) since this setting also uses vconsole.conf. +# Use `latarcyrheb-sun32` if you want to use the default +# terminal font instead. +# +# https://wiki.archlinux.org/index.php/Installation_guide + +set -xe + +echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf +echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen + +arch-chroot /mnt locale-gen + +echo "KEYMAP=us" > /mnt/etc/vconsole.conf +echo "FONT=ter-132n" >> /mnt/etc/vconsole.conf diff --git a/sh/014-systemd b/sh/014-systemd new file mode 100644 index 0000000..d3d3ef6 --- /dev/null +++ b/sh/014-systemd @@ -0,0 +1,14 @@ +#!/bin/sh +# +# Change the systemd wait time from 90s to 10s, preventing the +# system from hanging at shutdown. +# +# https://unix.stackexchange.com/questions/273876 +# https://old.reddit.com/r/archlinux/comments/4bawf7 + +set -xe + +SYSTEMD="/mnt/etc/systemd/system.conf" + +echo "DefaultTimeoutStartSec=10s" >> $SYSTEMD +echo "DefaultTimeoutStopSec=10s" >> $SYSTEMD diff --git a/sh/015-pacman b/sh/015-pacman new file mode 100644 index 0000000..a2d708c --- /dev/null +++ b/sh/015-pacman @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Enable colors in pacman by uncommenting the Color line. +# +# https://wiki.archlinux.org/index.php/Color_output_in_console#pacman + +set -xe + +PACMAN="/mnt/etc/pacman.conf" + +sed -i '/Color/s/^#//g' $PACMAN