OSDN Git Service

[update] : Optimized script for Alter.
authorhayao <shun819.mail@gmail.com>
Tue, 31 Mar 2020 06:43:09 +0000 (15:43 +0900)
committerhayao <shun819.mail@gmail.com>
Tue, 31 Mar 2020 06:43:09 +0000 (15:43 +0900)
airootfs/root/customize_airootfs.sh [deleted file]
airootfs/root/customize_airootfs_alter-madeleine.sh [new file with mode: 0755]
airootfs/root/install.txt [deleted file]

diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh
deleted file mode 100755 (executable)
index 16442d1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-set -e -u
-
-sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen
-sed -i 's/#\(ja_JP\.UTF-8\)/\1/' /etc/locale.gen
-locale-gen
-
-ln -sf /usr/share/zoneinfo/UTC /etc/localtime
-
-usermod -s /bin/bash root
-cp -aT /etc/skel/ /root/
-LC_ALL=C xdg-user-dirs-update
-chmod 700 /root
-LANG=C xdg-user-dirs-update
-
-<< disabled
-groupadd arch
-useradd -m -g arch -s /bin/bash arch
-groupadd sudo
-usermod -G sudo arch
-sed -i 's/^#\s*\(%sudo\s\+ALL=(ALL)\s\+ALL\)/\1/' /etc/sudoers
-cp -aT /etc/skel/ /home/arch/
-disabled
-
-rm /usr/share/backgrounds/xfce/xfce-stripes.png
-ln -s /usr/share/backgrounds/archlinux.jpg /usr/share/backgrounds/xfce/xfce-stripes.png
-chmod 644 /usr/share/backgrounds/archlinux.jpg
-if [[ -d /usr/share/calamares/branding/manjaro ]]; then
-    rm -rf /usr/share/calamares/branding/manjaro
-fi
-
-sed -i 's/#\(PermitRootLogin \).\+/\1yes/' /etc/ssh/sshd_config
-sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist
-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 enable NetworkManager
diff --git a/airootfs/root/customize_airootfs_alter-madeleine.sh b/airootfs/root/customize_airootfs_alter-madeleine.sh
new file mode 100755 (executable)
index 0000000..8d88df8
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+#
+# Yamada Hayao
+# Twitter: @Hayao0819
+# Email  : hayao@fascone.net
+#
+# (c) 2019-2020 Fascode Network.
+#
+
+set -e -u
+
+
+# Default value
+# All values can be changed by arguments.
+password=alter
+boot_splash=false
+kernel=core
+theme_name=alter-logo
+rebuild=false
+japanese=false
+username='alter'
+
+
+# Parse arguments
+while getopts 'p:bt:k:rxju:' arg; do
+    case "${arg}" in
+        p) password="${OPTARG}" ;;
+        b) boot_splash=true ;;
+        t) theme_name="${OPTARG}" ;;
+        k) kernel="${OPTARG}" ;;
+        r) rebuild=true ;;
+        j) japanese=true;;
+        u) username="${OPTARG}" ;;
+        x) set -xv ;;
+    esac
+done
+
+
+# Delete file only if file exists
+# remove <file1> <file2> ...
+function remove () {
+    local _list
+    local _file
+    _list=($(echo "$@"))
+    for _file in "${_list[@]}"; do
+        if [[ -f ${_file} ]]; then
+            rm -f "${_file}"
+        elif [[ -d ${_file} ]]; then
+            rm -rf "${_file}"
+        fi
+        echo "${_file} was deleted."
+    done
+}
+
+
+# Replace file
+remove /usr/share/backgrounds/xfce/xfce-stripes.png
+ln -s /usr/share/backgrounds/archlinux.jpg /usr/share/backgrounds/xfce/xfce-stripes.png
+[[ -f /usr/share/backgrounds/alter.png ]] && chmod 644 /usr/share/backgrounds/alter.png
+remove /usr/share/calamares/branding/manjaro
\ No newline at end of file
diff --git a/airootfs/root/install.txt b/airootfs/root/install.txt
deleted file mode 100644 (file)
index 3c8f171..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-View this installation guide online at
-https://wiki.archlinux.org/index.php/Installation_Guide
-