Skip to content

Commit

Permalink
new rewrite scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
emmett1 committed Oct 21, 2022
1 parent d28dc23 commit 4bc700f
Show file tree
Hide file tree
Showing 94 changed files with 1,427 additions and 2,675 deletions.
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
config
xpkg.conf
*-crosstoolchain/
.done
*conf
*-crosstool/
*-rootfs/
ccache/
alicelinux-*.tar.xz
sources/
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ An experimental minimal [musl](https://www.musl-libc.org/) based distro.
alicelinux is not based on any other distro, it follows the **[KISS philosophy](https://en.wikipedia.org/wiki/KISS_principle)**.

## Host Build Dependencies
* rsync
* git
* curl
* base-devel (gcc)
* ccache
## Install dependency needed to build

**Arch linux Install dependency**
Expand All @@ -23,17 +21,16 @@ alicelinux is not based on any other distro, it follows the **[KISS philosophy](
```
# dnf groupinstall -y "C Development Tools and Libraries"
# dnf groupinstall -y "Development Tools"
# dnf install git rsync curl ccache
# dnf install git curl
```

### How to build Alicelinux
1. git clone **[https://github.com/emmett1/alicelinux.git](https://github.com/emmett1/alicelinux.git)**
2. cd alicelinux
3. Execute ./genconf generate xpkg.conf for build-cross
4. Execute ./build for build cross-compile
3. Execute ./build.sh to start build

#### Wiki Alicelinux
[wiki is under development](https://github.com/walber-vaz/alicelinux/wiki)
[wiki is under development](https://github.com/emmett1/alicelinux/wiki)

#### LICENSE GPLv3
[LICENSE](https://github.com/emmett1/alicelinux/blob/main/LICENSE)
23 changes: 0 additions & 23 deletions build

This file was deleted.

58 changes: 58 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/sh -e

CARCH="x86_64"
HOST=$(gcc -dumpmachine | sed "s/-[^-]*/-cross/")
TARGET="$CARCH-linux-musl"

ROOTFS="$PWD/$TARGET-rootfs"
CROSSTOOL="$PWD/$TARGET-crosstool"
THREADS="$(nproc)"
MAKEFLAGS="-j$THREADS"
CFLAGS="${CFLAGS:--O2 -march=x86-64 -pipe}"
CXXFLAGS="${CXXFLAGS:-${CFLAGS}}"

cat << EOF > conf
export HOST="$HOST"
export TARGET="$TARGET"
export CARCH="$CARCH"
export MAKEFLAGS="$MAKEFLAGS"
export ROOTFS="$ROOTFS"
export CROSSTOOL="$CROSSTOOL"
export PATH=$CROSSTOOL/bin:$PATH
export BOOTSTRAP=1
export CROSS_COMPILE="$TARGET-"
export CFLAGS="$CFLAGS"
export CXXFLAGS="$CXXFLAGS"
export CC="$TARGET-gcc"
export CXX="$TARGET-g++"
export AR="$TARGET-ar"
export AS="$TARGET-as"
export RANLIB="$TARGET-ranlib"
export LD="$TARGET-ld"
export STRIP="$TARGET-strip"
export PKG_CONFIG_PATH="$ROOTFS/usr/lib/pkgconfig:$ROOTFS/usr/share/pkgconfig"
#export PKG_CONFIG_SYSROOT_DIR="$ROOTFS"
EOF

cat << EOF > crosstool-conf
export HOST="$HOST"
export TARGET="$TARGET"
export CARCH="$CARCH"
export MAKEFLAGS="$MAKEFLAGS"
export ROOTFS="$ROOTFS"
export CROSSTOOL="$CROSSTOOL"
export PATH=$CROSSTOOL/bin:$PATH
export BOOTSTRAP=1
EOF

touch .done
for i in linux-headers cross-binutils cross-gcc-static musl \
cross-gcc filesystem zlib binutils m4 libgmp libmpfr \
libmpc gcc make file busybox libressl curl; do
grep -qx $i .done && continue
case $i in
cross-*) ROOT=$ROOTFS CONF=$(realpath ./crosstool-conf) ./scripts/$i.sh;;
*) ROOT=$ROOTFS CONF=$(realpath ./conf) ./scripts/$i.sh;;
esac
[ $? = 0 ] && echo $i >> .done || exit 1
done
20 changes: 0 additions & 20 deletions compressrootfs

This file was deleted.

14 changes: 0 additions & 14 deletions config.default

This file was deleted.

15 changes: 0 additions & 15 deletions cpscripts

This file was deleted.

62 changes: 0 additions & 62 deletions enterchroot

This file was deleted.

Loading

0 comments on commit 4bc700f

Please sign in to comment.