Changeset 282


Ignore:
Timestamp:
Mar 11, 2007 6:44:34 PM (6 years ago)
Author:
dkg
Message:

debirf: modified make-debirf to make it closer to functional (still not tested as a direct script).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/make-debirf

    r281 r282  
    66cd /srv/debirf 
    77 
    8 /usr/sbin/debootstrap --exclude=aptitude etch ./root/ http://ftp.debian.org/debian 
     8# start by fetching initramfs-tools because they'll be handy 
     9/usr/sbin/debootstrap --exclude=aptitude --include=initramfs-tools etch ./root/ http://ftp.debian.org/debian 
    910 
    10 cd root 
     11echo debirf > root/etc/hostname 
     12cat >root/etc/kernel-img.conf <<EOF 
     13do_symlinks = yes 
     14do_bootloader = no 
     15do_initrd = yes 
     16EOF 
    1117 
    12 echo debirf > /etc/hostname 
     18mount -t proc proc root/proc 
     19mount -t sysfs sys root/sys 
    1320 
    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 '{}' \; 
     21# set $KERNEL_PACKAGE to the path to a kernel .deb if you have one 
     22# lying around: 
     23if [ "$KERNEL_PACKAGE" ]; then 
     24    KNAME=$(basename "$KERNEL_PACKAGE") 
     25    cp "$KERNEL_PACKAGE" "root/root/$KNAME" 
     26    chroot root dpkg --install "root/$KNAME" 
     27else 
     28    chroot root apt-get update 
     29    chroot root apt-get install linux-image-2.6-486 
     30fi 
    2331 
    2432# clean apt? 
    2533if 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 
     34    chroot root apt-get clean 
     35    rm root/var/cache/apt/*.bin 
     36    rm -rf root/var/lib/apt/lists/* 
     37    mkdir root/var/lib/apt/lists/partial 
    3038fi 
    3139 
    32 exit 
    33 # exit chroot ############################################ 
     40umount root/proc 
     41umount root/sys 
    3442 
    35 mv boot/vmlinuz-* ../ 
    36 mv boot/initrd.img-* ../ 
     43mkdir -p extras/boot 
     44 
     45mv root/boot/vmlinuz-* extras/boot 
     46mv root/boot/initrd.img-* extras/boot 
     47 
     48# remove/backup locales: 
     49mkdir -p extras/usr/share/locale 
     50(cd root && find usr/share/locale -maxdepth 1 -mindepth 1 -type d ! -iname 'en*' -exec mv '{}' '../extras/{}' \; ) 
     51 
    3752 
    3853# stupid simple method 
    3954if [ "$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 
     55    > root/etc/mtab 
     56    echo proc /proc proc defaults 0 0 >> root/etc/fstab 
     57    ln -s sbin/init root/init 
     58    (cd root && find * | cpio -H newc --create  | gzip ) > debirf.cgz 
    4459fi 
    4560 
Note: See TracChangeset for help on using the changeset viewer.