~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: 2011-05-26 15:54:12 UTC
  • mfrom: (0.2.18 sid)
  • Revision ID: james.westby@ubuntu.com-20110526155412-aj6c54r99zdaa1u6
Tags: 1.119ubuntu1
* 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.
  - Run dpkg with --force-unsafe-io during installation.
* Explicitly drop code supporting -386 kernels, which were dropped from
  Ubuntu some time ago.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
case `udpkg --print-os` in
20
20
        linux)          KERNEL_MAJOR="$(uname -r | cut -d . -f 1,2)" ;;
21
21
        kfreebsd)       KERNEL_MAJOR="$(uname -r | cut -d . -f 1)" ;;
 
22
        hurd)           KERNEL_MAJOR="$(uname -v | cut -d ' ' -f 2 | cut -d . -f 1)" ;;
22
23
esac
23
24
KERNEL_VERSION="$(uname -r | cut -d - -f 1)"
24
25
KERNEL_ABI="$(uname -r | cut -d - -f 1,2)"
138
139
        case "$OS" in
139
140
                linux) setup_dev_linux ;;
140
141
                kfreebsd) setup_dev_kfreebsd ;;
 
142
                hurd) : ;;
141
143
                *) warning "setup_dev called for an unknown OS ($OS)." ;;
142
144
        esac    
143
145
}
342
344
        (set +e;
343
345
        # Hack to get the metapackages in the right order; should be
344
346
        # replaced by something better at some point.
345
 
        chroot /target apt-cache search ^linux- | grep '^linux-\(amd64\|386\|686\|k7\|generic\|server\|virtual\|preempt\|rt\|xen\|power\|cell\|ia64\|sparc\|hppa\|imx51\|dove\|omap\)';
 
347
        chroot /target apt-cache search ^linux- | grep '^linux-\(amd64\|686\|k7\|generic\|server\|virtual\|preempt\|rt\|xen\|power\|cell\|ia64\|sparc\|hppa\|imx51\|dove\|omap\)';
346
348
        chroot /target apt-cache search ^linux-image- | grep -v '^linux-image-2\.';
347
349
        chroot /target apt-cache search ^linux-image-2. | sort -r;
348
 
        chroot /target apt-cache search ^kfreebsd-image) | \
 
350
        chroot /target apt-cache search ^kfreebsd-image;
 
351
        chroot /target apt-cache search ^gnumach-image) | \
349
352
        cut -d" " -f1 | uniq > "$KERNEL_LIST.unfiltered"
350
353
        kernels=`< "$KERNEL_LIST.unfiltered" tr '\n' ' ' | sed -e 's/ $//'`
351
354
        for candidate in $kernels; do
851
854
        fi
852
855
}
853
856
 
 
857
install_kernel_hurd() {
 
858
        if [ "$KERNEL" = none ]; then
 
859
                info "Not installing any kernel"
 
860
                return
 
861
        fi
 
862
 
 
863
        # Create configuration file for kernel-package
 
864
        if [ -f /target/etc/kernel-img.conf ]; then
 
865
                # Backup old kernel-img.conf
 
866
                mv /target/etc/kernel-img.conf /target/etc/kernel-img.conf.$$
 
867
        fi
 
868
 
 
869
        cat > /target/etc/kernel-img.conf <<EOF
 
870
# Kernel image management overrides
 
871
# See kernel-img.conf(5) for details
 
872
do_symlinks = no
 
873
EOF
 
874
        # Advance progress bar to 10% of allocated space for install_kfreebsd
 
875
        update_progress 10 100
 
876
 
 
877
        # Install the kernel
 
878
        db_subst base-installer/section/install_kernel_package SUBST0 "$KERNEL"
 
879
        db_progress INFO base-installer/section/install_kernel_package
 
880
        log-output -t base-installer apt-install "$KERNEL" || kernel_install_failed=$?
 
881
 
 
882
        # Advance progress bar to 90% of allocated space for install_kernel_hurd
 
883
        update_progress 90 100
 
884
 
 
885
        if [ -f /target/etc/kernel-img.conf.$$ ]; then
 
886
                # Revert old kernel-img.conf
 
887
                mv /target/etc/kernel-img.conf.$$ /target/etc/kernel-img.conf
 
888
        fi
 
889
 
 
890
        if [ "$kernel_install_failed" ]; then
 
891
                db_subst base-installer/kernel/failed-install KERNEL "$KERNEL"
 
892
                exit_error base-installer/kernel/failed-install
 
893
        fi
 
894
}
 
895
 
854
896
install_kernel() {
855
897
        case "$OS" in
856
898
                linux) install_kernel_linux ;;
857
899
                kfreebsd) install_kernel_kfreebsd ;;
 
900
                hurd) install_kernel_hurd ;;
858
901
                *) warning "install_kernel called for an unknown OS ($OS)." ;;
859
902
        esac    
860
903
}