Skip to content

Commit bb681a1

Browse files
committed
meh, debootstrap failing horribly, changed everything up to work on
saucy
1 parent 5e90bef commit bb681a1

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

builder.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ case "$1" in
4646
patch_deboot
4747
echo "Creating the chroot build environment"
4848
deboot_chroot
49+
echo "Upgrading the chroot system"
50+
upgrade_chroot
51+
echo "Installing build tools"
52+
install_build_tools
53+
;;
54+
update)
55+
echo "Upgrading the chroot system"
56+
upgrade_chroot
4957
;;
5058
esac
5159
exit 0

configuration

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ BASE_DIR=`pwd`
2626

2727
# target and sources for our chroot
2828
ROOT_TARGET=build_environment
29-
ROOT_SUITE=wheezy
30-
ROOT_SOURCE=http://http.debian.net/debian
29+
#ROOT_SUITE=wheezy
30+
#ROOT_SOURCE=http://http.debian.net/debian
31+
ROOT_SUITE=saucy
32+
ROOT_SOURCE=http://archive.ubuntu.com/ubuntu/
3133
# these packages will be installed into the chroot build environment
3234
# and are needed to build the kernel
33-
REQUIRED_PACKAGES=gcc-arm-linux-gnueabihf,ccache,kernel-wedge,libncursesw5-dev
35+
REQUIRED_PACKAGES=gcc-arm-linux-gnueabihf ccache kernel-wedge libncursesw5-dev
3436

3537
# the script should be able to figure this out, but you can override
3638
# or set it manually here, leaving it blank is fine
3739
ROOT_ARCH=
3840

3941
# debootstrap sources and working directory
4042
DEBOOT_DEB=debootstrap_1.0.55_all.deb
43+
#DEBOOT_DEB=debootstrap_1.0.48+deb7u1_all.deb
4144
DEBOOT_SRC=http://ftp.debian.org/debian/pool/main/d/debootstrap
4245
DEBOOT_DIR=deboot_working
4346

functions

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,52 @@ get_deboot ()
3939
cd $BASE_DIR/$DEBOOT_DIR;
4040
wget -c $DEBOOT_SRC/$DEBOOT_DEB;
4141
ar -x $DEBOOT_DEB;
42-
tar -xf data.tar.xz;
42+
tar -xzf data.tar.gz;
4343
cd $BASE_DIR;
4444
}
4545

4646
# this function just creates the chroot environment
4747
deboot_chroot ()
4848
{
4949
# do the bootstrap
50-
DEBOOTSTRAP_DIR=$BASE_DIR/$DEBOOT_DIR/usr/share/debootstrap $BASE_DIR/$DEBOOT_DIR/usr/sbin/debootstrap --arch=$ROOT_ARCH --include=$REQUIRED_PACKAGES --no-check-gpg $ROOT_SUITE $BASE_DIR/$ROOT_TARGET $ROOT_SOURCE;
50+
DEBOOTSTRAP_DIR=$BASE_DIR/$DEBOOT_DIR/usr/share/debootstrap $BASE_DIR/$DEBOOT_DIR/usr/sbin/debootstrap --variant=buildd --arch=$ROOT_ARCH --no-check-gpg $ROOT_SUITE $BASE_DIR/$ROOT_TARGET $ROOT_SOURCE;
5151

5252
#deboot feels the need to mount proc, we don't need it here
5353
umount $BASE_DIR/$ROOT_TARGET/proc;
5454

55-
#stop dpkg from running daemons
55+
#stop dpkg from running daemons
5656
cat > $BASE_DIR/$ROOT_TARGET/usr/sbin/policy-rc.d <<EOF
5757
#!/bin/sh
5858
exit 101
5959
EOF
6060
chmod a+x $BASE_DIR/$ROOT_TARGET/usr/sbin/policy-rc.d;
6161

62+
# update the chroot's sources.list
63+
cat > $BASE_DIR/$ROOT_TARGET/etc/apt/sources.list <<EOF
64+
deb http://archive.ubuntu.com/ubuntu $ROOT_SUITE main restricted universe multiverse
65+
deb http://archive.ubuntu.com/ubuntu $ROOT_SUITE-updates main restricted universe multiverse
66+
deb http://archive.ubuntu.com/ubuntu $ROOT_SUITE-security main restricted universe multiverse
67+
EOF
68+
6269
#divert ischroot
6370
#note that this throws error, my need to be fixed, not sure
6471
chroot $BASE_DIR/$ROOT_TARGET dpkg-divert --divert /usr/bin/ischroot.debianutils --rename /usr/bin/ischroot;
6572
chroot $BASE_DIR/$ROOT_TARGET /bin/ln -s /bin/true /usr/bin/ischroot;
73+
74+
chroot $BASE_DIR/$ROOT_TARGET dpkg -i /var/cache/apt/archives/apt_*.deb;
75+
}
76+
77+
# bring the chroot current
78+
upgrade_chroot ()
79+
{
80+
chroot $BASE_DIR/$ROOT_TARGET apt-get update;
81+
chroot $BASE_DIR/$ROOT_TARGET apt-get dist-upgrade;
82+
}
83+
84+
# install required packages in the chroot
85+
install_build_tools ()
86+
{
87+
chroot $BASE_DIR/$ROOT_TARGET apt-get install $REQUIRED_PACKAGES;
6688
}
6789

6890
# this function gets the architecture for our chroot

0 commit comments

Comments
 (0)