2 # Filename: /etc/debootstrap/chroot-script
3 # Purpose: script executed in chroot when installing Debian via grml-debootstrap
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: Fre Nov 03 01:19:41 CET 2006 [mika]
8 ################################################################################
12 . /etc/debootstrap/config || exit 1
14 mount -t proc none /proc
16 if [ -n "$RECONFIGURE" ] ; then
17 for package in $RECONFIGURE ; do
18 dpkg-reconfigure $package
22 # set password of user root
25 if ! [ -f /etc/hosts ] ; then
26 echo "127.0.0.1 localhost $HOSTNAME" > $MNTPOINT/etc/hosts
29 if ! [ -f /etc/network/interfaces ] ; then
30 cat >> /etc/network/interfaces << EOF
31 iface lo inet loopback
39 if [ -n "$TIMEZONE" ] ; then
40 ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime
43 if ! [ -f /etc/fstab ] ; then
44 cat >> /etc/fstab << EOF
45 sysfs /sys sysfs auto 0 0
46 proc /proc proc defaults 0 0
47 $TARGET / auto defaults,errors=remount-ro 0 1
48 # /dev/sda2 none swap sw 0 0
49 /dev/cdrom /mnt/cdrom0 iso9660 ro,user,noauto 0 0
53 # create default devices
54 cd /dev && MAKEDEV generic
57 if [ -n "$INITRD" ] ; then
58 update-initramfs -c -t -k $KERNEL
59 if [ -f "/boot/initrd.img-$KERNELVER" ] ; then
60 GRUBINITRD="initrd /boot/initrd.img-$KERNELVER"
61 LILOINITRD=" initrd=/boot/initrd.img-$KERNELVER"
65 # assume the first available kernel as our main kernel
66 KERNELIMG=$(ls -1 /boot/vmlinuz-* | head -1)
67 KERNELVER=${KERNELIMG#/boot/vmlinuz-}
69 if [ "$BOOTMGR" = 'grub' ] ; then
70 if ! [ -f /boot/grub/menu.lst ] ; then
73 cat >> /boot/grub/menu.lst << EOF
74 # Boot automatically after 30 secs.
77 # By default, boot the first entry.
80 # Fallback to the second entry.
83 title Debian Etch, kernel $KERNELVER (on $ARGET)
85 kernel $KERNELIMG root=$TARGET ro
90 # rootnoverify (hd0,0)
96 # copy stage-files to /boot/grub/
97 cp -i /usr/lib/grub/i386-pc/* /boot/grub/
99 # finally install grub
103 if [ "$BOOTMGR" = 'lilo' ] ; then
104 # /usr/share/doc/lilo/examples/conf.sample
105 cat > /etc/lilo.conf << EOF
106 # This allows booting from any partition on disks with more than 1024 cylinders.
109 # Specifies the boot device
112 # Specifies the device that should be mounted as root.
115 # use Debian on software raid:
116 # raid-extra-boot=mbr-only
124 image=/boot/vmlinuz-2.6.17-grml
132 # unmount all filesystems in chroot
135 # finally exit the chroot
138 ## END OF FILE #################################################################