From 8ea79401e553f6fec8f45efe01e0a7af7ab6bef4 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 6 Oct 2011 14:57:30 +0200 Subject: [PATCH] bootusb: added dual kernel support (mamba,mamba-64GB) --- makedist.inc.sh | 8 +++- platforms/bootusb/post.inc.sh | 80 +++++++++++++++++++++------------- platforms/bootusb/settings.inc | 2 + 3 files changed, 58 insertions(+), 32 deletions(-) diff --git a/makedist.inc.sh b/makedist.inc.sh index 795d928..9031280 100644 --- a/makedist.inc.sh +++ b/makedist.inc.sh @@ -71,7 +71,9 @@ install_rpms_by_target "Installing base packages for ${MAKEDIST_TARGET} target" pre_install_rpms if [ ! "$KERNEL_IGNORE" ]; then - install_kernel ${KERNEL_EXTRAVER}${KERNEL_PLATFORM} "${KERNEL_ADDITIONAL}" + for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + install_kernel ${K}${KERNEL_PLATFORM} "${KERNEL_ADDITIONAL}" + done fi # set system hostname and domain @@ -89,7 +91,9 @@ install_rpms_by_target "Installing ${PLATFORM} platform packages" ${MAKEDIST_TAR [ "$ARCH" ] && install_rpms_by_target "Installing ${PLATFORM} platform localization packages for arch $ARCH" ${MAKEDIST_TARGET}-${PLATFORM}-${ARCH} "${RPMEXTRAARGS}" if [ ! "$KERNEL_IGNORE" ]; then - update_modules_dependencies ${KERNEL_VER}${KERNEL_EXTRAVER} + for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + update_modules_dependencies ${KERNEL_VER}${K} + done fi if [ "$APPLICATION_TARGET" ]; then diff --git a/platforms/bootusb/post.inc.sh b/platforms/bootusb/post.inc.sh index 969c10f..0b1c286 100644 --- a/platforms/bootusb/post.inc.sh +++ b/platforms/bootusb/post.inc.sh @@ -1,16 +1,12 @@ # make initramfs - -chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}${KERNEL_EXTRAVER} - -## FIXME: ONLY FOR TEST; REMOVE THE FOLLOWING LINE! -#cp /tmp/unionfs.ko $MOUNTDIR/lib/modules/${KERNEL_MAJVER}${KERNEL_EXTRAVER}/kernel/fs/unionfs/unionfs.ko -#cp /tmp/squashfs.ko $MOUNTDIR/lib/modules/${KERNEL_MAJVER}${KERNEL_EXTRAVER}/kernel/fs/squashfs/squashfs.ko - -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} +for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}${K} + LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \ + --filesystems "ext3 ext4 unionfs squashfs isofs reiserfs reiser4" \ + --nomdadmconf --nolvmconf \ + /boot/initramfs-${KERNEL_MAJVER}${K}.img.gz \ + ${KERNEL_MAJVER}${K} +done # add buildinfo buildinfo="`cat $MOUNTDIR/etc/openmamba-release` ${PLATFORM}" @@ -20,26 +16,50 @@ cat > $MOUNTDIR/boot/extlinux.conf << _EOF PROMPT 0 TIMEOUT 20 DEFAULT vesamenu.c32 -MENU TITLE ${buildinfo} (${KERNEL_MAJVER}${KERNEL_EXTRAVER} kernel) +MENU TITLE ${buildinfo} (${KERNEL_MAJVER} kernel) MENU BACKGROUND openmamba.png MENU COLOR TITLE 1;32;49 #ff00993d #00000000 std +_EOF -LABEL kms -MENU LABEL default - kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER} - append initrd=/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 quiet splash vga=792 -LABEL vga1024 -MENU LABEL VGA 1024x768 (no modeset) - kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER} - append initrd=/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 quiet splash vga=792 nomodeset -LABEL vga800 -MENU LABEL VGA 800x600 (no modeset) - kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER} - append initrd=/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 quiet splash vga=789 nomodeset -LABEL debug -MENU LABEL Debug mode - kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER} - append initrd=/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 rddebug rdshell debug +for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + cat >> $MOUNTDIR/boot/extlinux.conf << _EOF +LABEL default-${KERNEL_MAJVER}${K} +MENU LABEL default (${KERNEL_MAJVER}${K}) + kernel /boot/vmlinuz-${KERNEL_MAJVER}${K} + append initrd=/boot/initramfs-${KERNEL_MAJVER}${K}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 quiet splash vga=792 +_EOF +done + +echo "MENU SEPARATOR" >> $MOUNTDIR/boot/extlinux.conf +for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + cat >> $MOUNTDIR/boot/extlinux.conf << _EOF +LABEL vga800-${KERNEL_MAJVER}${K} +MENU LABEL VGA 800x600 no modeset (${KERNEL_MAJVER}${K}) + kernel /boot/vmlinuz-${KERNEL_MAJVER}${K} + append initrd=/boot/initramfs-${KERNEL_MAJVER}${K}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 quiet splash vga=789 nomodeset +_EOF +done + +for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + cat >> $MOUNTDIR/boot/extlinux.conf << _EOF +LABEL vga1024-${KERNEL_MAJVER}${K} +MENU LABEL VGA 1024x768 no modeset (${KERNEL_MAJVER}${K}) + kernel /boot/vmlinuz-${KERNEL_MAJVER}${K} + append initrd=/boot/initramfs-${KERNEL_MAJVER}${K}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 quiet splash vga=792 nomodeset +_EOF +done + +echo "MENU SEPARATOR" >> $MOUNTDIR/boot/extlinux.conf +for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do + cat >> $MOUNTDIR/boot/extlinux.conf << _EOF +LABEL debug-${KERNEL_MAJVER}${K} +MENU LABEL ${KERNEL_MAJVER}${K} Debug mode + kernel /boot/vmlinuz-${KERNEL_MAJVER}${K} + append initrd=/boot/initramfs-${KERNEL_MAJVER}${K}.img.gz root=live:/openmamba_live/openmamba-live.iso ro selinux=0 rddebug rdshell debug +_EOF +done + +cat >> $MOUNTDIR/boot/extlinux.conf << _EOF MENU SEPARATOR LABEL memtest MENU LABEL Memory test @@ -62,7 +82,7 @@ cp -a $MOUNTDIR/boot $MOUNTDIR2 cp $MOUNTDIR/usr/share/syslinux/vesamenu.c32 $MOUNTDIR2/boot/ # copy static files for specific platform -[ -e $TARGETDIR/platforms/$PLATFORM/root ] && +[ -e $TARGETDIR/platforms/$PLATFORM/root ] && cp -a $TARGETDIR/platforms/$PLATFORM/root/* $MOUNTDIR2/ # copy localized static files for specific platform diff --git a/platforms/bootusb/settings.inc b/platforms/bootusb/settings.inc index 3867757..9834c2c 100644 --- a/platforms/bootusb/settings.inc +++ b/platforms/bootusb/settings.inc @@ -6,6 +6,8 @@ KERNEL_EXTRAVER=mamba KERNEL_PLATFORM="" #KERNEL_ADDITIONAL="extramodules wireless sound" +KERNEL_MORE_EXTRAVER=mamba-64GB + RPMEXTRAARGS="--excludedocs" TARGET_HOSTNAME=openmamba-bootusb