makedist-openmamba-milestone3/platforms/bootcd/post.inc.sh

73 lines
2.5 KiB
Bash
Raw Normal View History

2011-05-19 16:02:37 +02:00
# bootcd post script
#
# creates a fake installation aimed at producing a kernel image and initrd
# for booting flash and disk partitions
[ -e $MOUNTDIR2/boot/isolinux ] || mkdir -p $MOUNTDIR2/boot/isolinux
chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}${KERNEL_EXTRAVER}
# make initramfs
# temporary workaround to disable nouveau driver in favour of nvidia proprietary until
# it gets 3D support
echo "blacklist nouveau" > $MOUNTDIR/etc/modprobe.d/nouveau.conf
LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \
--filesystems "ext3 ext4 unionfs squashfs isofs reiserfs reiser4" \
--nomdadmconf --nolvmconf \
/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz \
${KERNEL_MAJVER}${KERNEL_EXTRAVER}
# Note: isolinux requires 8.3 filenames
cp $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz \
$MOUNTDIR2/boot/initrmfs.gz
cp $MOUNTDIR/boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER} \
$MOUNTDIR2/boot/vmlinuz
# configure isolinux boot loader
cat > $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
timeout 100
prompt 1
display menu.txt
F1 help.txt
F2 helpit.txt
default 1
label 1
kernel /boot/vmlinuz
append video=vesafb:1024x768-32,ywrap,mtrr root=/dev/sda1 console=tty1 initrd=/boot/initrmfs.gz splash=silent quiet
label 2
kernel /boot/vmlinuz
append video=vesafb:1024x768-32,ywrap,mtrr root=/dev/sda2 console=tty1 initrd=/boot/initrmfs.gz splash=silent quiet
label 3
kernel /boot/vmlinuz
append video=vesafb:1024x768-32,ywrap,mtrr root=/dev/sda console=tty1 initrd=/boot/initrmfs.gz splash=silent quiet
label 4
kernel /boot/vmlinuz
append video=vesafb:1024x768-32,ywrap,mtrr root=/dev/hda1 console=tty1 initrd=/boot/initrmfs.gz splash=silent quiet
label 8
kernel /boot/vmlinuz
append video=vesafb:1024x768-32,ywrap,mtrr root=/dev/sda1 console=tty1 initrd=/boot/initrmfs.gz debug=1 splash=verbose
label 9
kernel memtest
_EOF
# install isolinux binary
[ -e $MOUNTDIR/usr/share/syslinux/isolinux.bin ] && cp $MOUNTDIR/usr/share/syslinux/isolinux.bin $MOUNTDIR2/boot/isolinux/isolinux.bin ||
{ echo "Error: /usr/share/syslinux/isolinux.bin not found. Please install the syslinux package.";
exit 1; }
# install memtest
[ -e $MOUNTDIR/boot/memtest.bin ] && cp $MOUNTDIR/boot/memtest.bin $MOUNTDIR2/boot/isolinux/memtest ||
{ echo "Error: /boot/memtest.bin not found. Please install the memtest86 package.";
exit 1; }
# copy static files for specific platform
[ -e $TARGETDIR/platforms/$PLATFORM/root ] &&
cp -a $TARGETDIR/platforms/$PLATFORM/root/* $MOUNTDIR2/
MOUNTDIR=$MOUNTDIR2 produce_media
exit 0