]> spindle.queued.net Git - xodist/commitdiff
merge lunge
authorJames Cameron <quozl@laptop.org>
Tue, 28 Oct 2008 22:35:35 +0000 (09:35 +1100)
committerJames Cameron <quozl@laptop.org>
Tue, 28 Oct 2008 22:35:35 +0000 (09:35 +1100)
1  2 
README.approx
initchroot.sh

diff --combined README.approx
index 7b67cf4da7e3efd03ec9de8e50bfe1c04d8c229e,c5616c0fd46638c36b9ea3f1c72d8aa42d4ee02b..80ef97ccffb52a38664e4df1f011615e21ae9035
@@@ -16,9 -16,12 +16,12 @@@ security        http://security.debian.
  
        % sudo /etc/init.d/approx restart
  
 -4.  during the creation of the root filesystem described in README,
 -add the --mirror option, like this:
 +4.  follow README, but during the creation of the root filesystem, add
- the --mirror option, like this:
++the --local-apt-mirror option, like this:
  
          sudo ./initchroot.sh \
              --package-list kde.packages \
-             --mirror http://localhost:9999/debian kde.root
 -            --local-apt-mirror "deb http://localhost:9999/debian lenny main contrib non-free
++            --local-apt-mirror \
++"deb http://localhost:9999/debian lenny main contrib non-free
+ deb http://localhost:9999/security lenny/updates main contrib non-free" \
+             kde.root
 -
diff --combined initchroot.sh
index 18c6e6505561cba8afb933aea19c33ea81fc94e8,b9ee4654a772fe55cb57aa39198838482371312b..706414a6b277ac6781b6c66d489361b9b35e1316
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
- DIST=lenny
  DEFUSER=olpc
  PLIST=gnome.packages
- MIRROR=http://http.us.debian.org/debian/
- OTHERMIRROR=
+ APT_SOURCES="deb http://http.us.debian.org/debian/ lenny main contrib non-free
+ deb http://security.debian.org/ lenny/updates main contrib non-free"
+ LOCAL_APT_MIRROR=
  
  . functions.sh
  
@@@ -30,11 -30,10 +30,10 @@@ usage(
        echo "Usage: $0 [<options>] <root directory>" 1>&2
        echo "" 1>&2
        echo "Options:" 1>&2
-       echo "  --distribution <name>     Which distribution to use" 1>&2
        echo "  --user <user>             Username for default user" 1>&2
        echo "  --package-list <list>     File containing package list" 1>&2
-       echo "  --mirror <url>            Main Mirror URL prefix" 1>&2
-       echo "  --othermirror <line>      An additional sources.list line" 1>&2
+       echo "  --apt-sources <srcs>      Contents of /etc/apt/sources.list" 1>&2
+       echo "  --local-apt-mirror <srcs> sources.list for local mirror" 1>&2
        echo "" 1>&2
        exit 1
  }
  while test $# != 0
  do
        case $1 in
-       --distribution)
-               DIST=$2
-               shift
-               if [ -z "${OTHERMIRROR}" ]; then
-                   OTHERMIRROR="deb http://security.debian.org/ ${DIST}/updates main contrib non-free"
-               fi
-               ;;
        --user)
                DEFUSER=$2
                shift
                }
                shift
                ;;
-       --mirror)
-               MIRROR=$2
+       --apt-sources)
+               APT_SOURCES="$2"
                shift
                ;;
-       --othermirror)
-               OTHERMIRROR=$2
+       --local-apt-mirror)
+               LOCAL_APT_MIRROR="$2"
                shift
                ;;
        *)
@@@ -95,10 -87,14 +87,14 @@@ f
  
  check_for_cmds debootstrap || exit 1
  
- if [ -z "${OTHERMIRROR}" ]; then
-     OTHERMIRROR="deb http://security.debian.org/ ${DIST}/updates main contrib non-free"
+ if [ -z "${LOCAL_APT_MIRROR}" ]; then
+     LOCAL_APT_MIRROR="${APT_SOURCES}"
  fi
  
+ # parse apt mirror
+ MIRROR=$(printf "${LOCAL_APT_MIRROR}\n" | awk '/deb /{print $2}' | head -n1)
+ DIST=$(printf "${LOCAL_APT_MIRROR}\n" | awk '/deb /{print $3}' | head -n1)
  # create chroot
  debootstrap --arch i386 ${DIST} ${ROOT_DIR} ${MIRROR}
  mkdir ${ROOT_DIR}/ofw
@@@ -114,6 -110,21 +110,21 @@@ echo "Warning: Fake start-stop-daemon c
  EOF
  chmod 755 ${ROOT_DIR}/sbin/start-stop-daemon
  
+ # set up hostname stuff
+ echo "debxo" > ${ROOT_DIR}/etc/hostname
+ cat >${ROOT_DIR}/etc/hosts<<EOF
+ 127.0.0.1 localhost.localdomain localhost
+ 127.0.0.1 debxo
+ # The following lines are desirable for IPv6 capable hosts
+ ::1     ip6-localhost ip6-loopback
+ fe00::0 ip6-localnet
+ ff00::0 ip6-mcastprefix
+ ff02::1 ip6-allnodes
+ ff02::2 ip6-allrouters
+ ff02::3 ip6-allhosts
+ EOF
  # set up apt (working around #314334)
  export DEBIAN_FRONTEND=noninteractive
  export DEBCONF_PRIORITY=critical
@@@ -127,10 -138,7 +138,7 @@@ Dir 
        };
  };
  EOF
- cat >${ROOT_DIR}/etc/apt/sources.list<<EOF
- deb ${MIRROR} ${DIST} main contrib non-free
- ${OTHERMIRROR}
- EOF
+ printf "${LOCAL_APT_MIRROR}\n" >${ROOT_DIR}/etc/apt/sources.list
  (chroot ${ROOT_DIR} aptitude update)
  
  # set up base system and base packages
@@@ -139,13 -147,15 +147,15 @@@ echo "en_US.UTF-8 UTF-8" >${ROOT_DIR}/e
  
  k="http://lunge.mit.edu/~dilinger/debxo-0.2/initramfs-tools_0.92l.2_all.deb 
   http://lunge.mit.edu/~dilinger/debxo-0.2/ofw-config_0.1_all.deb 
-  http://lunge.mit.edu/~dilinger/debxo-0.3/linux-2.6.25.15_2.6.25.15-146_i386.deb"
+  http://lunge.mit.edu/~dilinger/debxo-0.3/linux-2.6.25.15_2.6.25.15-147_i386.deb"
  mkdir -p cache
  for i in $k; do
        pkg=$(basename ${i})
        wget --continue -O cache/${pkg} ${i}
        cp cache/${pkg} ${ROOT_DIR}/${pkg} 
        (chroot ${ROOT_DIR} dpkg -i /${pkg})
+       pkgbase=$(echo $pkg | cut -d_ -f1)
+       echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
        rm -f ${ROOT_DIR}/${pkg}
  done
  
@@@ -158,20 -168,6 +168,6 @@@ scx200_ac
  i8042
  EOF
  
- echo "debxo" > ${ROOT_DIR}/etc/hostname
- cat >${ROOT_DIR}/etc/hosts<<EOF
- 127.0.0.1 localhost.localdomain localhost
- 127.0.0.1 debxo
- # The following lines are desirable for IPv6 capable hosts
- ::1     ip6-localhost ip6-loopback
- fe00::0 ip6-localnet
- ff00::0 ip6-mcastprefix
- ff02::1 ip6-allnodes
- ff02::2 ip6-allrouters
- ff02::3 ip6-allhosts
- EOF
  # install packages
  (chroot ${ROOT_DIR} aptitude install -y `cat ${PLIST}`)
  
@@@ -233,7 -229,8 +229,7 @@@ rm -rf ${ROOT_DIR}/home/*;         # i have n
  echo "${DEFUSER} ALL=(ALL) NOPASSWD: ALL" >> ${ROOT_DIR}/etc/sudoers
  
  # add local network interface
 -cat >>${ROOT_DIR}/etc/network/interfaces<<EOF
 -
 +cat <<EOF >> ${ROOT_DIR}/etc/network/interfaces
  auto lo
  iface lo inet loopback
  EOF
@@@ -248,6 -245,10 +244,10 @@@ suga
  EOF
  fi
  
+ # override sources.list with shipping version
+ printf "${APT_SOURCES}\n" >${ROOT_DIR}/etc/apt/sources.list
+ (chroot ${ROOT_DIR} aptitude update)
  # done, clean up
  mv ${ROOT_DIR}/sbin/start-stop-daemon.REAL ${ROOT_DIR}/sbin/start-stop-daemon
  (chroot ${ROOT_DIR} aptitude clean)