Update readme, typos, use login shell in chroot, add user profile in chroot
This commit is contained in:
parent
930389c7c8
commit
a5dacebc3d
5 changed files with 88 additions and 15 deletions
48
README.md
48
README.md
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
Welcome, this is iglunix-autobuild.
|
Welcome, this is iglunix-autobuild.
|
||||||
Thu GNU General Public License v3 licesed (mostly) automatic build system for Iglunix.
|
Thu GNU General Public License v3 lincesed (mostly) automatic build system for Iglunix.
|
||||||
Iglunix for the uninitiated is a inux distribution designed to not use _GNU_, sadly this is quit hard. GNU make is still available inside this environment.
|
Iglunix for the uninitiated is a linux distribution designed to not use _GNU_, sadly this is quit hard. GNU make is still available inside this environment.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Iglunix for the uninitiated is a inux distribution designed to not use _GNU_, sa
|
||||||
## Fase 1: Docker
|
## Fase 1: Docker
|
||||||
This will create an llvm/musl toolchain.
|
This will create an llvm/musl toolchain.
|
||||||
I've heard that you guys don't like waiting for code to be compiled.
|
I've heard that you guys don't like waiting for code to be compiled.
|
||||||
A docker swarm to the recue, completely over engineered.
|
A docker swarm to the rescue, completely over engineered.
|
||||||
|
|
||||||
Make your main pc/laptop the manager of the swarm using:
|
Make your main pc/laptop the manager of the swarm using:
|
||||||
`docker swarm init --advertise-addr [The IP-address of your device you want to use local/global]`
|
`docker swarm init --advertise-addr [The IP-address of your device you want to use local/global]`
|
||||||
|
@ -19,7 +19,7 @@ It will return a command that allows your other pcs to join, use it.
|
||||||
|
|
||||||
On the main node run: `docker network create -d overlay my_docker_net`
|
On the main node run: `docker network create -d overlay my_docker_net`
|
||||||
|
|
||||||
The problem is that we can't chain commands when starting a docker service create, so we'll have to modify the base abyssos/abyss:dev docker container. We'll need to dowload packages for the installation, we'll add these to the our modified package.
|
The problem is that we can't chain commands when starting a docker service create, so we'll have to modify the base abyssos/abyss:dev docker container. We'll need to download packages for the installation, we'll add these to the our modified package.
|
||||||
This method might also reduce internet usage.
|
This method might also reduce internet usage.
|
||||||
|
|
||||||
To initialize run ```docker_init_clean```, this will create iglunix_abyss.tar, this will have to be manually moved to all docker nodes and then loaded using: ``` docker load -i iglunix_abyss.tar```
|
To initialize run ```docker_init_clean```, this will create iglunix_abyss.tar, this will have to be manually moved to all docker nodes and then loaded using: ``` docker load -i iglunix_abyss.tar```
|
||||||
|
@ -27,7 +27,7 @@ To initialize run ```docker_init_clean```, this will create iglunix_abyss.tar, t
|
||||||
To start the distributed compiler `docker_start_farm` can be used. Prior to execution modify `docker_start_farm` to suit the number of jobs you need to run.
|
To start the distributed compiler `docker_start_farm` can be used. Prior to execution modify `docker_start_farm` to suit the number of jobs you need to run.
|
||||||
|
|
||||||
Run ```docker ps -a``` to find the container id of your work nodes
|
Run ```docker ps -a``` to find the container id of your work nodes
|
||||||
and execute a shell on a node of your chosing using. This can be done as follows:
|
and execute a shell on a node of your choosing using. This can be done as follows:
|
||||||
`docker exec -it [container id] /bin/sh`
|
`docker exec -it [container id] /bin/sh`
|
||||||
|
|
||||||
Modify DISTCC_HOSTS in `compile` in one container to point to all the docker distcc volunteers. Afterwards run `compile`.
|
Modify DISTCC_HOSTS in `compile` in one container to point to all the docker distcc volunteers. Afterwards run `compile`.
|
||||||
|
@ -36,22 +36,24 @@ It could be useful to leave the compile farm around for the compilation indide t
|
||||||
|
|
||||||
## Fase 2: Chroot
|
## Fase 2: Chroot
|
||||||
|
|
||||||
This part is significantly less over engineerd (luckily).
|
This part is significantly less over engineered (luckily).
|
||||||
There are 4 commands the user should be aware of, they are writen in chronological order.
|
There are 4 new commands the user should be aware of, they are written in chronological order.
|
||||||
|
|
||||||
* chroot_prepare_iglunix
|
* chroot_prepare_iglunix
|
||||||
|
|
||||||
This creates the chroot and cleans the most important locations (/lib, /bin, /sbin, /usr, /iglunix, /etc).
|
This creates the chroot and cleans the most important locations (/lib, /bin, /sbin, /usr, /iglunix, /etc).
|
||||||
|
It will also copy the network and keyboard configuration from the host. This will be put into the `*.img`by a script hosted in iglunix/iglunix.
|
||||||
|
|
||||||
* chroot_fetch
|
* chroot_fetch
|
||||||
|
|
||||||
This command will fetch the sources needed to get curl working inside the chroot. And some files for to be used inside the chroot environment. This command will automatically be execute by `chroot_prepare_iglunix`. It is __NOT NEEDED__ to be manually exected. But it can be.
|
This command will fetch the sources needed to get curl working inside the chroot. And some files for to be used inside the chroot environment. This command will automatically be execute by `chroot_prepare_iglunix`. It is __NOT NEEDED__ to be manually executed. But it can be for development purposes.
|
||||||
* chroot_iglunix
|
* chroot_iglunix
|
||||||
|
|
||||||
This will chroot into the Iglunix environment.
|
This will chroot into the Iglunix environment. Once inside run `source /etc/profile` this helps debugging.
|
||||||
* inside_chroot
|
* inside_chroot
|
||||||
|
|
||||||
This is the script that has to be executed inside the chroot to compile all the required apckages in the correct order.
|
This is the script that has to be executed inside the chroot to compile all the required packages in the correct order.
|
||||||
This will also generate a
|
This will also generate `iglunix.img` in `/iglunix/`
|
||||||
|
|
||||||
## Fase 3: Boot
|
## Fase 3: Boot
|
||||||
|
|
||||||
|
@ -63,7 +65,29 @@ Or execute QEMU directly with the following
|
||||||
qemu-system-x86_64 path/to/disk -enable-kvm -m 4096
|
qemu-system-x86_64 path/to/disk -enable-kvm -m 4096
|
||||||
```
|
```
|
||||||
|
|
||||||
Sources:
|
## Trivia
|
||||||
|
|
||||||
|
Everything in trivia is not important.
|
||||||
|
|
||||||
|
* The name `Iglunix`
|
||||||
|
This comes from the following reasoning, by yours truly aheirman.
|
||||||
|
```
|
||||||
|
∄GNU --> iglu
|
||||||
|
iglu-unix --> iglunix
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
* The location to place the git repository of `iglunix` in the filesystem is controversial. These are the contenders:
|
||||||
|
|
||||||
|
```
|
||||||
|
/iglunix
|
||||||
|
/root/iglunix
|
||||||
|
```
|
||||||
|
|
||||||
|
The `iglunix` repo tries to be agnostic to the install dir. This repo choses (because it must choose) for `/root/iglunix`.
|
||||||
|
|
||||||
|
|
||||||
|
Further reading:
|
||||||
* https://www.youtube.com/watch?v=nGSNULpHHZc
|
* https://www.youtube.com/watch?v=nGSNULpHHZc
|
||||||
* https://docs.docker.com/network/overlay/
|
* https://docs.docker.com/network/overlay/
|
||||||
* https://docs.docker.com/registry/
|
* https://docs.docker.com/registry/
|
||||||
|
|
|
@ -51,6 +51,12 @@ echo "------------------------------------"
|
||||||
cp ${root}/../dont_use_here/inside_chroot ${root}
|
cp ${root}/../dont_use_here/inside_chroot ${root}
|
||||||
cp ${root}/../dont_use_here/linux_header_only_patch ${root}
|
cp ${root}/../dont_use_here/linux_header_only_patch ${root}
|
||||||
cp ${root}/../dont_use_here/inittab ${root}/etc/inittab
|
cp ${root}/../dont_use_here/inittab ${root}/etc/inittab
|
||||||
|
|
||||||
|
mkdir ${root}/etc
|
||||||
|
mkdir ${root}/etc/profile.d
|
||||||
|
|
||||||
|
cp ${root}/../dont_use_here/profile ${root}/etc/profile
|
||||||
|
|
||||||
echo "---------------------"
|
echo "---------------------"
|
||||||
echo "finished chroot_fetch"
|
echo "finished chroot_fetch"
|
||||||
echo "---------------------"
|
echo "---------------------"
|
||||||
|
|
|
@ -4,6 +4,7 @@ cd ./root
|
||||||
|
|
||||||
echo "Going to chroot, woot!"
|
echo "Going to chroot, woot!"
|
||||||
|
|
||||||
|
|
||||||
mkdir proc
|
mkdir proc
|
||||||
mkdir sys
|
mkdir sys
|
||||||
mkdir dev
|
mkdir dev
|
||||||
|
@ -18,7 +19,22 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sudo chroot ./ /bin/sh
|
if false; then
|
||||||
|
sudo chroot ./ /usr/bin/env -i \
|
||||||
|
HOME="/root" \
|
||||||
|
TERM="$TERM" \
|
||||||
|
PS1='chroot: ' \
|
||||||
|
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" \
|
||||||
|
/bin/bash -l +h
|
||||||
|
fi
|
||||||
|
if false; then
|
||||||
|
sudo chroot ./ /usr/bin/env -i \
|
||||||
|
/bin/bash source /etc/profile\
|
||||||
|
/bin/bash -l +h
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo chroot ./ /bin/bash -l
|
||||||
|
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,14 @@ echo "installed busybox"
|
||||||
|
|
||||||
printf "export PATH=/bin:/usr/bin:/usr/sbin:\nexport JOBS=16\n" > ${ROOT}/etc/iglupkg.conf
|
printf "export PATH=/bin:/usr/bin:/usr/sbin:\nexport JOBS=16\n" > ${ROOT}/etc/iglupkg.conf
|
||||||
|
|
||||||
#--------------------------------------
|
echo "---------------------------------"
|
||||||
|
echo " Kayboard configuration"
|
||||||
|
echo "---------------------------------"
|
||||||
|
|
||||||
|
echo "Copying host keymap"
|
||||||
|
|
||||||
|
cp /etc/vconsole.conf ${ROOT}/etc/vconsole.conf
|
||||||
|
|
||||||
echo "---------------------------------"
|
echo "---------------------------------"
|
||||||
echo "Starting networking configuration"
|
echo "Starting networking configuration"
|
||||||
echo "---------------------------------"
|
echo "---------------------------------"
|
||||||
|
|
20
dont_use_here/profile
Normal file
20
dont_use_here/profile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Setup Path
|
||||||
|
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
export POSIX_ME_HARDER=1
|
||||||
|
|
||||||
|
# Setup Shell Prompt
|
||||||
|
if [ "$(whoami)" == "root" ]; then
|
||||||
|
export PS1=$(hostname)"-chroot# "
|
||||||
|
else
|
||||||
|
export PS1=$(hostname)"-chroot$ "
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Replace TERM with xterm because netbsd-curses doesn't include alacritty
|
||||||
|
if [ "$TERM" == "alacritty" ]; then
|
||||||
|
export TERM=xterm
|
||||||
|
fi
|
||||||
|
|
||||||
|
# load profile
|
||||||
|
for file in $(ls /etc/profile.d); do
|
||||||
|
. /etc/profile.d/$file
|
||||||
|
done
|
Loading…
Reference in a new issue