Browse Source

This commit was long overdue

master
mid-kid 10 years ago
parent
commit
b204bdd8d9
  1. 36
      astronaut/astronaut
  2. 9
      tools/mktools
  3. 26
      tools/prepchroot
  4. 8
      tools/satellites/binutils-1.sat
  5. 6
      tools/satellites/extrafiles/busybox/busybox.config
  6. 12
      tools/satellites/gawk.sat
  7. 12
      tools/satellites/m4.sat

36
astronaut/astronaut

@ -8,6 +8,7 @@ dir_source="$PWD/source"
dir_install="$PWD/install" dir_install="$PWD/install"
cmd_download="curl -#L -o {dst} {src}" cmd_download="curl -#L -o {dst} {src}"
cmd_extract="tar xf {src}" cmd_extract="tar xf {src}"
enable_movedirs=true
enable_check=true enable_check=true
if [ -f /etc/astronaut.conf ]; then if [ -f /etc/astronaut.conf ]; then
. /etc/astronaut.conf . /etc/astronaut.conf
@ -17,13 +18,15 @@ fi
show_help() { show_help() {
echo "This astronaut will help you build some satellites. echo "This astronaut will help you build some satellites.
Just describe what he's got to do in a satellite file. Just describe what he's got to do in a satellite file.
Usage: $0 [-s <dir>] [-b <dir>] [-i <dir>] [-cC] <satellite> Usage: $0 [-sbi <dir>] [-cCmM] <satellite>
-s Set source directory -s Set source directory
-b Set build directory [WARNING: Will be deleted before build] -b Set build directory [WARNING: Will be deleted before build]
-i Set install directory -i Set install directory
-c Enable package checking -c Enable package checking
-C Disable package checking" -C Disable package checking
-m Enable moving directories to match custom tree
-M Disable moving directories to match custom tree"
} }
msg() { msg() {
@ -36,7 +39,7 @@ exiterr() {
} }
# Gather info # Gather info
while getopts "h?s:b:i:cC" opt; do while getopts "h?s:b:i:cCmM" opt; do
case "$opt" in case "$opt" in
h|\?) h|\?)
show_help show_help
@ -55,10 +58,16 @@ while getopts "h?s:b:i:cC" opt; do
dir_install="$(realpath "$OPTARG")" dir_install="$(realpath "$OPTARG")"
;; ;;
c) c)
enable_checking=true enable_check=true
;; ;;
C) C)
enable_checking=false enable_check=false
;;
m)
enable_movedirs=true
;;
M)
enable_movedirs=false
;; ;;
esac esac
done done
@ -135,7 +144,7 @@ extrafile() {
} }
do_check() { do_check() {
if [ "$enable_check" = true ]; then if $enable_check; then
if [ "$1" ]; then if [ "$1" ]; then
$@ $@
else else
@ -153,3 +162,18 @@ mkdir -p "$dir_install"
cd "$dir_build" cd "$dir_build"
. "$satellite" . "$satellite"
if $enable_movedirs; then
if [ "$(uname -m)" == "x86_64" ]; then
if [ -d "$dir_install/lib64" ]; then
mkdir -p "$dir_install/lib"
mv $(find "$dir_install/lib64/" -maxdepth 1 -mindepth 1) "$dir_install/lib"
rmdir "$dir_install/lib64"
fi
if [ -d "$dir_install/usr/lib64" ]; then
mkdir -p "$dir_install/usr/lib"
mv $(find "$dir_install/usr/lib64/" -maxdepth 1 -mindepth 1) "$dir_install/usr/lib"
rmdir "$dir_install/usr/lib64"
fi
fi
fi

9
tools/mktools

@ -39,11 +39,13 @@ envrun() {
} }
astrobuild() { astrobuild() {
envrun astronaut -i "$rocket" "$satellite_dir/$1.sat" envrun astronaut -M -i "$rocket" "$satellite_dir/$1.sat"
} }
mkdir -p "$rocket/tools/lib"
ln -sf lib "$rocket/tools/lib64"
# List of packages to build # List of packages to build
mkdir -p "$rocket/tools"
# Toolchain # Toolchain
astrobuild "binutils-1" astrobuild "binutils-1"
@ -57,7 +59,10 @@ astrobuild "gcc-2"
# Utilities # Utilities
astrobuild "busybox" astrobuild "busybox"
astrobuild "bash" astrobuild "bash"
astrobuild "gawk"
astrobuild "make" astrobuild "make"
astrobuild "m4"
astrobuild "perl" astrobuild "perl"
astrobuild "openssl" astrobuild "openssl"
astrobuild "ca-certificates" astrobuild "ca-certificates"

26
tools/prepchroot

@ -24,13 +24,27 @@ mknod -m 600 "$rocket/dev/console" c 5 1 2> /dev/null || true
mknod -m 666 "$rocket/dev/null" c 1 3 2> /dev/null || true mknod -m 666 "$rocket/dev/null" c 1 3 2> /dev/null || true
echo "Creating directories" echo "Creating directories"
install -dm755 "$rocket/root" install -dm750 "$rocket/root"
mkdir -p "$rocket/etc/ssl" "$rocket/bin" "$rocket/usr/pkg" "$rocket/usr/sat" install -dm1777 "$rocket/tmp"
mkdir -p "$rocket/etc" "$rocket/usr/pkg" "$rocket/usr/sat"
if [ "$(uname -m)" == "x86_64" ]; then
ln -sf lib "$rocket/lib64"
ln -sf lib "$rocket/usr/lib64"
fi
echo "Moving temporary things into place" echo "Creating temporary symlinks"
ln -sf /tools/bin/sh "$rocket/bin/sh" mkdir -p "$rocket/usr/pkg/tmp-coreutils/bin"
ln -sf /tools/bin/bash "$rocket/bin/bash" ln -sf ../../../../tools/bin/sh "$rocket/usr/pkg/tmp-coreutils/bin/sh"
ln -sf /tools/lib/ssl/certs "$rocket/etc/ssl/certs" ln -sf ../../../../tools/bin/pwd "$rocket/usr/pkg/tmp-coreutils/bin/pwd"
mkdir -p "$rocket/usr/pkg/tmp-bash/bin"
ln -sf ../../../../tools/bin/bash "$rocket/usr/pkg/tmp-bash/bin/bash"
mkdir -p "$rocket/usr/pkg/tmp-ca-certificates/etc/ssl"
ln -sf ../../../../../tools/lib/ssl/certs "$rocket/usr/pkg/tmp-ca-certificates/etc/ssl/certs"
mkdir -p "$rocket/usr/pkg/tmp-gcc/usr/lib"
ln -sf ../../../../../tools/lib/libgcc_s.so "$rocket/usr/pkg/tmp-gcc/usr/lib/libgcc_s.so"
ln -sf ../../../../../tools/lib/libgcc_s.so.1 "$rocket/usr/pkg/tmp-gcc/usr/lib/libgcc_s.so.1"
ln -sf ../../../../../tools/lib/libstdc++.so "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so"
ln -sf ../../../../../tools/lib/libstdc++.so.6 "$rocket/usr/pkg/tmp-gcc/usr/lib/libstdc++.so.6"
echo "Creating users and groups" echo "Creating users and groups"
echo 'root:x:0:0:root:/root:/bin/sh' > "$rocket/etc/passwd" echo 'root:x:0:0:root:/root:/bin/sh' > "$rocket/etc/passwd"

8
tools/satellites/binutils-1.sat

@ -14,12 +14,6 @@ mkdir "$name-build"; cd "$name-build"
--disable-nls \ --disable-nls \
--disable-werror --disable-werror
make make; make DESTDIR="$dir_install" install
case $(uname -m) in
x86_64) mkdir "$dir_install/tools/lib" && ln -s lib "$dir_install/tools/lib64" ;;
esac
make DESTDIR="$dir_install" install
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

6
tools/satellites/extrafiles/busybox/busybox.config

@ -1,7 +1,7 @@
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Busybox version: 1.22.1 # Busybox version: 1.22.1
# Tue Nov 18 22:48:33 2014 # Sun Dec 7 14:30:18 2014
# #
CONFIG_HAVE_DOT_CONFIG=y CONFIG_HAVE_DOT_CONFIG=y
@ -150,7 +150,7 @@ CONFIG_FEATURE_SEAMLESS_GZ=y
# CONFIG_DPKG is not set # CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set # CONFIG_DPKG_DEB is not set
# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set # CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
# CONFIG_GZIP is not set CONFIG_GZIP=y
# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set # CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
CONFIG_GZIP_FAST=0 CONFIG_GZIP_FAST=0
# CONFIG_LZOP is not set # CONFIG_LZOP is not set
@ -158,7 +158,7 @@ CONFIG_GZIP_FAST=0
# CONFIG_RPM is not set # CONFIG_RPM is not set
# CONFIG_RPM2CPIO is not set # CONFIG_RPM2CPIO is not set
CONFIG_TAR=y CONFIG_TAR=y
# CONFIG_FEATURE_TAR_CREATE is not set CONFIG_FEATURE_TAR_CREATE=y
CONFIG_FEATURE_TAR_AUTODETECT=y CONFIG_FEATURE_TAR_AUTODETECT=y
CONFIG_FEATURE_TAR_FROM=y CONFIG_FEATURE_TAR_FROM=y
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y

12
tools/satellites/gawk.sat

@ -0,0 +1,12 @@
name=gawk
version=4.1.1
dlextract "http://ftp.gnu.org/gnu/gawk/gawk-4.1.1.tar.xz" \
"a2a26543ce410eb74bc4a508349ed09a"
cd "$name-$version"
./configure --prefix=/tools
make; make DESTDIR="$dir_install" install
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

12
tools/satellites/m4.sat

@ -0,0 +1,12 @@
name=m4
version=1.4.17
dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.xz" \
"12a3c829301a4fd6586a57d3fcf196dc"
cd "$name-$version"
./configure --prefix=/tools
make; make DESTDIR="$dir_install" install
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
Loading…
Cancel
Save