@@ -1,47 +1,41 | |||||
1 | # |
|
1 | # | |
2 | # Debootstrap basic system |
|
2 | # Debootstrap basic system | |
3 | # |
|
3 | # | |
4 |
|
4 | |||
5 | # Load utility functions |
|
5 | # Load utility functions | |
6 | . ./functions.sh |
|
6 | . ./functions.sh | |
7 |
|
7 | |||
8 | VARIANT="" |
|
8 | VARIANT="" | |
9 | COMPONENTS="main" |
|
9 | COMPONENTS="main" | |
10 | EXCLUDES="" |
|
|||
11 |
|
10 | |||
12 | # Use non-free Debian packages if needed |
|
11 | # Use non-free Debian packages if needed | |
13 | if [ "$ENABLE_NONFREE" = true ] ; then |
|
12 | if [ "$ENABLE_NONFREE" = true ] ; then | |
14 | COMPONENTS="main,non-free,contrib" |
|
13 | COMPONENTS="main,non-free,contrib" | |
15 | fi |
|
14 | fi | |
16 |
|
15 | |||
17 | # Use minbase bootstrap variant which only includes essential packages |
|
16 | # Use minbase bootstrap variant which only includes essential packages | |
18 | if [ "$ENABLE_MINBASE" = true ] ; then |
|
17 | if [ "$ENABLE_MINBASE" = true ] ; then | |
19 | VARIANT="--variant=minbase" |
|
18 | VARIANT="--variant=minbase" | |
20 | fi |
|
19 | fi | |
21 |
|
20 | |||
22 | # Exclude packages if required by Debian release |
|
|||
23 | if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then |
|
|||
24 | EXCLUDES="--exclude=init,systemd-sysv" |
|
|||
25 | fi |
|
|||
26 |
|
||||
27 | # Base debootstrap (unpack only) |
|
21 | # Base debootstrap (unpack only) | |
28 | http_proxy=${APT_PROXY} debootstrap ${EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian" |
|
22 | http_proxy=${APT_PROXY} debootstrap ${APT_EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian" | |
29 |
|
23 | |||
30 | # Copy qemu emulator binary to chroot |
|
24 | # Copy qemu emulator binary to chroot | |
31 | install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}" |
|
25 | install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}" | |
32 |
|
26 | |||
33 | # Copy debian-archive-keyring.pgp |
|
27 | # Copy debian-archive-keyring.pgp | |
34 | mkdir -p "${R}/usr/share/keyrings" |
|
28 | mkdir -p "${R}/usr/share/keyrings" | |
35 | install_readonly /usr/share/keyrings/debian-archive-keyring.gpg "${R}/usr/share/keyrings/debian-archive-keyring.gpg" |
|
29 | install_readonly /usr/share/keyrings/debian-archive-keyring.gpg "${R}/usr/share/keyrings/debian-archive-keyring.gpg" | |
36 |
|
30 | |||
37 | # Complete the bootstrapping process |
|
31 | # Complete the bootstrapping process | |
38 | chroot_exec /debootstrap/debootstrap --second-stage |
|
32 | chroot_exec /debootstrap/debootstrap --second-stage | |
39 |
|
33 | |||
40 | # Mount required filesystems |
|
34 | # Mount required filesystems | |
41 | mount -t proc none "${R}/proc" |
|
35 | mount -t proc none "${R}/proc" | |
42 | mount -t sysfs none "${R}/sys" |
|
36 | mount -t sysfs none "${R}/sys" | |
43 |
|
37 | |||
44 | # Mount pseudo terminal slave if supported by Debian release |
|
38 | # Mount pseudo terminal slave if supported by Debian release | |
45 | if [ -d "${R}/dev/pts" ] ; then |
|
39 | if [ -d "${R}/dev/pts" ] ; then | |
46 | mount --bind /dev/pts "${R}/dev/pts" |
|
40 | mount --bind /dev/pts "${R}/dev/pts" | |
47 | fi |
|
41 | fi |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant