Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaem-era improvements #340

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sysa/after-preseeded.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ set -ex

# Set commonly used variables
sysa=/sysa
distfiles=/sysa/distfiles
prefix=/usr
bindir=${prefix}/bin
libdir=${libdir}/mes
incdir=${prefix}/include
srcdir=${prefix}/src
DISTFILES=/sysa/distfiles
PREFIX=/usr
BINDIR=${PREFIX}/bin
LIBDIR=${PREFIX}/lib/mes
INCDIR=${PREFIX}/include/mes
SRCDIR=${PREFIX}/src
TMPDIR=/tmp # tmpdir is needed for patch to work
PATH=${bindir}
PATH=${BINDIR}

cd ${sysa}

Expand Down
88 changes: 44 additions & 44 deletions sysa/after.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,56 @@ PATH=/${ARCH_DIR}/bin

# Set commonly used variables
sysa=/sysa
distfiles=/sysa/distfiles
prefix=/usr
bindir=${prefix}/bin
libdir=${prefix}/lib
incdir=${prefix}/include
srcdir=${prefix}/src
DISTFILES=/sysa/distfiles
PREFIX=/usr
BINDIR=${PREFIX}/bin
LIBDIR=${PREFIX}/lib
INCDIR=${PREFIX}/include/mes
SRCDIR=${PREFIX}/src
TMPDIR=/tmp # tmpdir is needed for patch to work

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

# Remove remaining dependencies on /bin (stage0-posix directory)
cp /${ARCH_DIR}/bin/blood-elf ${bindir}/blood-elf
cp /${ARCH_DIR}/bin/catm ${bindir}/catm
cp /${ARCH_DIR}/bin/chmod ${bindir}/chmod
cp /${ARCH_DIR}/bin/get_machine ${bindir}/get_machine
cp /${ARCH_DIR}/bin/hex2 ${bindir}/hex2
cp /${ARCH_DIR}/bin/kaem ${bindir}/kaem
cp /${ARCH_DIR}/bin/match ${bindir}/match
cp /${ARCH_DIR}/bin/M1 ${bindir}/M1
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${bindir}/M2-Mesoplanet
cp /${ARCH_DIR}/bin/M2-Planet ${bindir}/M2-Planet
cp /${ARCH_DIR}/bin/mkdir ${bindir}/mkdir
cp /${ARCH_DIR}/bin/sha256sum ${bindir}/sha256sum
cp /${ARCH_DIR}/bin/unbz2 ${bindir}/unbz2
cp /${ARCH_DIR}/bin/ungz ${bindir}/ungz
cp /${ARCH_DIR}/bin/untar ${bindir}/untar
cp /${ARCH_DIR}/bin/cp ${bindir}/cp
cp /${ARCH_DIR}/bin/replace ${bindir}/replace
cp /${ARCH_DIR}/bin/rm ${bindir}/rm
cp /${ARCH_DIR}/bin/blood-elf ${BINDIR}/blood-elf
cp /${ARCH_DIR}/bin/catm ${BINDIR}/catm
cp /${ARCH_DIR}/bin/chmod ${BINDIR}/chmod
cp /${ARCH_DIR}/bin/get_machine ${BINDIR}/get_machine
cp /${ARCH_DIR}/bin/hex2 ${BINDIR}/hex2
cp /${ARCH_DIR}/bin/kaem ${BINDIR}/kaem
cp /${ARCH_DIR}/bin/match ${BINDIR}/match
cp /${ARCH_DIR}/bin/M1 ${BINDIR}/M1
cp /${ARCH_DIR}/bin/M2-Mesoplanet ${BINDIR}/M2-Mesoplanet
cp /${ARCH_DIR}/bin/M2-Planet ${BINDIR}/M2-Planet
cp /${ARCH_DIR}/bin/mkdir ${BINDIR}/mkdir
cp /${ARCH_DIR}/bin/sha256sum ${BINDIR}/sha256sum
cp /${ARCH_DIR}/bin/unbz2 ${BINDIR}/unbz2
cp /${ARCH_DIR}/bin/ungz ${BINDIR}/ungz
cp /${ARCH_DIR}/bin/untar ${BINDIR}/untar
cp /${ARCH_DIR}/bin/cp ${BINDIR}/cp
cp /${ARCH_DIR}/bin/replace ${BINDIR}/replace
cp /${ARCH_DIR}/bin/rm ${BINDIR}/rm

chmod 755 ${bindir}/blood-elf
chmod 755 ${bindir}/catm
chmod 755 ${bindir}/chmod
chmod 755 ${bindir}/cp
chmod 755 ${bindir}/get_machine
chmod 755 ${bindir}/hex2
chmod 755 ${bindir}/kaem
chmod 755 ${bindir}/match
chmod 755 ${bindir}/M1
chmod 755 ${bindir}/M2-Mesoplanet
chmod 755 ${bindir}/M2-Planet
chmod 755 ${bindir}/mkdir
chmod 755 ${bindir}/sha256sum
chmod 755 ${bindir}/unbz2
chmod 755 ${bindir}/ungz
chmod 755 ${bindir}/untar
chmod 755 ${bindir}/replace
chmod 755 ${bindir}/rm
chmod 755 ${BINDIR}/blood-elf
chmod 755 ${BINDIR}/catm
chmod 755 ${BINDIR}/chmod
chmod 755 ${BINDIR}/cp
chmod 755 ${BINDIR}/get_machine
chmod 755 ${BINDIR}/hex2
chmod 755 ${BINDIR}/kaem
chmod 755 ${BINDIR}/match
chmod 755 ${BINDIR}/M1
chmod 755 ${BINDIR}/M2-Mesoplanet
chmod 755 ${BINDIR}/M2-Planet
chmod 755 ${BINDIR}/mkdir
chmod 755 ${BINDIR}/sha256sum
chmod 755 ${BINDIR}/unbz2
chmod 755 ${BINDIR}/ungz
chmod 755 ${BINDIR}/untar
chmod 755 ${BINDIR}/replace
chmod 755 ${BINDIR}/rm

PATH=${bindir}
PATH=${BINDIR}

cd ${sysa}

Expand Down
6 changes: 3 additions & 3 deletions sysa/after2.kaem
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# SPDX-FileCopyrightText: 2023 Richard Masters <[email protected]>
# SPDX-License-Identifier: MIT

prefix=/usr
bindir=${prefix}/bin
PREFIX=/usr
BINDIR=${PREFIX}/bin

PATH=${bindir}
PATH=${BINDIR}

cd sysa

Expand Down
12 changes: 6 additions & 6 deletions sysa/bash-2.05b/bash-2.05b.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mkdir build src
cd build

# Extract
cp ${distfiles}/${pkg}.tar.gz ../src/
cp ${DISTFILES}/${pkg}.tar.gz ../src/
gzip -d -f ../src/${pkg}.tar.gz
tar xf ../src/${pkg}.tar
rm -r ../src/
Expand Down Expand Up @@ -46,11 +46,11 @@ cd ..
make

# Install
install bash ${prefix}/bin/
install bash ${PREFIX}/bin/
mkdir /bin/
ln -s ${prefix}/bin/bash /bin/bash
ln -s ${prefix}/bin/bash /bin/sh
ln -s ${prefix}/bin/bash ${prefix}/bin/sh
ln -s ${PREFIX}/bin/bash /bin/bash
ln -s ${PREFIX}/bin/bash /bin/sh
ln -s ${PREFIX}/bin/bash ${PREFIX}/bin/sh

cd ../..

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

install ${pkg}.checksums ${srcdir}
install ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
12 changes: 6 additions & 6 deletions sysa/bzip2-1.0.8/bzip2-1.0.8.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mkdir build src
cd build

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

# Install
cp bzip2 ${prefix}/bin/bzip2
cp bzip2 ${prefix}/bin/bunzip2
chmod 755 ${prefix}/bin/bzip2
chmod 755 ${prefix}/bin/bunzip2
cp bzip2 ${PREFIX}/bin/bzip2
cp bzip2 ${PREFIX}/bin/bunzip2
chmod 755 ${PREFIX}/bin/bzip2
chmod 755 ${PREFIX}/bin/bunzip2

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

cp ${pkg}.checksums ${srcdir}
cp ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
2 changes: 1 addition & 1 deletion sysa/checksum-transcriber.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define MAX_TOKENS 3

char *get_distfiles(char **envp) {
char *envvar = "distfiles=";
char *envvar = "DISTFILES=";
int i = 0;
while (envp[i] != NULL && strncmp(envp[i], envvar, strlen(envvar)) != 0) i += 1;
// Now we have distfiles= - get just the part we want.
Expand Down
8 changes: 4 additions & 4 deletions sysa/coreutils-5.0/coreutils-5.0.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mkdir build src
cd build

# Extract
cp ${distfiles}/${pkg}.tar.bz2 ../src/
cp ${DISTFILES}/${pkg}.tar.bz2 ../src/
bunzip2 -f ../src/${pkg}.tar.bz2
tar xf ../src/${pkg}.tar
cd ${pkg}
Expand Down Expand Up @@ -45,8 +45,8 @@ patch -Np0 -i ../../patches/sort-locale.patch
patch -Np0 -i ../../patches/uniq-fopen.patch

# Build and install
make -f Makefile PREFIX=${prefix}
make -f Makefile PREFIX=${prefix} install
make -f Makefile PREFIX=${PREFIX}
make -f Makefile PREFIX=${PREFIX} install

cd ../..
rm -r src/
Expand Down Expand Up @@ -116,7 +116,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
/usr/bin/rm \
/usr/bin/sha1sum

install ${pkg}.checksums ${srcdir}
install ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
8 changes: 4 additions & 4 deletions sysa/fiwix-1.4.0-lb3/fiwix-1.4.0-lb3.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ sha256sum -c sources.SHA256SUM
# Extract
mkdir build src
cd src
ungz --file ${distfiles}/${pkg}.tar.gz --output ${pkg}.tar
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
cd ..

cd build
untar --file ../src/${pkg}.tar
cd ${pkg}

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"
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"

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"
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"

cd kernel
as -c -o boot.o boot.S
Expand Down Expand Up @@ -554,7 +554,7 @@ if match x${UPDATE_CHECKSUMS} xTrue; then
sha256sum -o ${pkg}.checksums \
/boot/fiwix

cp ${pkg}.checksums ${srcdir}
cp ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
12 changes: 6 additions & 6 deletions sysa/gzip-1.2.4/gzip-1.2.4.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mkdir build src
cd build

# Extract
ungz --file ${distfiles}/${pkg}.tar.gz --output ../src/${pkg}.tar
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ../src/${pkg}.tar
untar --file ../src/${pkg}.tar
rm ../src/${pkg}.tar
cd ${pkg}
Expand All @@ -42,10 +42,10 @@ cp util.c.new util.c
make

# Install
cp gzip ${bindir}/gzip
cp gzip ${bindir}/gunzip
chmod 755 ${bindir}/gzip
chmod 755 ${bindir}/gunzip
cp gzip ${BINDIR}/gzip
cp gzip ${BINDIR}/gunzip
chmod 755 ${BINDIR}/gzip
chmod 755 ${BINDIR}/gunzip

cd ../..

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

cp ${pkg}.checksums ${srcdir}
cp ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
16 changes: 8 additions & 8 deletions sysa/heirloom-devtools-070527/heirloom-devtools-070527.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd build
lexdir=/lex

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

# Install yacc
install yacc ${bindir}
install -m 644 yaccpar /
install yacc ${BINDIR}
install -m 644 yaccpar ${LIBDIR}

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

# Install lex
mkdir ${lexdir}
install lex ${bindir}
install libl.a ${libdir}
install -m 644 ncform ${lexdir}
mkdir ${LEXDIR}
install lex ${BINDIR}
install libl.a ${LIBDIR}
install -m 644 ncform ${LEXDIR}

cd ../../..

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

install ${pkg}.checksums ${srcdir}
install ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
4 changes: 2 additions & 2 deletions sysa/kexec-fiwix/kexec-fiwix.kaem
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
set -ex

cd src
tcc -m32 -march=i386 -std=c89 -I../../tcc/tcc-0.9.27/include -o ${bindir}/kexec-fiwix kexec-fiwix.c
tcc -m32 -march=i386 -std=c89 -I../../tcc/tcc-0.9.27/include -o ${BINDIR}/kexec-fiwix kexec-fiwix.c
cd ..

# Checksums
if match x${UPDATE_CHECKSUMS} xTrue; then
sha256sum -o ${pkg}.checksums \
/usr/bin/kexec-fiwix

cp ${pkg}.checksums ${srcdir}
cp ${pkg}.checksums ${SRCDIR}
else
sha256sum -c ${pkg}.checksums
fi
Loading
Loading