Arch Framework which helps to install the new Arch Linux โ๏ธ
ATTENTION ME!
This is very early stage project. So it may happen some breaking changes.
It's Arch Framework which helps to install the new Arch Linux. afw is made with Bash and available in interactive shell and script.
- Simple structure
- Easy installation of Arch Linux
- Highly customizable
- Custom entry point support
We can add the desktop environment (GNOME, KDE, etc), the server application (OpenSSH, VNC, etc), and the special configuration (Kiosk system, etc) to installation process with a few commands. Configuration is managable as a component. So we can use the components which you need, when you need them!
Be Simple
Done is Better Than Perfect
They continue to maintain good points. They are also useful for helping developers.
You can try the next commands in Bash to install the new system with the preset named basic
:
eval "$(curl https://raw.githubusercontent.com/sakkke/afw/main/lib/afw)"
afw presets/basic
You can see available presets in /components/presets/. Or, you can see how to create the your custom preset.
Add the next one-liner to your script:
eval "$(curl https://raw.githubusercontent.com/sakkke/afw/main/lib/afw)"
The next code is the example script
#!/bin/bash
eval "$(curl https://raw.githubusercontent.com/sakkke/afw/main/lib/afw)"
# Device header lines
AFW_DEVICE_HEADER_LINES=(
'label: gpt'
)
# Path to EFI file
AFW_EFI_FILE=/GRUB/grubx64.efi
# File systems
AFW_FILESYSTEMS=(
fat32
ext4
)
# Bootloader ID for GRUB
AFW_GRUB_BOOTLOADER_ID=GRUB
# Hostname
AFW_HOSTNAME=afw
# /etc/locale.gen
AFW_LOCALE_GEN=(
'en_US.UTF-8 UTF-8'
)
# Mountpoints
AFW_MOUNTPOINTS=(
2:/
1:/boot
)
# Pacman mirrors
AFW_PACMAN_MIRRORS=(
'https://geo.mirror.pkgbuild.com/$repo/os/$arch'
)
# Packages for the new system
AFW_PACSTRAP_PACKAGES=(
base
efibootmgr
linux
linux-firmware
networkmanager
grub
)
# Partitions
AFW_PARTS=(
'1 : size=300MiB, type="EFI System"'
'2 : type="Linux root (x86-64)"'
)
# Passwords
AFW_PASSWORDS=(
root:afw
)
# Entrypoint for mount
AFW_ROOT=/mnt
# systemd services
AFW_SYSTEMD_SERVICES=(
NetworkManager.service
)
# Timezone
AFW_TIMEZONE=UTC
# Users
AFW_USERS=()
# User shells
AFW_USER_SHELLS=()
# /etc/vconsole.conf
AFW_VCONSOLE_CONF=(
KEYMAP=us
)
# Prompt for device which will be installed on the new system
if [[ -z $AFW_DEVICE ]]; then
read -p AFW_DEVICE= AFW_DEVICE
fi
afw update-ntp
afw part
afw format
afw mount
afw pacman/update-mirrorlist
afw pacstrap
afw update-fstab
afw update-timezone
afw update-adjtime
afw update-locale_gen
afw update-locale
afw update-vconsole_conf
afw update-hostname
afw update-passwords
afw grub/install
afw grub/install-grub_cfg
afw grub/fix-bootx64_efi
afw systemd/enable-services
afw umount
There are environment variables which is used by afw function.
Name | Description | Default value |
---|---|---|
AFW_ENTRYPOINT |
URL or file path to reference the components directory. | https://raw.githubusercontent.com/sakkke/afw/main/components |
afw is Bash function; it does two steps:
- Download the script from the entry point URL with cURL
- Eval the downloaded script content in the current shell
The default entry point URL is https://raw.githubusercontent.com/sakkke/afw/main/components
.
You can change the entry point URL with the environment variable AFW_ENTRYPOINT
.
components/
: Entry pointdeps/
: Including scripts of dependenciespresets/
: Dependencies for presets[-A-Z_a-z]+/
: Including scripts[-A-Z_a-z]+
: Scripts
presets/
: Including scripts for usersprompts/
: Including scripts for inputtingvars/
: Including scripts of variablespresets/
: Variables for presets[-A-Z_a-z]+/
: Including scripts[-A-Z_a-z]+
: Scripts
[-A-Z_a-z]+/
: Including scripts[-A-Z_a-z]+
: Scripts
Scripts are named <noun>
, <command_name>
or <verb>-<noun>
.
First, create the script in $AFW_ENTRYPOINT/presets/
.
Here, name the script as foo
.
Put the next content to newly created script:
#!/bin/bash
afw vars/foo
afw deps/foo
afw done
#!/bin/bash
tells the editor the file type.
This script does three steps:
- Load variables
- Load dependencies
- Show the done messages
Second, enter Bash. To run newly created script:
afw presets/foo
Feel free to contribute to this project!
MIT
Thanks goes to these wonderful people (emoji key):
Konosuke Sakai ๐ป ๐ ๐ค |
Taylor Jean ๐ |
This project follows the all-contributors specification. Contributions of any kind welcome!