Skip to main content
Topic: Install Artix without ISO? (Read 785 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Install Artix without ISO?

Using a non Artix host and without the help of a ISO - is it possible to build a rootfs from the ground and install desired packages to create a Artix system?

I'm really curious for educational purposes!


Re: Install Artix without ISO?

Reply #2
Thank you @gripped
Admittedly I'm having a hard time reading what the script actually does. Do you know if it's possible to make artix-bootstrap.sh print all the commands which it's running?

Re: Install Artix without ISO?

Reply #3
Why not just run the script ?

If you don't understand the commands reading the script then having bash parrot them will at best be marginally better.

I have become one with the matrix  :)

To chatgpt
Quote
As detailed as possible explain the following bash script in plain english. Do not output the script again.

Quote
This Bash script, named "artix-bootstrap.sh," is designed to facilitate the process of bootstrapping a base Artix Linux system using any GNU/Linux distribution that supports Bash. Bootstrapping, in this context, refers to setting up the initial essential components of a Linux system.

Here's a detailed explanation of each section and function within the script:

1. Shebang and Script Header:
   - The script starts with the shebang line `#!/bin/bash` to specify that it should be interpreted using the Bash shell.
   - The script provides a brief description of its purpose, which is to bootstrap a base Artix Linux system using a GNU distribution.
   - It lists the dependencies required to run the script, including various command-line utilities like `bash`, `wget`, `sed`, `tar`, `gzip`, `chroot`, and more.
   - Installation instructions and usage guidelines are also provided.

2. Error Handling and Debugging:
   - `set -e -u -o pipefail`: These options ensure that the script exits immediately if any command returns a non-zero exit status, if an unset variable is used, or if a pipeline fails.
   - The `cleanup` function is defined to unmount certain directories if they were mounted during the script's execution.

3. Utility Functions:
   - `stderr()`: This function prints the provided message to the standard error stream.
   - `debug()`: Used for debug messages, it formats and prints messages to stderr.
   - `extract_href()`: This function uses `sed` to extract hyperlinks from an HTML `<a>` tag.
   - `fetch()`: Performs a curl request to fetch content from a given URL.
   - `fetch_file()`: Fetches a file from a URL and handles the case where the file already exists.
   - `uncompress()`: Uncompresses a package file based on its format (gz, xz, or zst) and extracts it to a specified destination.

4. Repository and Configuration Functions:
   - Various functions are defined to generate repository URLs and configure Pacman for package installation.
   - `configure_minimal_system()`: Sets up a minimal system configuration, including creating device nodes and modifying essential files.
   - `fetch_packages_list()`, `fetch_repo_packages_list()`: Retrieve lists of packages available in different repositories.

5. Package Installation Functions:
   - `install_pacman_packages()`: Installs packages and their dependencies using Pacman.
   - `install_packages()`: Mounts required filesystems, chroots into the destination, installs specified packages, and unmounts the filesystems.

6. Cleanup and Finalization:
   - `cleanup_files()`: Removes certain temporary files from the destination directory.
   - `show_usage()`: Displays usage information for the script.
   - `main()`: The main function of the script. It processes arguments and options, sets default values for various variables, fetches package lists, installs packages, configures Pacman, and performs cleanup.

The script follows a structured approach to perform the necessary tasks for bootstrapping an Artix Linux system, including downloading and installing packages, setting up essential configurations, and managing temporary files. It provides flexibility in choosing an initialization system (`-i` option) and repository URL (`-r` option) while bootstrapping the system. Additionally, it provides a method to chroot into the newly created system for further configuration and usage.

You could do the same then ask for more detail about each function.

Other than that there's maybe running bash interactively (-i) and man pages etc

Re: Install Artix without ISO?

Reply #4
This script is neat but what I'm actually looking for is the commands to build a rootfs manually with all the required packages.

I've tried to figure out what each function does in the script but it's like trying to solve puzzle the way it's written. I've also tried running artix-bootstrap with set -o xtrace but it's too difficult to read.

Maybe there's a different approach that I can try to bootstrap a Artix rootfs locally?

Re: Install Artix without ISO?

Reply #5
AFAIK there is no currently existent guide to do what you ask other than solving the puzzle and understanding the script.

If you find one do post it.

Admirable what you want to do but sometimes you do have to solve the puzzle which is fun  :) .

And as I've said, if your not opposed to to using chatgpt it can break things down in more and more detail.
It's helped me write some fairly complex python programs. Which 6 months ago I knew nothing about.
It's not always right. but it often is and is a lot quicker than studying the, often sparse, documentation.

Re: Install Artix without ISO?

Reply #6
You could just say the script is a command. Commands are no different really, but often written in another language:
https://github.com/coreutils/coreutils/blob/master/src/ls.c
Understanding a script like that will take more than 50 minutes, you could spend that time studying a single function or line if it was complicated. The script is much shorter and simpler than the commands, should you use them or write your own? The example of ls is written in C, which is compiled to assembly code by GCC, this gets converted to digital binary commands, how low level do you want to go?
That aside, basically what you need is to get a working Pacman somehow then install the list of files to the target fs proceeding pretty much like described on the base install page on the Artix wiki. Besides the basestrap script there are statically built pacman's and many popular distros have packages with pacman in, you might need to search online as they might not be in the std repos. The packages are just compressed archives which you can unpack manually too and put in place yourself, but there might be complications getting them registered with Pacman as being installed packages, I don't know offhand exactly how the database management is done.
To chroot from another distro is quite simple once you have the required stuff installed:
Code: [Select]
$ sudo mount /dev/**? mntpnt/
$ for d in dev sys run proc; do sudo mount --bind /$d ~/mntpnt/$d; done
$ sudo chroot ~/mntpnt
# bash

...do stuff...

# exit
# exit
$ for d in dev sys run proc; do sudo umount -r ~/mntpnt/$d; done


Perhaps that adds some other possibilities anyway, I'm sure it will be undoubtedly educational trying to this!

Re: Install Artix without ISO?

Reply #7
Has the original poster considered thoroughly reading the manpage(s) for the commands in question?

Re: Install Artix without ISO?

Reply #8
I'm really curious for educational purposes!

It is, but you will need pacman installed on your host linux.

I think on gentoo, its not that difficult for example.