source: trunk/debirf/make-debirf @ 281

Last change on this file since 281 was 281, checked in by jrollins, 6 years ago

debirf/make-debirf: initial skelton of a make-debirf script

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2
3METHOD=0
4#http_proxy=http://proxy.lair.fifthhorseman.net:3128/
5
6cd /srv/debirf
7
8/usr/sbin/debootstrap --exclude=aptitude etch ./root/ http://ftp.debian.org/debian
9
10cd root
11
12echo debirf > /etc/hostname
13
14# enter chroot ############################################
15chroot .
16apt-get update
17echo 'do_initrd = Yes' >> /etc/kernel-img.conf
18# another modification of /etc/kernel-img.conf to not do symlinks?
19apt-get install linux-image-2.6-486
20
21# remove locales?
22# find /usr/share/locale -maxdepth 1 -mindepth 1 -type d ! -iname 'en*' -exec rm -rf '{}' \;
23
24# clean apt?
25if false ; then
26    apt-cache clean
27    rm /var/cache/apt/*.bin
28    rm -rf /var/lib/apt/lists/*
29    mkdir /var/lib/apt/lists/partial
30fi
31
32exit
33# exit chroot ############################################
34
35mv boot/vmlinuz-* ../
36mv boot/initrd.img-* ../
37
38# stupid simple method
39if [ "$METHOD" = 0 ] ; then
40> etc/mtab
41echo proc /proc proc defaults 0 0 >> etc/fstab
42ln -s sbin/init init
43find * | cpio -H newc --create  | gzip > ../debirf.cgz
44fi
45
46
47# tweak initrd method
48if [ "$METHOD" = 1 ] ; then
49
50
51cat scripts/debirf <<EOF
52mountroot() {
53 rootmnt="/"
54}
55EOF
56
57cat > bin/run-init <<EOF
58#!/bin/sh
59if [ "$1" != "/" ] ; then
60  exec /usr/lib/klibc/bin/run-init "$@"
61else
62  MOUNT_POINT="$1"
63  INIT="$2"
64  shift 2
65  exec "$INIT" "$@"
66fi
67EOF
68
69fi
Note: See TracBrowser for help on using the repository browser.