[arch-releng] [RFC] [PATCH] [archiso] README: add: Transfer ISO file to target medium

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Wed Apr 18 10:27:58 EDT 2012


On 04/16/2012 03:09 PM, Gerardo Exequiel Pozzi wrote:
> On 04/16/2012 02:49 PM, Keshav P R wrote:
>> On Mon, Apr 16, 2012 at 23:11, Gerardo Exequiel Pozzi
>> <vmlinuz386 at yahoo.com.ar>  wrote:
>>> Please review, since my english is not the best. Thanks.
>>> (Otherwise I will merge in about one week)
>>>
>>> Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386 at yahoo.com.ar>
>>> ---
>>>   README |  115 
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>   1 file changed, 115 insertions(+)
>>>
>>> diff --git a/README b/README
>>> index 5df3128..f5577bb 100644
>>> --- a/README
>>> +++ b/README
>>> @@ -10,6 +10,7 @@ INDEX
>>>    * hooks/archiso_loop_mnt
>>>   * Boot parameters (only for configs/releng)
>>>    * etc/rc.conf
>>> +* Transfer ISO file to target medium (configs/releng)
>>>   * Build requirements
>>>   * Image types generated by mkarchiso.
>>>   * File format for aitab.
>>> @@ -147,6 +148,120 @@ if nothing is specified on command line.
>>>
>>>
>>>
>>> +*** Transfer ISO image to target medium (configs/releng)
>>> +
>>> +ISO images names consist of: 
>>> archlinux-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
>>> +
>>> +Where:
>>> +<YYYY>  Year
>>> +<MM>  Month
>>> +<DD>  Day
>>> +<TYPE>  netinstall | core
>>> +<ARCH>  i686 | x86_64 | dual(*)
>>> +
>>> +(*) "dual" includes both i686 and x86_64 architectures.
>>> +
>>> +
>>> +** To ->  CD / DVD / BD
>>> +Note: All ISO images are booteable on a PC-BIOS via "El Torito" in 
>>> no-emulation mode,
>>> +      All x86_64 ISO images are booteable on a PC-EFI via "El 
>>> Torito" in no-emulation mode.
>>> +
>>> +Nomeclature:
>>> +<B>  scsibus number
>>> +<T>  target number
>>> +<L>  lun number
>>> +    (Note: see cdrecord -scanbus, for these numbers)
>>> +
>>> +
>>> +1) Write it directly using your favorite recording program.
>>> +# cdrecord dev=<B>,<T>,<L>  -dao 
>>> archlinux-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
>>> +
>>> +
>>> +** To ->  USB Flash Drive (USB-key) / Memory card (SD) /
>>> +         Hard-Disk Drive (HDD) / Solid-State Drive (SSD)
>>> +
>>> +Note: These steps are the general workflow, you can skip some of them,
>>> +      using another filesystem if your bootloader supports it,
>>> +      or installing to another directory than "arch/".
>>> +      Just ensure that main boot params options (archisolabel= and
>>> +      archisobasedir=) are set correctly according to your setup.
>>> +
>>> +Nomeclature:
>>> +<DEV-TARGET>:   Device node of the drive where ISO contents should 
>>> be copied
>>> +                (example: /dev/sdx)
>>> +<DEV-TARGET-N>: Device node of the partition on<DEV-TARGET>
>>> +                (example: /dev/sdx1)
>>> +<MNT-TARGET-N>: Mount point path where<DEV-TARGET-N>  is mounted
>>> +                (example: /mnt/sdx/1)
>>> +<ISO-SOURCE>:   Path to the ISO file 
>>> archlinux-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
>>> +                (example: 
>>> ~/archlinux-2012.04.16-netinstall-x86_64.iso)
>>> +<FS-LABEL>:     Represents the filesystem label of the<ISO-SOURCE>
>>> +                (example: ARCH_201204 [for all 
>>> ~/archlinux-2012.04.*.iso])
>>> +
>>> +
>>> +* PC-BIOS (MBR):
>>> +
>>> +1) Create one partition entry in MBR (of type "b" for FAT32 or "83" 
>>> for EXTFS)
>>> +   and mark it as "active" (booteable).
>>> +# fdisk<DEV-TARGET>
>>> +
>>> +2) Create a FAT32 or EXTFS filesystem on such partition and setup a 
>>> label.
>>> +# mkfs.vfat -F 32 -n<FS-LABEL> <DEV-TARGET-N>
>>> +# mkfs.ext2 -L<FS-LABEL> <DEV-TARGET-N>
>>> +
>>> +3) Mount target filesystem.
>>> +# mount<DEV-TARGET-N> <MNT-TARGET-N>
>>> +
>>> +4) Extract ISO image on target filesystem.
>>> +# bsdtar -x --exclude=isolinux/ --exclude=EFI/ -f<ISO-SOURCE>  
>>> -C<MNT-TARGET-N>
>>> +
>>> +5) Install syslinux bootloader on target filesystem.
>>> +# extlinux -i<MNT-TARGET-N>/arch/boot/syslinux
>>> +
>>> +6) Unmount target filesystem.
>>> +# umount<MNT-TARGET-N>
>>> +
>>> +7) Install syslinux MBR boot code on target drive.
>>> +# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin 
>>> of=<DEV-TARGET>
>>> +
>>> +
>> The above + /efi/archiso files (extracted from efiboot.img) should
>> work well for UEFI. No need for specifically GPT in the USB. MBR
>> (partition table, not boot code) is very well supported by UEFI Spec.
> UEFI spec != firmware vendors implementation. I am only described "the 
> most" standard way that should safe work in all cases.
> (at least here, wiki should be more appropiated for other methods)
>
> Maybe firmwares says "oh there is a valid MBR, booting using legacy 
> method only", and then fails, who knows...
>
>>
>>> +* PC-BIOS (ISOHYBRID-MBR):
>>> +
>>> +This method is the most easily, quick and dirty,
>>> +but is the most limited if you want to use your target medium for 
>>> other purposes.
>>> +
>>> +1) Dump ISO file to target medium.
>>> +# dd if=<ISO-SOURCE>  of=<DEV-TARGET>
>>> +
>>> +
>>> +* PC-EFI (GPT) [x86_64 only]
>>> +
>>> +Note: Using here a GPT partition mode, but MBR should also work.
>>> +      Optionally you can use your favorite EFI boot manager instead 
>>> of an efi-shell+startup.nsh.
>>> +
>>> +1) Create one partition entry in GPT (of type "ef00")
>>> +# gdisk<DEV-TARGET>
>>> +
>>> +2) Create a FAT32 filesystem on such partition and setup a label.
>>> +# mkfs.vfat -F 32 -n<FS-LABEL> <DEV-TARGET-N>
>>> +
>>> +3) Mount target filesystem.
>>> +# mount<DEV-TARGET-N> <MNT-TARGET-N>
>>> +
>>> +4) Extract ISO image on target filesystem.
>>> +# bsdtar -x --exclude=isolinux/ --exclude=arch/boot/syslinux/ 
>>> -f<ISO-SOURCE>  -C<MNT-TARGET-N>
>>> +
>>> +5) Extract efiboot.img on EFI/ on target filesystem.
>>> +# mcopy -s -i<MNT-TARGET-N>/EFI/archiso/efiboot.img 
>>> ::/EFI<MNT-TARGET-N>/
>>> +
>>> +6) Remove uneeded efiboot.img
>>> +# rm<MNT-TARGET-N>/EFI/archiso/efiboot.img
>>> +
>>> +7) Unmount target filesystem.
>>> +# umount<MNT-TARGET-N>
>>> +
>> Even GPT+SYSLINUX should work for BIOS booting.
> Same as above, just using MBR and GPT as example as "the most standard 
> way".
>
> Thanks for your feedback :)
>
>>
>> - Keshav
>>
>> PS: Which iso(s) at http://releng.archlinux.org/isos/ (upto
>> 2012.04.12_16-00-01-testing) has efiboot.img in them?
>>
>
> At this time: none. Builds are broken. Dieter needs to add dosfstools 
> to releng-scripts [#1]
>
> [#1] 
> http://mailman.archlinux.org/pipermail/arch-releng/2012-April/002505.html
>

Added/changed few notes:

diff --git a/README b/README
index 8a88b89..584964f 100644
--- a/README
+++ b/README
@@ -163,6 +163,7 @@ Where:


  ** To -> CD / DVD / BD
+
  Note: All ISO images are booteable on a PC-BIOS via "El Torito" in 
no-emulation mode,
        All x86_64 ISO images are booteable on a PC-EFI via "El Torito" 
in no-emulation mode.

@@ -182,9 +183,9 @@ Nomeclature:

  Note: These steps are the general workflow, you can skip some of them,
        using another filesystem if your bootloader supports it,
-      or installing to another directory than "arch/".
-      Just ensure that main boot params options (archisolabel= and
-      archisobasedir=) are set correctly according to your setup.
+      installing to another directory than "arch/" or using more than
+      one partition. Just ensure that main boot params options
+      (archisolabel= and archisobasedir=) are set correctly according 
to your setup.

  Nomeclature:
<DEV-TARGET>:   Device node of the drive where ISO contents should be copied
@@ -201,6 +202,11 @@ Nomeclature:

  * PC-BIOS (MBR):

+Note: Using here a MBR partition mode as example, but GPT should also works
+      if machine firmware is not broken.
+      Just ensure that partition is set with attribute "2: legacy BIOS 
bootable"
+      and use gptmbr.bin instead of mbr.bin for syslinux.
+
  1) Create one partition entry in MBR (of type "b" for FAT32 or "83" 
for EXTFS)
     and mark it as "active" (booteable).
  # fdisk <DEV-TARGET>
@@ -227,8 +233,8 @@ Nomeclature:

  * PC-BIOS (ISOHYBRID-MBR):

-This method is the most easily, quick and dirty,
-but is the most limited if you want to use your target medium for other 
purposes.
+Note: This method is the most easily, quick and dirty, but is the most 
limited
+      if you want to use your target medium for other purposes.

  1) Dump ISO file to target medium.
  # dd if=<ISO-SOURCE> of=<DEV-TARGET>
@@ -236,8 +242,8 @@ but is the most limited if you want to use your 
target medium for other purposes

  * PC-EFI (GPT) [x86_64 only]

-Note: Using here a GPT partition mode, but MBR should also work.
-      Optionally you can use your favorite EFI boot manager instead of 
an efi-shell+startup.nsh.
+Note: Using here a GPT partition mode as example, but MBR should also works
+      if machine firmware is not broken.

  1) Create one partition entry in GPT (of type "ef00")
  # gdisk <DEV-TARGET>


-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1



More information about the arch-releng mailing list