working state
This commit is contained in:
parent
d94113878f
commit
46cea63aae
12 changed files with 241 additions and 61 deletions
|
@ -1,44 +0,0 @@
|
|||
#!/usr/bin/env 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|https|ftp|tftp)://) ]]; then
|
||||
# there's no synchronization for network availability before executing this script
|
||||
printf '%s: waiting for network-online.target\n' "$0"
|
||||
until systemctl --quiet is-active network-online.target; do
|
||||
sleep 1
|
||||
done
|
||||
printf '%s: downloading %s\n' "$0" "${script}"
|
||||
curl "${script}" --location --retry-connrefused --retry 10 -s -o /tmp/startup_script
|
||||
rt=$?
|
||||
else
|
||||
cp "${script}" /tmp/startup_script
|
||||
rt=$?
|
||||
fi
|
||||
if [[ ${rt} -eq 0 ]]; then
|
||||
chmod +x /tmp/startup_script
|
||||
printf '%s: executing automated script\n' "$0"
|
||||
# note that script is executed when other services (like pacman-init) may be still in progress, please
|
||||
# synchronize to "systemctl is-system-running --wait" when your script depends on other services
|
||||
/tmp/startup_script
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $(tty) == "/dev/tty1" ]]; then
|
||||
automated_script
|
||||
fi
|
|
@ -3,4 +3,14 @@ if grep -Fqa 'accessibility=' /proc/cmdline &> /dev/null; then
|
|||
setopt SINGLE_LINE_ZLE
|
||||
fi
|
||||
|
||||
~/.automated_script.sh
|
||||
loadkeys fr
|
||||
|
||||
echo "[.zlogin] ____ starting auto install ____"
|
||||
archinstall --config ./user_configuration.json --creds ./user_credentials.json
|
||||
echo "[.zlogin] ____ finished auto install ____"
|
||||
echo "[.zlogin] ____ starting post install ____"
|
||||
sh post_install.sh
|
||||
echo "[.zlogin] ____ finished post install ____"
|
||||
|
||||
# echo "[.zlogin] shutting down ..."
|
||||
# # shutdown now
|
||||
|
|
22
profile/airootfs/root/post_install.sh
Normal file
22
profile/airootfs/root/post_install.sh
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
alias log='echo [post_install.sh]'
|
||||
|
||||
|
||||
ROOT=/mnt/archinstall
|
||||
|
||||
|
||||
log "altering linux confs"
|
||||
sed -i 's|# %wheel ALL=(ALL:ALL) NOPASSWD: ALL|%wheel ALL=(ALL:ALL) NOPASSWD: ALL|g' "$ROOT/etc/sudoers"
|
||||
sed -i 's|@includedir /etc/sudoers.d|# @includedir /etc/sudoers.d|g' "$ROOT/etc/sudoers"
|
||||
sed -i 's|#ParallelDownloads = 5|ParallelDownloads = 5|g' "$ROOT/etc/pacman.conf"
|
||||
sed -i 's|SigLevel = Required DatabaseOptional|SigLevel = Never|g' "$ROOT/etc/pacman.conf"
|
||||
|
||||
|
||||
log "installing paru"
|
||||
echo "
|
||||
cd /tmp
|
||||
git clone https://aur.archlinux.org/paru-bin.git
|
||||
cd paru-bin
|
||||
makepkg -si
|
||||
" | arch-chroot "$ROOT" su user sh
|
153
profile/airootfs/root/user_configuration.json
Normal file
153
profile/airootfs/root/user_configuration.json
Normal file
|
@ -0,0 +1,153 @@
|
|||
{
|
||||
"additional-repositories": [],
|
||||
"archinstall-language": "English",
|
||||
"audio_config": {
|
||||
"audio": "pulseaudio"
|
||||
},
|
||||
"bootloader": "Limine",
|
||||
"config_version": "2.7.1",
|
||||
"debug": false,
|
||||
"disk_config": {
|
||||
"config_type": "default_layout",
|
||||
"device_modifications": [
|
||||
{
|
||||
"device": "/dev/sda",
|
||||
"partitions": [
|
||||
{
|
||||
"btrfs": [],
|
||||
"dev_path": null,
|
||||
"flags": [
|
||||
"Boot"
|
||||
],
|
||||
"fs_type": "fat32",
|
||||
"mount_options": [],
|
||||
"mountpoint": "/boot",
|
||||
"obj_id": "d0c249bc-34fb-4e40-9211-25bef99178f3",
|
||||
"size": {
|
||||
"sector_size": {
|
||||
"unit": "B",
|
||||
"value": 512
|
||||
},
|
||||
"unit": "MiB",
|
||||
"value": 203
|
||||
},
|
||||
"start": {
|
||||
"sector_size": {
|
||||
"unit": "B",
|
||||
"value": 512
|
||||
},
|
||||
"unit": "MiB",
|
||||
"value": 3
|
||||
},
|
||||
"status": "create",
|
||||
"type": "primary"
|
||||
},
|
||||
{
|
||||
"btrfs": [],
|
||||
"dev_path": null,
|
||||
"flags": [],
|
||||
"fs_type": "ext4",
|
||||
"mount_options": [],
|
||||
"mountpoint": "/",
|
||||
"obj_id": "32195d81-ab74-4bf3-b653-f7b23f774dae",
|
||||
"size": {
|
||||
"sector_size": {
|
||||
"unit": "B",
|
||||
"value": 512
|
||||
},
|
||||
"unit": "B",
|
||||
"value": 21258829824
|
||||
},
|
||||
"start": {
|
||||
"sector_size": {
|
||||
"unit": "B",
|
||||
"value": 512
|
||||
},
|
||||
"unit": "B",
|
||||
"value": 216006656
|
||||
},
|
||||
"status": "create",
|
||||
"type": "primary"
|
||||
}
|
||||
],
|
||||
"wipe": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"disk_encryption": null,
|
||||
"hostname": "epitls",
|
||||
"kernels": [
|
||||
"linux"
|
||||
],
|
||||
"locale_config": {
|
||||
"kb_layout": "fr",
|
||||
"sys_enc": "UTF-8",
|
||||
"sys_lang": "en_US"
|
||||
},
|
||||
"mirror_config": {
|
||||
"custom_mirrors": [],
|
||||
"mirror_regions": {
|
||||
"France": [
|
||||
"https://mirrors.jtremesay.org/archlinux/$repo/os/$arch",
|
||||
"https://mirrors.gandi.net/archlinux/$repo/os/$arch",
|
||||
"https://mirrors.eric.ovh/arch/$repo/os/$arch",
|
||||
"https://mirrors.celianvdb.fr/archlinux/$repo/os/$arch",
|
||||
"https://mirror.wormhole.eu/archlinux/$repo/os/$arch",
|
||||
"https://mirror.theo546.fr/archlinux/$repo/os/$arch",
|
||||
"https://mirror.thekinrar.fr/archlinux/$repo/os/$arch",
|
||||
"https://mirror.sysa.tech/archlinux/$repo/os/$arch",
|
||||
"https://mirror.oldsql.cc/archlinux/$repo/os/$arch",
|
||||
"https://mirror.its-tps.fr/archlinux/$repo/os/$arch",
|
||||
"https://mirror.ibakerserver.pt/Arch/$repo/os/$arch",
|
||||
"https://mirror.cyberbits.eu/archlinux/$repo/os/$arch",
|
||||
"https://archlinux.mirrors.ovh.net/archlinux/$repo/os/$arch",
|
||||
"https://archlinux.mailtunnel.eu/$repo/os/$arch",
|
||||
"https://arch.yourlabs.org/$repo/os/$arch",
|
||||
"http://mirrors.gandi.net/archlinux/$repo/os/$arch",
|
||||
"http://mirrors.celianvdb.fr/archlinux/$repo/os/$arch",
|
||||
"http://mirror.theo546.fr/archlinux/$repo/os/$arch",
|
||||
"http://mirror.oldsql.cc/archlinux/$repo/os/$arch",
|
||||
"http://mirror.lastmikoi.net/archlinux/$repo/os/$arch",
|
||||
"http://mirror.its-tps.fr/archlinux/$repo/os/$arch",
|
||||
"http://mirror.cyberbits.eu/archlinux/$repo/os/$arch",
|
||||
"http://mirror.archlinux.ikoula.com/archlinux/$repo/os/$arch",
|
||||
"http://mir.archlinux.fr/$repo/os/$arch",
|
||||
"http://ftp.u-strasbg.fr/linux/distributions/archlinux/$repo/os/$arch",
|
||||
"http://archlinux.mirrors.ovh.net/archlinux/$repo/os/$arch",
|
||||
"http://archlinux.mailtunnel.eu/$repo/os/$arch",
|
||||
"http://archlinux.datagr.am/$repo/os/$arch",
|
||||
"http://arch.yourlabs.org/$repo/os/$arch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"network_config": {},
|
||||
"no_pkg_lookups": false,
|
||||
"ntp": true,
|
||||
"offline": false,
|
||||
"packages": [
|
||||
"git",
|
||||
"virtualbox-guest-utils"
|
||||
],
|
||||
"parallel downloads": 0,
|
||||
"profile_config": {
|
||||
"gfx_driver": "All open-source",
|
||||
"greeter": "lightdm-gtk-greeter",
|
||||
"profile": {
|
||||
"custom_settings": {
|
||||
"Xfce4": {}
|
||||
},
|
||||
"details": [
|
||||
"Xfce4"
|
||||
],
|
||||
"main": "Desktop"
|
||||
}
|
||||
},
|
||||
"script": "guided",
|
||||
"silent": false,
|
||||
"skip_ntp": false,
|
||||
"skip_version_check": false,
|
||||
"swap": true,
|
||||
"timezone": "Europe/Paris",
|
||||
"uki": false,
|
||||
"version": "2.7.1"
|
||||
}
|
10
profile/airootfs/root/user_credentials.json
Normal file
10
profile/airootfs/root/user_credentials.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"!root-password": "root",
|
||||
"!users": [
|
||||
{
|
||||
"!password": "user",
|
||||
"sudo": true,
|
||||
"username": "user"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue