Merge pull request #17 from owl4ce/master
Added doas support, not just sudo
This commit is contained in:
commit
0ad0173cdd
2 changed files with 18 additions and 9 deletions
17
01-toolchain
17
01-toolchain
|
@ -1,5 +1,14 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
if type -p "sudo" &>/dev/null; then
|
||||||
|
PRIV="sudo"
|
||||||
|
elif type -p "doas" &>/dev/null; then
|
||||||
|
PRIV="doas"
|
||||||
|
else
|
||||||
|
echo "\e[1;31merror:\e[0m sudo/doas not found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
fetch() {
|
fetch() {
|
||||||
tarballname=$(echo $1 | rev | cut -d / -f 1 | rev)
|
tarballname=$(echo $1 | rev | cut -d / -f 1 | rev)
|
||||||
WGETCMD="wget --passive-ftp --tries=3 --waitretry=3 --output-document=$2/$tarballname.partial"
|
WGETCMD="wget --passive-ftp --tries=3 --waitretry=3 --output-document=$2/$tarballname.partial"
|
||||||
|
@ -94,7 +103,7 @@ main() {
|
||||||
checkdone || continue
|
checkdone || continue
|
||||||
build_stage1 $script
|
build_stage1 $script
|
||||||
done
|
done
|
||||||
sudo chown -Rv 0:0 $LFS
|
$PRIV chown -Rv 0:0 $LFS
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $(id -u) = 0 ]; then
|
if [ $(id -u) = 0 ]; then
|
||||||
|
@ -129,15 +138,15 @@ export LC_ALL=C PATH MAKEFLAGS LFS LFS_TGT LFS_TGT32
|
||||||
mkdir -p $SRCDIR $PKGDIR $WORKDIR
|
mkdir -p $SRCDIR $PKGDIR $WORKDIR
|
||||||
|
|
||||||
if [ ! -d $LFS/tools ]; then
|
if [ ! -d $LFS/tools ]; then
|
||||||
sudo mkdir -pv $LFS/tools
|
$PRIV mkdir -pv $LFS/tools
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -w $LFS ]; then
|
if [ ! -w $LFS ]; then
|
||||||
sudo chown -Rv $USER:$USER $LFS
|
$PRIV chown -Rv $USER:$USER $LFS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -L /tools ] || [ $(realpath /tools) != $LFS/tools ]; then
|
if [ ! -L /tools ] || [ $(realpath /tools) != $LFS/tools ]; then
|
||||||
sudo ln -svf $LFS/tools /
|
$PRIV ln -svf $LFS/tools /
|
||||||
fi
|
fi
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
|
|
10
README.md
10
README.md
|
@ -4,10 +4,10 @@ This repo contain scripts to automate multilib LFS build + livecd. This LFS buil
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
* sudo
|
* `sudo` / `doas`
|
||||||
* wget
|
* `wget`
|
||||||
* passes lfs version-check.sh test
|
* passes lfs `version-check.sh` test
|
||||||
* squashfs-tools & libisoburn (optional to create the livecd iso)
|
* `squashfs-tools` & `libisoburn` (optional to create the livecd iso)
|
||||||
|
|
||||||
### Scripts
|
### Scripts
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ Basically you just need to run all those 3 scripts without other command to get
|
||||||
```
|
```
|
||||||
$ ./01-toolchain && sudo ./02-base && sudo ./03-mkiso
|
$ ./01-toolchain && sudo ./02-base && sudo ./03-mkiso
|
||||||
```
|
```
|
||||||
> Note: script 01-toolchain gonna ask for sudo password
|
> Note: script 01-toolchain gonna ask for sudo or doas password
|
||||||
|
|
||||||
- First grab any distro's livecd to use as host, or you can just your current running linux distro as host. (read below for tested host)
|
- First grab any distro's livecd to use as host, or you can just your current running linux distro as host. (read below for tested host)
|
||||||
- Prepare your partition for LFS and mount it on `/mnt/lfs` or you can change where LFS build directory in `config` file.
|
- Prepare your partition for LFS and mount it on `/mnt/lfs` or you can change where LFS build directory in `config` file.
|
||||||
|
|
Loading…
Add table
Reference in a new issue