-
Notifications
You must be signed in to change notification settings - Fork 1
/
s_f
29 lines (25 loc) · 1.05 KB
/
s_f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# s_f
# load environment functions and variables pertinent to running cmds
# uncomment for your number of logical processors
# export MAKEFLAGS=-j7
export PATH=$PATH:/sources/bin # script binary should be copied here
if [[ ! $(command -v script) ]]; then
echo -e "\033[1mscript not found, please copy /usr/bin/script" \
"from host into \$LFS/sources/bin - this directory will be added to the PATH variable" \
"automatically\033[0m"
fi
# note: if LFS env variable is not set, as in chroot, this works. kept for
#flexibility
function mklfscmd {
# make a directory under /sources/cmds with the same name as the directory where mklfscmd
#is run and copy the skeleton files into this newly created dir, then cd to newly
#created directory under /sources/cmds
set -C
pkgname=$(basename $PWD)
mkdir -pv $LFS/sources/cmds/$pkgname
cp $LFS/sources/lc_autolfs/cmdskeleton/* $LFS/sources/cmds/$pkgname
mkdir $LFS/sources/cmds/$pkgname/.cmds
echo -e "\033[2mchanging directory to $LFS/sources/cmds/$pkgname/.cmds\033[0m"
cd $LFS/sources/cmds/$pkgname/.cmds
}