Skip to content

Commit

Permalink
Add netcat port
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalmiel committed Nov 7, 2023
1 parent aceaed1 commit 9553d1a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ https://github.com/rafalmiel/cykusz-rs/assets/3881998/afa514a1-f435-4eeb-8c80-20
## Kernel

- [x] 64bit higher-half kernel
- [x] VGA text output
- [x] VESA fb output
- [x] Physical memory allocator
- [x] Paging
- [x] Kernel heap
Expand Down Expand Up @@ -56,6 +56,7 @@ https://github.com/rafalmiel/cykusz-rs/assets/3881998/afa514a1-f435-4eeb-8c80-20
- [x] less (<https://github.com/rafalmiel/less/tree/cykusz>)
- [x] zstd (<https://github.com/rafalmiel/zstd/tree/cykusz>)
- [x] doom (<https://github.com/rafalmiel/doomgeneric/tree/cykusz>)
- [x] netcat (<https://github.com/rafalmiel/netcat/tree/cykusz>)

## Building

Expand Down
32 changes: 32 additions & 0 deletions sysroot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TZDB_SRC_DIR=$SRC_DIR/tzdb
ZSTD_SRC_DIR=$SRC_DIR/zstd
LLVM_SRC_DIR=$SRC_DIR/llvm-project
LESS_SRC_DIR=$SRC_DIR/less
NETCAT_SRC_DIR=$SRC_DIR/netcat

BUILD_DIR=$CYKUSZ_DIR/sysroot/build
BINUTILS_BUILD_DIR=$BUILD_DIR/binutils-gdb
Expand All @@ -33,6 +34,7 @@ COREUTILS_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-coreutils
ZSTD_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-zstd
LLVM_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-llvm
LESS_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-less
NETCAT_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-netcat
GCC_BUILD_DIR=$BUILD_DIR/gcc
MLIBC_BUILD_DIR=$BUILD_DIR/mlibc
GMP_BUILD_DIR=$BUILD_DIR/gmp
Expand Down Expand Up @@ -164,6 +166,13 @@ function _prepare_less {
fi
}

function _prepare_netcat {
if [ ! -d $NETCAT_SRC_DIR ]; then
mkdir -p $SRC_DIR
git clone --depth 1 -b cykusz https://github.com/rafalmiel/netcat.git $NETCAT_SRC_DIR
fi
}

function _sysroot {
_prepare_mlibc

Expand All @@ -172,6 +181,8 @@ function _sysroot {
rm -rf $MLIBC_BUILD_DIR
meson setup --cross-file $SPATH/cross-file.ini --prefix $SYSROOT/usr -Dheaders_only=true $MLIBC_BUILD_DIR $MLIBC_SRC_DIR
meson install -C $MLIBC_BUILD_DIR

cp $SPATH/resolv.conf $SYSROOT/etc
}

function _binutils {
Expand Down Expand Up @@ -392,6 +403,27 @@ function _cykusz_less {
make -C $LESS_CYKUSZ_BUILD_DIR DESTDIR=$SYSROOT install
}

function _cykusz_netcat {
_prepare_netcat

mkdir -p $NETCAT_CYKUSZ_BUILD_DIR

pushd .

cd $NETCAT_CYKUSZ_BUILD_DIR
$NETCAT_SRC_DIR/configure --host=$TRIPLE --target=$TRIPLE --prefix=/usr

popd

make -C $NETCAT_CYKUSZ_BUILD_DIR DESTDIR=$SYSROOT -j4
make -C $NETCAT_CYKUSZ_BUILD_DIR DESTDIR=$SYSROOT install

pushd .
cd $SYSROOT/usr/bin
ln -sf $TRIPLE-netcat netcat
popd
}

function _cykusz_coreutils {
_prepare_coreutils

Expand Down

0 comments on commit 9553d1a

Please sign in to comment.