https://github.com/sakkke/afw
🧰 afw - Arch Framework which helps to install the new Arch Linux
https://github.com/sakkke/afw
archlinux
Last synced: 3 months ago
JSON representation
🧰 afw - Arch Framework which helps to install the new Arch Linux
- Host: GitHub
- URL: https://github.com/sakkke/afw
- Owner: sakkke
- License: mit
- Created: 2022-08-20T09:54:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-03T04:24:59.000Z (over 3 years ago)
- Last Synced: 2025-02-03T14:22:54.378Z (about 1 year ago)
- Topics: archlinux
- Language: Shell
- Homepage:
- Size: 140 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# afw
Arch Framework which helps to install the new Arch Linux ⚙️
[](https://archlinux.org/)
[](https://github.com/sakkke/afw/fork)
[](https://github.com/sakkke/afw/issues)
[](https://github.com/sakkke/afw/blob/main/LICENSE)
[](https://github.com/sakkke/afw/pulls)
[](https://github.com/sakkke/afw/stargazers)
[](#contributors-)
[](https://app.codecov.io/gh/sakkke/afw)
[](https://github.com/sakkke/afw/actions/workflows/linter.yml)
[](https://discord.gg/HYKfDBMkyq)
[](https://web.libera.chat/)
[](https://www.buymeacoffee.com/sakkke)
__ATTENTION ME!__
This is very early stage project.
So it may happen some breaking changes.
---
[](https://asciinema.org/a/517447)
## Overview
It's Arch Framework which helps to install the new Arch Linux.
afw is made with Bash and available in [interactive shell](#work-with-interactive-shell) and [script](#work-with-script).
### Good Points
- 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!
## Philosophy
> Be Simple
> Done is Better Than Perfect
They continue to maintain [good points](#good-points).
They are also useful for helping developers.
## User Guides
### Work with Interactive Shell
You can try the next commands __in Bash__ to install the new system with the preset named `basic`:
```bash
eval "$(curl https://raw.githubusercontent.com/sakkke/afw/main/lib/afw)"
afw presets/basic
```
You can see available presets in [/components/presets/](https://github.com/sakkke/afw/tree/main/components/presets).
Or, you can see [how to create the your custom preset](#create-the-your-custom-preset).
### Work with Script
Add the next one-liner to your script:
```bash
eval "$(curl https://raw.githubusercontent.com/sakkke/afw/main/lib/afw)"
```
The next code is the example script
```bash
#!/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
```
### Environment Variables
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`
## Development Guides
afw is Bash function; it does two steps:
1. Download the script from the entry point URL with cURL
2. 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`.
### Directory Structure
- `components/`: Entry point
- `deps/`: Including scripts of dependencies
- `presets/`: Dependencies for presets
- `[-A-Z_a-z]+/`: Including scripts
- `[-A-Z_a-z]+`: Scripts
- `presets/`: Including scripts for users
- `prompts/`: Including scripts for inputting
- `vars/`: Including scripts of variables
- `presets/`: 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
### Script Naming Rules
Scripts are named ``, `` or `-`.
### Create the your custom preset
#### A Recommended Way
First, create the script in `$AFW_ENTRYPOINT/presets/`.
Here, name the script as `foo`.
Put the next content to newly created script:
```bash
#!/bin/bash
afw vars/foo
afw deps/foo
afw done
```
`#!/bin/bash` tells the editor the file type.
This script does three steps:
1. Load variables
2. Load dependencies
3. Show the done messages
Second, enter Bash.
To run newly created script:
```bash
afw presets/foo
```
## Code of Conduct
[CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
## Contributing
Feel free to contribute to this project!
[CONTRIBUTING.md](./CONTRIBUTING.md)
## License
`MIT`
[LICENSE](./LICENSE)
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Konosuke Sakai
💻 📖 🤔

Taylor Jean
📖
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!