Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: [OT] Making a bootable USB flash drive from ISO image
Date: Mon, 06 Oct 2014 11:52:24
Message-Id: 20141006125210.3eb97f62@digimed.co.uk
In Reply to: [gentoo-user] Re: [OT] Making a bootable USB flash drive from ISO image by James
1 On Fri, 3 Oct 2014 15:19:40 +0000 (UTC), James wrote:
2
3 > > I was also wrong in stating I use isohybrid for the LXFDVDs. I used to
4 > > but since switching to using GRUB to boot the DVDs, there is no need
5 > > for it. GRUB bootable DVD ISOs can boot from USB sticks by default.
6
7 > Can you elaborate? For example how do you know a given *.iso* is grub
8 > bootable? It there a test? Is there a list? Just burn it to a usbstick
9 > and test?
10
11 I'm not referring to booting ISOs from GRUB here, the LXFDVDs use GRUB as
12 their bootloader, instead of isolinux, which allows for various options
13 for the builder (me) that aren't available with isolinux.
14
15 As fr as booting individual ISOs with GRUB, you can boot any ISO this
16 way, the problem is telling the distro's init script that you have done
17 so and that is should look for an ISO image instead of a DVD drive to
18 load the rest of the files.
19
20 With some distros this is trivial, anything Ubuntu derived simply seeds
21 an extra kernel option to specify the location of the ISO. For others I
22 had to modify the initrd to get it to work while some have so far
23 defeated me.
24
25 Most do work, but you need to Google for the specifics for that
26 particular distro, there is no standard way. One Arch-derivative even
27 changed the names of all the variables in the init script for no apparent
28 reason other than to pretend it wasn't an arch script.
29
30 > Justuse a tool such as the aforementioned "isohybrid" can
31 > convert any *.iso* to a grub bootable? I like the idea of one image
32 > (iso) being able to install via MBR or grub.
33
34 I usually put a System Rescue Cd image in /boot and have this as an
35 executable file in /etc/grub.d
36
37 #!/bin/sh
38
39 BOOT_PART="hd0,gpt1"
40
41 ISOS=$(ls -1r /boot/systemrescuecd-x86-*.iso)
42 if [[ -n "$ISOS" ]]; then
43 echo -e "submenu \"System Rescue CD\" {"
44 echo -e "\tset root='$BOOT_PART'"
45 for i in $ISOS; do
46 ISO=$(basename $i)
47 VER=$(echo $ISO | sed 's/systemrescuecd-x86-\(.*\)\.iso/\1/')
48 echo -e "\n\tmenuentry \"System Rescue CD $VER - Std kernel\" {"
49 echo -e "\t\tloopback loop /$ISO"
50 echo -e "\t\tlinux (loop)/isolinux/rescue64 rootpass=yeahright setkmap=uk isoloop=$ISO"
51 echo -e "\t\tinitrd
52 (loop)/isolinux/initram.igz" echo -e "\t}"
53
54 echo -e "\n\tmenuentry \"System Rescue CD $VER - Alt kernel\" {"
55 echo -e "\t\tloopback loop /$ISO"
56 echo -e "\t\tlinux (loop)/isolinux/altker64 rootpass=nochance setkmap=uk isoloop=$ISO"
57 echo -e "\t\tinitrd (loop)/isolinux/initram.igz"
58 echo -e "\t}"
59 done
60 echo -e "}\n"
61 echo -e "menuentry ' ' { true }\n"
62 fi
63
64
65 --
66 Neil Bothwick
67
68 Standard: (n., adj.) a design target which manufacturers may embellish, improve
69 upon, or ignore as they wish, so long as it can be used profitably
70 in their advertising.

Attachments

File name MIME type
signature.asc application/pgp-signature