diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-10-26 17:50:31 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-10-26 17:50:31 +0100 |
commit | 7646f26e425b0997818c450543b9bf5c70b6a26e (patch) | |
tree | 786ec2378f384cde6959c10b6958f532ba5040b2 /airootfs | |
download | archiso-config-7646f26e425b0997818c450543b9bf5c70b6a26e.tar.gz archiso-config-7646f26e425b0997818c450543b9bf5c70b6a26e.tar.xz |
initial commit
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'airootfs')
-rw-r--r-- | airootfs/etc/fstab | 0 | ||||
-rw-r--r-- | airootfs/etc/hostname | 1 | ||||
-rw-r--r-- | airootfs/etc/locale.conf | 1 | ||||
-rw-r--r-- | airootfs/etc/machine-id | 0 | ||||
-rw-r--r-- | airootfs/etc/systemd/network/10-ethernet.network | 5 | ||||
-rwxr-xr-x | airootfs/etc/systemd/scripts/choose-mirror | 26 | ||||
-rw-r--r-- | airootfs/etc/systemd/system/choose-mirror.service | 10 | ||||
-rw-r--r-- | airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount | 8 | ||||
-rw-r--r-- | airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf | 3 | ||||
-rw-r--r-- | airootfs/etc/systemd/system/pacman-init.service | 15 | ||||
-rw-r--r-- | airootfs/etc/udev/rules.d/81-dhcpcd.rules | 0 | ||||
-rwxr-xr-x | airootfs/root/.automated_script.sh | 35 | ||||
-rw-r--r-- | airootfs/root/.zlogin | 1 | ||||
-rwxr-xr-x | airootfs/root/customize_airootfs.sh | 57 | ||||
-rw-r--r-- | airootfs/root/install.txt | 3 |
15 files changed, 165 insertions, 0 deletions
diff --git a/airootfs/etc/fstab b/airootfs/etc/fstab new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/airootfs/etc/fstab diff --git a/airootfs/etc/hostname b/airootfs/etc/hostname new file mode 100644 index 0000000..2dbe21e --- /dev/null +++ b/airootfs/etc/hostname @@ -0,0 +1 @@ +archiso diff --git a/airootfs/etc/locale.conf b/airootfs/etc/locale.conf new file mode 100644 index 0000000..01ec548 --- /dev/null +++ b/airootfs/etc/locale.conf @@ -0,0 +1 @@ +LANG=en_US.UTF-8 diff --git a/airootfs/etc/machine-id b/airootfs/etc/machine-id new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/airootfs/etc/machine-id diff --git a/airootfs/etc/systemd/network/10-ethernet.network b/airootfs/etc/systemd/network/10-ethernet.network new file mode 100644 index 0000000..f2578d1 --- /dev/null +++ b/airootfs/etc/systemd/network/10-ethernet.network @@ -0,0 +1,5 @@ +[Match] +Name=e* + +[Network] +DHCP=yes diff --git a/airootfs/etc/systemd/scripts/choose-mirror b/airootfs/etc/systemd/scripts/choose-mirror new file mode 100755 index 0000000..0ae0806 --- /dev/null +++ b/airootfs/etc/systemd/scripts/choose-mirror @@ -0,0 +1,26 @@ +#!/bin/bash + +get_cmdline() { + local param + for param in $(< /proc/cmdline); do + case "${param}" in + $1=*) echo "${param##*=}"; + return 0 + ;; + esac + done +} + +mirror=$(get_cmdline mirror) +[[ $mirror = auto ]] && mirror=$(get_cmdline archiso_http_srv) +[[ $mirror ]] || exit 0 + +mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig +cat >/etc/pacman.d/mirrorlist << EOF +# +# Arch Linux repository mirrorlist +# Generated by archiso +# + +Server = ${mirror%%/}/\$repo/os/\$arch +EOF diff --git a/airootfs/etc/systemd/system/choose-mirror.service b/airootfs/etc/systemd/system/choose-mirror.service new file mode 100644 index 0000000..1e4d771 --- /dev/null +++ b/airootfs/etc/systemd/system/choose-mirror.service @@ -0,0 +1,10 @@ +[Unit] +Description=Choose mirror from the kernel command line +ConditionKernelCommandLine=mirror + +[Service] +Type=oneshot +ExecStart=/etc/systemd/scripts/choose-mirror + +[Install] +WantedBy=multi-user.target diff --git a/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount b/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount new file mode 100644 index 0000000..4eab551 --- /dev/null +++ b/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount @@ -0,0 +1,8 @@ +[Unit] +Description=Temporary /etc/pacman.d/gnupg directory + +[Mount] +What=tmpfs +Where=/etc/pacman.d/gnupg +Type=tmpfs +Options=mode=0755 diff --git a/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf b/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf new file mode 100644 index 0000000..d1d8474 --- /dev/null +++ b/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux diff --git a/airootfs/etc/systemd/system/pacman-init.service b/airootfs/etc/systemd/system/pacman-init.service new file mode 100644 index 0000000..23b8144 --- /dev/null +++ b/airootfs/etc/systemd/system/pacman-init.service @@ -0,0 +1,15 @@ +[Unit] +Description=Initializes Pacman keyring +Wants=haveged.service +After=haveged.service +Requires=etc-pacman.d-gnupg.mount +After=etc-pacman.d-gnupg.mount + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/pacman-key --init +ExecStart=/usr/bin/pacman-key --populate archlinux + +[Install] +WantedBy=multi-user.target diff --git a/airootfs/etc/udev/rules.d/81-dhcpcd.rules b/airootfs/etc/udev/rules.d/81-dhcpcd.rules new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/airootfs/etc/udev/rules.d/81-dhcpcd.rules diff --git a/airootfs/root/.automated_script.sh b/airootfs/root/.automated_script.sh new file mode 100755 index 0000000..68201c0 --- /dev/null +++ b/airootfs/root/.automated_script.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param#*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then + if [[ "${script}" =~ ^http:// || "${script}" =~ ^ftp:// ]]; then + wget "${script}" --retry-connrefused -q -O /tmp/startup_script >/dev/null + rt=$? + else + cp "${script}" /tmp/startup_script + rt=$? + fi + if [[ ${rt} -eq 0 ]]; then + chmod +x /tmp/startup_script + /tmp/startup_script + fi + fi +} + +if [[ -x $0 ]]; then + chmod -x $0 + automated_script +fi diff --git a/airootfs/root/.zlogin b/airootfs/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/airootfs/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh new file mode 100755 index 0000000..cebcfa4 --- /dev/null +++ b/airootfs/root/customize_airootfs.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +set -e -u + +export HOME=/root + +sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen +locale-gen + +ln -sf /usr/share/zoneinfo/Europe/Vienna /etc/localtime + +usermod -s /usr/bin/zsh root +cp -aT /etc/skel/ /root/ +chmod 700 /root + +rm -f /etc/pacman.d/mirrorlist +echo -en 'Server = http://mirror.server-speed.net/$repo/os/$arch\n' > /etc/pacman.d/mirrorlist +echo -en '192.168.4.1 mistral.server-speed.net mistral\n' >> /etc/hosts +echo -en '192.168.4.103 pearl.server-speed.net mirror.server-speed.net pearl\n' >> /etc/hosts +sed -i 's/#\(Storage=\)auto/\1volatile/' /etc/systemd/journald.conf + +sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' /etc/systemd/logind.conf +sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' /etc/systemd/logind.conf +sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' /etc/systemd/logind.conf + +systemctl enable pacman-init.service choose-mirror.service +systemctl set-default multi-user.target + +mkdir -p /root/.ssh +touch /root/.ssh/authorized_keys +chmod 700 /root/.ssh +chmod 600 /root/.ssh/authorized_keys + +cat <<EOF >/root/.ssh/authorized_keys +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAte43fgKVPKvmwhMQcQRYNm27i2cadOIJvpOFA3jPWHFN2YeqxHvgVbAESLOAO/sJ0MqXlQnBc9rr8PbQd67YP7teOBnXLOfX2mofxGEDtP2mtwneAxkMNJcYtxWjPeKL7LF5tknqPb6dXavm4+gJt27CQFFY6DJ+cD0tUUgh17HG6VGiTXF6AgB9aho/ToaMQZ4vCzztvf94kQK2uBYUXsvx4L62ZrEJbIzfB7fynBbl9+deBqsYmWRCbzaYV77YjwLhk9hI/GsUjLkTAB77WbeWJdk7fgJ/PgI69FRMhRlYASRVBqeek6NLcyQ9x54CrUkOFBC5Q+j4yjsDQN7NBw== flo@Marin +EOF + +systemctl enable systemd-networkd +systemctl enable systemd-resolved +systemctl enable sshd + +rm /root/{.bashrc,.screenrc,.zshrc} + +curl --pinnedpubkey 'sha256//XkpLKx+vdbYKQ7Ry7N+X/plN0nM7MCSFu3rOqywNPCM=' https://git.server-speed.net/users/flo/bin/plain/init_new_user.sh | bash + +echo "source .zlogin" >> /root/.zprofile + +pacman -Rdd --noconfirm openresolv netctl dhcpcd + +trust extract-compat + +pacman -Syy +pkgfile -u + +umount /etc/resolv.conf +ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf + diff --git a/airootfs/root/install.txt b/airootfs/root/install.txt new file mode 100644 index 0000000..3c8f171 --- /dev/null +++ b/airootfs/root/install.txt @@ -0,0 +1,3 @@ +View this installation guide online at +https://wiki.archlinux.org/index.php/Installation_Guide + |