| 1 | # emdebian secondstage support (Default busybox, dpkg and apt version) |
|---|
| 2 | # |
|---|
| 3 | # Copyright (C) 2007-2008 Neil Williams <codehelp@debian.org> |
|---|
| 4 | # |
|---|
| 5 | # This package is free software; you can redistribute it and/or modify |
|---|
| 6 | # it under the terms of the GNU General Public License as published by |
|---|
| 7 | # the Free Software Foundation; either version 3 of the License, or |
|---|
| 8 | # (at your option) any later version. |
|---|
| 9 | # |
|---|
| 10 | # This program is distributed in the hope that it will be useful, |
|---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | # GNU General Public License for more details. |
|---|
| 14 | # |
|---|
| 15 | # You should have received a copy of the GNU General Public License |
|---|
| 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | # |
|---|
| 18 | |
|---|
| 19 | mirror_style release |
|---|
| 20 | download_style apt |
|---|
| 21 | |
|---|
| 22 | work_out_debs () { |
|---|
| 23 | required="coreutils dpkg libstdc++6 libgcc1 libc6 cdebconf |
|---|
| 24 | debconf-shell libdebian-installer4 zlib1g libnewt0.52 |
|---|
| 25 | libslang2 base-passwd" |
|---|
| 26 | |
|---|
| 27 | base="apt gpgv libncurses5 libreadline5 readline-common |
|---|
| 28 | debianutils makedev whiptail gnupg udev base-files |
|---|
| 29 | debian-archive-keyring dhcp3-client |
|---|
| 30 | util-linux module-init-tools initscripts" |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | first_stage_install () { |
|---|
| 34 | PRESERVE_BUILDPLACE="yes" |
|---|
| 35 | . /usr/share/emdebian-tools/emrootfslib |
|---|
| 36 | extract $required |
|---|
| 37 | make_dpkg_dirs |
|---|
| 38 | prepare_proc |
|---|
| 39 | prepare_var |
|---|
| 40 | info INSTCORE " -> Preparing basic defaults for $BUILDPLACE/etc" |
|---|
| 41 | basic_etc_fstab |
|---|
| 42 | basic_group_setup |
|---|
| 43 | basic_passwd_setup |
|---|
| 44 | basic_shadow_setup |
|---|
| 45 | basic_etc_profile |
|---|
| 46 | shell_update_rcd |
|---|
| 47 | set_approx_time |
|---|
| 48 | set_cdebconf_default |
|---|
| 49 | provide_empty_install_info |
|---|
| 50 | provide_var_lib_x11 |
|---|
| 51 | info INSTCORE " -> Setting up dpkg in $BUILDPLACE" |
|---|
| 52 | x_feign_install dpkg |
|---|
| 53 | info INSTCORE " -> Unpacking packages in $BUILDPLACE" |
|---|
| 54 | unpack_debootstrap |
|---|
| 55 | info INSTCORE " -> Adapting configuration for Emdebian" |
|---|
| 56 | disable_apt_recommends |
|---|
| 57 | setup_devices |
|---|
| 58 | info INSTCORE " -> First stage install complete in $BUILDPLACE" |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | second_stage_install () { |
|---|
| 62 | if [ -f /datestring ]; then |
|---|
| 63 | TIME=`cat /datestring` |
|---|
| 64 | echo "Setting approximate time of $TIME" |
|---|
| 65 | date -s $TIME |
|---|
| 66 | fi |
|---|
| 67 | info INSTCORE "Running ldconfig..." |
|---|
| 68 | in_target /sbin/ldconfig |
|---|
| 69 | in_target depmod |
|---|
| 70 | info INSTCORE "Setting cdebconf environment" |
|---|
| 71 | export DEBCONF_USE_CDEBCONF=true |
|---|
| 72 | DEBIAN_FRONTEND=noninteractive |
|---|
| 73 | DEBCONF_NONINTERACTIVE_SEEN=true |
|---|
| 74 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN |
|---|
| 75 | # bug: See #451130 |
|---|
| 76 | in_target /usr/lib/cdebconf/debconf-loadtemplate /usr/share/debconf/demo /usr/share/debconf/demo.templates |
|---|
| 77 | info INSTCORE "Configuring in $BUILDPLACE" |
|---|
| 78 | in_target dpkg --configure -a |
|---|
| 79 | info BASESUCCESS "Emdebian base system installed successfully." |
|---|
| 80 | } |
|---|