|
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 | |
|---|
| 3 | METHOD=0 |
|---|
| 4 | #http_proxy=http://proxy.lair.fifthhorseman.net:3128/ |
|---|
| 5 | |
|---|
| 6 | cd /srv/debirf |
|---|
| 7 | |
|---|
| 8 | /usr/sbin/debootstrap --exclude=aptitude etch ./root/ http://ftp.debian.org/debian |
|---|
| 9 | |
|---|
| 10 | cd root |
|---|
| 11 | |
|---|
| 12 | echo debirf > /etc/hostname |
|---|
| 13 | |
|---|
| 14 | # enter chroot ############################################ |
|---|
| 15 | chroot . |
|---|
| 16 | apt-get update |
|---|
| 17 | echo 'do_initrd = Yes' >> /etc/kernel-img.conf |
|---|
| 18 | # another modification of /etc/kernel-img.conf to not do symlinks? |
|---|
| 19 | apt-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? |
|---|
| 25 | if 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 |
|---|
| 30 | fi |
|---|
| 31 | |
|---|
| 32 | exit |
|---|
| 33 | # exit chroot ############################################ |
|---|
| 34 | |
|---|
| 35 | mv boot/vmlinuz-* ../ |
|---|
| 36 | mv boot/initrd.img-* ../ |
|---|
| 37 | |
|---|
| 38 | # stupid simple method |
|---|
| 39 | if [ "$METHOD" = 0 ] ; then |
|---|
| 40 | > etc/mtab |
|---|
| 41 | echo proc /proc proc defaults 0 0 >> etc/fstab |
|---|
| 42 | ln -s sbin/init init |
|---|
| 43 | find * | cpio -H newc --create | gzip > ../debirf.cgz |
|---|
| 44 | fi |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | # tweak initrd method |
|---|
| 48 | if [ "$METHOD" = 1 ] ; then |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | cat scripts/debirf <<EOF |
|---|
| 52 | mountroot() { |
|---|
| 53 | rootmnt="/" |
|---|
| 54 | } |
|---|
| 55 | EOF |
|---|
| 56 | |
|---|
| 57 | cat > bin/run-init <<EOF |
|---|
| 58 | #!/bin/sh |
|---|
| 59 | if [ "$1" != "/" ] ; then |
|---|
| 60 | exec /usr/lib/klibc/bin/run-init "$@" |
|---|
| 61 | else |
|---|
| 62 | MOUNT_POINT="$1" |
|---|
| 63 | INIT="$2" |
|---|
| 64 | shift 2 |
|---|
| 65 | exec "$INIT" "$@" |
|---|
| 66 | fi |
|---|
| 67 | EOF |
|---|
| 68 | |
|---|
| 69 | fi |
|---|
Note: See
TracBrowser
for help on using the repository browser.