Skip to content

Commit 6c6ced7

Browse files
committed
Use uppercase variables in kaem-era
lowercase variables are inconsistent, bring them into line with rest of live-bootstrap
1 parent f7c028b commit 6c6ced7

File tree

22 files changed

+312
-318
lines changed

22 files changed

+312
-318
lines changed

sysa/after-preseeded.kaem

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ set -ex
1111

1212
# Set commonly used variables
1313
sysa=/sysa
14-
distfiles=/sysa/distfiles
15-
prefix=/usr
16-
bindir=${prefix}/bin
17-
libdir=${libdir}/mes
18-
incdir=${prefix}/include
19-
srcdir=${prefix}/src
14+
DISTFILES=/sysa/distfiles
15+
PREFIX=/usr
16+
BINDIR=${PREFIX}/bin
17+
LIBDIR=${LIBDIR}/mes
18+
INCDIR=${PREFIX}/include
19+
SRCDIR=${PREFIX}/src
2020
TMPDIR=/tmp # tmpdir is needed for patch to work
21-
PATH=${bindir}
21+
PATH=${BINDIR}
2222

2323
cd ${sysa}
2424

sysa/after.kaem

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,56 @@ PATH=/${ARCH_DIR}/bin
1313

1414
# Set commonly used variables
1515
sysa=/sysa
16-
distfiles=/sysa/distfiles
17-
prefix=/usr
18-
bindir=${prefix}/bin
19-
libdir=${prefix}/lib
20-
incdir=${prefix}/include
21-
srcdir=${prefix}/src
16+
DISTFILES=/sysa/distfiles
17+
PREFIX=/usr
18+
BINDIR=${PREFIX}/bin
19+
LIBDIR=${PREFIX}/lib
20+
INCDIR=${PREFIX}/include
21+
SRCDIR=${PREFIX}/src
2222
TMPDIR=/tmp # tmpdir is needed for patch to work
2323

24-
mkdir -p ${prefix} ${bindir} ${libdir} ${incdir} ${srcdir} ${TMPDIR}
24+
mkdir -p ${PREFIX} ${BINDIR} ${LIBDIR} ${INCDIR} ${SRCDIR} ${TMPDIR}
2525

2626
# Remove remaining dependencies on /bin (stage0-posix directory)
27-
cp /${ARCH_DIR}/bin/blood-elf ${bindir}/blood-elf
28-
cp /${ARCH_DIR}/bin/catm ${bindir}/catm
29-
cp /${ARCH_DIR}/bin/chmod ${bindir}/chmod
30-
cp /${ARCH_DIR}/bin/get_machine ${bindir}/get_machine
31-
cp /${ARCH_DIR}/bin/hex2 ${bindir}/hex2
32-
cp /${ARCH_DIR}/bin/kaem ${bindir}/kaem
33-
cp /${ARCH_DIR}/bin/match ${bindir}/match
34-
cp /${ARCH_DIR}/bin/M1 ${bindir}/M1
35-
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${bindir}/M2-Mesoplanet
36-
cp /${ARCH_DIR}/bin/M2-Planet ${bindir}/M2-Planet
37-
cp /${ARCH_DIR}/bin/mkdir ${bindir}/mkdir
38-
cp /${ARCH_DIR}/bin/sha256sum ${bindir}/sha256sum
39-
cp /${ARCH_DIR}/bin/unbz2 ${bindir}/unbz2
40-
cp /${ARCH_DIR}/bin/ungz ${bindir}/ungz
41-
cp /${ARCH_DIR}/bin/untar ${bindir}/untar
42-
cp /${ARCH_DIR}/bin/cp ${bindir}/cp
43-
cp /${ARCH_DIR}/bin/replace ${bindir}/replace
44-
cp /${ARCH_DIR}/bin/rm ${bindir}/rm
27+
cp /${ARCH_DIR}/bin/blood-elf ${BINDIR}/blood-elf
28+
cp /${ARCH_DIR}/bin/catm ${BINDIR}/catm
29+
cp /${ARCH_DIR}/bin/chmod ${BINDIR}/chmod
30+
cp /${ARCH_DIR}/bin/get_machine ${BINDIR}/get_machine
31+
cp /${ARCH_DIR}/bin/hex2 ${BINDIR}/hex2
32+
cp /${ARCH_DIR}/bin/kaem ${BINDIR}/kaem
33+
cp /${ARCH_DIR}/bin/match ${BINDIR}/match
34+
cp /${ARCH_DIR}/bin/M1 ${BINDIR}/M1
35+
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${BINDIR}/M2-Mesoplanet
36+
cp /${ARCH_DIR}/bin/M2-Planet ${BINDIR}/M2-Planet
37+
cp /${ARCH_DIR}/bin/mkdir ${BINDIR}/mkdir
38+
cp /${ARCH_DIR}/bin/sha256sum ${BINDIR}/sha256sum
39+
cp /${ARCH_DIR}/bin/unbz2 ${BINDIR}/unbz2
40+
cp /${ARCH_DIR}/bin/ungz ${BINDIR}/ungz
41+
cp /${ARCH_DIR}/bin/untar ${BINDIR}/untar
42+
cp /${ARCH_DIR}/bin/cp ${BINDIR}/cp
43+
cp /${ARCH_DIR}/bin/replace ${BINDIR}/replace
44+
cp /${ARCH_DIR}/bin/rm ${BINDIR}/rm
4545

46-
chmod 755 ${bindir}/blood-elf
47-
chmod 755 ${bindir}/catm
48-
chmod 755 ${bindir}/chmod
49-
chmod 755 ${bindir}/cp
50-
chmod 755 ${bindir}/get_machine
51-
chmod 755 ${bindir}/hex2
52-
chmod 755 ${bindir}/kaem
53-
chmod 755 ${bindir}/match
54-
chmod 755 ${bindir}/M1
55-
chmod 755 ${bindir}/M2-Mesoplanet
56-
chmod 755 ${bindir}/M2-Planet
57-
chmod 755 ${bindir}/mkdir
58-
chmod 755 ${bindir}/sha256sum
59-
chmod 755 ${bindir}/unbz2
60-
chmod 755 ${bindir}/ungz
61-
chmod 755 ${bindir}/untar
62-
chmod 755 ${bindir}/replace
63-
chmod 755 ${bindir}/rm
46+
chmod 755 ${BINDIR}/blood-elf
47+
chmod 755 ${BINDIR}/catm
48+
chmod 755 ${BINDIR}/chmod
49+
chmod 755 ${BINDIR}/cp
50+
chmod 755 ${BINDIR}/get_machine
51+
chmod 755 ${BINDIR}/hex2
52+
chmod 755 ${BINDIR}/kaem
53+
chmod 755 ${BINDIR}/match
54+
chmod 755 ${BINDIR}/M1
55+
chmod 755 ${BINDIR}/M2-Mesoplanet
56+
chmod 755 ${BINDIR}/M2-Planet
57+
chmod 755 ${BINDIR}/mkdir
58+
chmod 755 ${BINDIR}/sha256sum
59+
chmod 755 ${BINDIR}/unbz2
60+
chmod 755 ${BINDIR}/ungz
61+
chmod 755 ${BINDIR}/untar
62+
chmod 755 ${BINDIR}/replace
63+
chmod 755 ${BINDIR}/rm
6464

65-
PATH=${bindir}
65+
PATH=${BINDIR}
6666

6767
cd ${sysa}
6868

sysa/after2.kaem

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# SPDX-FileCopyrightText: 2023 Richard Masters <[email protected]>
22
# SPDX-License-Identifier: MIT
33

4-
prefix=/usr
5-
bindir=${prefix}/bin
4+
PREFIX=/usr
5+
BINDIR=${PREFIX}/bin
66

7-
PATH=${bindir}
7+
PATH=${BINDIR}
88

99
cd sysa
1010

sysa/bash-2.05b/bash-2.05b.kaem

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mkdir build src
1616
cd build
1717

1818
# Extract
19-
cp ${distfiles}/${pkg}.tar.gz ../src/
19+
cp ${DISTFILES}/${pkg}.tar.gz ../src/
2020
gzip -d -f ../src/${pkg}.tar.gz
2121
tar xf ../src/${pkg}.tar
2222
rm -r ../src/
@@ -46,11 +46,11 @@ cd ..
4646
make
4747

4848
# Install
49-
install bash ${prefix}/bin/
49+
install bash ${PREFIX}/bin/
5050
mkdir /bin/
51-
ln -s ${prefix}/bin/bash /bin/bash
52-
ln -s ${prefix}/bin/bash /bin/sh
53-
ln -s ${prefix}/bin/bash ${prefix}/bin/sh
51+
ln -s ${PREFIX}/bin/bash /bin/bash
52+
ln -s ${PREFIX}/bin/bash /bin/sh
53+
ln -s ${PREFIX}/bin/bash ${PREFIX}/bin/sh
5454

5555
cd ../..
5656

@@ -59,7 +59,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
5959
sha256sum -o ${pkg}.checksums \
6060
/usr/bin/bash
6161

62-
install ${pkg}.checksums ${srcdir}
62+
install ${pkg}.checksums ${SRCDIR}
6363
else
6464
sha256sum -c ${pkg}.checksums
6565
fi

sysa/bzip2-1.0.8/bzip2-1.0.8.kaem

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mkdir build src
1515
cd build
1616

1717
# Extract
18-
cp ${distfiles}/${pkg}.tar.gz ../src/
18+
cp ${DISTFILES}/${pkg}.tar.gz ../src/
1919
gzip -d -f ../src/${pkg}.tar.gz
2020
tar xf ../src/${pkg}.tar
2121
cd ${pkg}
@@ -28,10 +28,10 @@ patch -Np0 -i ../../patches/coreutils.patch
2828
make CC=tcc AR="tcc -ar" LDFLAGS="-static" bzip2
2929

3030
# Install
31-
cp bzip2 ${prefix}/bin/bzip2
32-
cp bzip2 ${prefix}/bin/bunzip2
33-
chmod 755 ${prefix}/bin/bzip2
34-
chmod 755 ${prefix}/bin/bunzip2
31+
cp bzip2 ${PREFIX}/bin/bzip2
32+
cp bzip2 ${PREFIX}/bin/bunzip2
33+
chmod 755 ${PREFIX}/bin/bzip2
34+
chmod 755 ${PREFIX}/bin/bunzip2
3535

3636
# Test
3737
bzip2 --help
@@ -43,7 +43,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
4343
sha256sum -o ${pkg}.checksums \
4444
/usr/bin/bzip2
4545

46-
cp ${pkg}.checksums ${srcdir}
46+
cp ${pkg}.checksums ${SRCDIR}
4747
else
4848
sha256sum -c ${pkg}.checksums
4949
fi

sysa/checksum-transcriber.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define MAX_TOKENS 3
1515

1616
char *get_distfiles(char **envp) {
17-
char *envvar = "distfiles=";
17+
char *envvar = "DISTFILES=";
1818
int i = 0;
1919
while (envp[i] != NULL && strncmp(envp[i], envvar, strlen(envvar)) != 0) i += 1;
2020
// Now we have distfiles= - get just the part we want.

sysa/coreutils-5.0/coreutils-5.0.kaem

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mkdir build src
1717
cd build
1818

1919
# Extract
20-
cp ${distfiles}/${pkg}.tar.bz2 ../src/
20+
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
2121
bunzip2 -f ../src/${pkg}.tar.bz2
2222
tar xf ../src/${pkg}.tar
2323
cd ${pkg}
@@ -45,8 +45,8 @@ patch -Np0 -i ../../patches/sort-locale.patch
4545
patch -Np0 -i ../../patches/uniq-fopen.patch
4646

4747
# Build and install
48-
make -f Makefile PREFIX=${prefix}
49-
make -f Makefile PREFIX=${prefix} install
48+
make -f Makefile PREFIX=${PREFIX}
49+
make -f Makefile PREFIX=${PREFIX} install
5050

5151
cd ../..
5252
rm -r src/
@@ -116,7 +116,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
116116
/usr/bin/rm \
117117
/usr/bin/sha1sum
118118

119-
install ${pkg}.checksums ${srcdir}
119+
install ${pkg}.checksums ${SRCDIR}
120120
else
121121
sha256sum -c ${pkg}.checksums
122122
fi

sysa/fiwix-1.4.0-lb3/fiwix-1.4.0-lb3.kaem

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ sha256sum -c sources.SHA256SUM
1111
# Extract
1212
mkdir build src
1313
cd src
14-
ungz --file ${distfiles}/${pkg}.tar.gz --output ${pkg}.tar
14+
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
1515
cd ..
1616

1717
cd build
1818
untar --file ../src/${pkg}.tar
1919
cd ${pkg}
2020

21-
alias as="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -traditional -I/sysa/${pkg}/build/${pkg}/include"
21+
alias as="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -traditional -I${SRCDIR}/${pkg}/build/${pkg}/include"
2222

23-
alias cc="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -I/sysa/${pkg}/build/${pkg}/include -O2 -fno-pie -fno-common -ffreestanding -Wall -Wstrict-prototypes"
23+
alias cc="tcc -m32 -march=i386 -std=c89 -D__KERNEL__ -DMAX_PID_VALUE=64000000 -DCONFIG_MMAP2 -DNO_CONFIG_OFFSET64 -DCONFIG_64BIT_SYSCALLS -DCONFIG_KEXEC -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DINIT_PROGRAM=\"/init\" -DUTS_SYSNAME=\"Linux\" -D__VERSION__=\"tcc\" -I${SRCDIR}/${pkg}/build/${pkg}/include -O2 -fno-pie -fno-common -ffreestanding -Wall -Wstrict-prototypes"
2424

2525
cd kernel
2626
as -c -o boot.o boot.S
@@ -554,7 +554,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
554554
sha256sum -o ${pkg}.checksums \
555555
/boot/fiwix
556556

557-
cp ${pkg}.checksums ${srcdir}
557+
cp ${pkg}.checksums ${SRCDIR}
558558
else
559559
sha256sum -c ${pkg}.checksums
560560
fi

sysa/gzip-1.2.4/gzip-1.2.4.kaem

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mkdir build src
1616
cd build
1717

1818
# Extract
19-
ungz --file ${distfiles}/${pkg}.tar.gz --output ../src/${pkg}.tar
19+
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ../src/${pkg}.tar
2020
untar --file ../src/${pkg}.tar
2121
rm ../src/${pkg}.tar
2222
cd ${pkg}
@@ -42,10 +42,10 @@ cp util.c.new util.c
4242
make
4343

4444
# Install
45-
cp gzip ${bindir}/gzip
46-
cp gzip ${bindir}/gunzip
47-
chmod 755 ${bindir}/gzip
48-
chmod 755 ${bindir}/gunzip
45+
cp gzip ${BINDIR}/gzip
46+
cp gzip ${BINDIR}/gunzip
47+
chmod 755 ${BINDIR}/gzip
48+
chmod 755 ${BINDIR}/gunzip
4949

5050
cd ../..
5151

@@ -54,7 +54,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
5454
sha256sum -o ${pkg}.checksums \
5555
/usr/bin/gzip
5656

57-
cp ${pkg}.checksums ${srcdir}
57+
cp ${pkg}.checksums ${SRCDIR}
5858
else
5959
sha256sum -c ${pkg}.checksums
6060
fi

sysa/heirloom-devtools-070527/heirloom-devtools-070527.kaem

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cd build
1717
lexdir=/lex
1818

1919
# Extract
20-
cp ${distfiles}/${pkg}.tar.bz2 ../src/
20+
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
2121
bunzip2 -f ../src/${pkg}.tar.bz2
2222
tar xf ../src/${pkg}.tar ${pkg}/yacc ${pkg}/lex
2323
rm -r ../src/
@@ -32,18 +32,18 @@ cd yacc
3232
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
3333

3434
# Install yacc
35-
install yacc ${bindir}
36-
install -m 644 yaccpar /
35+
install yacc ${BINDIR}
36+
install -m 644 yaccpar ${LIBDIR}
3737

3838
# Build lex
3939
cd ../lex
4040
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true
4141

4242
# Install lex
43-
mkdir ${lexdir}
44-
install lex ${bindir}
45-
install libl.a ${libdir}
46-
install -m 644 ncform ${lexdir}
43+
mkdir ${LEXDIR}
44+
install lex ${BINDIR}
45+
install libl.a ${LIBDIR}
46+
install -m 644 ncform ${LEXDIR}
4747

4848
cd ../../..
4949

@@ -56,7 +56,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
5656
/yaccpar \
5757
/lex/ncform
5858

59-
install ${pkg}.checksums ${srcdir}
59+
install ${pkg}.checksums ${SRCDIR}
6060
else
6161
sha256sum -c ${pkg}.checksums
6262
fi

0 commit comments

Comments
 (0)