summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README361
1 files changed, 329 insertions, 32 deletions
diff --git a/README b/README
index df37d35..d562b2e 100644
--- a/README
+++ b/README
@@ -5,14 +5,31 @@ This is a rebranded fork of the original Archiso for Parabola GNU/Linux-libre.
* Boot parameters (initramfs stage)
* hooks/archiso
+ * hooks/archiso_pxe_common
* hooks/archiso_pxe_nbd
+ * hooks/archiso_pxe_http
+ * hooks/archiso_pxe_nfs
* hooks/archiso_loop_mnt
* Boot parameters (only for configs/releng)
* etc/rc.conf
+* Transfer ISO file to target medium (configs/releng)
+ * To -> CD / DVD / BD
+ * To -> USB-key / SD / HDD / SSD
+ * PC-BIOS (MBR)
+ * PC-BIOS (ISOHYBRID-MBR)
+ * PC-EFI (GPT) [x86_64 only]
+* Alternative boot methods (configs/releng)
+ * ISO in loopback mode
+ * ISO in memdisk mode
+ * Network booting (PXE) [first stage]
+ * DHCP + TFTP
+ * DHCP + HTTP
+ * HTTP/NFS/NBD [second stage]
* Build requirements
* Image types generated by mkarchiso.
* File format for aitab.
* Why the /isolinux and /libre/boot/syslinux directories?
+* Know issues
* Building the most basic Parabola live media. (configs/baseline)
* Building official Parabola live media. (configs/releng)
@@ -37,15 +54,23 @@ This is a rebranded fork of the original Archiso for Parabola GNU/Linux-libre.
performs a self-test of all files inside ${install_dir},
and continue booting if ok.
Default: (unset)
+* cow_label= Set the filesystem label where COW (dm-snapshot)
+ files must be stored.
+ Default: (unset)
+* cow_device= Set the device node where COW (dm-snapshot) files
+ must be stored.
+ Default: (unset) or "/dev/disk/by-label/${cow_label}"
+* cow_directory= Set a directory inside ${cow_device}.
+ Default: "/persistent_${archisolabel}/${arch}"
+* cow_persistent= Set if snapshots are persistent "P" or non-persistent "N".
+ Default: "N" (if no ${cow_device} is used) otherwise "P".
* cowspace_size= Set the size of tmpfs /cowspace. This space is used for
Copy-On-Write files of dm-snapshot.
- (directory not visible outside initramfs)
Size is in bytes (suffix with "k", "m" and "g") or
in percentage of available RAM.
Default: "75%"
-* copytoram_size= Set the size of tmpfs /cowpytoram. This space is used for
+* copytoram_size= Set the size of tmpfs. This space is used for
copy of all SquashFS images used, if copytoram=y.
- (directory not visible outside initramfs)
Size is in bytes (suffix with "k", "m" and "g") or
in percentage of available RAM.
Default: "75%"
@@ -57,7 +82,7 @@ This is a rebranded fork of the original Archiso for Parabola GNU/Linux-libre.
Default: (architecture of running kernel)
-** hooks/archiso_pxe_nbd
+** hooks/archiso_pxe_common
* ip= This parameter is setup automatically by PXELINUX
when option "IPAPPEND" is set to 1 or 2 in config.
@@ -67,14 +92,53 @@ This is a rebranded fork of the original Archiso for Parabola GNU/Linux-libre.
when option "IPAPPEND" is set to 2 or 3 in config.
BOOTIF=<hardware-address-of-boot-interface>
Default: (set via PXELINUX)
+
+
+** hooks/archiso_pxe_nbd
+
* archiso_nbd_name= Set NBD export name used by the server.
Default: archiso
+* archiso_nbd_srv= Set an IP address where NBD reside.
+ If ${pxeserver} is used, PXE IP will be used.
+ Default: (unset)
+
+
+** hooks/archiso_pxe_http
+
+* archiso_http_srv= Set an HTTP URL (must end with /) where ${archisobasedir}
+ is found with all *.sfs files.
+ In the IP/domain part if ${pxeserver} is used, use PXE IP.
+ Default: (unset)
+* archiso_http_spc= Set the size of tmpfs where *.sfs files are downloaded.
+ Default: "75%"
+
+
+** hooks/archiso_pxe_nfs
+
+* archiso_nfs_srv= Set the NFS-IP:/path of the server
+ In the IP part if ${pxeserver} is used, PXE IP will be used.
+ Default: (unset)
+* archiso_nfs_opt= Set NFS mount options separated by comma.
+ Default: (unset, see below)
+ These are the implicit options:
+ port = as given by server portmap daemon
+ rsize = 1024
+ wsize = 1024
+ timeo = 7
+ retrans = 3
+ acregmin = 3
+ acregmax = 60
+ acdirmin = 30
+ acdirmax = 60
+ flags = hard, nointr, noposix, cto, ac
** hooks/archiso_loop_mnt
-* img_dev= Device where archiso-image.iso reside.
+* img_label= Set the filesystem label where archiso-image.iso.
Default: (unset)
+* img_dev= Device where archiso-image.iso reside.
+ Default: (unset) or "/dev/disk/by-label/${img_label}"
* img_loop= Full path where archiso-image.iso is located on ${img_dev}
Default: (unset)
@@ -98,23 +162,258 @@ if nothing is specified on command line.
+*** Transfer ISO image to target medium (configs/releng)
+
+ISO images names consist of: parabola-<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 parabola-<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,
+ 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
+ (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 parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
+ (example: ~/parabola-2012.04.16-netinstall-x86_64.iso)
+<FS-LABEL>: Represents the filesystem label of the <ISO-SOURCE>
+ (example: LIBRE_201204 [for all ~/parabola-2012.04.*.iso])
+
+
+* 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" (bootable).
+# 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.ext4 -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>
+
+
+* PC-BIOS (ISOHYBRID-MBR):
+
+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>
+
+
+* PC-EFI (GPT) [x86_64 only]
+
+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>
+
+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>
+
+
+
+*** Alternative boot methods (configs/releng)
+
+** ISO in loopback mode.
+
+Note: Described method is for using with GRUB2.
+ GRUB2 is installed on target media and parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
+ is at path <TARGET-PATH> on disk <D> and partition <P>,
+ where filesystem is labeled as <TARGET-FS-LABEL>.
+
+menuentry "Parabola GNU/Linux-libre (x86_64)" {
+ set isofile="/<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso"
+ loopback loop (hd<D>,<P>)$isofile
+ linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=<FS-LABEL> img_label=<TARGET-FS-LABEL> img_loop=$isofile
+ initrd (loop)/arch/boot/x86_64/libreiso.img
+}
+
+menuentry "Parabola GNU/Linux-libre (i686)" {
+ set isofile="/<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso"
+ loopback loop (hd<D>,<P>)$isofile
+ linux (loop)/arch/boot/i686/vmlinuz archisolabel=<FS-LABEL> img_label=<TARGET-FS-LABEL> img_loop=$isofile
+ initrd (loop)/arch/boot/i686/libreiso.img
+}
+
+
+** ISO in memdisk mode.
+
+Note: Described method is for using with SYSLINUX. Anyway MEMDISK from SYSLINUX can work
+ with other bootloaders.
+ SYSLINUX is installed on target media and parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
+ is at path <TARGET-PATH>.
+ On 32-bit systems, is needed to pass vmalloc=nnM to the kernel, where nn is the size
+ of the ISO image plus 64 MiB (or 128 MiB).
+
+
+LABEL parabola_x64
+ LINUX memdisk
+ INITRD /<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
+ APPEND iso
+
+LABEL parabola_x32
+ LINUX memdisk
+ INITRD /<TARGET-PATH>/parabola-<YYYY>.<MM>.<DD>-<TYPE>-<ARCH>.iso
+ APPEND iso
+
+
+** Network booting (PXE).
+
+All ISOs are ready to act as PXE server, some manual steps are needed
+to setup the desired PXE boot mode.
+Alternatively it is possible to use an existing PXE server following the same logic.
+Note: Setup network first, adjust IP adresses, and respect all slashes "/".
+
+First stage is for loading kernel and initramfs via PXE, two methods described here:
+
+* DHCP + TFTP
+
+Note: All NIC firmwares should support this.
+
+# dnsmasq --port=0 \
+ --enable-tftp \
+ --tftp-root=/run/archiso/bootmnt \
+ --dhcp-range=192.168.0.2,192.168.0.254,86400 \
+ --dhcp-boot=/arch/boot/syslinux/gpxelinux.0 \
+ --dhcp-option-force=209,boot/syslinux/archiso.cfg \
+ --dhcp-option-force=210,/arch/
+
+* DHCP + HTTP
+
+Note: Not all NIC firmware supports HTTP and DNS (if domain name is used).
+ At least this works with iPXE and gPXE.
+
+# dnsmasq --port=0 \
+ --dhcp-range=192.168.0.2,192.168.0.254,86400 \
+ --dhcp-boot=http://192.168.0.7/arch/boot/syslinux/gpxelinux.0 \
+ --dhcp-option-force=209,boot/syslinux/archiso.cfg \
+ --dhcp-option-force=210,http://192.168.0.7/arch/
+
+
+Once the kernel is started from PXE, SquashFS files and other misc files
+inside "arch" directory must be loaded (second stage). One of the following
+methods can be used to serve the rest of live-medium.
+
+* HTTP
+
+# darkhttpd /run/archiso/bootmnt
+
+
+* NFS
+
+# echo "/run/archiso/bootmnt 192.168.0.*(ro,no_subtree_check,no_root_squash)" >> /etc/exports
+# rc.d start rpcbind nfs-common nfs-server
+
+
+* NBD
+
+Note: Adjust LIBRE_201204 as needed.
+
+# cat << EOF > /tmp/nbd-server.conf
+[generic]
+[archiso]
+ readonly = true
+ exportname = /dev/disk/by-label/LIBRE_201204
+EOF
+# nbd-server -C /tmp/nbd-server.conf
+
+
+
*** Build requirements
** For mkarchiso script needs these packages (build host):
- + devtools for mkarchroot
+ squashfs-tools for mksquashfs
- + syslinux for isohybrid
- + cdrkit for mkisofs
+ + libisoburn for xorriso
+ + rsync for rsync
+
+** For configs/releng build.sh needs theses packages (build host):
+ + dosfstools for mkfs.vfat
** For these hooks needs these packages (on target root-image)
* archiso
+ (none)
* archiso_loop_mnt
+ (none)
-* archiso_pxe_nbd
+* archiso_pxe_common
+ mkinitcpio-nfs-utils for ipconfig
+* archiso_pxe_nbd
+ nbd for nbd-client
-
+* archiso_pxe_http
+ + curl for curl
+* archiso_pxe_nfs
+ + mkinitcpio-nfs-utils for nfsmount
+* archiso_shutdown
+ + (none)
*** Image types generated by mkarchiso.
@@ -123,10 +422,6 @@ if nothing is specified on command line.
* image-name.fs.sfs SquashFS with only one file inside (image-name.fs),
which is an image of some type of filesystem
(ext4, ext3, ext2, xfs), all files reside on it.
-* image-name.fs Like image-name.fs.sfs but without SquashFS.
- (For testing purposes only. The option copytoram
- for archiso hook does not have any effect on these images)
-
*** File format for aitab.
@@ -141,7 +436,6 @@ It consists of some fields which define the behaviour of images.
<mnt> Mount point.
<arch> Architecture { i686 | x86_64 | any }.
<sfs_comp> SquashFS compression type { gzip | lzo | xz }.
- A special value of "none" denotes no usage of SquashFS.
<fs_type> Set the filesystem type of the image { ext4 | ext3 | ext2 | xfs }.
A special value of "none" denotes no usage of a filesystem.
In that case all files are pushed directly to SquashFS filesystem.
@@ -152,9 +446,6 @@ It consists of some fields which define the behaviour of images.
This is an estimation, and calculated in a simple way.
Space used + 10% (estimated for metadata overhead) + desired %
-Note: Some combinations are invalid, example: sfs_comp=none and fs_type=none
-
-
*** Why the /isolinux and /arch/boot/syslinux directories?
@@ -165,6 +456,16 @@ When make your custom boot-pendrive, you need to copy /libre directory to it.
/isolinux/isolinux.cfg just holds /libre/boot/syslinux/syslinux.cfg
+*** Know issues
+
+** On shutdown there are two steps that [FAIL]:
+ "Unmounting Swap-backed Filesystems" and "Unmounting Non-API Filesystems",
+ These filesystem are in use at this stage by archiso, but...
+ This is not a real issue since, all mounted filesystem, loopback devices
+ and device mapper devices made by archiso will be "free" on "shutdown tmpfs"
+ (A.K.A deinitramfs), build at initramfs by [archiso_shutdown] initcpio hook.
+
+
*** Building the most basic Parabola live media. (configs/baseline)
@@ -177,7 +478,7 @@ When make your custom boot-pendrive, you need to copy /libre directory to it.
* Install archiso on chroot (needs git and make)
[host] # pacman -S git make --needed
- [host] # git clone git://projects.archlinux.org/archiso.git
+ [host] # git clone git://projects.parabolagnulinux.org/archiso.git
[host] # make -C archiso/archiso DESTDIR=/tmp/chroot install
* Enter to chroot (prefix with linux32 if needed).
@@ -191,7 +492,7 @@ When make your custom boot-pendrive, you need to copy /libre directory to it.
[chroot] # echo 'Server = http://repo.parabolagnulinux.org/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
* Install aditional packages needed for mkarchiso.
- [chroot] # pacman -S devtools squashfs-tools syslinux cdrkit
+ [chroot] # pacman -S devtools squashfs-tools syslinux cdrkit libisoburn rsync
* Build a basic iso.
[chroot] # cp -r /usr/share/archiso/configs/baseline /tmp
@@ -205,7 +506,6 @@ Note: If you want to customize, just see the configs/releng directory which is
used to build official images with much more things.
-
*** Building official Parabola live media. (configs/releng)
Note: These steps should be done with 64 bits support.
@@ -215,7 +515,7 @@ Note: These steps should be done with 64 bits support.
[host64] # linux32 mkarchroot /tmp/chroot32 base
[host64] # linux32 mkarchroot -r bash /tmp/chroot32
[chroot32] # echo 'Server = http://repo.parabolagnulinux.org/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
- [chroot32] # pacman -S devtools squashfs-tools syslinux cdrkit
+ [chroot32] # pacman -S devtools squashfs-tools syslinux cdrkit rsync dosfstools
[chroot32] # exit
* Prepare a 64 bits chroot enviroment.
@@ -223,7 +523,7 @@ Note: These steps should be done with 64 bits support.
[host64] # mkarchroot /tmp/chroot64 base
[host64] # mkarchroot -r bash /tmp/chroot64
[chroot64] # echo 'Server = http://repo.parabolagnulinux.org/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
- [chroot64] # pacman -S devtools squashfs-tools syslinux cdrkit
+ [chroot64] # pacman -S devtools squashfs-tools syslinux cdrkit rsync dosfstools
[chroot64] # exit
* Install archiso on both chroots.
@@ -245,20 +545,17 @@ Note: These steps should be done with 64 bits support.
[chroot32] # mknod /dev/loop1032 b 7 1032 #assumed loop.max_part=0 (by default)
[chroot32] # cp -r /usr/share/archiso/configs/releng /tmp
[chroot32] # cd /tmp/releng
- [chroot32] # ./build.sh all_iso_single
- [chroot32] # ./build.sh purge_single #optional
+* Build them!
+ [chroot64] # cd /tmp/releng
+ [chroot64] # ./build.sh build all all
* Enter 64 bits chroot enviroment then build core and netinstall single images.
[chroot64] # mkarchroot -r bash /tmp/chroot64
[chroot64] # mknod /dev/loop1064 b 7 1064 #assumed loop.max_part=0 (by default)
[chroot64] # cp -r /usr/share/archiso/configs/releng /tmp
+* Build them!
[chroot64] # cd /tmp/releng
- [chroot64] # ./build.sh all_iso_single
- [chroot64] # ./build.sh purge_single #optional
+ [chroot64] # ./build.sh build all all
-* Build core and netinstall dual images from any of the chroot enviroments.
-
- [host64] # mkarchroot -r bash /tmp/chroot64
- [chroot64] # cd /tmp/releng
- [chroot64] # ./build.sh all_iso_dual
+Note: See build.sh -h for more options.