From 7646f26e425b0997818c450543b9bf5c70b6a26e Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 26 Oct 2015 17:50:31 +0100 Subject: initial commit Signed-off-by: Florian Pritz --- airootfs/root/.automated_script.sh | 35 +++++++++++++++++++++++ airootfs/root/.zlogin | 1 + airootfs/root/customize_airootfs.sh | 57 +++++++++++++++++++++++++++++++++++++ airootfs/root/install.txt | 3 ++ 4 files changed, 96 insertions(+) create mode 100755 airootfs/root/.automated_script.sh create mode 100644 airootfs/root/.zlogin create mode 100755 airootfs/root/customize_airootfs.sh create mode 100644 airootfs/root/install.txt (limited to 'airootfs/root') 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 </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 + -- cgit v1.2.3-24-g4f1b