~ubuntu-branches/ubuntu/oneiric/base-installer/oneiric

« back to all changes in this revision

Viewing changes to library.sh

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-10-21 16:29:45 UTC
  • mfrom: (0.2.12 sid)
  • Revision ID: james.westby@ubuntu.com-20101021162945-hoyg6dy83kevgli5
Tags: 1.113ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Use and depend on the Ubuntu keyring.
  - Enable the restricted component by default, unless
    apt-setup/restricted is preseeded to false.
  - Set up the default sources.list to look in -updates and -security (the
    latter from apt-setup/security_host) as well as the unadorned suite;
    also -proposed if apt-setup/proposed is true.
  - Use Ubuntu kernel image names.
  - Allow preseeding base-installer/kernel/override-image to force a given
    kernel to be used.
  - Install busybox-initramfs rather than busybox.
  - Revert Joey's patch to call base-installer.d hooks after running
    debootstrap, which broke console-setup's expectation of being able to
    insert its configuration file into /target before console-setup is
    installed by debootstrap.
  - Add armel/imx51, armel/dove, and armel/omap subarchitectures.
  - Install kernel headers to match the kernel. This may be overridden by
    setting base-installer/kernel/headers to false.
  - Add base-installer/kernel/backports-modules template, which may be
    preseeded to install selected linux-backports-modules-* packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
MACHINE="$(uname -m)"
27
27
NUMCPUS=$(cat /var/numcpus 2>/dev/null) || true
28
28
CPUINFO=/proc/cpuinfo
29
 
MEMTOTAL=0
30
 
if [ -x /usr/lib/base-installer/dmi-available-memory ]; then
31
 
        MEMTOTAL="$(/usr/lib/base-installer/dmi-available-memory)"
32
 
fi
33
 
if [ "$MEMTOTAL" = 0 ]; then
34
 
        MEMTOTAL="$(grep '^MemTotal:[[:space:]]*' /proc/meminfo | \
35
 
                    sed 's/^MemTotal:[[:space:]]*//; s/ .*//')"
36
 
fi
37
29
 
38
30
# files and directories
39
31
APT_SOURCES=/target/etc/apt/sources.list
94
86
check_target () {
95
87
        # Make sure something is mounted on the target.
96
88
        # Partconf causes the latter format.
97
 
        if ! grep -q '/target ' /proc/mounts && \
 
89
        if [ -e /proc/mounts ] && \
 
90
           ! grep -q '/target ' /proc/mounts && \
98
91
           ! grep -q '/target/ ' /proc/mounts; then
99
92
                exit_error base-installer/no_target_mounted
100
93
        fi
870
863
 
871
864
                # The bind mount is left mounted, for future apt-install
872
865
                # calls to use.
873
 
                if ! mount -o bind $DIRECTORY $tdir; then
874
 
                        warning "failed to bind mount $tdir"
875
 
                fi
 
866
                case "$OS" in
 
867
                        linux)
 
868
                        if ! mount -o bind $DIRECTORY $tdir; then
 
869
                                warning "failed to bind mount $tdir"
 
870
                        fi
 
871
                        ;;
 
872
                        kfreebsd)
 
873
                        if ! mount -t nullfs $DIRECTORY $tdir ; then
 
874
                                warning "failed to bind mount $tdir"
 
875
                        fi
 
876
                        ;;
 
877
                        hurd)
 
878
                        if ! mount -t firmlink $DIRECTORY $tdir ; then
 
879
                                warning "failed to bind mount $tdir"
 
880
                        fi
 
881
                        ;;
 
882
                esac
876
883
 
877
884
                # Define the mount point for apt-cdrom
878
885
                cat > $APT_CONFDIR/00CDMountPoint << EOT