Changeset 1274


Ignore:
Timestamp:
Sep 28, 2009, 12:14:10 PM (9 years ago)
Author:
jrollins
Message:

update makeiso to use new grub-mkrescue utility from grub-pc package
(grub2, now default in squeeze), or use isolinux from syslinux-common

Location:
trunk/debirf
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/debian/changelog

    r1262 r1274  
     1debirf (0.24-1) unstable; urgency=low
     2
     3  * update makeiso to use new grub2 grub-pc grub-mkrescue utility, or
     4    isolinux from syslinux-common
     5
     6 -- Jameson Graef Rollins <jrollins@finestructure.net>  Mon, 28 Sep 2009 18:11:46 +0200
     7
    18debirf (0.23-1) unstable; urgency=low
    29
  • trunk/debirf/debian/control

    r1260 r1274  
    1414Architecture: all
    1515Depends: debootstrap, cpio, apt, fakeroot, fakechroot, busybox-static | busybox, klibc-utils, ${misc:Depends}
    16 Recommends: genisoimage, grub
     16Recommends: genisoimage, grub-pc | syslinux-common
    1717Suggests: linux-patch-inittmpfs
    1818Description: build a kernel and initrd to run Debian from RAM
  • trunk/debirf/man/man1/debirf.1

    r1186 r1274  
    3232.B makeiso PROFILE
    3333Create a bootable CD-ROM image from the kernel and initramfs in
    34 PROFILE.  This requires a copy of the GRUB El Torito bootloader to be
    35 available (it is pulled from the debian package's default location,
    36 but can an absolute path to the image can be supplied with the
    37 GRUB_ELTORITO environment variable).  "mkisofs" must be present in the
    38 user's path.
     34PROFILE.  This requires an El Torito bootloader to be available.  If
     35grub-pc is installed, then the grub-mkrescue utility from that package
     36will be used.  If grub-mkrescue is not available, then isolinux from
     37the syslinux-common can be used as long as genisoimage utility is also
     38available.
    3939.TP
    4040.B help
  • trunk/debirf/src/debirf

    r1272 r1274  
    563563    esac
    564564
    565     # find GRUB
    566     # FIXME: it would be best to pull the name of the architecture
    567     # exactly instead of using shell globbing to guess at it:
    568     local GRUB_ELTORITO=${GRUB_ELTORITO:-$(echo "/usr/lib/grub/"*"-pc/stage2_eltorito")}
    569     [ -r "$GRUB_ELTORITO" ] || \
    570         failure "Failed to find a grub El Torito stage2 loader at '$GRUB_ELTORITO'.  Try specifying it explicitly with the GRUB_ELTORITO environment variable"
     565    # determine which eltorito boot loader we're using
     566    if [ -z "$DEBIRF_ELTORITO" ] ; then
     567        if which grub-mkrescue >/dev/null ; then
     568            local DEBIRF_ELTORITO=grub
     569        elif [ -f /usr/lib/syslinux/isolinux.bin ] ; then
     570            local DEBIRF_ELTORITO=isolinux
     571        else
     572            failure "Suitable El Torito boot loader not found.  Please install grub-pc or syslinux-common."
     573        fi
     574    fi
    571575
    572576    msg "creating debirf iso..."
     
    578582    local ISODIR="${DEBIRF_BUILDD}/iso"
    579583    rm -rf "$ISODIR"
    580     mkdir -p "$ISODIR"/boot/grub
    581 
    582     # use hard links to avoid massive copying time and genisoimage's
    583     # warning about -f (we're almost certainly on the same filesystem):
    584     ln "${DEBIRF_BUILDD}/${KERNEL}" "${ISODIR}/" || failure "Failed to link kernel into iso"
    585     ln "${DEBIRF_BUILDD}/${INITRAMFS}" "${ISODIR}/" || failure "Failed to link initramfs into iso"
    586 
    587     # this file is very likely not on the same filesystem (and it's
    588     # likely to be small) so copying it makes more sense than linking:
    589     cp "$GRUB_ELTORITO" "$ISODIR"/boot/grub/
    590     cat >"$ISODIR"/boot/grub/menu.lst <<EOF
     584    mkdir -p "$ISODIR"
     585
     586    case "$DEBIRF_ELTORITO" in
     587        grub)
     588            msg "using grub as bootloader..."
     589
     590            # use hard links to avoid massive copying time and genisoimage's
     591            # warning about -f (we're almost certainly on the same filesystem):
     592            ln "${DEBIRF_BUILDD}/${KERNEL}" "${ISODIR}/" || failure "Failed to link kernel into iso"
     593            ln "${DEBIRF_BUILDD}/${INITRAMFS}" "${ISODIR}/" || failure "Failed to link initramfs into iso"
     594
     595            # make grub.cfg
     596            mkdir -p "$ISODIR"/boot/grub/
     597            cat >"$ISODIR"/boot/grub/grub.cfg <<EOF
    591598serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
    592 terminal --timeout=10 serial console
    593 
    594 title Debirf: $DEBIRF_LABEL, serial console (created $(date -R))
    595 kernel /$KERNEL console=ttyS0,115200n8
    596 initrd /$INITRAMFS
    597 
    598 title Debirf: $DEBIRF_LABEL, video console (created $(date -R))
    599 kernel /$KERNEL console=tty0
    600 initrd /$INITRAMFS
     599if terminal_input serial ; then true ; else
     600  # For backward compatibility with versions of terminal.mod that don't
     601  # understand terminal_input
     602  terminal --timeout=10 serial console
     603fi
     604if terminal_output serial ; then true ; else
     605  # For backward compatibility with versions of terminal.mod that don't
     606  # understand terminal_output
     607  terminal --timeout=10 serial console
     608fi
     609menuentry "Debirf: $DEBIRF_LABEL, serial console (created $(date -R))" {
     610        linux   /$KERNEL console=ttyS0,115200n8
     611        initrd  /$INITRAMFS
     612}
     613menuentry "Debirf: $DEBIRF_LABEL, video console (created $(date -R))" {
     614        linux   /$KERNEL console=tty0
     615        initrd  /$INITRAMFS
     616}
    601617EOF
    602618
    603     genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o "${DEBIRF_BUILDD}/${ISO}" "$ISODIR"
     619            # make the iso
     620            grub-mkrescue --image-type=cdrom --overlay="$ISODIR" "${DEBIRF_BUILDD}/${ISO}"
     621   
     622            ;;
     623
     624        isolinux)
     625            msg "using isolinux as bootloader..."
     626
     627            # use hard links to avoid massive copying time and genisoimage's
     628            # warning about -f (we're almost certainly on the same filesystem):
     629            ln "${DEBIRF_BUILDD}/${KERNEL}" "${ISODIR}/vmlinuz" || failure "Failed to link kernel into iso"
     630            ln "${DEBIRF_BUILDD}/${INITRAMFS}" "${ISODIR}/debirf.cfg" || failure "Failed to link initramfs into iso"
     631
     632            # insert isolinux eltorito image
     633            cp /usr/lib/syslinux/isolinux.bin "$ISODIR"/
     634
     635            local ELTORITO=isolinux.bin
     636
     637            # make isolinux menu
     638            cat >"$ISODIR"/isolinux.cfg <<EOF
     639serial 0 115200
     640prompt 1
     641timeout 0
     642display isolinux.cfg
     643default serial
     644
     645# DebIRF: $DEBIRF_LABEL
     646# kernel: $KERNEL
     647# initramfs: $INITRAMFS
     648# created: $(date -R)
     649
     650# serial console
     651label serial
     652  kernel vmlinuz
     653  append initrd=debirf.cfg console=ttyS0,115200n8
     654
     655# video console
     656label video
     657  kernel vmlinuz
     658  append initrd=debirf.cfg console=tty0
     659
     660EOF
     661
     662            # generate the iso
     663            genisoimage -R -b "$ELTORITO" \
     664                -no-emul-boot -boot-load-size 4 -boot-info-table \
     665                -o "${DEBIRF_BUILDD}/${ISO}" \
     666                "$ISODIR"
     667            ;;
     668
     669        *)
     670
     671            failure "unknown iso build method '$METHOD'"
     672            ;;
     673    esac
     674
    604675    # do we need to clean up the iso/ directory so that this can be run again?
    605676
Note: See TracChangeset for help on using the changeset viewer.