diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-09-13 21:54:55 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-09-13 21:54:55 -0300 |
commit | b11fa2ad388eaaa3776a3d3c99fb30d6ddb111b0 (patch) | |
tree | c5386f2d16ed5ff4170f4915fbf07c6f478f8599 | |
parent | 64a660adb9a1ad658874759c186e0e9cbf138e63 (diff) | |
parent | 0d04c89e6bfee46477ef08030654a0b421ba86ae (diff) |
Merge branch 'master' of https://projects.archlinux.org/git/archiso
Conflicts:
README
archiso/mkarchiso
configs/baseline/build.sh
configs/baseline/syslinux/syslinux.cfg
configs/releng/build.sh
configs/releng/packages.i686
configs/releng/packages.x86_64
configs/releng/root-image/etc/arch-release
configs/releng/root-image/etc/hosts
configs/releng/root-image/etc/issue
configs/releng/root-image/etc/motd
configs/releng/root-image/etc/rc.conf
configs/releng/root-image/libre/report-issues
configs/releng/root-image/libre/setup
configs/releng/syslinux.dual/archiso_head.cfg
configs/releng/syslinux.dual/archiso_sys32.cfg
configs/releng/syslinux.dual/archiso_sys64.cfg
configs/releng/syslinux.dual/archiso_tail.cfg
configs/releng/syslinux/syslinux.cfg
91 files changed, 1989 insertions, 1520 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5966153 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +.gitattributes export-ignore +.gitignore export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d71495 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +archiso-*.tar.gz* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1abeb4a --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +V=2 + +INSTALL_FILES=$(wildcard archiso/initcpio/install/*) +HOOKS_FILES=$(wildcard archiso/initcpio/hooks/*) +SCRIPT_FILES=$(wildcard archiso/initcpio/script/*) + + +INSTALL_DIR=$(DESTDIR)/usr/lib/initcpio/install +HOOKS_DIR=$(DESTDIR)/usr/lib/initcpio/hooks +SCRIPT_DIR=$(DESTDIR)/usr/lib/initcpio + +all: + +install: install-program install-initcpio install-examples install-doc + +install-program: + install -D -m 755 archiso/mkarchiso $(DESTDIR)/usr/sbin/mkarchiso + +install-initcpio: + install -d $(SCRIPT_DIR) $(HOOKS_DIR) $(INSTALL_DIR) + install -m 755 -t $(SCRIPT_DIR) $(SCRIPT_FILES) + install -m 644 -t $(HOOKS_DIR) $(HOOKS_FILES) + install -m 644 -t $(INSTALL_DIR) $(INSTALL_FILES) + +install-examples: + install -d -m 755 $(DESTDIR)/usr/share/archiso/ + cp -a configs $(DESTDIR)/usr/share/archiso/ + +install-doc: + install -D -m 644 README $(DESTDIR)/usr/share/doc/archiso/README + +dist: + git archive --format=tar --prefix=archiso-$(V)/ v$(V) | gzip -9 > archiso-$(V).tar.gz + gpg --detach-sign --use-agent archiso-$(V).tar.gz + +.PHONY: install install-program install-initcpio install-examples install-doc dist @@ -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,54 +92,314 @@ 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) +* copy_resolvconf= Copy /etc/resolv.conf from initramfs to live-enviroment. + Set to "n" to skip them. + Default: "y" + + +** 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) -*** Boot parameters (only for configs/releng) +*** Transfer ISO image to target medium (configs/releng) + +ISO images names consist of: archlinux-<YYYY>.<MM>.<DD>-<ARCH>.iso + +Where: + <YYYY> Year + <MM> Month + <DD> Day + <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>-<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 archlinux-<YYYY>.<MM>.<DD>-<ARCH>.iso + (example: ~/archlinux-2012.07.22-x86_64.iso) +<FS-LABEL>: Represents the filesystem label of the <ISO-SOURCE> + (example: ARCH_201207 [for all ~/archlinux-2012.07.*.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> -** /etc/rc.conf -By default these parameters are set by default to these values -if nothing is specified on command line. -* locale= "en_US.UTF-8" -* daemon_locale= "no" -* hardwareclock= "UTC" -* timezone= "Canada/Pacific" -* keymap= "us" -* consolefont= (unset) -* consolemap= (unset) -* usecolor= "yes" +*** Alternative boot methods (configs/releng) + +** ISO in loopback mode. + +Note: Described method is for using with GRUB2. + GRUB2 is installed on target media and archlinux-<YYYY>.<MM>.<DD>-<ARCH>.iso + is at path <TARGET-PATH> on disk <D> and partition <P>, + where filesystem is labeled as <TARGET-FS-LABEL>. + +menuentry "Arch Linux (x86_64)" { + set isofile="/<TARGET-PATH>/archlinux-<YYYY>.<MM>.<DD>-<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/archiso.img +} + +menuentry "Arch Linux (i686)" { + set isofile="/<TARGET-PATH>/archlinux-<YYYY>.<MM>.<DD>-<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/archiso.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 archlinux-<YYYY>.<MM>.<DD>-<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 arch_x64 + LINUX memdisk + INITRD /<TARGET-PATH>/archlinux-<YYYY>.<MM>.<DD>-<ARCH>.iso + APPEND iso + +LABEL arch_x32 + LINUX memdisk + INITRD /<TARGET-PATH>/archlinux-<YYYY>.<MM>.<DD>-<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 ARCH_201207 as needed. + +# cat << EOF > /tmp/nbd-server.conf +[generic] +[archiso] + readonly = true + exportname = /dev/disk/by-label/ARCH_201207 +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 + + btrfs-progs for mkfs.btrfs (optional) + +** For configs/releng build.sh needs theses packages (build host): + + dosfstools for mkfs.vfat + + patch for patch + + lynx for fetching the latest installation guide ** 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 +408,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,8 +422,8 @@ 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 }. +<fs_type> Set the filesystem type of the image + { ext4 | ext3 | ext2 | xfs | btrfs }. A special value of "none" denotes no usage of a filesystem. In that case all files are pushed directly to SquashFS filesystem. <fs_size> An absolute value of file system image size in MiB. @@ -152,9 +433,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,100 +443,42 @@ 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 -*** Building the most basic Parabola live media. (configs/baseline) - -* Install devtools if needed, mkarchroot needs it - [host] # pacman -S devtools --needed - -* Create a base chroot to work on it. - (prefix with linux32 if you want to build a 32 bits enviroment under 64 bits) - [host] # mkarchroot /tmp/chroot base - -* Install archiso on chroot (needs git and make) - [host] # pacman -S git make --needed - [host] # git clone git://projects.archlinux.org/archiso.git - [host] # make -C archiso/archiso DESTDIR=/tmp/chroot install +** 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. -* Enter to chroot (prefix with linux32 if needed). - [host] # mkarchroot -r bash /tmp/chroot -* Create a loopback device. - (mkarchroot does not create it, use other number if not available) - [chroot] # mknod /dev/loop0 b 7 0 +*** Building the most basic Arch Linux live media. (configs/baseline) -* Setup a mirror. - [chroot] # echo 'Server = http://repo.parabolagnulinux.org/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +* Install needed packages. + # pacman -S git make squashfs-tools libisoburn rsync --needed -* Install aditional packages needed for mkarchiso. - [chroot] # pacman -S devtools squashfs-tools syslinux cdrkit +* Install archiso. + # git clone git://projects.parabolagnulinux.org/archiso.git + # make -C archiso install * Build a basic iso. - [chroot] # cp -r /usr/share/archiso/configs/baseline /tmp - [chroot] # cd /tmp/baseline - [chroot] # ./build.sh - -* Exit from chroot. - [chroot] # exit + # /usr/share/archiso/configs/baseline/build.sh 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. - -* Prepare a 32 bit chroot enviroment. - - [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] # exit - -* Prepare a 64 bits chroot enviroment. - - [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] # exit - -* Install archiso on both chroots. - - [host64] # git clone https://projects.parabolagnulinux.org/archiso.git - [host64] # make -C archiso/archiso DESTDIR=/tmp/chroot32 install - [host64] # make -C archiso/archiso DESTDIR=/tmp/chroot64 install - -* Create a shared /tmp directory between two chroots for working. - - [host64] # mkdir /tmp/shared - [host64] # chmod 1777 /tmp/shared - [host64] # mount --bind /tmp/shared /tmp/chroot32/tmp - [host64] # mount --bind /tmp/shared /tmp/chroot64/tmp - -* Enter 32 bits chroot enviroment then build core and netinstall single images. - - [chroot32] # linux32 mkarchroot -r bash /tmp/chroot32 - [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 - -* Enter 64 bits chroot enviroment then build core and netinstall single images. +* Install needed packages. + # pacman -S git make squashfs-tools libisoburn dosfstools lynx patch --needed - [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 - [chroot64] # cd /tmp/releng - [chroot64] # ./build.sh all_iso_single - [chroot64] # ./build.sh purge_single #optional +* Install archiso. + # git clone git://projects.parabolagnulinux.org/archiso.git + # make -C archiso install -* Build core and netinstall dual images from any of the chroot enviroments. +* Build them! + # /usr/share/archiso/configs/releng/build.sh build all - [host64] # mkarchroot -r bash /tmp/chroot64 - [chroot64] # cd /tmp/releng - [chroot64] # ./build.sh all_iso_dual +Note: See build.sh -h for more options. diff --git a/archiso/Makefile b/archiso/Makefile deleted file mode 100644 index 60632e2..0000000 --- a/archiso/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -all: - -install: install-program install-hooks install-examples install-doc - -install-program: - # install to sbin since script only usable by root - install -D -m 755 mkarchiso $(DESTDIR)/usr/sbin/mkarchiso - # testiso can be used by anyone - install -D -m 755 testiso $(DESTDIR)/usr/bin/testiso - -install-hooks: - # hooks/install are needed by mkinitcpio - install -D -m 644 hooks/archiso $(DESTDIR)/lib/initcpio/hooks/archiso - install -D -m 644 install/archiso $(DESTDIR)/lib/initcpio/install/archiso - install -D -m 644 hooks/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd - install -D -m 644 install/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd - install -D -m 644 hooks/archiso_loop_mnt $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt - install -D -m 644 install/archiso_loop_mnt $(DESTDIR)/lib/initcpio/install/archiso_loop_mnt - -install-examples: - # install examples - install -d -m 755 $(DESTDIR)/usr/share/archiso/ - cp -r ../configs $(DESTDIR)/usr/share/archiso/ - -install-doc: - install -d -m 755 $(DESTDIR)/usr/share/archiso/ - install -D -m 644 ../README $(DESTDIR)/usr/share/doc/archiso/README - -uninstall: - rm -f $(DESTDIR)/usr/sbin/mkarchiso - rm -f $(DESTDIR)/usr/bin/testiso - rm -f $(DESTDIR)/lib/initcpio/hooks/archiso - rm -f $(DESTDIR)/lib/initcpio/install/archiso - rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd - rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd - rm -rf $(DESTDIR)/usr/share/archiso/ - -.PHONY: install install-program install-hooks install-examples install-doc uninstall diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso deleted file mode 100644 index c973ffc..0000000 --- a/archiso/hooks/archiso +++ /dev/null @@ -1,198 +0,0 @@ -# Initialize loopback device logic (we using on-demand mode) -# args: none -_init_loop_dev() { - modprobe loop - loop_dev_count=99 - loop_dev_range=$(cat /sys/block/loop0/range) - loop_dev_minor=$((loop_dev_count*loop_dev_range)) -} - -# Call this function before _make_loop_dev() each time. -# args: none -_next_loop_dev() { - loop_dev_count=$((loop_dev_count+1)) - loop_dev_minor=$((loop_dev_count*loop_dev_range)) -} - -# Setup a loopback device for image passed as argument and echo the path to loopback device used. -# args: /path/to/image_file -_make_loop_dev() { - local img="${1}" - mknod /dev/loop${loop_dev_count} b 7 ${loop_dev_minor} &> /dev/null - losetup /dev/loop${loop_dev_count} "${img}" &> /dev/null - echo /dev/loop${loop_dev_count} -} - -# args: source, mountpoint -_mnt_fs() { - local img="${1}" - local mnt="${2}" - local img_fullname="${img##*/}"; - local img_name="${img_fullname%%.*}" - local dm_snap_name="${dm_snap_prefix}_${img_name}" - local ro_dev ro_dev_size ro_dev_fs_type rw_dev - - mkdir -p "${mnt}" - - _next_loop_dev - ro_dev=$(_make_loop_dev "${img}") - ro_dev_size=$(blockdev --getsz ${ro_dev}) - ro_dev_fs_type=$(blkid -o value -s TYPE -p ${ro_dev} 2> /dev/null) - - dd of="/cowspace/${img_name}.cow" count=0 seek=${ro_dev_size} &> /dev/null - _next_loop_dev - rw_dev=$(_make_loop_dev "/cowspace/${img_name}.cow") - - echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${dm_snap_name} - - msg ":: Mounting '/dev/mapper/${dm_snap_name}' (${ro_dev_fs_type}) to '${mnt}'" - if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${dm_snap_name}" "${mnt}" ; then - echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${mnt}'" - launch_interactive_shell - fi -} - -# args: /path/to/image_file, mountpoint -_mnt_sfs() { - local img="${1}" - local mnt="${2}" - local img_fullname="${img##*/}"; - - mkdir -p "${mnt}" - - if [[ "${copytoram}" == "y" ]]; then - msg -n ":: Copying squashfs image to RAM..." - if ! cp "${img}" "/copytoram/${img_fullname}" ; then - echo "ERROR: while copy '${img}' to '/copytoram/${img_fullname}'" - launch_interactive_shell - fi - img="/copytoram/${img_fullname}" - msg "done." - fi - _next_loop_dev - msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r -t squashfs $(_make_loop_dev "${img}") "${mnt}" &> /dev/null ; then - echo "ERROR: while mounting '${img}' to '${mnt}'" - launch_interactive_shell - fi -} - -_verify_checksum() { - local _status - cd "/bootmnt/${archisobasedir}" - md5sum -c checksum.md5 > /checksum.log 2>&1 - _status=$? - cd "${OLDPWD}" - return ${_status} -} - - -run_hook() { - [[ -z "${arch}" ]] && arch="$(uname -m)" - [[ -z "${cowspace_size}" ]] && cowspace_size="75%" - [[ -z "${copytoram_size}" ]] && copytoram_size="75%" - [[ -z "${archisobasedir}" ]] && archisobasedir="arch" - [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" - [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" - if [[ -z "${aitab}" ]]; then - aitab="/bootmnt/${archisobasedir}/aitab" - else - aitab="/bootmnt/${aitab}" - fi - # set mount handler for archiso - mount_handler="archiso_mount_handler" -} - -# This function is called normally from init script, but it can be called -# as chain from other mount handlers. -# args: /path/to/newroot -archiso_mount_handler() { - local newroot="${1}" - local fstype fserror - - _init_loop_dev - - msg ":: Waiting for boot device..." - while ! poll_device "${archisodevice}" 30; do - echo "ERROR: boot device didn't show up after 30 seconds..." - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - done - - fstype=$(blkid -o value -s TYPE -p "${archisodevice}" 2> /dev/null) - if [[ -n "${fstype}" ]]; then - if mount -r -t "${fstype}" "${archisodevice}" /bootmnt; then - if [[ -f "${aitab}" ]]; then - msg ":: Mounted archiso volume successfully." - fserror=0 - else - echo "ERROR: Mounting was successful, but the '${aitab}' file does not exist." - fserror=1 - fi - else - echo "ERROR; Failed to mount '${archisodevice}' (FS is ${fstype})" - fserror=1 - fi - else - echo "ERROR: '${archisodevice}' found, but the filesystem type is unknown." - fserror=1 - fi - - if [[ ${fserror} -eq 1 ]]; then - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi - - if [[ "${checksum}" == "y" ]]; then - if [[ -f "/bootmnt/${archisobasedir}/checksum.md5" ]]; then - msg -n ":: Self-test requested, please wait..." - if _verify_checksum; then - msg "done. Checksum is OK, continue booting." - else - echo "ERROR: one or more files are corrupted" - echo "see /checksum.log for details" - launch_interactive_shell - fi - else - echo "ERROR: checksum=y option specified but checksum.md5 not found" - launch_interactive_shell - fi - fi - - if [[ "${copytoram}" == "y" ]]; then - msg -n ":: Mounting /copytoram (tmpfs) filesystem, size=${copytoram_size}..." - mount -t tmpfs -o "size=${copytoram_size}",mode=0755 copytoram /copytoram - msg "done." - fi - - msg -n ":: Mounting /cowspace (tmpfs) filesystem, size=${cowspace_size}..." - mount -t tmpfs -o "size=${cowspace_size}",mode=0755 cowspace /cowspace - msg "done." - - local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size - while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do - [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue - [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue - if [[ "${aitab_fs_type}" != "none" ]]; then - if [[ "${aitab_sfs_comp}" != "none" ]]; then - _mnt_sfs "/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/sfs/${aitab_img}" - _mnt_fs "/sfs/${aitab_img}/${aitab_img}.fs" "${newroot}${aitab_mnt}" - else - _mnt_fs "/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.fs" "${newroot}${aitab_mnt}" - fi - else - _mnt_sfs "/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "${newroot}${aitab_mnt}" - fi - done < "${aitab}" - - if [[ "${copytoram}" == "y" ]]; then - umount /bootmnt - else - mkdir "${newroot}/bootmnt" - mount --bind /bootmnt "${newroot}/bootmnt" - fi -} - -# vim:ft=sh:ts=4:sw=4:et: diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt deleted file mode 100644 index 13f8743..0000000 --- a/archiso/hooks/archiso_loop_mnt +++ /dev/null @@ -1,37 +0,0 @@ -# vim: set ft=sh: - -run_hook () { - if [ -n "${img_dev}" ] && [ -n "${img_loop}" ]; then - mount_handler="archiso_loop_mount_handler" - fi -} - -archiso_loop_mount_handler () { - newroot="${1}" - - msg ":: Waiting for boot device..." - while ! poll_device ${img_dev} 30; do - echo "ERROR: boot device didn't show up after 30 seconds..." - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - done - - msg "::: Setup a loop device from ${img_loop} located at device ${img_dev}" - FSTYPE=$(blkid -o value -s TYPE -p ${img_dev} 2> /dev/null) - if [ -n "${FSTYPE}" ]; then - if mount -r -t "${FSTYPE}" ${img_dev} /img_dev > /dev/null 2>&1; then - _dev_loop=$(losetup -f) - losetup ${_dev_loop} /img_dev/${img_loop} - fi - fi - - archiso_mount_handler ${newroot} - - if [ "${copytoram}" = "y" ]; then - msg "::: Deataching loop device ${_dev_loop}" - losetup -d ${_dev_loop} - msg "::: Unmounting ${img_dev}" - umount ${img_dev} - fi -} diff --git a/archiso/hooks/archiso_pxe_nbd b/archiso/hooks/archiso_pxe_nbd deleted file mode 100644 index 588e033..0000000 --- a/archiso/hooks/archiso_pxe_nbd +++ /dev/null @@ -1,94 +0,0 @@ -# vim: set ft=sh: -run_hook () { - local line i address netmask gateway dns0 dns1 rootserver rootpath filename - - : > /ip_opts - - if [ -n "${ip}" ]; then - if [ -n "${BOOTIF}" ]; then - bootif_mac=${BOOTIF#01-} - bootif_mac=${bootif_mac//-/:} - bootif_dev=$(grep -l $bootif_mac /sys/class/net/*/address) - bootif_dev=${bootif_dev#/sys/class/net/} - bootif_dev=${bootif_dev%/address} - ip="$ip::$bootif_dev" - fi - - # setup network and save some values - ipconfig "ip=${ip}" | while read line; do - # echo ":: ${line}" - if [ "${line#"IP-Config:"}" != "${line}" ]; then - continue - fi - line="$(echo ${line} | sed -e 's/ :/:/g;s/: /=/g')" - for i in ${line}; do - case "${i}" in - address=*) - echo "${i}" >> /ip_opts - ;; - netmask=*) - echo "${i}" >> /ip_opts - ;; - gateway=*) - echo "${i}" >> /ip_opts - ;; - dns0=*) - echo "${i}" >> /ip_opts - ;; - dns1=*) - echo "${i}" >> /ip_opts - ;; - rootserver=*) - echo "${i}" >> /ip_opts - ;; - rootpath=*) - echo "${i}" >> /ip_opts - ;; - esac - done - done - - . /ip_opts - - echo "IP-Config: ${address}/${netmask}" - echo "IP-Config: gw: ${gateway} dns0: ${dns0} dns1: ${dns1}" - - nbdserver=${rootserver} - - [[ -z "${archiso_nbd_name}" ]] && archiso_nbd_name="archiso" - - mount_handler="archiso_pxe_nbd_mount_handler" - fi -} - -archiso_pxe_nbd_mount_handler () { - newroot="${1}" - - # Module autoloading like with loop devices does not work, doing manually... - modprobe nbd 2> /dev/null - msg ":: Waiting for boot device..." - while ! poll_device /dev/nbd0 30; do - echo "ERROR: boot device didn't show up after 30 seconds..." - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - done - - msg "::: Setup NBD from ${nbdserver} at /dev/nbd0" - if [ "${copytoram}" = "y" ]; then - nbd-client ${nbdserver} -N ${archiso_nbd_name} /dev/nbd0 - else - nbd-client ${nbdserver} -N ${archiso_nbd_name} /dev/nbd0 -persist - fi - - archisodevice=/dev/nbd0 - - archiso_mount_handler ${newroot} - - if [ "${copytoram}" = "y" ]; then - msg "::: Disconnect NBD from ${nbdserver} at /dev/nbd0" - nbd-client -d /dev/nbd0 - else - pidof nbd-client > /run/nbd_client.pid - fi -} diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso new file mode 100644 index 0000000..9445498 --- /dev/null +++ b/archiso/initcpio/hooks/archiso @@ -0,0 +1,198 @@ +# args: source, newroot, mountpoint +_mnt_fs() { + local img="${1}" + local newroot="${2}" + local mnt="${3}" + local img_fullname="${img##*/}"; + local img_name="${img_fullname%%.*}" + local dm_snap_name="${dm_snap_prefix}_${img_name}" + local ro_dev ro_dev_size rw_dev + + ro_dev=$(losetup --find --show --read-only "${img}") + echo ${ro_dev} >> /run/archiso/used_block_devices + ro_dev_size=$(blockdev --getsz ${ro_dev}) + + if [[ "${cow_persistent}" == "P" ]]; then + if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then + msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent." + else + msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as persistent." + dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${ro_dev_size} &> /dev/null + fi + else + if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then + msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' but non-persistent requested, removing." + rm -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" + fi + msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent." + dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${ro_dev_size} &> /dev/null + fi + + rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") + echo ${rw_dev} >> /run/archiso/used_block_devices + + echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} + + _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" + echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices + echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab +} + +# args: /path/to/image_file, mountpoint +_mnt_sfs() { + local img="${1}" + local mnt="${2}" + local img_fullname="${img##*/}" + local sfs_dev + + if [[ "${copytoram}" == "y" ]]; then + msg -n ":: Copying squashfs image to RAM..." + if ! cp "${img}" "/run/archiso/copytoram/${img_fullname}" ; then + echo "ERROR: while copy '${img}' to '/run/archiso/copytoram/${img_fullname}'" + launch_interactive_shell + fi + img="/run/archiso/copytoram/${img_fullname}" + msg "done." + fi + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev} >> /run/archiso/used_block_devices + _mnt_dev "${sfs_dev}" "${mnt}" "-r" +} + +# args: device, mountpoint, flags +_mnt_dev() { + local dev="${1}" + local mnt="${2}" + local flg="${3}" + + mkdir -p "${mnt}" + + msg ":: Mounting '${dev}' to '${mnt}'" + + while ! poll_device "${dev}" 30; do + echo "ERROR: '${dev}' device did not show up after 30 seconds..." + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + done + + if mount "${flg}" "${dev}" "${mnt}"; then + msg ":: Device '${dev}' mounted successfully." + else + echo "ERROR; Failed to mount '${dev}'" + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + fi +} + +_verify_checksum() { + local _status + cd "/run/archiso/bootmnt/${archisobasedir}" + md5sum -c checksum.${arch}.md5 > /tmp/checksum.${arch}.log 2>&1 + _status=$? + cd "${OLDPWD}" + return ${_status} +} + +run_hook() { + [[ -z "${arch}" ]] && arch="$(uname -m)" + [[ -z "${cowspace_size}" ]] && cowspace_size="75%" + [[ -z "${copytoram_size}" ]] && copytoram_size="75%" + [[ -z "${archisobasedir}" ]] && archisobasedir="arch" + [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch" + [[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}" + + if [[ -z "${aitab}" ]]; then + aitab="/run/archiso/bootmnt/${archisobasedir}/aitab" + else + aitab="/run/archiso/bootmnt/${archisobasedir}/${aitab}" + fi + + if [[ -n "${cow_label}" ]]; then + cow_device="/dev/disk/by-label/${cow_label}" + [[ -z "${cow_persistent}" ]] && cow_persistent="P" + elif [[ -n "${cow_device}" ]]; then + [[ -z "${cow_persistent}" ]] && cow_persistent="P" + else + cow_persistent="N" + fi + + [[ -z "${cow_directory}" ]] && cow_directory="persistent_${archisolabel}/${arch}" + + # set mount handler for archiso + mount_handler="archiso_mount_handler" +} + +# This function is called normally from init script, but it can be called +# as chain from other mount handlers. +# args: /path/to/newroot +archiso_mount_handler() { + local newroot="${1}" + + if ! mountpoint -q "/run/archiso/bootmnt"; then + _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + if [[ "${copytoram}" != "y" ]]; then + echo $(readlink -f ${archisodevice}) >> /run/archiso/used_block_devices + fi + fi + + + if [[ ! -f "${aitab}" ]]; then + echo "ERROR: '${aitab}' file does not exist." + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + fi + + if [[ "${checksum}" == "y" ]]; then + if [[ -f "/run/archiso/bootmnt/${archisobasedir}/checksum.${arch}.md5" ]]; then + msg -n ":: Self-test requested, please wait..." + if _verify_checksum; then + msg "done. Checksum is OK, continue booting." + else + echo "ERROR: one or more files are corrupted" + echo "see /tmp/checksum.${arch}.log for details" + launch_interactive_shell + fi + else + echo "ERROR: checksum=y option specified but checksum.${arch}.md5 not found" + launch_interactive_shell + fi + fi + + if [[ "${copytoram}" == "y" ]]; then + msg ":: Mounting /run/archiso/copytoram (tmpfs) filesystem, size=${copytoram_size}" + mkdir -p /run/archiso/copytoram + mount -t tmpfs -o "size=${copytoram_size}",mode=0755 copytoram /run/archiso/copytoram + fi + + if [[ -n "${cow_device}" ]]; then + _mnt_dev "${cow_device}" "/run/archiso/cowspace" "-r" + echo $(readlink -f ${cow_device}) >> /run/archiso/used_block_devices + mount -o remount,rw "/run/archiso/cowspace" + else + msg ":: Mounting /run/archiso/cowspace (tmpfs) filesystem, size=${cowspace_size}..." + mkdir -p /run/archiso/cowspace + mount -t tmpfs -o "size=${cowspace_size}",mode=0755 cowspace /run/archiso/cowspace + fi + mkdir -p "/run/archiso/cowspace/${cow_directory}" + + local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size + while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do + [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue + [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue + if [[ "${aitab_fs_type}" != "none" ]]; then + _mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/run/archiso/sfs/${aitab_img}" + _mnt_fs "/run/archiso/sfs/${aitab_img}/${aitab_img}.fs" "${newroot}" "${aitab_mnt}" + else + _mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "${newroot}${aitab_mnt}" + fi + done < "${aitab}" + + if [[ "${copytoram}" == "y" ]]; then + umount /run/archiso/bootmnt + fi +} + +# vim:ft=sh:ts=4:sw=4:et: diff --git a/archiso/initcpio/hooks/archiso_loop_mnt b/archiso/initcpio/hooks/archiso_loop_mnt new file mode 100644 index 0000000..a02cfac --- /dev/null +++ b/archiso/initcpio/hooks/archiso_loop_mnt @@ -0,0 +1,32 @@ +# vim: set ft=sh: + +run_hook () { + [[ -n "${img_label}" ]] && img_dev="/dev/disk/by-label/${img_label}" + if [[ -n "${img_dev}" && -n "${img_loop}" ]]; then + mount_handler="archiso_loop_mount_handler" + fi +} + +archiso_loop_mount_handler () { + newroot="${1}" + + local _dev_loop + + msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" + _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" + if [[ "${copytoram}" != "y" ]]; then + echo $(readlink -f ${img_dev}) >> /run/archiso/used_block_devices + fi + + if ! _dev_loop=$(losetup --find --show --read-only "/run/archiso/img_dev/${img_loop}"); then + echo "ERROR: Setting loopback device for file '/run/archiso/img_dev/${img_loop}'" + launch_interactive_shell + fi + + archiso_mount_handler ${newroot} + + if [[ "${copytoram}" == "y" ]]; then + losetup -d ${_dev_loop} + umount /run/archiso/img_dev + fi +} diff --git a/archiso/initcpio/hooks/archiso_pxe_common b/archiso/initcpio/hooks/archiso_pxe_common new file mode 100644 index 0000000..d8ac709 --- /dev/null +++ b/archiso/initcpio/hooks/archiso_pxe_common @@ -0,0 +1,50 @@ +# vim: set ft=sh: + +run_hook () { + local i net_mac bootif_mac bootif_dev + # These variables will be parsed from /tmp/net-*.conf generated by ipconfig + local DEVICE + local IPV4ADDR IPV4BROADCAST IPV4NETMASK IPV4GATEWAY IPV4DNS0 IPV4DNS1 + local HOSTNAME DNSDOMAIN NISDOMAIN ROOTSERVER ROOTPATH + local filename + # /tmp/net-*.conf + + if [[ -n "${ip}" ]]; then + if [[ -n "${BOOTIF}" ]]; then + bootif_mac=${BOOTIF#01-} + bootif_mac=${bootif_mac//-/:} + for i in /sys/class/net/*/address; do + read net_mac < ${i} + if [[ "${bootif_mac}" == "${net_mac}" ]]; then + bootif_dev=${i#/sys/class/net/} + bootif_dev=${bootif_dev%/address} + break + fi + done + ip="${ip}::${bootif_dev}" + fi + + # setup network and save some values + ipconfig "ip=${ip}" + + . /tmp/net-*.conf + + pxeserver=${ROOTSERVER} + + # setup DNS resolver + if [[ "${IPV4DNS0}" != "0.0.0.0" ]]; then + echo "nameserver ${IPV4DNS0}" > /etc/resolv.conf + fi + if [[ "${IPV4DNS1}" != "0.0.0.0" ]]; then + echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf + fi + fi +} + +run_latehook () { + [[ -z "${copy_resolvconf}" ]] && copy_resolvconf="y" + + if [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then + cp /etc/resolv.conf /new_root/etc/resolv.conf + fi +} diff --git a/archiso/initcpio/hooks/archiso_pxe_http b/archiso/initcpio/hooks/archiso_pxe_http new file mode 100644 index 0000000..32e8ab0 --- /dev/null +++ b/archiso/initcpio/hooks/archiso_pxe_http @@ -0,0 +1,61 @@ +# vim: set ft=sh: + +run_hook() { + if [[ -n "${ip}" && -n "${archiso_http_srv}" ]]; then + + archiso_http_srv=$(eval echo ${archiso_http_srv}) + [[ -z "${archiso_http_spc}" ]] && archiso_http_spc="75%" + + mount_handler="archiso_pxe_http_mount_handler" + fi +} + +# Fetch a file with CURL +# +# $1 URL +# $2 Destination directory inside httpspace/${archisobasedir} +_curl_get() { + local _url="${1}" + local _dst="${2}" + + msg ":: Downloading '${_url}'" + if ! curl -L -f -o "/run/archiso/httpspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then + echo "ERROR: Downloading '${_url}'" + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + fi +} + +archiso_pxe_http_mount_handler () { + newroot="${1}" + + msg ":: Mounting /run/archiso/httpspace (tmpfs) filesystem, size='${archiso_http_spc}'" + mkdir -p "/run/archiso/httpspace" + mount -t tmpfs -o size="${archiso_http_spc}",mode=0755 httpspace "/run/archiso/httpspace" + + local _aitab_url="${archiso_http_srv}${aitab#/run/archiso/bootmnt/}" + local _aitab_file="/run/archiso/httpspace/${aitab#/run/archiso/bootmnt/}" + + _curl_get "${_aitab_url}" "/" + + local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size + while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do + [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue + [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue + if [[ "${aitab_fs_type}" != "none" ]]; then + _curl_get "${archiso_http_srv}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/${aitab_arch}" + else + _curl_get "${archiso_http_srv}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "/${aitab_arch}" + fi + done < "${_aitab_file}" + + if [[ "${checksum}" == "y" ]]; then + _curl_get "${archiso_http_srv}${archisobasedir}/checksum.${arch}.md5" "/" + fi + + mkdir -p "/run/archiso/bootmnt" + mount -o bind /run/archiso/httpspace /run/archiso/bootmnt + + archiso_mount_handler ${newroot} +} diff --git a/archiso/initcpio/hooks/archiso_pxe_nbd b/archiso/initcpio/hooks/archiso_pxe_nbd new file mode 100644 index 0000000..a9f84d5 --- /dev/null +++ b/archiso/initcpio/hooks/archiso_pxe_nbd @@ -0,0 +1,37 @@ +# vim: set ft=sh: + +run_hook() { + if [[ -n "${ip}" && -n "${archiso_nbd_srv}" ]]; then + + archiso_nbd_srv=$(eval echo ${archiso_nbd_srv}) + [[ -z "${archiso_nbd_name}" ]] && archiso_nbd_name="archiso" + + mount_handler="archiso_pxe_nbd_mount_handler" + fi +} + +archiso_pxe_nbd_mount_handler () { + newroot="${1}" + + # Module autoloading like with loop devices does not work, doing manually... + modprobe nbd 2> /dev/null + + msg ":: Waiting for boot device..." + while ! poll_device /dev/nbd0 30; do + echo "ERROR: boot device didn't show up after 30 seconds..." + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + done + + msg ":: Setup NBD from ${archiso_nbd_srv} at /dev/nbd0" + nbd-client ${archiso_nbd_srv} -N ${archiso_nbd_name} /dev/nbd0 + + copytoram="y" + archisodevice=/dev/nbd0 + + archiso_mount_handler ${newroot} + + msg ":: Disconnect NBD from ${archiso_nbd_srv} at /dev/nbd0" + nbd-client -d /dev/nbd0 +} diff --git a/archiso/initcpio/hooks/archiso_pxe_nfs b/archiso/initcpio/hooks/archiso_pxe_nfs new file mode 100644 index 0000000..ef41c01 --- /dev/null +++ b/archiso/initcpio/hooks/archiso_pxe_nfs @@ -0,0 +1,27 @@ +# vim: set ft=sh: + +run_hook() { + if [[ -n "${ip}" && -n "${archiso_nfs_srv}" ]]; then + + archiso_nfs_srv=$(eval echo ${archiso_nfs_srv}) + [[ -n "${archiso_nfs_opt}" ]] && archiso_nfs_opt="-o ${archiso_nfs_opt}" + + mount_handler="archiso_nfs_mount_handler" + fi +} + +archiso_nfs_mount_handler() { + newroot="${1}" + mkdir -p "/run/archiso/bootmnt" + msg ":: Mounting '${archiso_nfs_srv}'" + # Do not put "${archiso_nfs_opt}" nfsmount fails! + if ! nfsmount ${archiso_nfs_opt} "${archiso_nfs_srv}" "/run/archiso/bootmnt"; then + echo "ERROR: Mounting '${archiso_nfs_srv}'" + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + fi + + copytoram="y" + archiso_mount_handler ${newroot} +} diff --git a/archiso/initcpio/hooks/archiso_shutdown b/archiso/initcpio/hooks/archiso_shutdown new file mode 100644 index 0000000..e50dedb --- /dev/null +++ b/archiso/initcpio/hooks/archiso_shutdown @@ -0,0 +1,6 @@ +run_cleanuphook() { + rm -rf /usr/lib/modules + cp -ax / /run/initramfs +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso b/archiso/initcpio/install/archiso new file mode 100644 index 0000000..8893667 --- /dev/null +++ b/archiso/initcpio/install/archiso @@ -0,0 +1,22 @@ +#!/bin/bash + +build() { + add_module "cdrom" + add_module "loop" + add_module "dm-snapshot" + + add_runscript + + add_binary /usr/lib/udev/cdrom_id + add_binary blockdev + add_binary dmsetup + add_binary losetup + add_binary mountpoint + + add_file /usr/lib/udev/rules.d/60-cdrom_id.rules + add_file /usr/lib/udev/rules.d/10-dm.rules + add_file /usr/lib/udev/rules.d/95-dm-notify.rules + add_file /usr/lib/initcpio/udev/11-dm-initramfs.rules /usr/lib/udev/rules.d/11-dm-initramfs.rules +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_kms b/archiso/initcpio/install/archiso_kms new file mode 100644 index 0000000..3ff31f3 --- /dev/null +++ b/archiso/initcpio/install/archiso_kms @@ -0,0 +1,26 @@ +#!/bin/bash + +build() { + add_module "radeon" + add_module "nouveau" + add_module "i915" + add_module "via-agp" + add_module "sis-agp" + add_module "intel-agp" + + if [[ $(uname -m) == i686 ]]; then + add_module "amd64-agp" + add_module "ati-agp" + add_module "sworks-agp" + add_module "ali-agp" + add_module "amd-k7-agp" + add_module "nvidia-agp" + add_module "efficeon-agp" + fi +} + +help() { + cat << HELPEOF +Adds all common KMS drivers to the initramfs image. +HELPEOF +} diff --git a/archiso/initcpio/install/archiso_loop_mnt b/archiso/initcpio/install/archiso_loop_mnt new file mode 100644 index 0000000..59f1d94 --- /dev/null +++ b/archiso/initcpio/install/archiso_loop_mnt @@ -0,0 +1,13 @@ +#!/bin/bash + +build() { + add_runscript +} + +help() { +cat<<HELPEOF + This hook loads the necessary modules for boot via loop device. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_pxe_common b/archiso/initcpio/install/archiso_pxe_common new file mode 100644 index 0000000..eec9a7e --- /dev/null +++ b/archiso/initcpio/install/archiso_pxe_common @@ -0,0 +1,26 @@ +#!/bin/bash + +build() { + add_checked_modules -f "(irda|phy|wimax|wireless|ppp_|plip|pppoe)" "/drivers/net/" + + add_runscript + + add_binary /usr/lib/initcpio/ipconfig /bin/ipconfig + + # Add hosts support files+dns + add_symlink /usr/lib/libnss_files.so.2 $(readlink /usr/lib/libnss_files.so.2) + add_binary $(readlink -f /usr/lib/libnss_files.so.2) + add_symlink /usr/lib/libnss_dns.so.2 $(readlink /usr/lib/libnss_dns.so.2) + add_binary $(readlink -f /usr/lib/libnss_dns.so.2) + + add_dir /etc + echo "hosts: files dns" > $BUILDROOT/etc/nsswitch.conf +} + +help() { +cat<<HELPEOF + This hook loads the necessary modules for boot via PXE. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_pxe_http b/archiso/initcpio/install/archiso_pxe_http new file mode 100644 index 0000000..4e02f98 --- /dev/null +++ b/archiso/initcpio/install/archiso_pxe_http @@ -0,0 +1,15 @@ +#!/bin/bash + +build() { + add_runscript + + add_binary curl +} + +help() { +cat<<HELPEOF + This hook loads the necessary modules for boot via PXE and HTTP. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_pxe_nbd b/archiso/initcpio/install/archiso_pxe_nbd new file mode 100644 index 0000000..47d98ce --- /dev/null +++ b/archiso/initcpio/install/archiso_pxe_nbd @@ -0,0 +1,17 @@ +#!/bin/bash + +build() { + add_module "nbd" + + add_runscript + + add_binary nbd-client +} + +help() { +cat<<HELPEOF + This hook loads the necessary modules for boot via PXE and NBD. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_pxe_nfs b/archiso/initcpio/install/archiso_pxe_nfs new file mode 100644 index 0000000..f8226e5 --- /dev/null +++ b/archiso/initcpio/install/archiso_pxe_nfs @@ -0,0 +1,17 @@ +#!/bin/bash + +build() { + add_module "nfs" + + add_runscript + + add_binary /usr/lib/initcpio/nfsmount /bin/nfsmount +} + +help() { + cat <<HELPEOF + This hook loads the necessary modules for boot via PXE and NFS. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_shutdown b/archiso/initcpio/install/archiso_shutdown new file mode 100644 index 0000000..5ae976a --- /dev/null +++ b/archiso/initcpio/install/archiso_shutdown @@ -0,0 +1,20 @@ +#!/bin/bash + +build() { + add_binary cp + + add_runscript + + add_file /usr/lib/initcpio/archiso_shutdown /shutdown +} + +help() { + cat <<HELPEOF +This hook will create a shutdown initramfs in /run/initramfs +that we can pivot to on shutdown in order to unmount / and +and others mount points, dm-snapshot devices and loopback devices. +Mostly usefull for dm-snapshot persistent. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/script/archiso_shutdown b/archiso/initcpio/script/archiso_shutdown new file mode 100644 index 0000000..41b3945 --- /dev/null +++ b/archiso/initcpio/script/archiso_shutdown @@ -0,0 +1,37 @@ +#!/bin/ash + +# /oldroot depends on things inside /oldroot/run/archiso... +mkdir /oldrun +mount -n --move /oldroot/run /oldrun + +# Unmount all mounts now. +umount $(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r) + +# Remove all dm-snapshot devices. +dmsetup remove_all + +# Remove all loopback devices. +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do + if ! losetup -d ${_lup} 2> /dev/null; then + umount -d ${_lup} + fi +done + +# Unmount the space used to store *.cow. +umount /oldrun/archiso/cowspace + +# Unmount boot device if needed (no copytoram=y used) +if [[ ! -d /oldrun/archiso/copytoram ]]; then + if [[ -d /oldrun/archiso/img_dev ]]; then + umount /oldrun/archiso/img_dev + else + umount /oldrun/archiso/bootmnt + fi +fi + +# reboot / poweroff / halt, depending on the argument passed by init +# if something invalid is passed, we halt +case "$1" in + reboot|poweroff|halt) "$1" -f ;; + *) halt -f;; +esac diff --git a/archiso/install/archiso b/archiso/install/archiso deleted file mode 100644 index 514c011..0000000 --- a/archiso/install/archiso +++ /dev/null @@ -1,30 +0,0 @@ -build () -{ - MODULES="cdrom ide-cd_mod ide-core ide-generic loop dm-mod dm-snapshot squashfs isofs $(all_modules '/kernel/fs' | grep -v "nls")" - MODULES="${MODULES} $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811_hcd" -e "isp116x_hcd")" - MODULES="${MODULES} usb_storage sd_mod sr_mod" - MODULES="${MODULES} virtio_pci virtio_blk" - MODULES=$(echo ${MODULES}) #trim whitespace - - BINARIES="" - FILES="" - - add_dir /cowspace - add_dir /copytoram - add_dir /bootmnt - - add_binary /lib/udev/cdrom_id - add_binary /sbin/blockdev - add_binary /sbin/lvm - add_binary /sbin/dmsetup - - add_file /lib/udev/rules.d/60-cdrom_id.rules - add_file /lib/udev/rules.d/10-dm.rules - add_file /lib/udev/rules.d/13-dm-disk.rules - add_file /lib/udev/rules.d/95-dm-notify.rules - add_file /lib/udev/rules.d/11-dm-lvm.rules - - SCRIPT="archiso" -} - -# vim:ft=sh:ts=4:sw=4:et: diff --git a/archiso/install/archiso_loop_mnt b/archiso/install/archiso_loop_mnt deleted file mode 100644 index 2c8d6f2..0000000 --- a/archiso/install/archiso_loop_mnt +++ /dev/null @@ -1,18 +0,0 @@ -# vim: set ft=sh: - -build () -{ - MODULES="" - - BINARIES="" - FILES="" - add_dir /img_dev - SCRIPT="archiso_loop_mnt" -} - -help () -{ -cat<<HELPEOF - This hook loads the necessary modules for boot via loop device. -HELPEOF -} diff --git a/archiso/install/archiso_pxe_nbd b/archiso/install/archiso_pxe_nbd deleted file mode 100644 index c8ba1a4..0000000 --- a/archiso/install/archiso_pxe_nbd +++ /dev/null @@ -1,24 +0,0 @@ -# vim: set ft=sh: - -build () -{ - MODULES="nbd" - MODULES="${MODULES} $(comm -2 -3 <(checked_modules "/drivers/net/" | sort) \ - <(find $MODULEDIR/kernel/drivers/net/{irda,phy,wimax,wireless} \ - -name '*.ko*' \ - -exec bash -c 'printf "%s\n" "${@%%.ko*}" | sed "s@.*/@@;s@-@_@" | sort' _ {} +) \ - | grep -v -e 'ppp_' -e 'plip' -e 'pppoe')" - BINARIES="" - FILES="" - SCRIPT="archiso_pxe_nbd" - - add_binary "/usr/sbin/nbd-client" "/bin/nbd-client" - add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig" -} - -help () -{ -cat<<HELPEOF - This hook loads the necessary modules for boot via PXE and NBD. -HELPEOF -} diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 1c3242d..31abd2c 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -2,15 +2,20 @@ set -e -u +export LANG=C + app_name=${0##*/} arch=$(uname -m) pkg_list="" +run_cmd="" quiet="y" pacman_conf="/etc/pacman.conf" export iso_label="PARABOLA_$(date +%Y%m)" iso_publisher="Parabola GNU/Linux-libre <https://parabolagnulinux.org>" iso_application="Parabola Live/Rescue CD" install_dir="libre" +work_dir="work" +out_dir="out" # Show an INFO message # $1: message string @@ -42,6 +47,44 @@ _show_space_usage () { _msg_info "Total: ${_total} MiB (100%) | Used: ${_used} MiB (${_pct_u}) | Avail: ${_avail} MiB ($((100 - ${_pct_u%\%}))%)" } +_chroot_mount () { + mount -t devtmpfs dev "${work_dir}/root-image/dev" + mount -t devpts devpts "${work_dir}/root-image/dev/pts" + mount -t tmpfs devshm "${work_dir}/root-image/dev/shm" + mount -t proc proc "${work_dir}/root-image/proc" + mount -t tmpfs run "${work_dir}/root-image/run" + mount -t sysfs sys "${work_dir}/root-image/sys" + mount -t tmpfs tmp "${work_dir}/root-image/tmp" + + trap '_chroot_umount' EXIT HUP INT TERM +} + +_chroot_umount () { + umount "${work_dir}/root-image/tmp" + umount "${work_dir}/root-image/sys" + umount "${work_dir}/root-image/run" + umount "${work_dir}/root-image/proc" + umount "${work_dir}/root-image/dev/shm" + umount "${work_dir}/root-image/dev/pts" + umount "${work_dir}/root-image/dev" + + trap - EXIT HUP INT TERM +} + +_chroot_init() { + if [[ ! -d ${work_dir}/root-image/var/cache/pacman ]]; then + mkdir -p ${work_dir}/root-image/{dev,proc,run,sys,tmp,var/lib/pacman} + _pacman "base" + _pacman "syslinux" + fi +} + +_chroot_run() { + _chroot_mount + eval chroot ${work_dir}/root-image "${run_cmd}" + _chroot_umount +} + # Mount a filesystem (trap signals in case of error for unmounting it # $1: source image # $2: mount-point @@ -97,30 +140,44 @@ _usage () echo "usage ${app_name} [options] command <command options>" echo " general options:" echo " -p PACKAGE(S) Package(s) to install, can be used multiple times" - echo " -C <file> Config file for pacman. Default ${pacman_conf}" + echo " -r <command> Run <command> inside root-image" + echo " -C <file> Config file for pacman." + echo " Default: '${pacman_conf}'" echo " -L <label> Set a label for the disk" + echo " Default: '${iso_label}'" echo " -P <publisher> Set a publisher for the disk" + echo " Default: '${iso_publisher}'" echo " -A <application> Set an application name for the disk" + echo " Default: '${iso_application}'" echo " -D <install_dir> Set an install_dir. All files will by located here." - echo " Default ${install_dir}" + echo " Default: '${install_dir}'" echo " NOTE: Max 8 characters, use only [a-z0-9]" + echo " -w <work_dir> Set the working directory" + echo " Default: '${work_dir}'" + echo " -o <out_dir> Set the output directory" + echo " Default: '${out_dir}'" echo " -v Enable verbose output" echo " -h This message" echo " commands:" - echo " create <dir>" - echo " create a base directory layout to work with" - echo " includes all specified packages" - echo " prepare <dir>" + echo " init" + echo " Make base layout and install base group" + echo " install" + echo " Install all specified packages (-p)" + echo " run" + echo " run command specified by -r" + echo " prepare" echo " build all images" - echo " checksum <dir>" + echo " checksum" echo " make a checksum.md5 for self-test" - echo " iso <dir> <image name>" + echo " pkglist" + echo " make a pkglist.txt of packages installed on root-image" + echo " iso <image name>" echo " build an iso image from the working dir" exit ${1} } # Shows configuration according to command mode. -# $1: create | prepare | iso +# $1: init | install | run | prepare | checksum | iso _show_config () { local _mode="$1" echo @@ -130,14 +187,22 @@ _show_config () { _msg_info " Working directory: ${work_dir}" _msg_info " Installation directory: ${install_dir}" case "${_mode}" in - create) + init) + _msg_info " Pacman config file: ${pacman_conf}" + ;; + install) _msg_info " Pacman config file: ${pacman_conf}" _msg_info " Packages: ${pkg_list}" ;; + run) + _msg_info " Run command: ${run_cmd}" + ;; prepare) ;; checksum) ;; + pkglist) + ;; iso) _msg_info " Image name: ${img_name}" _msg_info " Disk label: ${iso_label}" @@ -153,20 +218,23 @@ _pacman () { _msg_info "Installing packages to '${work_dir}/root-image/'..." + _chroot_mount + if [[ "${quiet}" = "y" ]]; then - mkarchroot -n -C "${pacman_conf}" -f "${work_dir}/root-image" $* &> /dev/null + pacman -Sy -r "${work_dir}/root-image" --config "${pacman_conf}" --needed --noconfirm $* &> /dev/null else - mkarchroot -n -C "${pacman_conf}" -f "${work_dir}/root-image" $* + pacman -Sy -r "${work_dir}/root-image" --config "${pacman_conf}" --needed --noconfirm $* fi - # Cleanup - find "${work_dir}" -name "*.pacnew" -name "*.pacsave" -name "*.pacorig" -delete + _chroot_umount + _msg_info "Packages installed successfully!" } # Cleanup root-image _cleanup () { - _msg_info "Cleaning up what we can on root-image" + _msg_info "Cleaning up what we can on root-image..." + # remove the initcpio images that were generated for the host system if [[ -d "${work_dir}/root-image/boot" ]]; then find "${work_dir}/root-image/boot" -name '*.img' -delete @@ -195,10 +263,13 @@ _cleanup () { if [[ -d "${work_dir}/root-image/tmp" ]]; then find "${work_dir}/root-image/tmp" -mindepth 1 -delete fi - # Delete etc/mtab if not is a symlink. + # Delete package pacman related files. + find "${work_dir}" -name "*.pacnew" -name "*.pacsave" -name "*.pacorig" -delete + # Create etc/mtab if not is a symlink. if [[ ! -L "${work_dir}/root-image/etc/mtab" ]]; then - rm -f "${work_dir}/root-image/etc/mtab" + ln -sf "/proc/self/mounts" "${work_dir}/root-image/etc/mtab" fi + _msg_info "Done!" } # Makes a SquashFS filesystem image of file/directory passes as argument with desired compression. @@ -217,9 +288,9 @@ _mksfs () { _msg_info "Creating SquashFS image for '${work_dir}/${_src}', This may take some time..." local _seconds=${SECONDS} if [[ "${quiet}" = "y" ]]; then - mksquashfs "${work_dir}/${_src}" "${_sfs_img}" -noappend -comp "${_sfs_comp}" &> /dev/null + mksquashfs "${work_dir}/${_src}" "${_sfs_img}" -noappend -comp "${_sfs_comp}" -no-progress &> /dev/null else - mksquashfs "${work_dir}/${_src}" "${_sfs_img}" -noappend -comp "${_sfs_comp}" + mksquashfs "${work_dir}/${_src}" "${_sfs_img}" -noappend -comp "${_sfs_comp}" -no-progress fi _seconds=$((SECONDS - _seconds)) printf "[mkarchiso] INFO: Image creation done in %02d:%02d minutes\n" $((_seconds / 60)) $((_seconds % 60)) @@ -227,7 +298,7 @@ _mksfs () { # Makes a filesystem from a source directory. # $1: Source directory -# $2: Target filesystem type (ext4 | ext3 | ext2 | xfs) +# $2: Target filesystem type (ext4 | ext3 | ext2 | xfs | btrfs) # $3: Size of target filesystem. Can be an absolute value in MiB, or relative value of desired free space (1% - 99%) _mkfs () { local _src="${1}" @@ -257,7 +328,7 @@ _mkfs () { fi fi - _msg_info "Creating ${_fs_type} image of ${_fs_size} MiB" + _msg_info "Creating ${_fs_type} image of ${_fs_size} MiB..." rm -f "${_fs_img}" dd of="${_fs_img}" count=0 bs=1M seek=${_fs_size} &> /dev/null local _qflag="" @@ -280,53 +351,97 @@ _mkfs () { xfs) mkfs.xfs ${_qflag} "${_fs_img}" ;; + btrfs) + mkfs.btrfs -M "${_fs_img}" + ;; *) _msg_error "Invalid filesystem: ${_fs_type}" 1 ;; esac + _msg_info "Done!" _mount_fs "${_fs_img}" "${work_dir}/mnt/${_src}" - _msg_info "Copying '${_fs_src}/' to '${work_dir}/mnt/${_src}/'" - rsync -aH "${_fs_src}/" "${work_dir}/mnt/${_src}/" + _msg_info "Copying '${_fs_src}/' to '${work_dir}/mnt/${_src}/'..." + cp -aT "${_fs_src}/" "${work_dir}/mnt/${_src}/" + _msg_info "Done!" _umount_fs "${work_dir}/mnt/${_src}" } command_checksum () { _show_config checksum - _msg_info "Creating checksum file for self-test" - cd "${work_dir}/iso/${install_dir}" - find -type f ! -name checksum.md5 -print0 | xargs -0 md5sum > checksum.md5 - cd ${OLDPWD} - _msg_info "Done!" + local _chk_arch + + for _chk_arch in i686 x86_64; do + if _is_directory_changed "${work_dir}/iso/${install_dir}" "${work_dir}/iso/${install_dir}/checksum.${_chk_arch}.md5"; then + _msg_info "Creating checksum file for self-test (${_chk_arch})..." + cd "${work_dir}/iso/${install_dir}" + if [[ -d "${_chk_arch}" ]]; then + md5sum aitab > checksum.${_chk_arch}.md5 + find ${_chk_arch} -type f -print0 | xargs -0 md5sum >> checksum.${_chk_arch}.md5 + if [[ -d "any" ]]; then + find any -type f -print0 | xargs -0 md5sum >> checksum.${_chk_arch}.md5 + fi + fi + cd ${OLDPWD} + _msg_info "Done!" + fi + done +} + +command_pkglist () { + _show_config pkglist + + if _is_directory_changed "${work_dir}/root-image/var/lib/pacman/local" "${work_dir}/iso/${install_dir}/pkglist.${arch}.txt"; then + _msg_info "Creating a list of installed packages on live-enviroment..." + pacman -Sl -r "${work_dir}/root-image" --config "${pacman_conf}" | \ + awk '/\[installed\]$/ {print $1 "/" $2 "-" $3}' > \ + "${work_dir}/iso/${install_dir}/pkglist.${arch}.txt" + _msg_info "Done!" + fi + } # Create an ISO9660 filesystem from "iso" directory. command_iso () { + local _iso_efi_boot_args="" + if [[ ! -f "${work_dir}/iso/isolinux/isolinux.bin" ]]; then _msg_error "The file '${work_dir}/iso/isolinux/isolinux.bin' does not exist." 1 fi + if [[ ! -f "${work_dir}/iso/isolinux/isohdpfx.bin" ]]; then + _msg_error "The file '${work_dir}/iso/isolinux/isohdpfx.bin' does not exist." 1 + fi - _show_config iso + # If exists, add an EFI "El Torito" boot image (FAT filesystem) to ISO-9660 image. + if [[ -f "${work_dir}/iso/EFI/archiso/efiboot.img" ]]; then + _iso_efi_boot_args="--efi-boot EFI/archiso/efiboot.img" + fi - _is_directory_changed "${work_dir}/iso" "${img_name}" + _show_config iso - _msg_info "Creating ISO image..." - local _qflag="" - if [[ ${quiet} == "y" ]]; then - _qflag="-quiet" + if _is_directory_changed "${work_dir}/iso" "${out_dir}/${img_name}"; then + mkdir -p ${out_dir} + _msg_info "Creating ISO image..." + local _qflag="" + if [[ ${quiet} == "y" ]]; then + _qflag="-quiet" + fi + xorriso -as mkisofs ${_qflag} \ + -iso-level 3 \ + -full-iso9660-filenames \ + -volid "${iso_label}" \ + -appid "${iso_application}" \ + -publisher "${iso_publisher}" \ + -preparer "prepared by mkarchiso" \ + -eltorito-boot isolinux/isolinux.bin \ + -eltorito-catalog isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + ${_iso_efi_boot_args} \ + -isohybrid-mbr ${work_dir}/iso/isolinux/isohdpfx.bin \ + -output "${out_dir}/${img_name}" \ + "${work_dir}/iso/" + _msg_info "Done! | $(ls -sh ${out_dir}/${img_name})" fi - mkisofs ${_qflag} -r -l \ - -b isolinux/isolinux.bin -c isolinux/boot.cat \ - -uid 0 -gid 0 \ - -udf -allow-limited-size -iso-level 3 \ - -input-charset utf-8 -p "prepared by mkarchiso" \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - -publisher "${iso_publisher}" \ - -A "${iso_application}" \ - -V "${iso_label}" \ - -o "${img_name}" "${work_dir}/iso/" - isohybrid "${img_name}" - _msg_info "Done! | $(ls -sh ${img_name})" } # Parse aitab and create each filesystem specified on that, and push it in "iso" directory. @@ -342,25 +457,15 @@ command_prepare () { if [[ ${_aitab_img} =~ ^# ]]; then continue fi - if [[ ${_aitab_sfs_comp} == "none" && ${_aitab_fs_type} == "none" ]]; then - _msg_error "In aitab, both fields 'sfs_comp' and 'fs_type' are set to none for '${_aitab_img}' image" 1 - fi local _src="${work_dir}/${_aitab_img}" local _dst="${work_dir}/iso/${install_dir}/${_aitab_arch}" mkdir -p "${_dst}" if [[ ${_aitab_fs_type} != "none" ]]; then - if [[ ${_aitab_sfs_comp} != "none" ]]; then - if _is_directory_changed "${_src}" "${_dst}/${_aitab_img}.fs.sfs"; then - _mkfs ${_aitab_img} ${_aitab_fs_type} ${_aitab_fs_size} - _mksfs ${_aitab_img}.fs ${_aitab_sfs_comp} - mv "${_src}.fs.sfs" "${_dst}" - rm "${_src}.fs" - fi - else - if _is_directory_changed "${_src}" "${_dst}/${_aitab_img}.fs"; then - _mkfs ${_aitab_img} ${_aitab_fs_type} ${_aitab_fs_size} - mv "${work_dir}/${_aitab_img}.fs" "${_dst}" - fi + if _is_directory_changed "${_src}" "${_dst}/${_aitab_img}.fs.sfs"; then + _mkfs ${_aitab_img} ${_aitab_fs_type} ${_aitab_fs_size} + _mksfs ${_aitab_img}.fs ${_aitab_sfs_comp} + mv "${_src}.fs.sfs" "${_dst}" + rm "${_src}.fs" fi else if _is_directory_changed "${_src}" "${_dst}/${_aitab_img}.sfs"; then @@ -373,7 +478,7 @@ command_prepare () { # Install packages on root-image. # A basic check to avoid double execution/reinstallation is done via hashing package names. -command_create () { +command_install () { if [[ ! -f "${pacman_conf}" ]]; then _msg_error "Pacman config file '${pacman_conf}' does not exist" 1 fi @@ -386,32 +491,43 @@ command_create () { _usage 1 fi - _show_config create + _show_config install local _pkg_list_hash _pkg_list_hash=$(echo ${pkg_list} | sort -u | md5sum | cut -c1-32) - if [[ -f "${work_dir}/create.${_pkg_list_hash}" ]]; then + if [[ -f "${work_dir}/install.${_pkg_list_hash}" ]]; then _msg_info "These packages are already installed, skipping." else - mkdir -p "${work_dir}/root-image/" _pacman "${pkg_list}" - : > "${work_dir}/create.${_pkg_list_hash}" + : > "${work_dir}/install.${_pkg_list_hash}" fi } +command_init() { + _show_config init + _chroot_init +} + +command_run() { + _show_config run + _chroot_run +} if [[ ${EUID} -ne 0 ]]; then _msg_error "This script must be run as root." 1 fi -while getopts 'p:C:L:P:A:D:fvh' arg; do +while getopts 'p:r:C:L:P:A:D:w:o:vh' arg; do case "${arg}" in p) pkg_list="${pkg_list} ${OPTARG}" ;; + r) run_cmd="${OPTARG}" ;; C) pacman_conf="${OPTARG}" ;; L) iso_label="${OPTARG}" ;; P) iso_publisher="${OPTARG}" ;; A) iso_application="${OPTARG}" ;; D) install_dir="${OPTARG}" ;; + w) work_dir="${OPTARG}" ;; + o) out_dir="${OPTARG}" ;; v) quiet="n" ;; h|?) _usage 0 ;; *) @@ -429,15 +545,15 @@ if [[ $# -lt 1 ]]; then fi command_name="${1}" -if [[ $# -lt 2 ]]; then - _msg_error "No working directory specified" 0 - _usage 1 -fi -work_dir="${2}" - case "${command_name}" in - create) - command_create + init) + command_init + ;; + install) + command_install + ;; + run) + command_run ;; prepare) command_prepare @@ -445,12 +561,15 @@ case "${command_name}" in checksum) command_checksum ;; + pkglist) + command_pkglist + ;; iso) - if [[ $# -lt 3 ]]; then + if [[ $# -lt 2 ]]; then _msg_error "No image specified" 0 _usage 1 fi - img_name="${3}" + img_name="${2}" command_iso ;; *) diff --git a/archiso/testiso b/archiso/testiso deleted file mode 100755 index 75bedc9..0000000 --- a/archiso/testiso +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ $# -eq 0 ]; then - echo "usage: testiso <isofile> [id|ic|sd|sc|vd|vc]" - echo - echo "id boot .iso as IDE disk" - echo "ic boot .iso as IDE cd-rom" - echo "sd boot .iso as SCSI disk" - echo "sc boot .iso as SCSI cd-rom" - echo "vd boot .iso as virtio disk" - echo "vc boot .iso as virtio cd-rom" - exit 1 -fi - -case "${2}" in - id) IF="ide"; MEDIA="disk";; - ic) IF="ide"; MEDIA="cdrom";; - sd) IF="scsi"; MEDIA="disk";; - sc) IF="scsi"; MEDIA="cdrom";; - vd) IF="virtio"; MEDIA="disk";; - vc) IF="virtio"; MEDIA="cdrom";; - *) IF="scsi"; MEDIA="cdrom";; -esac - -echo qemu -m 256 -drive file=${1},if=${IF},media=${MEDIA},boot=on -qemu -m 256 -drive file=${1},if=${IF},media=${MEDIA},boot=on diff --git a/configs/baseline/build.sh b/configs/baseline/build.sh index 3ae50e7..06b76ba 100755 --- a/configs/baseline/build.sh +++ b/configs/baseline/build.sh @@ -2,27 +2,28 @@ set -e -u -name=parabola +iso_name=parabola iso_label="PARABOLA_$(date +%Y%m)" -version=$(date +%Y.%m.%d) +iso_version=$(date +%Y.%m.%d) install_dir=libre arch=$(uname -m) work_dir=work +out_dir=out verbose="n" script_path=$(readlink -f ${0%/*}) # Base installation (root-image) make_basefs() { - mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}" - mkarchiso ${verbose} -D "${install_dir}" -p "syslinux" create "${work_dir}" + mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" init } # Copy mkinitcpio archiso hooks (root-image) make_setup_mkinitcpio() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - cp /lib/initcpio/hooks/archiso ${work_dir}/root-image/lib/initcpio/hooks - cp /lib/initcpio/install/archiso ${work_dir}/root-image/lib/initcpio/install + cp /usr/lib/initcpio/hooks/archiso ${work_dir}/root-image/usr/lib/initcpio/hooks + cp /usr/lib/initcpio/install/archiso ${work_dir}/root-image/usr/lib/initcpio/install + cp ${script_path}/mkinitcpio.conf ${work_dir}/root-image/etc/mkinitcpio-archiso.conf : > ${work_dir}/build.${FUNCNAME} fi } @@ -31,11 +32,10 @@ make_setup_mkinitcpio() { make_boot() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch} - mkinitcpio \ - -c ${script_path}/mkinitcpio.conf \ - -b ${work_dir}/root-image \ - -k /boot/vmlinuz-linux-libre \ - -g ${work_dir}/iso/${install_dir}/boot/${arch}/libreiso.img + mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" \ + -r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux-libre -g /boot/libreiso.img' \ + run + cp ${work_dir}/root-image/boot/libreiso.img ${work_dir}/iso/${install_dir}/boot/${arch}/libreiso.img cp ${work_dir}/root-image/boot/vmlinuz-linux-libre ${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz : > ${work_dir}/build.${FUNCNAME} fi @@ -59,6 +59,7 @@ make_isolinux() { mkdir -p ${work_dir}/iso/isolinux sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/ + cp ${work_dir}/root-image/usr/lib/syslinux/isohdpfx.bin ${work_dir}/iso/isolinux/ : > ${work_dir}/build.${FUNCNAME} fi } @@ -73,16 +74,16 @@ make_aitab() { # Build all filesystem images specified in aitab (.fs .fs.sfs .sfs) make_prepare() { - mkarchiso ${verbose} -D "${install_dir}" prepare "${work_dir}" + mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" prepare } # Build ISO make_iso() { - mkarchiso ${verbose} -D "${install_dir}" checksum "${work_dir}" - mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${name}-${version}-${arch}.iso" + mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" checksum + mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${arch}.iso" } -if [[ $verbose == "y" ]]; then +if [[ ${verbose} == "y" ]]; then verbose="-v" else verbose="" diff --git a/configs/baseline/mkinitcpio.conf b/configs/baseline/mkinitcpio.conf index 389ec51..a1aafa8 100644 --- a/configs/baseline/mkinitcpio.conf +++ b/configs/baseline/mkinitcpio.conf @@ -1,2 +1,2 @@ -HOOKS="base udev archiso sata filesystems" +HOOKS="base udev archiso virtio filesystems" COMPRESSION="xz" diff --git a/configs/baseline/syslinux/syslinux.cfg b/configs/baseline/syslinux/syslinux.cfg index 6bd59a5..7f5ac05 100644 --- a/configs/baseline/syslinux/syslinux.cfg +++ b/configs/baseline/syslinux/syslinux.cfg @@ -1,12 +1,8 @@ -DEFAULT menu.c32 -PROMPT 0 +UI menu.c32 MENU TITLE Parabola GNU/Linux-libre -TIMEOUT 300 LABEL libre MENU LABEL Parabola GNU/Linux-libre LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz INITRD /%INSTALL_DIR%/boot/%ARCH%/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% - -ONTIMEOUT libre diff --git a/configs/releng/aitab.netinstall b/configs/releng/aitab index 2231154..ede4033 100644 --- a/configs/releng/aitab.netinstall +++ b/configs/releng/aitab @@ -1,4 +1,4 @@ # <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size> root-image / %ARCH% xz ext4 50% -lib-modules /lib/modules %ARCH% xz ext4 50% +usr-lib-modules /usr/lib/modules %ARCH% xz ext4 50% usr-share /usr/share any xz ext4 50% diff --git a/configs/releng/aitab.core b/configs/releng/aitab.core deleted file mode 100644 index 6d10a75..0000000 --- a/configs/releng/aitab.core +++ /dev/null @@ -1,6 +0,0 @@ -# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size> -root-image / %ARCH% xz ext4 50% -lib-modules /lib/modules %ARCH% xz ext4 50% -usr-share /usr/share any xz ext4 50% -repo-core-%ARCH% /repo/core/%ARCH% %ARCH% xz none 0 -repo-core-any /repo/core/any any xz none 0 diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 4a48b0a..8d71d75 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -2,53 +2,48 @@ set -e -u -name=parabola +iso_name=parabola iso_label="LIBRE_$(date +%Y%m)" -version=$(date +%Y.%m.%d) +iso_version=$(date +%Y.%m.%d) install_dir=libre arch=$(uname -m) work_dir=work -verbose="n" +out_dir=out +verbose="" +cmd_args="" script_path=$(readlink -f ${0%/*}) +setup_workdir() { + cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g')) + mkdir -p "${work_dir}" + pacman_conf="${work_dir}/pacman.conf" + sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${cache_dirs[@]})|g" \ + "${script_path}/pacman.conf" > "${pacman_conf}" +} + # Base installation (root-image) make_basefs() { - mkarchiso ${verbose} -D "${install_dir}" -p "base" create "${work_dir}" - mkarchiso ${verbose} -D "${install_dir}" -p "memtest86+ syslinux mkinitcpio-nfs-utils nbd" create "${work_dir}" + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" init + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "memtest86+ mkinitcpio-nfs-utils nbd curl" install } # Additional packages (root-image) make_packages() { - mkarchiso ${verbose} -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" create "${work_dir}" -} - -# Customize installation (root-image) -make_customize_root_image() { - if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - cp -af ${script_path}/root-image ${work_dir} - chmod 750 ${work_dir}/root-image/etc/sudoers.d - chmod 440 ${work_dir}/root-image/etc/sudoers.d/g_wheel - mkdir -p ${work_dir}/root-image/etc/pacman.d - echo "Server = http://repo.parabolagnulinux.org/\$repo/os/\$arch" > \ - ${work_dir}/root-image/etc/pacman.d/mirrorlist - chroot ${work_dir}/root-image /usr/sbin/locale-gen - chroot ${work_dir}/root-image /usr/sbin/useradd -m -p "" -g users -G "audio,disk,optical,wheel" libre -# Cleanup, makes the ISO lighter -# Remove headers - rm -rf ${work_dir}/root-image/usr/include/* - : > ${work_dir}/build.${FUNCNAME} - fi + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "$(grep -v ^# ${script_path}/packages.${arch})" install } # Copy mkinitcpio archiso hooks (root-image) make_setup_mkinitcpio() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then local _hook - for _hook in archiso archiso_pxe_nbd archiso_loop_mnt; do - cp /lib/initcpio/hooks/${_hook} ${work_dir}/root-image/lib/initcpio/hooks - cp /lib/initcpio/install/${_hook} ${work_dir}/root-image/lib/initcpio/install + for _hook in archiso archiso_shutdown archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_loop_mnt; do + cp /usr/lib/initcpio/hooks/${_hook} ${work_dir}/root-image/usr/lib/initcpio/hooks + cp /usr/lib/initcpio/install/${_hook} ${work_dir}/root-image/usr/lib/initcpio/install done + cp /usr/lib/initcpio/install/archiso_kms ${work_dir}/root-image/usr/lib/initcpio/install + cp /usr/lib/initcpio/archiso_shutdown ${work_dir}/root-image/usr/lib/initcpio + cp ${script_path}/mkinitcpio.conf ${work_dir}/root-image/etc/mkinitcpio-archiso.conf : > ${work_dir}/build.${FUNCNAME} fi } @@ -59,11 +54,10 @@ make_boot() { local _src=${work_dir}/root-image local _dst_boot=${work_dir}/iso/${install_dir}/boot mkdir -p ${_dst_boot}/${arch} - mkinitcpio \ - -c ${script_path}/mkinitcpio.conf \ - -b ${_src} \ - -k /boot/vmlinuz-linux-libre \ - -g ${_dst_boot}/${arch}/libreiso.img + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux-libre -g /boot/libreiso.img' \ + run + mv ${_src}/boot/libreiso.img ${_dst_boot}/${arch}/libreiso.img mv ${_src}/boot/vmlinuz-linux-libre ${_dst_boot}/${arch}/vmlinuz cp ${_src}/boot/memtest86+/memtest.bin ${_dst_boot}/memtest cp ${_src}/usr/share/licenses/common/GPL2/license.txt ${_dst_boot}/memtest.COPYING @@ -71,23 +65,68 @@ make_boot() { fi } +# Prepare EFI "El Torito" boot image (using Linux >= 3.3 EFI boot stub) +make_boot_efi() { + if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then + if [[ ${arch} == "x86_64" ]]; then + mkdir -p ${work_dir}/iso/EFI/archiso + dd of=${work_dir}/iso/EFI/archiso/efiboot.img bs=1 seek=20M count=0 + mkfs.vfat ${work_dir}/iso/EFI/archiso/efiboot.img + + mkdir -p ${work_dir}/efiboot + mount ${work_dir}/iso/EFI/archiso/efiboot.img ${work_dir}/efiboot + + mkdir -p ${work_dir}/efiboot/EFI/archiso + cp ${work_dir}/iso/${install_dir}/boot/x86_64/vmlinuz ${work_dir}/efiboot/EFI/archiso/vmlinuz.efi + cp ${work_dir}/iso/${install_dir}/boot/x86_64/archiso.img ${work_dir}/efiboot/EFI/archiso/archiso.img + + # There are plans to support command line options via a config file (not yet in linux-3.3) + #cp ${work_dir}/iso/${install_dir}/boot/x86_64/vmlinuz ${work_dir}/efiboot/EFI/boot/bootx64.efi + #cp ${work_dir}/iso/${install_dir}/boot/x86_64/archiso.img ${work_dir}/efiboot/EFI/boot/linux.img + #echo "archisolabel=${iso_label} initrd=\EFI\boot\linux.img" | iconv -f ascii -t ucs2 > ${work_dir}/iso/EFI/boot/linux.conf + + # For now, provide an EFI-shell until 'linux.conf' hits mainline. + mkdir -p ${work_dir}/efiboot/EFI/boot + # EFI Shell 2.0 for UEFI 2.3+ ( http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UEFI_Shell ) + #wget -O ${work_dir}/efiboot/EFI/boot/bootx64.efi https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/ShellBinPkg/UefiShell/X64/Shell.efi + # EFI Shell 1.0 for non UEFI 2.3+ ( http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Efi-shell ) + wget -O ${work_dir}/efiboot/EFI/boot/bootx64.efi https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi + + # Add an EFI shell script for automatic boot if ESC-key is not pressed within 5 seconds timeout. + sed "s|%ARCHISO_LABEL%|${iso_label}|g; + s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/efiboot/EFI/boot/startup_iso.nsh > ${work_dir}/efiboot/EFI/boot/startup.nsh + + mkdir -p ${work_dir}/iso/EFI/boot + cp ${work_dir}/efiboot/EFI/boot/bootx64.efi ${work_dir}/iso/EFI/boot/bootx64.efi + + sed "s|%ARCHISO_LABEL%|${iso_label}|g; + s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/efiboot/EFI/boot/startup_usb.nsh > ${work_dir}/iso/EFI/boot/startup.nsh + + umount ${work_dir}/efiboot + fi + : > ${work_dir}/build.${FUNCNAME} + fi +} + # Prepare /${install_dir}/boot/syslinux make_syslinux() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then local _src_syslinux=${work_dir}/root-image/usr/lib/syslinux local _dst_syslinux=${work_dir}/iso/${install_dir}/boot/syslinux mkdir -p ${_dst_syslinux} - sed "s|%ARCHISO_LABEL%|${iso_label}|g; - s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" ${script_path}/syslinux/syslinux.cfg > ${_dst_syslinux}/syslinux.cfg + for _cfg in ${script_path}/syslinux/*.cfg; do + sed "s|%ARCHISO_LABEL%|${iso_label}|g; + s|%INSTALL_DIR%|${install_dir}|g; + s|%ARCH%|${arch}|g" ${_cfg} > ${_dst_syslinux}/${_cfg##*/} + done cp ${script_path}/syslinux/splash.png ${_dst_syslinux} cp ${_src_syslinux}/*.c32 ${_dst_syslinux} cp ${_src_syslinux}/*.com ${_dst_syslinux} cp ${_src_syslinux}/*.0 ${_dst_syslinux} cp ${_src_syslinux}/memdisk ${_dst_syslinux} mkdir -p ${_dst_syslinux}/hdt - wget -O - http://pciids.sourceforge.net/v2.2/pci.ids | gzip -9 > ${_dst_syslinux}/hdt/pciids.gz - cat ${work_dir}/root-image/lib/modules/*-LIBRE/modules.alias | gzip -9 > ${_dst_syslinux}/hdt/modalias.gz + cat ${work_dir}/root-image/usr/share/hwdata/pci.ids | gzip -9 > ${_dst_syslinux}/hdt/pciids.gz + cat ${work_dir}/root-image/usr/lib/modules/*-LIBRE/modules.alias | gzip -9 > ${_dst_syslinux}/hdt/modalias.gz : > ${work_dir}/build.${FUNCNAME} fi } @@ -98,84 +137,77 @@ make_isolinux() { mkdir -p ${work_dir}/iso/isolinux sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg cp ${work_dir}/root-image/usr/lib/syslinux/isolinux.bin ${work_dir}/iso/isolinux/ + cp ${work_dir}/root-image/usr/lib/syslinux/isohdpfx.bin ${work_dir}/iso/isolinux/ : > ${work_dir}/build.${FUNCNAME} fi } -# Split out /lib/modules from root-image (makes more "dual-iso" friendly) -make_lib_modules() { +# Customize installation (root-image) +make_customize_root_image() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - mv ${work_dir}/root-image/lib/modules ${work_dir}/lib-modules + cp -af ${script_path}/root-image ${work_dir} + cp -aT ${work_dir}/root-image/etc/skel/ ${work_dir}/root-image/root/ + ln -sf /usr/share/zoneinfo/UTC ${work_dir}/root-image/etc/localtime + chmod 750 ${work_dir}/root-image/etc/sudoers.d + chmod 440 ${work_dir}/root-image/etc/sudoers.d/g_wheel + mkdir -p ${work_dir}/root-image/etc/pacman.d + wget -O ${work_dir}/root-image/etc/pacman.d/mirrorlist 'https://www.archlinux.org/mirrorlist/?country=all&protocol=http&use_mirror_status=on' + lynx -dump -nolist 'https://wiki.archlinux.org/index.php/Installation_Guide?action=render' >> ${work_dir}/root-image/root/install.txt + sed -i "s/#Server/Server/g" ${work_dir}/root-image/etc/pacman.d/mirrorlist + patch ${work_dir}/root-image/usr/bin/pacman-key < ${script_path}/pacman-key-4.0.3_unattended-keyring-init.patch + sed -i 's/#\(en_US\.UTF-8\)/\1/' ${work_dir}/root-image/etc/locale.gen + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'locale-gen' \ + run + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'usermod -s /bin/zsh root' \ + run + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'useradd -m -p "" -g users -G "audio,disk,optical,wheel" -s /bin/zsh arch' \ + run : > ${work_dir}/build.${FUNCNAME} fi } -# Split out /usr/share from root-image (makes more "dual-iso" friendly) -make_usr_share() { +# Split out /usr/lib/modules from root-image (makes more "dual-iso" friendly) +make_usr_lib_modules() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - mv ${work_dir}/root-image/usr/share ${work_dir}/usr-share + mv ${work_dir}/root-image/usr/lib/modules ${work_dir}/usr-lib-modules : > ${work_dir}/build.${FUNCNAME} fi } -# Make [core] repository, keep "any" pkgs in a separate fs (makes more "dual-iso" friendly) -# TODO add 'base' packages on [libre] -make_core_repo() { +# Split out /usr/share from root-image (makes more "dual-iso" friendly) +make_usr_share() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - local _url _urls _pkg_name _cached_pkg _dst - mkdir -p ${work_dir}/repo-core-any - mkdir -p ${work_dir}/repo-core-${arch} - pacman -Sy - _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# ${script_path}/core.exclude.${arch} | sort))) - for _url in ${_urls}; do - _pkg_name=${_url##*/} - _cached_pkg=/var/cache/pacman/pkg/${_pkg_name} - _dst=${work_dir}/repo-core-${arch}/${_pkg_name} - if [[ ! -e ${_dst} ]]; then - if [[ -e ${_cached_pkg} ]]; then - cp -v "${_cached_pkg}" "${_dst}" - else - wget -nv "${_url}" -O "${_dst}" - fi - fi - repo-add -q ${work_dir}/repo-core-${arch}/core.db.tar.gz ${work_dir}/repo-core-${arch}/${_pkg_name} - if [[ ${_pkg_name} =~ any.pkg ]]; then - mv "${_dst}" ${work_dir}/repo-core-any/${_pkg_name} - ln -sf ../any/${_pkg_name} ${work_dir}/repo-core-${arch}/${_pkg_name} - fi - done + mv ${work_dir}/root-image/usr/share ${work_dir}/usr-share : > ${work_dir}/build.${FUNCNAME} fi } # Process aitab -# args: $1 (core | netinstall) make_aitab() { - local _iso_type=${1} - if [[ ! -e ${work_dir}/build.${FUNCNAME}_${_iso_type} ]]; then - sed "s|%ARCH%|${arch}|g" ${script_path}/aitab.${_iso_type} > ${work_dir}/iso/${install_dir}/aitab - : > ${work_dir}/build.${FUNCNAME}_${_iso_type} + if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then + sed "s|%ARCH%|${arch}|g" ${script_path}/aitab > ${work_dir}/iso/${install_dir}/aitab + : > ${work_dir}/build.${FUNCNAME} fi } # Build all filesystem images specified in aitab (.fs .fs.sfs .sfs) make_prepare() { - mkarchiso ${verbose} -D "${install_dir}" prepare "${work_dir}" + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" pkglist + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" prepare } # Build ISO -# args: $1 (core | netinstall) make_iso() { - local _iso_type=${1} - mkarchiso ${verbose} -D "${install_dir}" checksum "${work_dir}" - mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}" "${name}-${version}-${_iso_type}-${arch}.iso" + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" checksum + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${arch}.iso" } # Build dual-iso images from ${work_dir}/i686/iso and ${work_dir}/x86_64/iso -# args: $1 (core | netinstall) make_dual() { - local _iso_type=${1} - if [[ ! -e ${work_dir}/dual/build.${FUNCNAME}_${_iso_type} ]]; then + if [[ ! -e ${work_dir}/dual/build.${FUNCNAME} ]]; then if [[ ! -d ${work_dir}/i686/iso || ! -d ${work_dir}/x86_64/iso ]]; then echo "ERROR: i686 or x86_64 builds does not exist." _usage 1 @@ -192,38 +224,95 @@ make_dual() { cp -a -l -f ${_src_one} ${work_dir}/dual cp -a -l -n ${_src_two} ${work_dir}/dual rm -f ${work_dir}/dual/iso/${install_dir}/aitab - rm -f ${work_dir}/dual/iso/${install_dir}/boot/syslinux/syslinux.cfg - if [[ ${_iso_type} == "core" ]]; then - if [[ ! -e ${work_dir}/dual/iso/${install_dir}/any/repo-core-any.sfs || - ! -e ${work_dir}/dual/iso/${install_dir}/i686/repo-core-i686.sfs || - ! -e ${work_dir}/dual/iso/${install_dir}/x86_64/repo-core-x86_64.sfs ]]; then - echo "ERROR: core_iso_single build is not found." - _usage 1 - fi - else - rm -f ${work_dir}/dual/iso/${install_dir}/any/repo-core-any.sfs - rm -f ${work_dir}/dual/iso/${install_dir}/i686/repo-core-i686.sfs - rm -f ${work_dir}/dual/iso/${install_dir}/x86_64/repo-core-x86_64.sfs - fi - paste -d"\n" <(sed "s|%ARCH%|i686|g" ${script_path}/aitab.${_iso_type}) \ - <(sed "s|%ARCH%|x86_64|g" ${script_path}/aitab.${_iso_type}) | uniq > ${work_dir}/dual/iso/${install_dir}/aitab + rm -f ${work_dir}/dual/iso/${install_dir}/boot/syslinux/*.cfg + paste -d"\n" <(sed "s|%ARCH%|i686|g" ${script_path}/aitab) \ + <(sed "s|%ARCH%|x86_64|g" ${script_path}/aitab) | uniq > ${work_dir}/dual/iso/${install_dir}/aitab for _cfg in ${script_path}/syslinux.dual/*.cfg; do sed "s|%ARCHISO_LABEL%|${iso_label}|g; s|%INSTALL_DIR%|${install_dir}|g" ${_cfg} > ${work_dir}/dual/iso/${install_dir}/boot/syslinux/${_cfg##*/} done - mkarchiso ${verbose} -D "${install_dir}" checksum "${work_dir}/dual" - mkarchiso ${verbose} -D "${install_dir}" -L "${iso_label}" iso "${work_dir}/dual" "${name}-${version}-${_iso_type}-dual.iso" - : > ${work_dir}/dual/build.${FUNCNAME}_${_iso_type} + mkarchiso ${verbose} -w "${work_dir}/dual" -D "${install_dir}" checksum + mkarchiso ${verbose} -w "${work_dir}/dual" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-dual.iso" + : > ${work_dir}/dual/build.${FUNCNAME} fi } +purge_single () +{ + if [[ -d ${work_dir} ]]; then + find ${work_dir} -mindepth 1 -maxdepth 1 \ + ! -path ${work_dir}/iso -prune \ + | xargs rm -rf + fi +} +purge_dual () +{ + if [[ -d ${work_dir}/dual ]]; then + find ${work_dir}/dual -mindepth 1 -maxdepth 1 \ + ! -path ${work_dir}/dual/iso -prune \ + | xargs rm -rf + fi +} + +clean_single () +{ + rm -rf ${work_dir} + rm -f ${out_dir}/${iso_name}-${iso_version}-*-${arch}.iso +} + +clean_dual () +{ + rm -rf ${work_dir}/dual + rm -f ${out_dir}/${iso_name}-${iso_version}-*-dual.iso +} + +make_common_single() { + make_basefs + make_packages + make_setup_mkinitcpio + make_boot + make_boot_efi + make_syslinux + make_isolinux + make_customize_root_image + make_usr_lib_modules + make_usr_share + make_aitab + make_prepare + make_iso +} _usage () { - echo "usage ${0##*/} net_iso_single | core_iso_single | all_iso_single | purge_single | clean_single" - echo " net_iso_dual | core_iso_dual | all_iso_dual | purge_dual | clean_dual" + echo "usage ${0} [options] command <command options>" + echo + echo " General options:" + echo " -N <iso_name> Set an iso filename (prefix)" + echo " Default: ${iso_name}" + echo " -V <iso_version> Set an iso version (in filename)" + echo " Default: ${iso_version}" + echo " -L <iso_label> Set an iso label (disk label)" + echo " Default: ${iso_label}" + echo " -D <install_dir> Set an install_dir (directory inside iso)" + echo " Default: ${install_dir}" + echo " -w <work_dir> Set the working directory" + echo " Default: ${work_dir}" + echo " -o <out_dir> Set the output directory" + echo " Default: ${out_dir}" + echo " -v Enable verbose output" + echo " -h This help message" echo + echo " Commands:" + echo " build <mode>" + echo " Build selected .iso by <mode>" + echo " purge <mode>" + echo " Clean working directory except iso/ directory of build <mode>" + echo " clean <mode>" + echo " Clean working directory and .iso file in output directory of build <mode>" + echo + echo " Command options:" + echo " <mode> Valid values 'single', 'dual' or 'all'" exit ${1} } @@ -232,81 +321,129 @@ if [[ ${EUID} -ne 0 ]]; then _usage 1 fi +while getopts 'N:V:L:D:w:o:vh' arg; do + case "${arg}" in + N) + iso_name="${OPTARG}" + cmd_args+=" -N ${iso_name}" + ;; + V) + iso_version="${OPTARG}" + cmd_args+=" -V ${iso_version}" + ;; + L) + iso_label="${OPTARG}" + cmd_args+=" -L ${iso_label}" + ;; + D) + install_dir="${OPTARG}" + cmd_args+=" -D ${install_dir}" + ;; + w) + work_dir="${OPTARG}" + cmd_args+=" -w ${work_dir}" + ;; + o) + out_dir="${OPTARG}" + cmd_args+=" -o ${out_dir}" + ;; + v) + verbose="-v" + cmd_args+=" -v" + ;; + h|?) _usage 0 ;; + *) + _msg_error "Invalid argument '${arg}'" 0 + _usage 1 + ;; + esac +done + +shift $((OPTIND - 1)) + if [[ $# -lt 1 ]]; then echo "No command specified" _usage 1 fi command_name="${1}" -if [[ ${verbose} == "y" ]]; then - verbose="-v" -else - verbose="" +if [[ $# -lt 2 ]]; then + echo "No command mode specified" + _usage 1 +fi +command_mode="${2}" + +if [[ ${command_mode} == "all" && ${arch} != "x86_64" ]]; then + echo "This mode <all> needs to be run on x86_64" + _usage 1 fi -if [[ ${command_name} =~ single ]]; then +if [[ ${command_mode} == "single" ]]; then work_dir=${work_dir}/${arch} fi -make_common_single() { - make_basefs - make_packages - make_customize_root_image - make_setup_mkinitcpio - make_boot - make_syslinux - make_isolinux - make_lib_modules - make_usr_share - make_aitab $1 - make_prepare $1 - make_iso $1 -} +setup_workdir case "${command_name}" in - net_iso_single) - make_common_single netinstall - ;; - core_iso_single) - make_core_repo - make_common_single core - ;; - all_iso_single) - make_common_single netinstall - make_core_repo - make_common_single core - ;; - net_iso_dual) - make_dual netinstall - ;; - core_iso_dual) - make_dual core - ;; - all_iso_dual) - make_dual netinstall - make_dual core - ;; - purge_single) - if [[ -d ${work_dir} ]]; then - find ${work_dir} -mindepth 1 -maxdepth 1 \ - ! -path ${work_dir}/iso -prune \ - | xargs rm -rf - fi - ;; - purge_dual) - if [[ -d ${work_dir}/dual ]]; then - find ${work_dir}/dual -mindepth 1 -maxdepth 1 \ - ! -path ${work_dir}/dual/iso -prune \ - | xargs rm -rf - fi + build) + case "${command_mode}" in + single) + make_common_single + ;; + dual) + make_dual + ;; + all) + $0 ${cmd_args} build single + $0 ${cmd_args} purge single + linux32 $0 ${cmd_args} build single + linux32 $0 ${cmd_args} purge single + $0 ${cmd_args} build dual + $0 ${cmd_args} purge dual + ;; + *) + echo "Invalid build mode '${command_mode}'" + _usage 1 + ;; + esac ;; - clean_single) - rm -rf ${work_dir} - rm -f ${name}-${version}-*-${arch}.iso + purge) + case "${command_mode}" in + single) + purge_single + ;; + dual) + purge_dual + ;; + all) + $0 ${cmd_args} purge single + linux32 $0 ${cmd_args} purge single + $0 ${cmd_args} purge dual + ;; + *) + echo "Invalid purge mode '${command_mode}'" + _usage 1 + ;; + esac ;; - clean_dual) - rm -rf ${work_dir}/dual - rm -f ${name}-${version}-*-dual.iso + clean) + case "${command_mode}" in + single) + clean_single + ;; + dual) + clean_dual + ;; + all) + $0 ${cmd_args} clean single + linux32 $0 ${cmd_args} clean single + $0 ${cmd_args} clean dual + ;; + *) + echo "Invalid clean mode '${command_mode}'" + _usage 1 + ;; + esac ;; *) echo "Invalid command name '${command_name}'" diff --git a/configs/releng/core.exclude.i686 b/configs/releng/core.exclude.i686 deleted file mode 100644 index a04ceef..0000000 --- a/configs/releng/core.exclude.i686 +++ /dev/null @@ -1,4 +0,0 @@ -gcc-ada -gcc-fortran -gcc-go -gcc-objc diff --git a/configs/releng/core.exclude.x86_64 b/configs/releng/core.exclude.x86_64 deleted file mode 100644 index a04ceef..0000000 --- a/configs/releng/core.exclude.x86_64 +++ /dev/null @@ -1,4 +0,0 @@ -gcc-ada -gcc-fortran -gcc-go -gcc-objc diff --git a/configs/releng/efiboot/EFI/boot/startup_iso.nsh b/configs/releng/efiboot/EFI/boot/startup_iso.nsh new file mode 100644 index 0000000..5c35ca8 --- /dev/null +++ b/configs/releng/efiboot/EFI/boot/startup_iso.nsh @@ -0,0 +1,10 @@ +@echo -off + +for %m run (0 20) + if exist fs%m:\EFI\archiso\vmlinuz.efi then + fs%m: + cd fs%m:\EFI\archiso + echo "Launching Arch Linux ISO Kernel fs%m:\EFI\archiso\vmlinuz.efi" + vmlinuz.efi archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% initrd=\EFI\archiso\archiso.img + endif +endfor diff --git a/configs/releng/efiboot/EFI/boot/startup_usb.nsh b/configs/releng/efiboot/EFI/boot/startup_usb.nsh new file mode 100644 index 0000000..439e400 --- /dev/null +++ b/configs/releng/efiboot/EFI/boot/startup_usb.nsh @@ -0,0 +1,10 @@ +@echo -off + +for %m run (0 20) + if exist fs%m:\%INSTALL_DIR%\boot\x86_64\vmlinuz then + fs%m: + cd fs%m:\%INSTALL_DIR%\boot\x86_64 + echo "Launching Archiso Kernel fs%m:\%INSTALL_DIR%\boot\x86_64\vmlinuz" + vmlinuz archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% initrd=\%INSTALL_DIR%\boot\x86_64\archiso.img + endif +endfor diff --git a/configs/releng/isolinux/isolinux.cfg b/configs/releng/isolinux/isolinux.cfg index e7bbaa4..1040d3f 100644 --- a/configs/releng/isolinux/isolinux.cfg +++ b/configs/releng/isolinux/isolinux.cfg @@ -1,5 +1,5 @@ DEFAULT loadconfig LABEL loadconfig - CONFIG /%INSTALL_DIR%/boot/syslinux/syslinux.cfg - APPEND /%INSTALL_DIR%/boot/syslinux/ + CONFIG /%INSTALL_DIR%/boot/syslinux/archiso.cfg + APPEND /%INSTALL_DIR%/ diff --git a/configs/releng/mkinitcpio.conf b/configs/releng/mkinitcpio.conf index df833eb..12a656d 100644 --- a/configs/releng/mkinitcpio.conf +++ b/configs/releng/mkinitcpio.conf @@ -1,2 +1,2 @@ -HOOKS="base udev memdisk archiso archiso_pxe_nbd archiso_loop_mnt pata scsi sata usb fw pcmcia filesystems usbinput" +HOOKS="base udev memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms pata scsi sata virtio usb fw pcmcia filesystems usbinput" COMPRESSION="xz" diff --git a/configs/releng/packages.i686 b/configs/releng/packages.i686 index 197dff3..dacc785 100644 --- a/configs/releng/packages.i686 +++ b/configs/releng/packages.i686 @@ -1,7 +1,7 @@ -aif -btrfs-progs-unstable +arch-install-scripts +btrfs-progs crda -curl +darkhttpd ddrescue dhclient dialog @@ -9,10 +9,14 @@ dmraid dnsmasq dnsutils dosfstools +efibootmgr elinks gnu-netcat +gptfdisk +grml-zsh-config +grub-bios +haveged hdparm -inetutils irssi lftp lilo @@ -33,8 +37,14 @@ pptpclient rp-pppoe rsync smartmontools +sudo tcpdump +usb_modeswitch vpnc +wget wireless_tools wpa_actiond zile +wvdial +xl2tpd +zsh diff --git a/configs/releng/packages.x86_64 b/configs/releng/packages.x86_64 index 197dff3..277cf72 100644 --- a/configs/releng/packages.x86_64 +++ b/configs/releng/packages.x86_64 @@ -1,7 +1,7 @@ -aif -btrfs-progs-unstable +arch-install-scripts +btrfs-progs crda -curl +darkhttpd ddrescue dhclient dialog @@ -9,10 +9,15 @@ dmraid dnsmasq dnsutils dosfstools +efibootmgr elinks gnu-netcat +gptfdisk +grml-zsh-config +grub-bios +grub-efi-x86_64 +haveged hdparm -inetutils irssi lftp lilo @@ -30,11 +35,18 @@ openssh openvpn parted pptpclient +refind-efi-x86_64 rp-pppoe rsync smartmontools +sudo tcpdump +usb_modeswitch vpnc +wget wireless_tools wpa_actiond zile +wvdial +xl2tpd +zsh diff --git a/configs/releng/pacman-key-4.0.3_unattended-keyring-init.patch b/configs/releng/pacman-key-4.0.3_unattended-keyring-init.patch new file mode 100644 index 0000000..0a5117f --- /dev/null +++ b/configs/releng/pacman-key-4.0.3_unattended-keyring-init.patch @@ -0,0 +1,32 @@ +Author: Pierre Schmitz <pierre@archlinux.de> + +* pacman-key: Use lsign_keys function in --populate +* pacman-key: reduce verbosity of --populate + +--- pacman-key 2012-07-10 18:45:32.000000000 -0300 ++++ pacman-key 2012-07-18 16:38:18.264110004 -0300 +@@ -376,7 +376,7 @@ + # Add keys from requested keyrings + for keyring in "${KEYRINGIDS[@]}"; do + msg "$(gettext "Appending keys from %s.gpg...")" "$keyring" +- "${GPG_PACMAN[@]}" --import "${KEYRING_IMPORT_DIR}/${keyring}.gpg" ++ "${GPG_PACMAN[@]}" --quiet --import "${KEYRING_IMPORT_DIR}/${keyring}.gpg" + done + + # Read the trusted key IDs to an array. Because this is an ownertrust +@@ -403,12 +403,13 @@ + msg "$(gettext "Locally signing trusted keys in keyring...")" + for key_id in "${!trusted_ids[@]}"; do + msg2 "$(gettext "Locally signing key %s...")" "${key_id}" +- "${GPG_PACMAN[@]}" --quiet --lsign-key "${key_id}" ++ KEYIDS=("${key_id}") ++ lsign_keys + done + msg "$(gettext "Importing owner trust values...")" + for keyring in "${KEYRINGIDS[@]}"; do + if [[ -f "${KEYRING_IMPORT_DIR}/${keyring}-trusted" ]]; then +- "${GPG_PACMAN[@]}" --import-ownertrust "${KEYRING_IMPORT_DIR}/${keyring}-trusted" ++ "${GPG_PACMAN[@]}" --import-ownertrust "${KEYRING_IMPORT_DIR}/${keyring}-trusted" 2>/dev/null + fi + done + fi diff --git a/configs/releng/pacman.conf b/configs/releng/pacman.conf new file mode 100644 index 0000000..821f9a5 --- /dev/null +++ b/configs/releng/pacman.conf @@ -0,0 +1,96 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +HoldPkg = pacman glibc +# If upgrades are available for these packages they will be asked for first +SyncFirst = pacman +#XferCommand = /usr/bin/curl -C - -f %u > %o +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#UseDelta +#TotalDownload +# We cannot check disk space from within a chroot environment +#CheckSpace +#VerbosePkgLists + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +#SigLevel = Optional TrustedOnly + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[testing] +#SigLevel = PackageRequired +#Include = /etc/pacman.d/mirrorlist + +[core] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +[extra] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +#[community-testing] +#SigLevel = PackageRequired +#Include = /etc/pacman.d/mirrorlist + +[community] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + diff --git a/configs/releng/root-image/etc/arch-release b/configs/releng/root-image/etc/arch-release deleted file mode 100644 index d04512c..0000000 --- a/configs/releng/root-image/etc/arch-release +++ /dev/null @@ -1 +0,0 @@ -Parabola GNU/Linux-libre Live ISO diff --git a/configs/releng/root-image/etc/conf.d/dhcpcd b/configs/releng/root-image/etc/conf.d/dhcpcd new file mode 100644 index 0000000..76b56ff --- /dev/null +++ b/configs/releng/root-image/etc/conf.d/dhcpcd @@ -0,0 +1,6 @@ +# +# Arguments to be passed to the DHCP client daemon +# + +DHCPCD_ARGS="-qb" + diff --git a/configs/releng/root-image/etc/hostname b/configs/releng/root-image/etc/hostname new file mode 100644 index 0000000..2dbe21e --- /dev/null +++ b/configs/releng/root-image/etc/hostname @@ -0,0 +1 @@ +archiso diff --git a/configs/releng/root-image/etc/hosts b/configs/releng/root-image/etc/hosts index f26c713..0b6242f 100644 --- a/configs/releng/root-image/etc/hosts +++ b/configs/releng/root-image/etc/hosts @@ -3,7 +3,7 @@ # #<ip-address> <hostname.domain.org> <hostname> -127.0.0.1 localhost.localdomain localhost libreiso -::1 localhost.localdomain localhost libreiso +127.0.0.1 localhost.localdomain localhost parabola +::1 localhost.localdomain localhost parabola # End of file diff --git a/configs/releng/root-image/etc/inittab b/configs/releng/root-image/etc/inittab index 2bbc494..e3fe2c8 100644 --- a/configs/releng/root-image/etc/inittab +++ b/configs/releng/root-image/etc/inittab @@ -24,7 +24,7 @@ rh:06:wait:/etc/rc.shutdown su:S:wait:/sbin/sulogin -p # -8 options fixes umlauts problem on login -c1:2345:respawn:/sbin/agetty -8 -s -n -l /usr/bin/autologin 38400 tty1 linux +c1:2345:respawn:/sbin/agetty -8 -s -a root 38400 tty1 linux c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux diff --git a/configs/releng/root-image/etc/issue b/configs/releng/root-image/etc/issue deleted file mode 100644 index 2e5b032..0000000 --- a/configs/releng/root-image/etc/issue +++ /dev/null @@ -1,5 +0,0 @@ -[H[2J -Parabola GNU/Linux-libre Live ISO (\l) -\s-\r \m. -Default logins "root" and "libre" have no password. -To begin installation, login as root. diff --git a/configs/releng/root-image/etc/locale.conf b/configs/releng/root-image/etc/locale.conf new file mode 100644 index 0000000..01ec548 --- /dev/null +++ b/configs/releng/root-image/etc/locale.conf @@ -0,0 +1 @@ +LANG=en_US.UTF-8 diff --git a/configs/releng/root-image/etc/locale.gen b/configs/releng/root-image/etc/locale.gen deleted file mode 100644 index 7e4e293..0000000 --- a/configs/releng/root-image/etc/locale.gen +++ /dev/null @@ -1,455 +0,0 @@ -## Configuration file for locale-gen -## -## lists of locales that are to be generated by the locale-gen command. -## -## Each line is of the form: -## -## <locale> <charset> -## -## where <locale> is one of the locales given in /usr/share/i18n/locales -## and <charset> is one of the character sets listed in /usr/share/i18n/charmaps -## -## Examples: -## en_US ISO-8859-1 -## en_US.UTF-8 UTF-8 -## de_DE ISO-8859-1 -## de_DE@euro ISO-8859-15 -## -## The locale-gen command will generate all the locales, -## placing them in /usr/lib/locale. -## -## A list of supported locales is included in this file. -## Uncomment the ones you need. -## -## This file names the currently supported and somewhat tested locales. -## If you have any additions please file a glibc bug report. -# -#aa_DJ.UTF-8 UTF-8 -#aa_DJ ISO-8859-1 -#aa_ER UTF-8 -#aa_ER@saaho UTF-8 -#aa_ET UTF-8 -#af_ZA.UTF-8 UTF-8 -#af_ZA ISO-8859-1 -#am_ET UTF-8 -#an_ES.UTF-8 UTF-8 -#an_ES ISO-8859-15 -#ar_AE.UTF-8 UTF-8 -#ar_AE ISO-8859-6 -#ar_BH.UTF-8 UTF-8 -#ar_BH ISO-8859-6 -#ar_DZ.UTF-8 UTF-8 -#ar_DZ ISO-8859-6 -#ar_EG.UTF-8 UTF-8 -#ar_EG ISO-8859-6 -#ar_IN UTF-8 -#ar_IQ.UTF-8 UTF-8 -#ar_IQ ISO-8859-6 -#ar_JO.UTF-8 UTF-8 -#ar_JO ISO-8859-6 -#ar_KW.UTF-8 UTF-8 -#ar_KW ISO-8859-6 -#ar_LB.UTF-8 UTF-8 -#ar_LB ISO-8859-6 -#ar_LY.UTF-8 UTF-8 -#ar_LY ISO-8859-6 -#ar_MA.UTF-8 UTF-8 -#ar_MA ISO-8859-6 -#ar_OM.UTF-8 UTF-8 -#ar_OM ISO-8859-6 -#ar_QA.UTF-8 UTF-8 -#ar_QA ISO-8859-6 -#ar_SA.UTF-8 UTF-8 -#ar_SA ISO-8859-6 -#ar_SD.UTF-8 UTF-8 -#ar_SD ISO-8859-6 -#ar_SY.UTF-8 UTF-8 -#ar_SY ISO-8859-6 -#ar_TN.UTF-8 UTF-8 -#ar_TN ISO-8859-6 -#ar_YE.UTF-8 UTF-8 -#ar_YE ISO-8859-6 -#az_AZ UTF-8 -#as_IN UTF-8 -#ast_ES.UTF-8 UTF-8 -#ast_ES ISO-8859-15 -#be_BY.UTF-8 UTF-8 -#be_BY CP1251 -#be_BY@latin UTF-8 -#bem_ZM UTF-8 -#ber_DZ UTF-8 -#ber_MA UTF-8 -#bg_BG.UTF-8 UTF-8 -#bg_BG CP1251 -#bn_BD UTF-8 -#bn_IN UTF-8 -#bo_CN UTF-8 -#bo_IN UTF-8 -#br_FR.UTF-8 UTF-8 -#br_FR ISO-8859-1 -#br_FR@euro ISO-8859-15 -#bs_BA.UTF-8 UTF-8 -#bs_BA ISO-8859-2 -#byn_ER UTF-8 -#ca_AD.UTF-8 UTF-8 -#ca_AD ISO-8859-15 -#ca_ES.UTF-8 UTF-8 -#ca_ES ISO-8859-1 -#ca_ES@euro ISO-8859-15 -#ca_FR.UTF-8 UTF-8 -#ca_FR ISO-8859-15 -#ca_IT.UTF-8 UTF-8 -#ca_IT ISO-8859-15 -#crh_UA UTF-8 -#cs_CZ.UTF-8 UTF-8 -#cs_CZ ISO-8859-2 -#csb_PL UTF-8 -#cv_RU UTF-8 -#cy_GB.UTF-8 UTF-8 -#cy_GB ISO-8859-14 -#da_DK.UTF-8 UTF-8 -#da_DK ISO-8859-1 -#de_AT.UTF-8 UTF-8 -#de_AT ISO-8859-1 -#de_AT@euro ISO-8859-15 -#de_BE.UTF-8 UTF-8 -#de_BE ISO-8859-1 -#de_BE@euro ISO-8859-15 -#de_CH.UTF-8 UTF-8 -#de_CH ISO-8859-1 -#de_DE.UTF-8 UTF-8 -#de_DE ISO-8859-1 -#de_DE@euro ISO-8859-15 -#de_LU.UTF-8 UTF-8 -#de_LU ISO-8859-1 -#de_LU@euro ISO-8859-15 -#dv_MV UTF-8 -#dz_BT UTF-8 -#el_GR.UTF-8 UTF-8 -#el_GR ISO-8859-7 -#el_CY.UTF-8 UTF-8 -#el_CY ISO-8859-7 -#en_AG UTF-8 -#en_AU.UTF-8 UTF-8 -#en_AU ISO-8859-1 -#en_BW.UTF-8 UTF-8 -#en_BW ISO-8859-1 -#en_CA.UTF-8 UTF-8 -#en_CA ISO-8859-1 -#en_DK.UTF-8 UTF-8 -#en_DK ISO-8859-1 -#en_GB.UTF-8 UTF-8 -#en_GB ISO-8859-1 -#en_HK.UTF-8 UTF-8 -#en_HK ISO-8859-1 -#en_IE.UTF-8 UTF-8 -#en_IE ISO-8859-1 -#en_IE@euro ISO-8859-15 -#en_IN UTF-8 -#en_NG UTF-8 -#en_NZ.UTF-8 UTF-8 -#en_NZ ISO-8859-1 -#en_PH.UTF-8 UTF-8 -#en_PH ISO-8859-1 -#en_SG.UTF-8 UTF-8 -#en_SG ISO-8859-1 -en_US.UTF-8 UTF-8 -#en_US ISO-8859-1 -#en_ZA.UTF-8 UTF-8 -#en_ZA ISO-8859-1 -#en_ZM UTF-8 -#en_ZW.UTF-8 UTF-8 -#en_ZW ISO-8859-1 -#es_AR.UTF-8 UTF-8 -#es_AR ISO-8859-1 -#es_BO.UTF-8 UTF-8 -#es_BO ISO-8859-1 -#es_CL.UTF-8 UTF-8 -#es_CL ISO-8859-1 -#es_CO.UTF-8 UTF-8 -#es_CO ISO-8859-1 -#es_CR.UTF-8 UTF-8 -#es_CR ISO-8859-1 -#es_DO.UTF-8 UTF-8 -#es_DO ISO-8859-1 -#es_EC.UTF-8 UTF-8 -#es_EC ISO-8859-1 -#es_ES.UTF-8 UTF-8 -#es_ES ISO-8859-1 -#es_ES@euro ISO-8859-15 -#es_GT.UTF-8 UTF-8 -#es_GT ISO-8859-1 -#es_HN.UTF-8 UTF-8 -#es_HN ISO-8859-1 -#es_MX.UTF-8 UTF-8 -#es_MX ISO-8859-1 -#es_NI.UTF-8 UTF-8 -#es_NI ISO-8859-1 -#es_PA.UTF-8 UTF-8 -#es_PA ISO-8859-1 -#es_PE.UTF-8 UTF-8 -#es_PE ISO-8859-1 -#es_PR.UTF-8 UTF-8 -#es_PR ISO-8859-1 -#es_PY.UTF-8 UTF-8 -#es_PY ISO-8859-1 -#es_SV.UTF-8 UTF-8 -#es_SV ISO-8859-1 -#es_US.UTF-8 UTF-8 -#es_US ISO-8859-1 -#es_UY.UTF-8 UTF-8 -#es_UY ISO-8859-1 -#es_VE.UTF-8 UTF-8 -#es_VE ISO-8859-1 -#et_EE.UTF-8 UTF-8 -#et_EE ISO-8859-1 -#et_EE.ISO-8859-15 ISO-8859-15 -#eu_ES.UTF-8 UTF-8 -#eu_ES ISO-8859-1 -#eu_ES@euro ISO-8859-15 -#fa_IR UTF-8 -#ff_SN UTF-8 -#fi_FI.UTF-8 UTF-8 -#fi_FI ISO-8859-1 -#fi_FI@euro ISO-8859-15 -#fil_PH UTF-8 -#fo_FO.UTF-8 UTF-8 -#fo_FO ISO-8859-1 -#fr_BE.UTF-8 UTF-8 -#fr_BE ISO-8859-1 -#fr_BE@euro ISO-8859-15 -#fr_CA.UTF-8 UTF-8 -#fr_CA ISO-8859-1 -#fr_CH.UTF-8 UTF-8 -#fr_CH ISO-8859-1 -#fr_FR.UTF-8 UTF-8 -#fr_FR ISO-8859-1 -#fr_FR@euro ISO-8859-15 -#fr_LU.UTF-8 UTF-8 -#fr_LU ISO-8859-1 -#fr_LU@euro ISO-8859-15 -#fur_IT UTF-8 -#fy_NL UTF-8 -#fy_DE UTF-8 -#ga_IE.UTF-8 UTF-8 -#ga_IE ISO-8859-1 -#ga_IE@euro ISO-8859-15 -#gd_GB.UTF-8 UTF-8 -#gd_GB ISO-8859-15 -#gez_ER UTF-8 -#gez_ER@abegede UTF-8 -#gez_ET UTF-8 -#gez_ET@abegede UTF-8 -#gl_ES.UTF-8 UTF-8 -#gl_ES ISO-8859-1 -#gl_ES@euro ISO-8859-15 -#gu_IN UTF-8 -#gv_GB.UTF-8 UTF-8 -#gv_GB ISO-8859-1 -#ha_NG UTF-8 -#he_IL.UTF-8 UTF-8 -#he_IL ISO-8859-8 -#hi_IN UTF-8 -#hne_IN UTF-8 -#hr_HR.UTF-8 UTF-8 -#hr_HR ISO-8859-2 -#hsb_DE ISO-8859-2 -#hsb_DE.UTF-8 UTF-8 -#ht_HT UTF-8 -#hu_HU.UTF-8 UTF-8 -#hu_HU ISO-8859-2 -#hy_AM UTF-8 -#hy_AM.ARMSCII-8 ARMSCII-8 -#id_ID.UTF-8 UTF-8 -#id_ID ISO-8859-1 -#ig_NG UTF-8 -#ik_CA UTF-8 -#is_IS.UTF-8 UTF-8 -#is_IS ISO-8859-1 -#it_CH.UTF-8 UTF-8 -#it_CH ISO-8859-1 -#it_IT.UTF-8 UTF-8 -#it_IT ISO-8859-1 -#it_IT@euro ISO-8859-15 -#iu_CA UTF-8 -#iw_IL.UTF-8 UTF-8 -#iw_IL ISO-8859-8 -#ja_JP.EUC-JP EUC-JP -#ja_JP.UTF-8 UTF-8 -#ka_GE.UTF-8 UTF-8 -#ka_GE GEORGIAN-PS -#kk_KZ.UTF-8 UTF-8 -#kk_KZ PT154 -#kl_GL.UTF-8 UTF-8 -#kl_GL ISO-8859-1 -#km_KH UTF-8 -#kn_IN UTF-8 -#ko_KR.EUC-KR EUC-KR -#ko_KR.UTF-8 UTF-8 -#kok_IN UTF-8 -#ks_IN UTF-8 -#ks_IN@devanagari UTF-8 -#ku_TR.UTF-8 UTF-8 -#ku_TR ISO-8859-9 -#kw_GB.UTF-8 UTF-8 -#kw_GB ISO-8859-1 -#ky_KG UTF-8 -#lb_LU UTF-8 -#lg_UG.UTF-8 UTF-8 -#lg_UG ISO-8859-10 -#li_BE UTF-8 -#li_NL UTF-8 -#lij_IT UTF-8 -#lo_LA UTF-8 -#lt_LT.UTF-8 UTF-8 -#lt_LT ISO-8859-13 -#lv_LV.UTF-8 UTF-8 -#lv_LV ISO-8859-13 -#mai_IN UTF-8 -#mg_MG.UTF-8 UTF-8 -#mg_MG ISO-8859-15 -#mhr_RU UTF-8 -#mi_NZ.UTF-8 UTF-8 -#mi_NZ ISO-8859-13 -#mk_MK.UTF-8 UTF-8 -#mk_MK ISO-8859-5 -#ml_IN UTF-8 -#mn_MN UTF-8 -#mr_IN UTF-8 -#ms_MY.UTF-8 UTF-8 -#ms_MY ISO-8859-1 -#mt_MT.UTF-8 UTF-8 -#mt_MT ISO-8859-3 -#my_MM UTF-8 -#nan_TW@latin UTF-8 -#nb_NO.UTF-8 UTF-8 -#nb_NO ISO-8859-1 -#nds_DE UTF-8 -#nds_NL UTF-8 -#ne_NP UTF-8 -#nl_AW UTF-8 -#nl_BE.UTF-8 UTF-8 -#nl_BE ISO-8859-1 -#nl_BE@euro ISO-8859-15 -#nl_NL.UTF-8 UTF-8 -#nl_NL ISO-8859-1 -#nl_NL@euro ISO-8859-15 -#nn_NO.UTF-8 UTF-8 -#nn_NO ISO-8859-1 -#nr_ZA UTF-8 -#nso_ZA UTF-8 -#oc_FR.UTF-8 UTF-8 -#oc_FR ISO-8859-1 -#om_ET UTF-8 -#om_KE.UTF-8 UTF-8 -#om_KE ISO-8859-1 -#or_IN UTF-8 -#os_RU UTF-8 -#pa_IN UTF-8 -#pa_PK UTF-8 -#pap_AN UTF-8 -#pl_PL.UTF-8 UTF-8 -#pl_PL ISO-8859-2 -#ps_AF UTF-8 -#pt_BR.UTF-8 UTF-8 -#pt_BR ISO-8859-1 -#pt_PT.UTF-8 UTF-8 -#pt_PT ISO-8859-1 -#pt_PT@euro ISO-8859-15 -#ro_RO.UTF-8 UTF-8 -#ro_RO ISO-8859-2 -#ru_RU.KOI8-R KOI8-R -#ru_RU.UTF-8 UTF-8 -#ru_RU ISO-8859-5 -#ru_UA.UTF-8 UTF-8 -#ru_UA KOI8-U -#rw_RW UTF-8 -#sa_IN UTF-8 -#sc_IT UTF-8 -#sd_IN UTF-8 -#sd_IN@devanagari UTF-8 -#se_NO UTF-8 -#shs_CA UTF-8 -#si_LK UTF-8 -#sid_ET UTF-8 -#sk_SK.UTF-8 UTF-8 -#sk_SK ISO-8859-2 -#sl_SI.UTF-8 UTF-8 -#sl_SI ISO-8859-2 -#so_DJ.UTF-8 UTF-8 -#so_DJ ISO-8859-1 -#so_ET UTF-8 -#so_KE.UTF-8 UTF-8 -#so_KE ISO-8859-1 -#so_SO.UTF-8 UTF-8 -#so_SO ISO-8859-1 -#sq_AL.UTF-8 UTF-8 -#sq_AL ISO-8859-1 -#sq_MK UTF-8 -#sr_ME UTF-8 -#sr_RS UTF-8 -#sr_RS@latin UTF-8 -#ss_ZA UTF-8 -#st_ZA.UTF-8 UTF-8 -#st_ZA ISO-8859-1 -#sv_FI.UTF-8 UTF-8 -#sv_FI ISO-8859-1 -#sv_FI@euro ISO-8859-15 -#sv_SE.UTF-8 UTF-8 -#sv_SE ISO-8859-1 -#sw_KE UTF-8 -#sw_TZ UTF-8 -#ta_IN UTF-8 -#te_IN UTF-8 -#tg_TJ.UTF-8 UTF-8 -#tg_TJ KOI8-T -#th_TH.UTF-8 UTF-8 -#th_TH TIS-620 -#ti_ER UTF-8 -#ti_ET UTF-8 -#tig_ER UTF-8 -#tk_TM UTF-8 -#tl_PH.UTF-8 UTF-8 -#tl_PH ISO-8859-1 -#tn_ZA UTF-8 -#tr_CY.UTF-8 UTF-8 -#tr_CY ISO-8859-9 -#tr_TR.UTF-8 UTF-8 -#tr_TR ISO-8859-9 -#ts_ZA UTF-8 -#tt_RU UTF-8 -#tt_RU@iqtelif UTF-8 -#ug_CN UTF-8 -#uk_UA.UTF-8 UTF-8 -#uk_UA KOI8-U -#ur_PK UTF-8 -#uz_UZ ISO-8859-1 -#uz_UZ@cyrillic UTF-8 -#ve_ZA UTF-8 -#vi_VN.TCVN TCVN5712-1 -#vi_VN UTF-8 -#wa_BE ISO-8859-1 -#wa_BE@euro ISO-8859-15 -#wa_BE.UTF-8 UTF-8 -#wae_CH UTF-8 -#wo_SN UTF-8 -#xh_ZA.UTF-8 UTF-8 -#xh_ZA ISO-8859-1 -#yi_US.UTF-8 UTF-8 -#yi_US CP1255 -#yo_NG UTF-8 -#yue_HK UTF-8 -#zh_CN.GB18030 GB18030 -#zh_CN.GBK GBK -#zh_CN.UTF-8 UTF-8 -#zh_CN GB2312 -#zh_HK.UTF-8 UTF-8 -#zh_HK BIG5-HKSCS -#zh_SG.UTF-8 UTF-8 -#zh_SG.GBK GBK -#zh_SG GB2312 -#zh_TW.EUC-TW EUC-TW -#zh_TW.UTF-8 UTF-8 -#zh_TW BIG5 -#zu_ZA.UTF-8 UTF-8 -#zu_ZA ISO-8859-1 diff --git a/configs/releng/root-image/etc/motd b/configs/releng/root-image/etc/motd deleted file mode 100644 index 0943569..0000000 --- a/configs/releng/root-image/etc/motd +++ /dev/null @@ -1,15 +0,0 @@ -************************************************************** -* To begin installation, run /libre/setup * -* You can find documentation at * -* /usr/share/aif/docs/official_installation_guide_en * -* * -* i18n: Use the 'km' utility to change your keyboard layout * -* and console font. * -* * -* If you encounter issues and want to report them or * -* seek help, run /libre/report-issues * -* * -* If you need help please consult * -* http://wiki.parabolagnulinux.org * -* * -************************************************************** diff --git a/configs/releng/root-image/etc/rc.conf b/configs/releng/root-image/etc/rc.conf index f34f828..679b804 100644 --- a/configs/releng/root-image/etc/rc.conf +++ b/configs/releng/root-image/etc/rc.conf @@ -1,33 +1,23 @@ -# -# /etc/rc.conf - Main Configuration for Parabola GNU/Linux-libre - . /etc/archiso/functions +# +# /etc/rc.conf - configuration file for initscripts +# +# Most of rc.conf has been replaced by various other configuration +# files. See parabola(7) for details. +# +# For more details on rc.conf see rc.conf(5). +# -LOCALE_DEFAULT="en_US.UTF-8" -DAEMON_LOCALE_DEFAULT="no" -CLOCK_DEFAULT="UTC" -TIMEZONE_DEFAULT="Canada/Pacific" -KEYMAP_DEFAULT="us" -CONSOLEFONT_DEFAULT= -CONSOLEMAP_DEFAULT= -USECOLOR_DEFAULT="yes" - -LOCALE="$(kernel_cmdline locale ${LOCALE_DEFAULT})" -DAEMON_LOCALE="$(kernel_cmdline daemon_locale ${DAEMON_LOCALE_DEFAULT})" -HARDWARECLOCK="$(kernel_cmdline clock ${CLOCK_DEFAULT})" -TIMEZONE="$(kernel_cmdline timezone ${TIMEZONE_DEFAULT})" -KEYMAP="$(kernel_cmdline keymap ${KEYMAP_DEFAULT})" -CONSOLEFONT="$(kernel_cmdline consolefont ${CONSOLEFONT_DEFAULT})" -CONSOLEMAP="$(kernel_cmdline consolemap ${CONSOLEMAP_DEFAULT})" -USECOLOR="$(kernel_cmdline usecolor ${USECOLOR_DEFAULT})" - -MODULES=() - -UDEV_TIMEOUT=30 -USEDMRAID="no" -USEBTRFS="no" -USELVM="no" +DAEMONS=(syslog-ng network haveged pacman-init) -HOSTNAME="libreiso" +# Storage +# +# USEDMRAID="no" +# USELVM="no" -DAEMONS=(hwclock syslog-ng) +# Network +# +# interface= +# address= +# netmask= +# gateway= diff --git a/configs/releng/root-image/etc/rc.d/functions.d/automated_script b/configs/releng/root-image/etc/rc.d/functions.d/automated_script index 7a35acb..f3e9018 100644 --- a/configs/releng/root-image/etc/rc.d/functions.d/automated_script +++ b/configs/releng/root-image/etc/rc.d/functions.d/automated_script @@ -1,18 +1,18 @@ automated_script () { script="$(kernel_cmdline script)" - if [[ -n "$script" ]]; then + if [[ -n "${script}" ]]; then stat_busy "Configuring $script" - if [[ "$script" =~ ^http:// || "$script" =~ ^ftp:// ]]; then - wget "$script" -q -O /tmp/startup_script >/dev/null + if [[ "${script}" =~ ^http:// || "${script}" =~ ^ftp:// ]]; then + wget "${script}" -q -O /tmp/startup_script >/dev/null rt=$? else - cp "$script" /tmp/startup_script + cp "${script}" /tmp/startup_script rt=$? fi - if [ $rt -eq 0 ]; then + if [ ${rt} -eq 0 ]; then chmod +x /tmp/startup_script - echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.bash_profile + echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.zprofile stat_done else stat_fail diff --git a/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client b/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client deleted file mode 100644 index b72f168..0000000 --- a/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client +++ /dev/null @@ -1,8 +0,0 @@ -if [[ -f /run/nbd_client.pid ]]; then - omit_kill_nbd_client() { - add_omit_pids $(< /run/nbd_client.pid) - } - - add_hook shutdown_prekillall omit_kill_nbd_client - add_hook single_prekillall omit_kill_nbd_client -fi diff --git a/configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen b/configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen deleted file mode 100644 index 47ed79d..0000000 --- a/configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen +++ /dev/null @@ -1,11 +0,0 @@ -prepare_locale_gen () -{ - if [[ ${LOCALE} != "en_US.UTF-8" ]]; then - stat_busy "Generating locales..." - sed -i "s/#\(${LOCALE/[@.]*}\)/\1/" /etc/locale.gen - /usr/sbin/locale-gen > /dev/null - stat_done - fi -} - -add_hook sysinit_postmount prepare_locale_gen diff --git a/configs/releng/root-image/etc/rc.d/pacman-init b/configs/releng/root-image/etc/rc.d/pacman-init new file mode 100755 index 0000000..bbbd719 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/pacman-init @@ -0,0 +1,34 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Initializing pacman keyring" + if { pacman-key --init && pacman-key --populate archlinux; } &>/dev/null; then + add_daemon pacman-init + stat_done + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Removing pacman keyring" + rm -rf /etc/pacman.d/gnupg + rm_daemon pacman-init + stat_done + ;; + + restart) + $0 stop + $0 start + ;; + + *) + echo "usage: $0 {start|stop|restart}" +esac + +exit 0 diff --git a/configs/releng/root-image/etc/resolv.conf b/configs/releng/root-image/etc/resolv.conf deleted file mode 100644 index cecafba..0000000 --- a/configs/releng/root-image/etc/resolv.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# /etc/resolv.conf -# - -#search <yourdomain.tld> -#nameserver <ip> - -# End of file diff --git a/configs/releng/root-image/etc/timezone b/configs/releng/root-image/etc/timezone new file mode 100644 index 0000000..e2e7775 --- /dev/null +++ b/configs/releng/root-image/etc/timezone @@ -0,0 +1 @@ +UTC diff --git a/configs/releng/root-image/etc/vconsole.conf b/configs/releng/root-image/etc/vconsole.conf new file mode 100644 index 0000000..c58bf7e --- /dev/null +++ b/configs/releng/root-image/etc/vconsole.conf @@ -0,0 +1,2 @@ +KEYMAP=us +FONT= diff --git a/configs/releng/root-image/libre/report-issues b/configs/releng/root-image/libre/report-issues deleted file mode 100755 index bf3b3a3..0000000 --- a/configs/releng/root-image/libre/report-issues +++ /dev/null @@ -1 +0,0 @@ -aif-report-issues.sh diff --git a/configs/releng/root-image/libre/setup b/configs/releng/root-image/libre/setup deleted file mode 100755 index 908d106..0000000 --- a/configs/releng/root-image/libre/setup +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# -aif -p interactive -d -l diff --git a/configs/releng/root-image/root/install.txt b/configs/releng/root-image/root/install.txt new file mode 100644 index 0000000..3c8f171 --- /dev/null +++ b/configs/releng/root-image/root/install.txt @@ -0,0 +1,3 @@ +View this installation guide online at +https://wiki.archlinux.org/index.php/Installation_Guide + diff --git a/configs/releng/root-image/usr/bin/autologin b/configs/releng/root-image/usr/bin/autologin deleted file mode 100755 index c124f9e..0000000 --- a/configs/releng/root-image/usr/bin/autologin +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -/bin/login -f root diff --git a/configs/releng/root-image/usr/bin/km b/configs/releng/root-image/usr/bin/km deleted file mode 100755 index e24d780..0000000 --- a/configs/releng/root-image/usr/bin/km +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -aif -p partial-keymap diff --git a/configs/releng/syslinux.dual/archiso.cfg b/configs/releng/syslinux.dual/archiso.cfg new file mode 100644 index 0000000..d1817af --- /dev/null +++ b/configs/releng/syslinux.dual/archiso.cfg @@ -0,0 +1,11 @@ +DEFAULT select + +LABEL select +COM32 boot/syslinux/whichsys.c32 +APPEND -pxe- pxe -sys- sys -iso- sys + +LABEL pxe +CONFIG boot/syslinux/archiso_pxe_choose.cfg + +LABEL sys +CONFIG boot/syslinux/archiso_sys_choose.cfg diff --git a/configs/releng/syslinux.dual/syslinux_head.cfg b/configs/releng/syslinux.dual/archiso_head.cfg index 4953b18..278255d 100644 --- a/configs/releng/syslinux.dual/syslinux_head.cfg +++ b/configs/releng/syslinux.dual/archiso_head.cfg @@ -1,17 +1,14 @@ SERIAL 0 38400 -DEFAULT vesamenu.c32 -PROMPT 0 +UI boot/syslinux/vesamenu.c32 MENU TITLE Parabola GNU/Linux-libre -MENU BACKGROUND splash.png -TIMEOUT 3000 +MENU BACKGROUND boot/syslinux/splash.png MENU WIDTH 78 MENU MARGIN 4 MENU ROWS 7 MENU VSHIFT 10 -MENU TIMEOUTROW 13 -MENU TABMSGROW 11 -MENU CMDLINEROW 11 +MENU TABMSGROW 14 +MENU CMDLINEROW 14 MENU HELPMSGROW 16 MENU HELPMSGENDROW 29 diff --git a/configs/releng/syslinux.dual/archiso_pxe32.cfg b/configs/releng/syslinux.dual/archiso_pxe32.cfg new file mode 100644 index 0000000..4bdeefa --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_pxe32.cfg @@ -0,0 +1,32 @@ +LABEL arch32_nbd +TEXT HELP +Boot the Arch Linux (i686) live medium (Using NBD). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (i686) (NBD) +LINUX boot/i686/vmlinuz +INITRD boot/i686/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} +IPAPPEND 3 + +LABEL arch32_nfs +TEXT HELP +Boot the Arch Linux (i686) live medium (Using NFS). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (i686) (NFS) +LINUX boot/i686/vmlinuz +INITRD boot/i686/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt +IPAPPEND 3 + +LABEL arch32_http +TEXT HELP +Boot the Arch Linux (i686) live medium (Using HTTP). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (i686) (HTTP) +LINUX boot/i686/vmlinuz +INITRD boot/i686/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ +IPAPPEND 3 diff --git a/configs/releng/syslinux.dual/archiso_pxe64.cfg b/configs/releng/syslinux.dual/archiso_pxe64.cfg new file mode 100644 index 0000000..1676236 --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_pxe64.cfg @@ -0,0 +1,32 @@ +LABEL arch64_nbd +TEXT HELP +Boot the Arch Linux (x86_64) live medium (Using NBD). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (x86_64) (NBD) +LINUX boot/x86_64/vmlinuz +INITRD boot/x86_64/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} +IPAPPEND 3 + +LABEL arch64_nfs +TEXT HELP +Boot the Arch Linux (x86_64) live medium (Using NFS). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (x86_64) (NFS) +LINUX boot/x86_64/vmlinuz +INITRD boot/x86_64/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt +IPAPPEND 3 + +LABEL arch64_http +TEXT HELP +Boot the Arch Linux (x86_64) live medium (Using HTTP). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (x86_64) (HTTP) +LINUX boot/x86_64/vmlinuz +INITRD boot/x86_64/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ +IPAPPEND 3 diff --git a/configs/releng/syslinux.dual/archiso_pxe_32_inc.cfg b/configs/releng/syslinux.dual/archiso_pxe_32_inc.cfg new file mode 100644 index 0000000..e4115df --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_pxe_32_inc.cfg @@ -0,0 +1,3 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_pxe32.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux.dual/archiso_pxe_both_inc.cfg b/configs/releng/syslinux.dual/archiso_pxe_both_inc.cfg new file mode 100644 index 0000000..324523e --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_pxe_both_inc.cfg @@ -0,0 +1,4 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_pxe32.cfg +INCLUDE boot/syslinux/archiso_pxe64.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux.dual/archiso_pxe_choose.cfg b/configs/releng/syslinux.dual/archiso_pxe_choose.cfg new file mode 100644 index 0000000..6296065 --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_pxe_choose.cfg @@ -0,0 +1,11 @@ +DEFAULT choose + +LABEL choose +COM32 boot/syslinux/ifcpu64.c32 +APPEND have64 -- nohave64 + +LABEL have64 +CONFIG boot/syslinux/archiso_pxe_both_inc.cfg + +LABEL nohave64 +CONFIG boot/syslinux/archiso_pxe_32_inc.cfg diff --git a/configs/releng/syslinux.dual/syslinux_arch32.cfg b/configs/releng/syslinux.dual/archiso_sys32.cfg index d6180f6..df79901 100644 --- a/configs/releng/syslinux.dual/syslinux_arch32.cfg +++ b/configs/releng/syslinux.dual/archiso_sys32.cfg @@ -4,8 +4,7 @@ Boot the Parabola (i686) live medium. It allows you to install a fully libre Arch Linux or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola (i686) -LINUX /%INSTALL_DIR%/boot/i686/vmlinuz -INITRD /%INSTALL_DIR%/boot/i686/libreiso.img +MENU LABEL Boot Arch Linux (i686) +LINUX boot/i686/vmlinuz +INITRD boot/i686/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% -# Next line should be uncommented when prepare enviroment to boot from PXE. -#IPAPPEND 3 diff --git a/configs/releng/syslinux.dual/syslinux_arch64.cfg b/configs/releng/syslinux.dual/archiso_sys64.cfg index 64f2269..409c5b2 100644 --- a/configs/releng/syslinux.dual/syslinux_arch64.cfg +++ b/configs/releng/syslinux.dual/archiso_sys64.cfg @@ -4,8 +4,6 @@ Boot the Parabola (x86_64) live medium. It allows you to install a fully libre Arch Linux or perform system maintenance. ENDTEXT MENU LABEL Boot Parabola (x86_64) -LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz -INITRD /%INSTALL_DIR%/boot/x86_64/libreiso.img +LINUX boot/x86_64/vmlinuz +INITRD boot/x86_64/libreiso.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% -# Next line should be uncommented when prepare enviroment to boot from PXE. -#IPAPPEND 3 diff --git a/configs/releng/syslinux.dual/archiso_sys_32_inc.cfg b/configs/releng/syslinux.dual/archiso_sys_32_inc.cfg new file mode 100644 index 0000000..9e37093 --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_sys_32_inc.cfg @@ -0,0 +1,3 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_sys32.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux.dual/archiso_sys_both_inc.cfg b/configs/releng/syslinux.dual/archiso_sys_both_inc.cfg new file mode 100644 index 0000000..4ed6b39 --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_sys_both_inc.cfg @@ -0,0 +1,4 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_sys32.cfg +INCLUDE boot/syslinux/archiso_sys64.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux.dual/archiso_sys_choose.cfg b/configs/releng/syslinux.dual/archiso_sys_choose.cfg new file mode 100644 index 0000000..24c597a --- /dev/null +++ b/configs/releng/syslinux.dual/archiso_sys_choose.cfg @@ -0,0 +1,11 @@ +DEFAULT choose + +LABEL choose +COM32 boot/syslinux/ifcpu64.c32 +APPEND have64 -- nohave64 + +LABEL have64 +CONFIG boot/syslinux/archiso_sys_both_inc.cfg + +LABEL nohave64 +CONFIG boot/syslinux/archiso_sys_32_inc.cfg diff --git a/configs/releng/syslinux.dual/syslinux_tail.cfg b/configs/releng/syslinux.dual/archiso_tail.cfg index a8441a9..a55548c 100644 --- a/configs/releng/syslinux.dual/syslinux_tail.cfg +++ b/configs/releng/syslinux.dual/archiso_tail.cfg @@ -4,26 +4,24 @@ Boot an existing operating system. Press TAB to edit the disk and partition number to boot. ENDTEXT MENU LABEL Boot existing OS -COM32 chain.c32 +COM32 boot/syslinux/chain.c32 APPEND hd0 0 # http://www.memtest.org/ LABEL memtest MENU LABEL Run Memtest86+ (RAM test) -LINUX /%INSTALL_DIR%/boot/memtest +LINUX boot/memtest # http://hdt-project.org/ LABEL hdt MENU LABEL Hardware Information (HDT) -COM32 hdt.c32 -APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz +COM32 boot/syslinux/hdt.c32 +APPEND modules_alias=boot/syslinux/hdt/modalias.gz pciids=boot/syslinux/hdt/pciids.gz LABEL reboot MENU LABEL Reboot -COM32 reboot.c32 +COM32 boot/syslinux/reboot.c32 LABEL poweroff MENU LABEL Power Off -COMBOOT poweroff.com - -ONTIMEOUT libre32 +COMBOOT boot/syslinux/poweroff.com diff --git a/configs/releng/syslinux.dual/syslinux.cfg b/configs/releng/syslinux.dual/syslinux.cfg index ac92998..3ee98de 100644 --- a/configs/releng/syslinux.dual/syslinux.cfg +++ b/configs/releng/syslinux.dual/syslinux.cfg @@ -1,12 +1,5 @@ -DEFAULT choose -PROMPT 0 +DEFAULT loadconfig -LABEL choose -KERNEL ifcpu64.c32 -APPEND have64 -- nohave64 - -LABEL have64 -CONFIG syslinux_both.cfg - -LABEL nohave64 -CONFIG syslinux_32only.cfg +LABEL loadconfig + CONFIG archiso.cfg + APPEND ../../ diff --git a/configs/releng/syslinux.dual/syslinux_32only.cfg b/configs/releng/syslinux.dual/syslinux_32only.cfg deleted file mode 100644 index c7a452d..0000000 --- a/configs/releng/syslinux.dual/syslinux_32only.cfg +++ /dev/null @@ -1,3 +0,0 @@ -INCLUDE syslinux_head.cfg -INCLUDE syslinux_arch32.cfg -INCLUDE syslinux_tail.cfg diff --git a/configs/releng/syslinux.dual/syslinux_both.cfg b/configs/releng/syslinux.dual/syslinux_both.cfg deleted file mode 100644 index 9cd1584..0000000 --- a/configs/releng/syslinux.dual/syslinux_both.cfg +++ /dev/null @@ -1,4 +0,0 @@ -INCLUDE syslinux_head.cfg -INCLUDE syslinux_arch32.cfg -INCLUDE syslinux_arch64.cfg -INCLUDE syslinux_tail.cfg diff --git a/configs/releng/syslinux/archiso.cfg b/configs/releng/syslinux/archiso.cfg new file mode 100644 index 0000000..126fc77 --- /dev/null +++ b/configs/releng/syslinux/archiso.cfg @@ -0,0 +1,11 @@ +DEFAULT select + +LABEL select +COM32 boot/syslinux/whichsys.c32 +APPEND -pxe- pxe -sys- sys -iso- sys + +LABEL pxe +CONFIG boot/syslinux/archiso_pxe_inc.cfg + +LABEL sys +CONFIG boot/syslinux/archiso_sys_inc.cfg diff --git a/configs/releng/syslinux/archiso_head.cfg b/configs/releng/syslinux/archiso_head.cfg new file mode 100644 index 0000000..faa2588 --- /dev/null +++ b/configs/releng/syslinux/archiso_head.cfg @@ -0,0 +1,25 @@ +SERIAL 0 38400 +UI boot/syslinux/vesamenu.c32 +MENU TITLE Arch Linux +MENU BACKGROUND boot/syslinux/splash.png + +MENU WIDTH 78 +MENU MARGIN 4 +MENU ROWS 6 +MENU VSHIFT 10 +MENU TABMSGROW 14 +MENU CMDLINEROW 14 +MENU HELPMSGROW 16 +MENU HELPMSGENDROW 29 + +# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu + +MENU COLOR border 30;44 #40ffffff #a0000000 std +MENU COLOR title 1;36;44 #9033ccff #a0000000 std +MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all +MENU COLOR unsel 37;44 #50ffffff #a0000000 std +MENU COLOR help 37;40 #c0ffffff #a0000000 std +MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std +MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std +MENU COLOR msg07 37;40 #90ffffff #a0000000 std +MENU COLOR tabmsg 31;40 #30ffffff #00000000 std diff --git a/configs/releng/syslinux/archiso_pxe.cfg b/configs/releng/syslinux/archiso_pxe.cfg new file mode 100644 index 0000000..8bb60ed --- /dev/null +++ b/configs/releng/syslinux/archiso_pxe.cfg @@ -0,0 +1,32 @@ +LABEL arch_nbd +TEXT HELP +Boot the Arch Linux live medium (Using NBD). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (NBD) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} +IPAPPEND 3 + +LABEL arch_nfs +TEXT HELP +Boot the Arch Linux live medium (Using NFS). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (NFS) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt +IPAPPEND 3 + +LABEL arch_http +TEXT HELP +Boot the Arch Linux live medium (Using HTTP). It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (HTTP) +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ +IPAPPEND 3 diff --git a/configs/releng/syslinux/archiso_pxe_inc.cfg b/configs/releng/syslinux/archiso_pxe_inc.cfg new file mode 100644 index 0000000..b2b6887 --- /dev/null +++ b/configs/releng/syslinux/archiso_pxe_inc.cfg @@ -0,0 +1,3 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_pxe.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux/archiso_sys.cfg b/configs/releng/syslinux/archiso_sys.cfg new file mode 100644 index 0000000..35303db --- /dev/null +++ b/configs/releng/syslinux/archiso_sys.cfg @@ -0,0 +1,9 @@ +LABEL arch +TEXT HELP +Boot the Arch Linux live medium. It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux +LINUX boot/%ARCH%/vmlinuz +INITRD boot/%ARCH%/archiso.img +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% diff --git a/configs/releng/syslinux/archiso_sys_inc.cfg b/configs/releng/syslinux/archiso_sys_inc.cfg new file mode 100644 index 0000000..56c6a17 --- /dev/null +++ b/configs/releng/syslinux/archiso_sys_inc.cfg @@ -0,0 +1,3 @@ +INCLUDE boot/syslinux/archiso_head.cfg +INCLUDE boot/syslinux/archiso_sys.cfg +INCLUDE boot/syslinux/archiso_tail.cfg diff --git a/configs/releng/syslinux/archiso_tail.cfg b/configs/releng/syslinux/archiso_tail.cfg new file mode 100644 index 0000000..a55548c --- /dev/null +++ b/configs/releng/syslinux/archiso_tail.cfg @@ -0,0 +1,27 @@ +LABEL existing +TEXT HELP +Boot an existing operating system. Press TAB to edit the disk and partition +number to boot. +ENDTEXT +MENU LABEL Boot existing OS +COM32 boot/syslinux/chain.c32 +APPEND hd0 0 + +# http://www.memtest.org/ +LABEL memtest +MENU LABEL Run Memtest86+ (RAM test) +LINUX boot/memtest + +# http://hdt-project.org/ +LABEL hdt +MENU LABEL Hardware Information (HDT) +COM32 boot/syslinux/hdt.c32 +APPEND modules_alias=boot/syslinux/hdt/modalias.gz pciids=boot/syslinux/hdt/pciids.gz + +LABEL reboot +MENU LABEL Reboot +COM32 boot/syslinux/reboot.c32 + +LABEL poweroff +MENU LABEL Power Off +COMBOOT boot/syslinux/poweroff.com diff --git a/configs/releng/syslinux/syslinux.cfg b/configs/releng/syslinux/syslinux.cfg index 14f48e6..3ee98de 100644 --- a/configs/releng/syslinux/syslinux.cfg +++ b/configs/releng/syslinux/syslinux.cfg @@ -1,70 +1,5 @@ -SERIAL 0 38400 -DEFAULT vesamenu.c32 -PROMPT 0 -MENU TITLE Parabola GNU/Linux-libre -MENU BACKGROUND splash.png -TIMEOUT 3000 +DEFAULT loadconfig -MENU WIDTH 78 -MENU MARGIN 4 -MENU ROWS 6 -MENU VSHIFT 10 -MENU TIMEOUTROW 13 -MENU TABMSGROW 11 -MENU CMDLINEROW 11 -MENU HELPMSGROW 16 -MENU HELPMSGENDROW 29 - -# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu - -MENU COLOR border 30;44 #40ffffff #a0000000 std -MENU COLOR title 1;36;44 #9033ccff #a0000000 std -MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all -MENU COLOR unsel 37;44 #50ffffff #a0000000 std -MENU COLOR help 37;40 #c0ffffff #a0000000 std -MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std -MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std -MENU COLOR msg07 37;40 #90ffffff #a0000000 std -MENU COLOR tabmsg 31;40 #30ffffff #00000000 std - -LABEL libre -TEXT HELP -Boot the Parabola live medium. It allows you to install a fully libre -Arch Linux or perform system maintenance. -ENDTEXT -MENU LABEL Boot Parabola GNU/Linux-libre -LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz -INITRD /%INSTALL_DIR%/boot/%ARCH%/libreiso.img -APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% -# Next line should be uncommented when prepare enviroment to boot from PXE. -#IPAPPEND 3 - -LABEL existing -TEXT HELP -Boot an existing operating system. Press TAB to edit the disk and partition -number to boot. -ENDTEXT -MENU LABEL Boot existing OS -COM32 chain.c32 -APPEND hd0 0 - -# http://www.memtest.org/ -LABEL memtest -MENU LABEL Run Memtest86+ (RAM test) -LINUX /%INSTALL_DIR%/boot/memtest - -# http://hdt-project.org/ -LABEL hdt -MENU LABEL Hardware Information (HDT) -COM32 hdt.c32 -APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz - -LABEL reboot -MENU LABEL Reboot -COM32 reboot.c32 - -LABEL poweroff -MENU LABEL Power Off -COMBOOT poweroff.com - -ONTIMEOUT libre +LABEL loadconfig + CONFIG archiso.cfg + APPEND ../../ |