Commit Graph

300 Commits

Author SHA1 Message Date
Gerardo Exequiel Pozzi
9532a8c3a9 [archiso] Minor change 2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
bdc79f2d26 [archiso] Remove _is_directory_changed()
This is a task done in some way by run_once() on build.sh
2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
539c38663c [archiso] Rework _mount_fs() to _mount_airootfs() same for umount
Also remove _show_space_usage() irrelevant now when fs size is fixed and big
2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
25e39ee081 [archiso] Merge _mkfs() and _mksfs() in _mkairootfs() 2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
ba40f273f6 [archiso] rename airootfs.fs.sfs to airootfs.sfs
* Make it ISO9660 friendly (extra dot "." is replaced by "_")
* Was used when support both .fs.sfs and .sfs
2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
36459f3acc [archiso] Drop aitab support
Always create one filesystem of a fixed size (32G), format (ext4) and
know name "airootfs".

Simplify logic a lot.
2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
9131f83404 [archiso] mkarchiso: Add -c switch to specify squashfs compression type. 2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
c62a9d748b [archiso] Always use a 32GiB filesystem size for airootfs
There is no big overhead.
Space usage in ext4-1G is ~0.4M while in ext4-32G is ~4M.
Just use a big value to make all people happy.
2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
b9833ce4f8 [archiso] mkarchiso: Only use ext4 as filesystem for airootfs 2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
604b182af5 [archiso] Rename root-image to airootfs
Two purposes:
 * systemd filename friendly: "-" is used for "/" and must be escaped with "\x20"
 * ISO9660 filename friendly: "-" is replaced with "_"
2014-06-28 00:35:50 -03:00
Gerardo Exequiel Pozzi
4f4af3df6e [archiso] Add nls_iso8859-1 to initramfs.
Fix FS#40217

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2014-05-21 20:45:29 -03:00
Gerardo Exequiel Pozzi
c2b6209532 [archiso] mkarchiso: init cmd: test for file instead of directory
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2013-10-02 19:37:39 -03:00
Gerardo Exequiel Pozzi
997dabbce2 [archiso] mkarchiso: use arch-install-scripts instead of own functions
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2013-09-21 18:11:43 -03:00
Gerardo Exequiel Pozzi
c5539c799c [configs/releng] explicit set 'Storage=volatile' for journald
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2013-09-21 16:53:45 -03:00
Gerardo Exequiel Pozzi
f19f6173c8 [archiso] Add support to isohybrid-gpt for EFI boot
Tested and works fine under qemu using seabios and ovmf

$ qemu-system-x86_64 -enable-kvm -drive file=~/archlinux-2013.06.20-dual.iso
$ qemu-system-x86_64 -enable-kvm -drive file=~/archlinux-2013.06.20-dual.iso,media=cdrom
$ qemu-system-x86_64 -enable-kvm -bios ~/arch/OVMF/bios.bin -drive file=~/archlinux-2013.06.20-dual.iso
$ qemu-system-x86_64 -enable-kvm -bios ~/arch/OVMF/bios.bin -drive file=~/archlinux-2013.06.20-dual.iso,media=cdrom

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2013-06-20 18:48:41 -03:00
Gerardo Exequiel Pozzi
21b6a908c3 [archiso] Fix find cmd in _cleanup()
Fix FS#34075

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2013-03-03 18:23:57 -03:00
Gerardo Exequiel Pozzi
00d1126f70 [archiso] Avoid integer overflow when .fs is > 10.2G 2013-01-08 20:20:03 -03:00
Gerardo Exequiel Pozzi
89fe9b78ae [archiso] mkarchiso: Cleanup kernel(s) in /boot
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-12-16 20:12:11 -03:00
Gerardo Exequiel Pozzi
e6409b6061 [archiso] mkarchiso: do not process aitab entry if arch differs
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-12-16 18:06:04 -03:00
Gerardo Exequiel Pozzi
9de7abfc19 [archiso] mkarchiso: Disable lazy_itable_init (ext4)
Ensure that all inode table is initialized at filesystem creation.
(Anyway filesystem is small, so at first mount is may quickly initialized)

This avoid possible COW usage during runtime ;)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-12-10 12:06:19 -03:00
Gerardo Exequiel Pozzi
f4ecca25b7 [archiso] mkarchiso: Use truncate instead of dd
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-12-10 12:06:19 -03:00
Gerardo Exequiel Pozzi
a79559c897 [archiso] Avoid journald log to /var/log/journal
This was recently enabled in [systemd] package.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-10-24 13:18:17 -03:00
Gerardo Exequiel Pozzi
aece3e3d2e [archiso] Remove uneeded cleanup /tmp
/tmp is mounted as tmpfs since archiso implements own chroot code.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-10-24 13:18:16 -03:00
Gerardo Exequiel Pozzi
594fc08b29 [archiso] Remove old code (now redundant)
/etc/mtab symlink is part of [filesystem] since long time

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-10-24 13:18:16 -03:00
Gerardo Exequiel Pozzi
21aa378007 [archiso] Allow set copytoram=n for NBD/NFS
On low memory systems installing via PXE is not possible.
Do not force copytoram=y for NFS/NDB.
Broken/hang things:
* On shutdown.
* On run-time if some network settings changed.

Implements FS#32006.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-10-16 19:10:17 -03:00
Gerardo Exequiel Pozzi
1746e31049 [archiso] Introduce cowfile_size= bootparam
If not set, nothing is changed in current behaviour.

Since dm-snapshot allows to use as "COW" a file with any size,
without caring about the the size of "origin", we can avoid creating a
"COW" file of the same size as the "origin". This is really useful,
when using as cow_device= a filesystem that is VFAT where sparse files
are not supported, so if root-image.fs is 1000M, passing cowfile_size=25%
will create a root-image.cow of 250M instead of 1000M.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-10-13 14:40:41 -03:00
Pierre Schmitz
a5e942a5c0 Revert "Fix typo in shebang"
This reverts commit 6f68bec907.

Using ash was actually correct as only this shell is available in initramfs.
It was the commit message of 27940c420f that was wrong
2012-10-06 11:08:44 +02:00
Pierre Schmitz
6f68bec907 Fix typo in shebang 2012-10-06 10:56:05 +02:00
Pierre Schmitz
76f275e993 Use tmpfs for /etc/pacman.d/gnupg instead of a symlink to /run
This fixes FS#31815

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-10-06 00:24:24 +02:00
Gerardo Exequiel Pozzi
5df61f0c9e [archiso] Rework Makefile / Reorder files
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-08-25 15:14:51 -03:00
Gerardo Exequiel Pozzi
b629c4a4ad [archiso] Always copytoram for NFS
Avoids problems on shutdown (and during normal usage if networks settings changed)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-08-25 15:14:51 -03:00
Gerardo Exequiel Pozzi
6fae221c28 [archiso] Always copytoram for NBD
Avoid issues on shutdown (and during normal usage if network settings changed)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-08-25 15:14:51 -03:00
Pierre Schmitz
4a33b67542 Move Makefile to project root to avoid issues with git archive
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-08-03 22:36:22 +02:00
Gerardo Exequiel Pozzi
ab7c443a4a [archiso] Replace rsync with cp
It does not make sense, since filesystem inside the imege is re-formated.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-08-01 20:16:45 -03:00
Florian Pritz
a2d2022ccf archiso_pxe_http: curl should follow redirects
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-01 20:16:45 -03:00
Pierre Schmitz
281234509f Add dist function to Makefile
This dist function creates a tar archive of a tag.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-07-31 19:52:09 -03:00
Gerardo Exequiel Pozzi
36a2496fad [archiso] archiso_pxe_common: /lib -> /usr/lib
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-07-24 21:20:29 -03:00
Gerardo Exequiel Pozzi
ac2d67929b [archiso] Update Makefile
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-07-24 18:54:28 -03:00
Gerardo Exequiel Pozzi
56c2e88913 [archiso] Remove testiso from Makefile
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-07-23 11:49:29 -03:00
Gerardo Exequiel Pozzi
8312642050 [archiso] Remove testiso script
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-07-22 20:29:18 -03:00
Gerardo Exequiel Pozzi
a1424446a1 [archiso] Add btrfs support as filesystem for *.fs.sfs
Implements FS#30378

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-07-20 17:31:20 -03:00
Gerardo Exequiel Pozzi
5ea02f68fe [archiso] archiso_shutdown: use run_cleanuphook()
Simplify build process, using the same method like in shutdown hook by mkinitcpio
we still need a custom shutdown script for archiso,
since "twisted" structure of block devices.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-07-17 02:25:18 -03:00
Gerardo Exequiel Pozzi
8e9c65fa5d [archiso] mkarchiso: improve info messages
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-05-29 23:48:24 -03:00
Gerardo Exequiel Pozzi
0b39407e68 [archiso] archiso_pxe_common: add copy_resolvconf= boot option 2012-05-29 23:48:15 -03:00
Gerardo Exequiel Pozzi
36e8d6322f [archiso] use new mkinitcpio API in hooks
Needs mkinitcpio >= 0.9.0

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-05-19 15:29:17 -03:00
Gerardo Exequiel Pozzi
c1ecc9b604 [archiso] archiso_pxe_nfs hook: /lib -> /usr/lib
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-05-03 00:18:06 -03:00
Gerardo Exequiel Pozzi
f844c7ed45 [archiso] Update install hook to new device-mapper udev rules location
device-mapper >= 2.02.95-2

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-04-26 22:08:34 -03:00
Gerardo Exequiel Pozzi
c816a33d0e [archiso] Canonicalize path to dm-devices in used_block_devices
All devices listed at used_block_devices, now are canonicalized.

Fix FS#29538

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-04-19 12:06:07 -03:00
Gerardo Exequiel Pozzi
f12097b2c4 [archiso] mkarchiso: add new pkglist command.
This command makes a list of installed packages on root-image,
on <ISO>/$archisobasedir/pkglist.$arch.txt with the format
<repo>/<package>-<version>

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-04-09 17:41:12 -03:00
Gerardo Exequiel Pozzi
fbb6272b86 [archiso] adjust archiso hook for udev>=181-9
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-04-05 20:05:21 -03:00
Gerardo Exequiel Pozzi
9069e2c103 [archiso] mkarchiso: optionally add EFI "El Torito" boot support.
If EFI/archiso/efiboot.img exists then an alternative "El Torito"
boot image is added to the ISO image compatible for EFI.
This image is a FAT filesystem, that is interpreted by EFI as ESP
(EFI System Partition).

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-04-01 12:04:00 -03:00
Gerardo Exequiel Pozzi
67096caef2 [archiso] Re-order and use long xorrisofs options.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-04-01 11:06:29 -03:00
Gerardo Exequiel Pozzi
eed6c84e40 [archiso] Set a safe locale to C
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-17 13:47:09 -03:00
Gerardo Exequiel Pozzi
911888b150 [archiso] Improve help message of mkarchiso
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-17 13:39:40 -03:00
Gerardo Exequiel Pozzi
3d05bef2b9 [archiso] Implement own chroot functions in mkarchiso
* Remove devtools dependency.
* Better control over what files are touched inside chroot (root-image).
  Now: NONE :)
* Two new commands:
  + init: To install {base} group and other needed packages (syslinux for now)
  + run: If we want to run some command inside chroot
         (mkinitcpio, locale-gen, useradd, etc etc...)
* Renamed command: "created" to "install", says much better what does.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-16 02:15:59 -03:00
Gerardo Exequiel Pozzi
ab5d67fe43 [archiso] archiso_shutdown: Avoid mtab warning (not found)
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-15 23:43:58 -03:00
Gerardo Exequiel Pozzi
6f9c629393 [archiso] Copy "mount" in archiso_shutdown
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-15 23:25:20 -03:00
Gerardo Exequiel Pozzi
1f66a737de [archiso] /lib/initcpio -> /usr/lib/initcpio
Needs mkinitpcio >= 0.8.4

Next changes will be for mdadm and mkinitcpio-nfs-utils:
* /lib/initcpio/udev/11-dm-initramfs.rules
* /lib/initcpio/ipconfig , /lib/initcpio/nfsmount

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-04 21:04:37 -03:00
Gerardo Exequiel Pozzi
4f79083856 [archiso] Remove uneeded /run/archiso/img_dev_loop
Superseded by /run/archiso/used_block_devices

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-23 00:50:35 -03:00
Gerardo Exequiel Pozzi
354a202bcc [archiso] Update archiso_shutdown hook
* Add libraries from /usr/lib and /sbin/losetup.
* Use used_block_devices to detach loop devices.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-23 00:01:17 -03:00
Gerardo Exequiel Pozzi
5123b25aa1 [archiso] Add /run/archiso/used_block_devices
This list includes block devices of:
* Boot medium [archisodevice] (only if no copytoram= is used)
* Loop medium [img_dev] (only if no copytoram= is used)
* COW space [cowdevice] (only if cowdevice= is used (no tmpfs is used))
* Loop devices used for SquashFS images.
* Loop devices used for device-mapper devices (two per each dm-device, one RO{*.fs} and one RW{*.cow})

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-22 23:46:14 -03:00
Gerardo Exequiel Pozzi
f0b4c35337 [archiso] Use losetup/mount instead of mount directly *.sfs
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-22 21:18:15 -03:00
Gerardo Exequiel Pozzi
e6c885d29f [archiso] Setup ro loop devs as read-only
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-22 21:18:15 -03:00
Gerardo Exequiel Pozzi
9703564262 [archiso] Use _mnt_dev() for SquashFS and dm-mapper
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-22 21:18:15 -03:00
Gerardo Exequiel Pozzi
bc4731a0d3 [archiso] Remove uneeded ;
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-22 21:18:15 -03:00
Gerardo Exequiel Pozzi
27940c420f [archiso] Misc style cleanups
* Add #!/bin/bash to install hooks and fixed vimlines.
* Removed empty variables.
* Reorder variables, adjust brace/parens in functions.
* Removed things implemented in base hook (/tmp, /etc/fstab).

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-22 21:18:07 -03:00
Gerardo Exequiel Pozzi
c593c2bd24 [archiso] Avoid full path in add_binary
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-02-03 10:58:01 -03:00
Gerardo Exequiel Pozzi
0720ac9bd4 [archiso] Refactor: Use losetup from util-linux
New losetup from util-linux 2.21 uses new /dev/loop-control from Linux 3.1.

Needs mkinitcpio-0.8.2+ (provides modules.devname, or workaround with earlymodules=loop)

Get advantages from it! Removing custom shell code.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-01-11 04:44:41 -03:00
Gerardo Exequiel Pozzi
36f327c6d4 [archiso] simplify _mnt_fs() and _mnt_sfs()
mount is now from util-linux (like in e135003c13)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-01-05 17:58:12 -03:00
Gerardo Exequiel Pozzi
2b211a9017 [archiso] Make fstab from initramfs
This is needed for initscripts 2012.01, at least the entry for /.
Otherwise / is remounted ro, but not remounted rw later.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-01-05 17:58:12 -03:00
Gerardo Exequiel Pozzi
882d9fa5ec [archiso] update testiso
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-12-16 16:27:17 -03:00
Gerardo Exequiel Pozzi
dceb5a029f [archiso] Rename archiso_curl_url= to archiso_http_srv=
Also rename curlspace_size= to archiso_http_spc=

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-12-04 17:18:06 -03:00
Gerardo Exequiel Pozzi
9ca157c140 [archiso] archiso_pxe_curl rename to archiso_pxe_http
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-12-03 18:08:57 -03:00
Gerardo Exequiel Pozzi
92dbba6c11 [archiso] Cleanup: pxe_curl: Remove download-iso-loopback support.
This was the first implementation that downloads the complete ISO,
but now we have the posibility of download only needed *.sfs files.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-12-03 17:45:45 -03:00
Gerardo Exequiel Pozzi
305bca4692 [archiso] Cleanup: Remove *.fs support.
This was useful to me during development of dm-snapshot support
to create very quickly isos without wating for SquashFS compression.

Is time to remove this, I think the is no practical usage,
and make the code a bit more simple.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-12-03 11:22:03 -03:00
Gerardo Exequiel Pozzi
3df0be6a22 [archiso] Do not use PXE NBD as default.
* Now we have more than one PXE boot methods.
* archiso_ndb_srv= accepts special ${pxeserver} parameter like in others PXE hooks.
* This allows to setup network from initramfs without forcing using a special PXE hook.
* Update README

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-12-02 14:12:16 -03:00
Thomas Bächler
cd91ad28b0 Add common KMS modules to the releng initramfs image.
On machines with common graphics chipsets (radeon, intel, nvidia), enable
KMS early. Downloading images from a remote server can take time, better
view the status with a nice resolution.
2011-11-29 09:53:22 -03:00
Gerardo Exequiel Pozzi
f3a3526ab0 [archiso] Fix libnss symlinks.
Otherwise does not work.

22100 Nov 29 09:29 ./lib/libnss_dns-2.14.1.so
   20 Nov 29 09:29 ./lib/libnss_dns.so.2 -> libnss_dns-2.14.1.so
46732 Nov 29 09:29 ./lib/libnss_files-2.14.1.so
   22 Nov 29 09:29 ./lib/libnss_files.so.2 -> libnss_files-2.14.1.so

Looks like my test was made before introducing symlinks
and using directly libnss_dns-$VERSION.so.2 as libnss_dns.so.2.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-29 09:42:46 -03:00
Gerardo Exequiel Pozzi
5b9eba924d [archiso] Add checksum support to pxe_curl
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 12:28:03 -03:00
Gerardo Exequiel Pozzi
cd359bc37a [archiso] Checksum only aitab and *.sfs (per architecture)
We are currently checksuming all files inside $archisobasedir
(aitab, *sfs, kernel/initramfs and boot/syslinux related files)
this is stored in one file only. Its works good for now,
but I think we only need to checksum only aitab and *.sfs if they are needed.
Currently if you boot a dual-iso in i686, also checksum is done
for *.sfs of x86_64. Not a big issue, this just take a bit more time.
The real issue is when booting via PXE with HTTP/FTP methods,
since they download only aitab and needed *.sfs files,
can not use directly the only one file where checksums are stored.

This patch does:

(1) Do not checksum syslinux related files, anyway you are already reach initramfs stage.
(2) Do not checksum kernel/initramfs files, for the same as (1)
(3) Two checksum.${arch}.md5 for each i686 and x86_64 for only aitab and *.sfs.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 12:28:03 -03:00
Gerardo Exequiel Pozzi
8bd067461d [archiso] Add DNS resolver support to archiso_pxe_common
[ramfs /]# cat /etc/resolv.conf
nameserver 192.168.0.77
[ramfs /]# curl -O http://releng.archlinux.org/pxeboot/README
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1129  100  1129    0     0   2191      0 --:--:-- --:--:-- --:--:--  4589
[ramfs /]#

Do not "add_binary /lib/libnss_dns.so.2", because will add libnss_dns-VERSION.so.2 as libnss_dns.so.2
Is not an issue will work (nobody links directly to VERSION), but is not nice.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 12:28:03 -03:00
Gerardo Exequiel Pozzi
76dea1654e [archiso] Add PXE NFS support
It add support for using *.sfs images via NFS.

It must be located after archiso_pxe_nbd in mkinitcpio.conf, in that way
NBD is the default.

New boot parameters:

    archiso_nfs_srv=IP:/path
         Set the NFS IP and path. Accepts ${pxeserver} as IP.

    archiso_nfs_opt= Sets NFS mount opts (comma separated)
                    Defaults to:
                      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

:: Running Hook [archiso_pxe_common]
IP-Config: eth0 hardware address 52:54:00:12:34:57 mtu 1500
IP-Config: eth0 guessed broadcast address 192.168.0.255
IP-Config: eth0 guessed nameserver address 192.168.0.218
IP-Config: eth0 complete (from 192.168.0.218):
 address: 192.168.0.90     broadcast: 192.168.0.255    netmask: 255.255.255.0
 gateway: 192.168.0.218    dns0     : 192.168.0.218    dns1   : 0.0.0.0
 rootserver: 192.168.0.218 rootpath:
 filename  :
:: Running Hook [archiso_pxe_nbd]
:: Running Hook [archiso_pxe_curl]
:: Running Hook [archiso_pxe_nfs]
:: Mounting '192.168.0.77:/mnt/iso'

...
192.168.0.77:/mnt/iso/ on /run/archiso/bootmnt type nfs (rw,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,nolock,proto=tcp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.77)
...

My /etc/exports
/mnt/iso 192.168.0.90(ro,no_subtree_check,no_root_squash)
2011-11-28 12:28:03 -03:00
Gerardo Exequiel Pozzi
8eb4c624dc [archiso] Add archiso_pxe_curl hook
Its add support for downloading the ISO image via HTTP/FTP with curl or download *.sfs files.
The files are downloaded on /run/archiso/curlspace (tmpfs) and setup a loop dev from it
(like in archiso_loop_mnt) in the ISO case, or just do a bind mount to
/run/archiso/bootmnt in the other case.

This hook must be located after archiso_pxe_nbd in mkinitcpio.conf, in that way
NBD is the default.

New bootparm:
* archiso_curl_url=(first form)
    archiso_curl_url=http://192.168.0.7/archlinux/iso/archlinux.iso (absolute form)
        Use an absolute URL. Fetch the entire ISO
    archiso_curl_url=ftp://${pxeserver}/archlinux/iso/archlinux.iso (relative form)
        Use the as IP the same server where PXE reside.  Fetch the entire ISO

* archiso_curl_url=(second form)
    archiso_curl_url=http://192.168.0.7/archlinux/iso/unpacked (absolute form)
        Use an absolute URL. Where unpacked (an example name) is a directory where
        ${archisobasedir} ("arch" by default) is located with all *.sfs.
        This fetch only needed files.
    archiso_curl_url=ftp://${pxeserver}/archlinux/iso/unpacked (relative form)
        Use the as IP the same server where PXE reside. Where unpacked (an example name)
        is a directory where ${archisobasedir} ("arch" by default)
        is located with all *.sfs. This fetch only needed files.

* curlspace_size= Set a size for a tmpfs filesystem where files are downloaded.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 12:28:03 -03:00
Gerardo Exequiel Pozzi
1edaf15cef [archiso] Split archiso_pxe_nbd in two hooks.
One hook only setup the network device (archiso_pxe_common) the other
setup the NBD client (archiso_pxe_nbd).

New bootparam:
    archiso_pxe_srv=IP
        Allow to set an IP different from the PXE server.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 12:28:03 -03:00
Gerardo Exequiel Pozzi
334db092b5 [archiso] Check if /run/archiso/bootmnt is a mountpoint.
In this way allow to mount /run/archiso/bootmnt from another hook,
but still use the logic from the main mount_hook, skipping only this mount.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 10:35:05 -03:00
Gerardo Exequiel Pozzi
f097724080 [archiso] Only accepts aitab inside
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 10:35:05 -03:00
Gerardo Exequiel Pozzi
e03ed816e0 [archiso] Use different logic when archisodevice == cow_device
* Now bootmnt/img_dev is always a ro-mount,
  and cowspace is first ro-mount then rw-mount.

* Fix a "hidden" bug: at the time of test [[ -ef ]], if devices nodes
  are not ready, such test will fail then archisodevice will mounted ro and
  when cow_device is mounted to be rw it fails.
  (I recently suffered this on a machine with slow USB)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 10:35:05 -03:00
Gerardo Exequiel Pozzi
e135003c13 [archiso] simplify _mnt_dev() (mount is now from util-linux)
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-28 10:35:05 -03:00
Gerardo Exequiel Pozzi
baf0ae0013 [archiso] Do not bind mount on /bootmnt
Boot media is already available in /run/archiso/bootmnt
if no copytoram is used.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-16 23:18:41 -03:00
Gerardo Exequiel Pozzi
da813e5b9d [hooks/archiso_pxe_nbd] Refactor, remove sed usage.
* ipconfig cmd writes a file in /tmp that is ready for direct evaluation.
We can use this instead of parsing the output, to do this some variable
renames are needed.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-16 16:37:04 -03:00
Gerardo Exequiel Pozzi
7ab83b8571 [hooks/archiso_pxe_nbd] Remove grep usage
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-15 19:37:10 -03:00
Gerardo Exequiel Pozzi
469b5b2c58 [archiso] install hook cleanups
* Remove IDE stuff.
* Remove modules that can be added via relevant hooks.
* Replace sata with virtio in baseline profile.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-11-05 21:03:35 -03:00
Gerardo Exequiel Pozzi
59ad1113d9 [archiso] Add archiso_shutdown hook.
STATUS: Working (std boot, loop_mnt, pxe) with copytoram=[y|n].

NEEDS: initscript > 2011.07.3, mkinitcpio > 0.7.2, mkinitcpio-busybox > 1.18.5-1

Purpose: we need this for propertly unmount $cow_device,
used for persistent dm-snapshot devices.

This hook is based on work from Tom Gundersen[#1],
but adapted for archiso things (specially the shutdown script)

[#1] http://mailman.archlinux.org/pipermail/arch-projects/2011-July/001549.html
[#2] http://projects.archlinux.org/initscripts.git/commit/?id=1fa7b4b453e96533ae1db3630031285e5fc302b3
[#3] http://mailman.archlinux.org/pipermail/arch-projects/2011-August/001749.html

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-23 21:24:18 -03:00
Gerardo Exequiel Pozzi
908551ef02 [archiso] Add support for img_label= and allow img_dev same as cow_dev
* Support img_label=
* Allow use img_dev= as cow_device=
* Use new function _mnt_dev() from archiso.
* Check for error while setting loopback device.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-23 21:24:17 -03:00
Gerardo Exequiel Pozzi
90fb8ea480 [archiso] Mount all fs on /run/archiso instead of /
This allow to take control again of these mountpoints outside initramfs.
(i.e: on deinitramfs stage at shutdown for unmount it)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-23 21:24:17 -03:00
Gerardo Exequiel Pozzi
e2055835fd [archiso] Allow persistent cow dm-snapshots.
Add some options to control where all COW files will be located.
Until this moment all files are located in a tmpfs filesystem.
Now is posible to set a device via a filesystem label or device node
plus a directory, where all these files will be stored.
All dm-snapshot devices will be persistent by default,
but this can be changed if wanted.

Take care, a filesystem that does not support sparse files maybe
is not the best choice for COW files, because they are created with
the same size (is apparent) like the read-only device (the image.fs inside .sfs).
Of course sooner or later, depending on use, these files actually end up
being as big as the read-only device.

KNOW-ISSUE: On shutdown in step "Unmounting Filesystems" will [FAIL],
    all filesystem except $cow_device, will be unmounted/remounted-ro.
    For this reason this change needs an archiso_shutdown hook, thats
    unmount all block devices used by archiso. (Work in progress)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-23 21:24:17 -03:00
Gerardo Exequiel Pozzi
91e11c30f4 [archiso] Add a new function _mnt_dev(), use it for mounting archisodevice.
Separate this code from main mount hook, and make it more generic.

_mnt_dev(device, mountpoint, flags) ->
    wait for device and mount, launch a shell if something goes wrong.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-23 21:24:17 -03:00
Gerardo Exequiel Pozzi
51db47e74b [archiso] disable progress bar in mksquashfs
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-14 22:46:45 -03:00
Gerardo Exequiel Pozzi
bfef0bc1eb [archiso] Unify ->
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-12 14:40:19 -03:00
Gerardo Exequiel Pozzi
1dcf439c30 [archiso] Create /etc/mtab as symlink.
This is now supported since util-linux pkg enable it.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-03 21:12:56 -03:00