2 # install guestfsd specific stuff
4 # Kernel modules take up nearly half of the image. Only include ones
5 # which are on the whitelist.
6 exec 5<../appliance/kmod.whitelist
8 while read kmod 0<&5; do
9 whitelist="$whitelist -a -not -name $kmod"
13 echo "Module whitelist: $whitelist"
14 find $DEBIRF_ROOT/lib/modules/*/kernel -name '*.ko' $whitelist -a -exec rm '{}' \;
16 # install additional packages from the package list, but
17 # only ones which exist in the repository
19 for pkg in $(< packagelist); do
20 if [ "$(debirf_exec apt-get -s install $pkg 3>&1 1>&2 2>&3 1>&- | grep '^E:' | wc -l)" -gt 0 ]; then
21 echo "Ignoring package $pkg, because it was not found in this repository."
23 PKGLIST="$PKGLIST $pkg"
26 echo "Will add $PKGLIST"
27 debirf_exec apt-get --assume-yes install $PKGLIST
28 debirf_exec apt-get --assume-yes remove vim-tiny dhcp3-client iptables
30 debirf_exec mkdir -p --mode=0777 /sysroot
32 # cleanup some other heavy lifters:
33 rm -rf "$DEBIRF_ROOT"/usr/share/doc/
34 rm -rf "$DEBIRF_ROOT"/usr/share/zoneinfo/
35 rm -rf "$DEBIRF_ROOT"/usr/share/man/
37 # Install the actual appliance:
39 install -o root -g root -m 0755 ../daemon/guestfsd "$DEBIRF_ROOT"/sbin/guestfsd
40 install -o root -g root -m 0755 init "$DEBIRF_ROOT"/sbin/init