Browse Source

Fixed some scripts, busybox now builds wget too, added stow and perl

master
mid-kid 10 years ago
parent
commit
61930c43a6
  1. 27
      tools/chroot
  2. 8
      tools/mktools
  3. 20
      tools/prepchroot
  4. 1
      tools/satellites/astronaut.sat
  5. 10
      tools/satellites/busybox.config
  6. 14
      tools/satellites/perl.sat
  7. 10
      tools/satellites/stow.sat

27
tools/chroot

@ -12,15 +12,29 @@ if [ ! "$rocket" ]; then
exit 1
fi
rocket="$(realpath "$rocket")"
checkmount() {
local point="$(eval echo \${$#})"
if cut -d' ' -f2 /proc/mounts | grep "$point" > /dev/null; then
true
else
mount $@
fi
}
mkdir -p "$rocket/dev" "$rocket/proc" "$rocket/sys" "$rocket/run"
mount --bind /dev "$rocket/dev"
mount -t devpts devpts "$rocket/dev/pts"
mount -t proc proc "$rocket/proc"
mount -t tmpfs tmpfs "$rocket/run"
checkmount --bind /dev "$rocket/dev"
checkmount -t devpts devpts "$rocket/dev/pts"
checkmount -t proc proc "$rocket/proc"
checkmount -t tmpfs tmpfs "$rocket/run"
if [ -h "$rocket/dev/shm" ]; then
mkdir -p "$rocket/$(readlink "$rocket/dev/shm")"
fi
mkdir -p "$rocket/etc"
cp /etc/resolv.conf "$rocket/etc/resolv.conf"
chroot "$rocket" /tools/bin/env -i \
HOME=/root \
TERM="$TERM" \
@ -28,3 +42,8 @@ chroot "$rocket" /tools/bin/env -i \
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/tools/bin \
MAKEFLAGS="$MAKEFLAGS" \
/tools/bin/ash -l
umount "$rocket/dev/pts"
umount "$rocket/dev"
umount "$rocket/proc"
umount "$rocket/run"

8
tools/mktools

@ -44,6 +44,8 @@ astrobuild() {
# List of packages to build
mkdir -p "$rocket/tools"
# Toolchain
astrobuild "binutils-1"
astrobuild "gcc-1"
astrobuild "linux-api"
@ -51,6 +53,10 @@ astrobuild "glibc"
astrobuild "libstdc"
astrobuild "binutils-2"
astrobuild "gcc-2"
astrobuild "make"
# Utilities
astrobuild "busybox"
astrobuild "make"
astrobuild "perl"
astrobuild "stow"
astrobuild "astronaut"

20
tools/prepchroot

@ -16,10 +16,24 @@ echo "Changing ownership of $rocket to root"
chown -R 0.0 "$rocket"
echo "Creating device nodes"
mknod -m 600 "$rocket/dev/console" c 5 1
mknod -m 666 "$rocket/dev/null" c 1 3
mkdir -p "$rocket/dev"
if cut -d' ' -f2 /proc/mounts | grep "$rocket/dev" > /dev/null; then
umount -R "$rocket/dev"
fi
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
echo "Creating directories"
install -dm755 "$rocket/root"
mkdir -p "$rocket/etc" "$rocket/bin" "$rocket/usr/pkg"
echo "Moving temporary things into place"
ln -sf /tools/bin/sh "$rocket/bin/sh"
echo "Creating users and groups"
echo 'root:x:0:0:root:/root:/bin/sh' > "$rocket/etc/passwd"
echo 'root:x:0:' > "$rocket/etc/group"
echo "Configuring astronaut"
mkdir -p "$rocket/etc"
echo '# This is a config for use with busybox
cmd_download="wget -O {dst} {src}"' > "$rocket/etc/astronaut.conf"

1
tools/satellites/astronaut.sat

@ -1,3 +1,4 @@
# This is a hacky satellite. Please refrain of making more like this if possible.
msg "Installing astronaut"
install -Dm755 "$(command -v "$0")" "$dir_install/tools/bin/astronaut"

10
tools/satellites/busybox.config

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.22.1
# Fri Nov 14 21:14:39 2014
# Tue Nov 18 22:48:33 2014
#
CONFIG_HAVE_DOT_CONFIG=y
@ -854,11 +854,11 @@ CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
# CONFIG_UDPSVD is not set
# CONFIG_VCONFIG is not set
# CONFIG_WGET is not set
# CONFIG_FEATURE_WGET_STATUSBAR is not set
# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
# CONFIG_FEATURE_WGET_TIMEOUT is not set
CONFIG_FEATURE_WGET_TIMEOUT=y
# CONFIG_ZCIP is not set
#

14
tools/satellites/perl.sat

@ -0,0 +1,14 @@
name=perl
version=5.20.1
dlextract "http://www.cpan.org/src/5.0/$name-$version.tar.gz" \
"7a195abb7d6769f751e90c7d30dcf2e0"
cd "$name-$version"
sh Configure -des -Dprefix=/tools -Dlibs=-lm
make
cp perl cpan/podlators/pod2man "$dir_install/tools/bin"
mkdir -p "$dir_install/tools/lib/perl5"
cp -r lib "$dir_install/tools/lib/perl5/$version"

10
tools/satellites/stow.sat

@ -0,0 +1,10 @@
name=stow
version=2.2.0
dlextract "http://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2" \
"5bb56592eff9aaf9dfb6c975b3004240"
cd "$name-$version"
./configure --prefix=/tools
make DESTDIR="$dir_install" install-exec-am install-pmDATA install-dist_pmstowDATA
Loading…
Cancel
Save