74 lines
2.4 KiB
Bash
74 lines
2.4 KiB
Bash
# bootcd post script
|
|
#
|
|
# creates a fake installation aimed at producing a kernel image and initrd
|
|
# for booting flash and disk partitions
|
|
|
|
# make initramfs
|
|
cat >> $MOUNTDIR/etc/modprobe.conf << _EOF
|
|
alias scsi_hostadapter ehci-hcd
|
|
alias scsi_hostadapter uhci-hcd
|
|
alias scsi_hostadapter ohci-hcd
|
|
alias scsi_hostadapter usb-storage
|
|
alias scsi_hostadapter sata_via
|
|
alias scsi_hostadapter ata_piix
|
|
alias scsi_hostadapter reiserfs
|
|
_EOF
|
|
|
|
[ -e $MOUNTDIR2/boot/isolinux ] || mkdir -p $MOUNTDIR2/boot/isolinux
|
|
|
|
chroot $MOUNTDIR mkinitramfs \
|
|
/boot/initramfs-${KERNEL_VER}${KERNEL_EXTRAVER}.img.gz \
|
|
${KERNEL_VER}${KERNEL_EXTRAVER}
|
|
|
|
# Note: isolinux requires 8.3 filenames
|
|
cp $MOUNTDIR/boot/initramfs-${KERNEL_VER}${KERNEL_EXTRAVER}.img.gz \
|
|
$MOUNTDIR2/boot/initrmfs.gz
|
|
|
|
cp $MOUNTDIR/boot/vmlinuz-${KERNEL_VER}${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 /usr/lib/syslinux/isolinux.bin ] && cp /usr/lib/syslinux/isolinux.bin $MOUNTDIR2/boot/isolinux/isolinux.bin ||
|
|
{ echo "Error: /boot/memtest.bin not found. Please install the memtest86 package.";
|
|
exit 1; }
|
|
|
|
# install memtest
|
|
[ -e /boot/memtest.bin ] && cp /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
|