From: <abe...@us...> - 2016-02-02 18:00:59
|
Revision: 7498 http://sourceforge.net/p/astlinux/code/7498 Author: abelbeck Date: 2016-02-02 18:00:56 +0000 (Tue, 02 Feb 2016) Log Message: ----------- runnix-iso, add Hybrid ISO support so the .iso can also be dd'ed to a USB drive if desired Modified Paths: -------------- branches/1.0/project/runnix-iso/files/rootfs_vfat/isolinux/isolinux.cfg branches/1.0/project/runnix-iso/target_skeleton/runnix branches/1.0/project/runnix-iso/target_skeleton/sbin/installer-menu branches/1.0/scripts/build-runnix-iso Added Paths: ----------- branches/1.0/project/runnix-iso/files/rootfs_vfat/os/isoflag Removed Paths: ------------- branches/1.0/project/runnix-iso/files/rootfs_vfat/os/astflag Modified: branches/1.0/project/runnix-iso/files/rootfs_vfat/isolinux/isolinux.cfg =================================================================== --- branches/1.0/project/runnix-iso/files/rootfs_vfat/isolinux/isolinux.cfg 2016-02-01 23:45:10 UTC (rev 7497) +++ branches/1.0/project/runnix-iso/files/rootfs_vfat/isolinux/isolinux.cfg 2016-02-02 18:00:56 UTC (rev 7498) @@ -5,5 +5,5 @@ label install kernel /runnix - append initrd=/runnix.img root=/dev/ram0 ro init=/runnix runimg=auto ibata.dma=3 rootdelay=5 + append initrd=/runnix.img root=/dev/ram0 ro init=/runnix runimg=auto libata.dma=3 rootdelay=8 Deleted: branches/1.0/project/runnix-iso/files/rootfs_vfat/os/astflag =================================================================== Copied: branches/1.0/project/runnix-iso/files/rootfs_vfat/os/isoflag (from rev 7497, branches/1.0/project/runnix-iso/files/rootfs_vfat/os/astflag) =================================================================== Modified: branches/1.0/project/runnix-iso/target_skeleton/runnix =================================================================== --- branches/1.0/project/runnix-iso/target_skeleton/runnix 2016-02-01 23:45:10 UTC (rev 7497) +++ branches/1.0/project/runnix-iso/target_skeleton/runnix 2016-02-02 18:00:56 UTC (rev 7498) @@ -6,8 +6,10 @@ RUNVER="$(cat /etc/runnix-release)" -DRIVES="sr0 sr1 sr2 sr3" +CDROM_DRIVES="sr0 sr1 sr2 sr3" +DRIVES="sda sdb sdc sdd sde sdf sdg sdh" + setup_network () { if [ -z "$NDEV" -a -n "$1" ]; then @@ -120,10 +122,12 @@ CMDLINE="$(cat /proc/cmdline)" -for x in $DRIVES; do +DEVICE="" + +for x in $CDROM_DRIVES; do if mount -t iso9660 -o ro /dev/${x} $BASE 2>/dev/null; then - if [ -f $BASE/os/astflag ]; then - DEVICE=${x} + if [ -f $BASE/os/isoflag ]; then + DEVICE="${x}" break else umount /dev/${x} @@ -131,6 +135,19 @@ fi done +if [ -z "$DEVICE" ]; then + for x in $DRIVES; do + if mount -t iso9660 -o ro /dev/${x}1 $BASE 2>/dev/null; then + if [ -f $BASE/os/isoflag ]; then + DEVICE="${x}" + break + else + umount /dev/${x}1 + fi + fi + done +fi + hostname runnix # Loader not found @@ -140,6 +157,8 @@ # reboot fi +echo "$DEVICE" >/tmp/boot_disk + echo "Menu..." /sbin/installer-menu Modified: branches/1.0/project/runnix-iso/target_skeleton/sbin/installer-menu =================================================================== --- branches/1.0/project/runnix-iso/target_skeleton/sbin/installer-menu 2016-02-01 23:45:10 UTC (rev 7497) +++ branches/1.0/project/runnix-iso/target_skeleton/sbin/installer-menu 2016-02-02 18:00:56 UTC (rev 7498) @@ -113,6 +113,14 @@ do_install() { + local boot_disk + + if [ -f /tmp/boot_disk ]; then + boot_disk="$(cat /tmp/boot_disk)" + else + boot_disk="" + fi + IMAGES="$(ls -1 $IMAGE_DIR/*.img.gz 2>/dev/null)" if [ -z "$IMAGES" ]; then @@ -131,7 +139,7 @@ return 1 fi - DISKS="$(fdisk -l 2>/dev/null | grep '^Disk */dev/sd[a-h]:')" + DISKS="$(fdisk -l 2>/dev/null | grep '^Disk */dev/sd[a-h]:' | grep -v "^Disk */dev/${boot_disk}:")" if [ -z "$DISKS" ]; then display_msg "No suitable disk found.\nExiting, no action performed." Modified: branches/1.0/scripts/build-runnix-iso =================================================================== --- branches/1.0/scripts/build-runnix-iso 2016-02-01 23:45:10 UTC (rev 7497) +++ branches/1.0/scripts/build-runnix-iso 2016-02-02 18:00:56 UTC (rev 7498) @@ -50,6 +50,7 @@ rm -f ${ISO_NAME} + echo "Generating ISO..." sudo genisoimage \ -o ${ISO_NAME} \ -b isolinux/isolinux.bin \ @@ -61,6 +62,13 @@ -boot-info-table \ -input-charset utf-8 \ ${RUNDIR} + + if [ -x "${SYSLINUX_DIR}/utils/isohybrid" ]; then + echo "Blessing as Hybrid ISO..." + sudo "${SYSLINUX_DIR}/utils/isohybrid" "${ISO_NAME}" + else + echo "Error: No Hybrid ISO support." + fi } save_state() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |