From 0ab268ee5f3ae1db199200091d694cf12bc76064 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 11 Aug 2010 20:17:59 +0200 Subject: .. we have working packages :) --- broot.sh | 2 +- chroot-scripts/build-core.sh | 15 +++++++++++---- chroot-scripts/packages/dialog.pkg.sh | 3 +++ chroot-scripts/packages/dropbear.pkg.sh | 3 +++ chroot-scripts/packages/hwinfo.pkg.sh | 3 +++ chroot-scripts/packages/kexec.pkg.sh | 3 +++ chroot-scripts/packages/nbd-client.pkg.sh | 3 +++ chroot-scripts/packages/splashy.pkg.sh | 3 +++ chroot-scripts/packages/strace.pkg.sh | 3 +++ chroot-scripts/pkg-builder.sh | 12 +++++++----- inc/chroot-functions.inc.sh | 2 ++ inc/env.inc.sh | 2 +- inc/helper.inc.sh | 4 ++-- tasks/build_core.task.sh | 4 +++- 14 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 chroot-scripts/packages/dialog.pkg.sh create mode 100644 chroot-scripts/packages/dropbear.pkg.sh create mode 100644 chroot-scripts/packages/hwinfo.pkg.sh create mode 100644 chroot-scripts/packages/kexec.pkg.sh create mode 100644 chroot-scripts/packages/nbd-client.pkg.sh create mode 100644 chroot-scripts/packages/splashy.pkg.sh create mode 100644 chroot-scripts/packages/strace.pkg.sh diff --git a/broot.sh b/broot.sh index 552fff3..b98afaf 100755 --- a/broot.sh +++ b/broot.sh @@ -23,7 +23,7 @@ case $1 in tasks="shell" ;; "build-core-pkgs") - tasks="build_core" + tasks="update_chrootscripts build_core" # updateScripts # chroot-exec /root/bin/build-preboot.sh ;; diff --git a/chroot-scripts/build-core.sh b/chroot-scripts/build-core.sh index d5e14ce..3ddfec5 100644 --- a/chroot-scripts/build-core.sh +++ b/chroot-scripts/build-core.sh @@ -1,16 +1,23 @@ #!/bin/bash +cd /root/bin + . ./pkg-builder.sh -PACKAGES="eglibc kexec dialog dropbear nbd-client iw strace" +PACKAGES="eglibc kexec dialog nbd-client iw splashy hwinfo strace" mkdir -p /root/packages +[ -d /root/packages/indices/ ] && rm /root/packages/indices/* for p in $PACKAGES do - . ./packages/$p.pkg.sh - aptitude install -y $APT_PACKAGES - copyfileswithdependencies + mkdir -p /chroot + . /root/bin/packages/$p.pkg.sh + aptitude install -y -q $APT_PACKAGES + killall dbus-daemon cd /chroot + copyfileswithdependencies tar cfvz /root/packages/$p.tgz * + cd /root/bin + rm -rf /chroot done diff --git a/chroot-scripts/packages/dialog.pkg.sh b/chroot-scripts/packages/dialog.pkg.sh new file mode 100644 index 0000000..67706e5 --- /dev/null +++ b/chroot-scripts/packages/dialog.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="dialog" +APT_PACKAGES="dialog" +REQUIRED_BINARIES="$(which dialog)" diff --git a/chroot-scripts/packages/dropbear.pkg.sh b/chroot-scripts/packages/dropbear.pkg.sh new file mode 100644 index 0000000..18fdff8 --- /dev/null +++ b/chroot-scripts/packages/dropbear.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="dropbear" +APT_PACKAGES="dropbear" +REQUIRED_BINARIES="$(which dropbear)" diff --git a/chroot-scripts/packages/hwinfo.pkg.sh b/chroot-scripts/packages/hwinfo.pkg.sh new file mode 100644 index 0000000..b86f0fd --- /dev/null +++ b/chroot-scripts/packages/hwinfo.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="hwinfo" +APT_PACKAGES="hwinfo" +REQUIRED_BINARIES="$(which hwinfo)" diff --git a/chroot-scripts/packages/kexec.pkg.sh b/chroot-scripts/packages/kexec.pkg.sh new file mode 100644 index 0000000..827bc76 --- /dev/null +++ b/chroot-scripts/packages/kexec.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="kexec" +APT_PACKAGES="kexec-tools" +REQUIRED_BINARIES="$(which kexec)" diff --git a/chroot-scripts/packages/nbd-client.pkg.sh b/chroot-scripts/packages/nbd-client.pkg.sh new file mode 100644 index 0000000..79584af --- /dev/null +++ b/chroot-scripts/packages/nbd-client.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="nbd-client" +APT_PACKAGES="nbd-client" +REQUIRED_BINARIES="$(which nbd-client)" diff --git a/chroot-scripts/packages/splashy.pkg.sh b/chroot-scripts/packages/splashy.pkg.sh new file mode 100644 index 0000000..701b413 --- /dev/null +++ b/chroot-scripts/packages/splashy.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="splashy" +APT_PACKAGES="splashy" +REQUIRED_BINARIES="$(which splashy)" diff --git a/chroot-scripts/packages/strace.pkg.sh b/chroot-scripts/packages/strace.pkg.sh new file mode 100644 index 0000000..917f20e --- /dev/null +++ b/chroot-scripts/packages/strace.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="strace" +APT_PACKAGES="strace" +REQUIRED_BINARIES="$(which strace)" diff --git a/chroot-scripts/pkg-builder.sh b/chroot-scripts/pkg-builder.sh index d172860..ec97343 100755 --- a/chroot-scripts/pkg-builder.sh +++ b/chroot-scripts/pkg-builder.sh @@ -6,7 +6,7 @@ if [ "$(readlink -f $0| xargs basename)" == "pkg-builder.sh" ]; then fi ### Variables ##### -CHROOT_DIR=/tmp/chroot +CHROOT_DIR=/chroot PKG_DIR=/root/packages [ ! -d "$PKG_DIR/indices" ] && mkdir -p "$PKG_DIR/indices" @@ -15,28 +15,30 @@ copyfileswithdependencies () { # Create $CHROOT_DIR [ ! -d $CHROOT_DIR ] && mkdir $CHROOT_DIR cd $CHROOT_DIR - # Copy $REQUIRED_CHROOT_FILES and shared library dependencies # to chroot environment [ -f "$PKG_DIR/indices/$PKG_NAME.files" ] && rm -f "$PKG_DIR/indices/$PKG_NAME.files" - for FILE in $REQUIRED_CHROOT_FILES + for FILE in $REQUIRED_BINARIES do DIR=`dirname $FILE | cut -c2-` - [ ! -d $DIR ] && mkdir -p $DIR + echo $DIR + [ ! -d "$DIR" ] && mkdir -p "$DIR" cp $FILE `echo $FILE | cut -c2-` echo $FILE | cut -c1- >> "$PKG_DIR/indices/$PKG_NAME.files" for SHARED_LIBRARY in `ldd $FILE | awk '{print $3}' |grep ^/` do + echo "$SHARED_LIBRARY" DIR=`dirname $SHARED_LIBRARY | cut -c2-` [ ! -d $DIR ] && mkdir -p $DIR [ ! -s "`echo $SHARED_LIBRARY | cut -c2-`" ] && \ - [ ! "$(grep -l $SHARED_LIBRARY $PKG_DIR/indices/*| wc -l)" == "0" ] && \ + [ "$(grep -l $SHARED_LIBRARY $PKG_DIR/indices/*| wc -l)" == "0" ] && \ cp $SHARED_LIBRARY `echo $SHARED_LIBRARY | cut -c2-` && \ echo $SHARED_LIBRARY | cut -c1- >> "$PKG_DIR/indices/$PKG_NAME.files" done done + REQUIRED_BINARIES="" #cp /lib/ld-* lib } diff --git a/inc/chroot-functions.inc.sh b/inc/chroot-functions.inc.sh index 35f2589..7eb566c 100644 --- a/inc/chroot-functions.inc.sh +++ b/inc/chroot-functions.inc.sh @@ -2,6 +2,8 @@ chroot-exec () { export HOME="/root" if [ $(mount |grep -c $BROOT_BUILDROOT_PATH/dev) -eq 0 ]; then setupBindmounts + else + echo "found existing mounts skipping mount setup" fi chroot $BROOT_BUILDROOT_PATH linux32 $@ } diff --git a/inc/env.inc.sh b/inc/env.inc.sh index 34e9c5b..52284d5 100644 --- a/inc/env.inc.sh +++ b/inc/env.inc.sh @@ -1,6 +1,6 @@ slxsettings=$(slxsettings 2>/dev/null ) if [ $? -eq 0 ]; then - BROOT_BUILDROOT_PATH=$(slxsettings |grep public-path | sed -e "s,^.*='\(.*\)'$,\1,") + BROOT_BUILDROOT_PATH=$(slxsettings |grep private-path | sed -e "s,^.*='\(.*\)'$,\1,") BROOT_BUILDROOT_PATH="$BROOT_BUILDROOT_PATH/buildroot" else BROOT_BUILDROOT_PATH="/tmp/buildroot" diff --git a/inc/helper.inc.sh b/inc/helper.inc.sh index 6f63dfe..d51aac2 100644 --- a/inc/helper.inc.sh +++ b/inc/helper.inc.sh @@ -1,7 +1,7 @@ setupBindmounts() { - mount -o bind /proc $BROOT_BUILDROOT_PATH/proc - mount -t devtmpfs dev $BROOT_BUILDROOT_PATH/dev + mount -t proc proc $BROOT_BUILDROOT_PATH/proc + mount -t tmpfs dev $BROOT_BUILDROOT_PATH/dev chroot $BROOT_BUILDROOT_PATH mount -t devpts devpts /dev/pts [ "x$(cat /proc/mounts | grep -q "/tmp/deb")" == "x" ] && mount -o bind /tmp/deb $BROOT_BUILDROOT_PATH/var/cache/apt/archives } diff --git a/tasks/build_core.task.sh b/tasks/build_core.task.sh index 5cdd3b1..73b2783 100644 --- a/tasks/build_core.task.sh +++ b/tasks/build_core.task.sh @@ -3,5 +3,7 @@ build_core_package_dependencies="" build_core() { local ME=build_core echo " Building core" - chroot-exec /root/bin/build-core.sh >> $BROOT_LOG.$ME + chroot-exec /root/bin/build-core.sh +#>> $BROOT_LOG.$ME + destroyBindmounts } -- cgit v1.2.3-55-g7522