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