diff options
author | Sebastian | 2010-04-11 20:32:55 +0200 |
---|---|---|
committer | Sebastian | 2010-04-11 20:32:55 +0200 |
commit | b614b050102ec60700e19403c748f974da5a29a0 (patch) | |
tree | 520f5a2b1f521cbdbe23b2e0d0218645e9954604 /chroot-scripts | |
parent | added function to quickly access a shell inside chroot (diff) | |
download | broot-b614b050102ec60700e19403c748f974da5a29a0.tar.gz broot-b614b050102ec60700e19403c748f974da5a29a0.tar.xz broot-b614b050102ec60700e19403c748f974da5a29a0.zip |
transfer
Diffstat (limited to 'chroot-scripts')
-rw-r--r-- | chroot-scripts/build-core.sh | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | chroot-scripts/build-preboot.sh | 12 | ||||
-rw-r--r-- | chroot-scripts/packages/eglibc.pkg.sh | 3 | ||||
-rw-r--r-- | chroot-scripts/packages/iw.pkg.sh | 3 | ||||
-rwxr-xr-x | chroot-scripts/pkg-builder.sh | 42 |
5 files changed, 74 insertions, 0 deletions
diff --git a/chroot-scripts/build-core.sh b/chroot-scripts/build-core.sh new file mode 100644 index 0000000..25268eb --- /dev/null +++ b/chroot-scripts/build-core.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +PACKAGES="eglibc kexec dialog dropbear nbd-client iw strace" + +mkdir -p /root/packages + +for p in $PACKAGES +do + . ./packages/$p.pkg.sh + aptitude install -y $APT_PACKAGES + copyfileswithdependencies + cd /chroot + tar cfvz /root/packages/$p.tgz * +done diff --git a/chroot-scripts/build-preboot.sh b/chroot-scripts/build-preboot.sh index 587f1e8..3e84e40 100644..100755 --- a/chroot-scripts/build-preboot.sh +++ b/chroot-scripts/build-preboot.sh @@ -16,3 +16,15 @@ do done tar cfvz -T /tmp/firmwarefiles /root/packages/firmware.pkg.tgz + + +#kernel stuff +aptitude install linux-source +aptitude install kernel-package fakeroot libc6-dev gcc debianutils make libncurses5-dev + +kernel=$(ls -1 /usr/src/linux-source-*.tar.bz2) +tar xjfv $kernel + +linux32 sh -c "cd /usr/local/linux && make oldconfig" +linux32 sh -c "make-kpkg kernel_image --rootcmd fakeroot --cross-compile - --arch i386 --revision openslxpreboot.$date" + diff --git a/chroot-scripts/packages/eglibc.pkg.sh b/chroot-scripts/packages/eglibc.pkg.sh new file mode 100644 index 0000000..3c83414 --- /dev/null +++ b/chroot-scripts/packages/eglibc.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="eglibc" +APT_PACKAGES="" +REQUIRED_BINARIES="$(which ldd) $(which ld) $(which ldconfig)" diff --git a/chroot-scripts/packages/iw.pkg.sh b/chroot-scripts/packages/iw.pkg.sh new file mode 100644 index 0000000..efc48ca --- /dev/null +++ b/chroot-scripts/packages/iw.pkg.sh @@ -0,0 +1,3 @@ +PKG_NAME="iw" +APT_PACKAGES="iw" +REQUIRED_BINARIES="$(which iw)" diff --git a/chroot-scripts/pkg-builder.sh b/chroot-scripts/pkg-builder.sh new file mode 100755 index 0000000..d172860 --- /dev/null +++ b/chroot-scripts/pkg-builder.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +if [ "$(readlink -f $0| xargs basename)" == "pkg-builder.sh" ]; then + echo "You shouldn't run this script directly." + exit 1 +fi + +### Variables ##### +CHROOT_DIR=/tmp/chroot +PKG_DIR=/root/packages + +[ ! -d "$PKG_DIR/indices" ] && mkdir -p "$PKG_DIR/indices" + +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 + do + DIR=`dirname $FILE | cut -c2-` + [ ! -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 + 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" ] && \ + cp $SHARED_LIBRARY `echo $SHARED_LIBRARY | cut -c2-` && \ + echo $SHARED_LIBRARY | cut -c1- >> "$PKG_DIR/indices/$PKG_NAME.files" + done + done + + #cp /lib/ld-* lib +} |