-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-debian-edison.sh
executable file
·55 lines (32 loc) · 1.28 KB
/
bootstrap-debian-edison.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/ash
set -e
DEBIAN_MIRROR_URL=http://ftp.debian.org/debian
CDEBOOTSTRAP_PACKAGE_VERSION=0.7.1_i386
SHA1SUM_SOURCE_URL=ftp://ftp.gnupg.org/gcrypt/binary/sha1sum.c
DEBIAN_CHROOT=/home/root/debian
DEBIAN_DIST=unstable
DEBIAN_ARCH=i386
if [ -e $DEBIAN_CHROOT ]; then
echo $DEBIAN_CHROOT exists already
exit 1
fi
if [ -d /tmp/debootstrap-bin/ ]; then
rm -r /tmp/debootstrap-bin/
fi
mkdir /tmp/debootstrap-bin/
cd /tmp/debootstrap-bin
wget -q $DEBIAN_MIRROR_URL/pool/main/c/cdebootstrap/cdebootstrap-static_$CDEBOOTSTRAP_PACKAGE_VERSION.deb
ar -x cdebootstrap-static_$CDEBOOTSTRAP_PACKAGE_VERSION.deb
tar xf data.tar.xz
tar xf ./usr/lib/cdebootstrap/cdebootstrap_$CDEBOOTSTRAP_PACKAGE_VERSION.tar.gz
echo "Untarred cdebootstrap tarball"
wget -q $SHA1SUM_SOURCE_URL
echo "wget sha1sum source complete"
cc -O3 -o sha1sum sha1sum.c
echo "compile of sha1sum complete"
cp sha1sum ./usr/bin/
echo "Running cdeboottrap-static"
PATH=/tmp/debootstrap-bin/usr/bin:$PATH ./usr/bin/cdebootstrap-static --debug --allow-unauthenticated -c /tmp/debootstrap-bin/usr/share/cdebootstrap-static/ -H /tmp/debootstrap-bin/usr/share/cdebootstrap-static -f standard --arch=$DEBIAN_ARCH $DEBIAN_DIST $DEBIAN_CHROOT $DEBIAN_MIRROR_URL
echo "Removing /dev from chroot"
rm -r $DEBIAN_CHROOT/dev/*
echo "Done"