Commit Graph

100 Commits

Author SHA1 Message Date
Gerardo Exequiel Pozzi
830555f71a [archiso] Add nbd hook, to make posible boot archiso from PXE via a NBD.
nbd (network block device utilities) package is required. This package is in AUR
at this moment: http://aur.archlinux.org/packages.php?ID=9691
Also mkinitcpio-nfs-utils is required for ipconfig.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-17 11:12:46 -03:00
Gerardo Exequiel Pozzi
fc9a01e713 Remove archiso_early hook, use /dev/disk/by-label/${archisolabel} instead.
Takes the advantage of already symlinks created on /dev/disk/by-label/ by
60-persistent-storage.rules add by udev hook.

Tested on:
* Real machine as CD-ROM and USB key drive.
* KVM as CD-ROM and DISK (for both modes, in combination with IDE and SCSI)
* VirtualBox as IDE CD-ROM.

IMPORTANT note: Since isohybrid is a hack, if more partitions are added to
USB key drive, filesystem on these partitions MUST have LABEL, otherwise
USB key will fail to boot. Anyway there is an option archisodevice=,
to force and specific device where live-media reside.
(Maybe isohybrid will change the hack method used in a future)

More info at:
http://mailman.archlinux.org/pipermail/arch-releng/2010-March/000890.html
http://mailman.archlinux.org/pipermail/arch-releng/2010-March/000913.html

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-16 01:53:40 -03:00
Gerardo Exequiel Pozzi
56750f37ed Revert back isohybrid offset to default setting.
This revert back the commit 991a5c69.
This causes more problems than solving (fixing the warning issue in parted)

With the default offset 0:
* makes posibble to create others extra partitions on USB key
  and use them inside the live enviroment.
* makes posible to use /dev/disk/by-label/ symlinks.
  archiso_early hook, can be removed.

Note: archboot also uses the default offset 0.

More info at:
http://mailman.archlinux.org/pipermail/arch-releng/2010-March/000912.html
http://mailman.archlinux.org/pipermail/arch-releng/2010-March/000890.html

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-16 00:02:47 -03:00
Gerardo Exequiel Pozzi
827f6a3f2b Fixed msg about copying images to RAM
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-15 23:58:55 -03:00
Gerardo Exequiel Pozzi
1e868e0114 Add missing archiso_early on uninstall procedure at Makefile
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-14 03:18:30 -03:00
Gerardo Exequiel Pozzi
4609c1c2d0 Add -p to blkid in hooks, to bypass the cache like in udev rules.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-06 19:12:04 -03:00
Gerardo Exequiel Pozzi
4d37d70884 Split aufs mount command from _mnt_squashfs()
New function _mnt_aufs(). Don't display incorrect message (Adding new aufs...)
when no aufs branch is mounted, because mount type is bind.

Also, makes the code more clean :)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-01 10:59:11 -03:00
Gerardo Exequiel Pozzi
c65f463ce3 Welcome back copytoram= option
Fixes FS#17182: copytoram=y does not work with aufs

The solution is simple, just use a directory outside aufs tree.

* If copytoram=y, then another tmpfs is mounted but on /tmpfs.sqfs
* Add a new option: tmpfs_sqfs_size= (default to 75%)
* Lock cdrom drive is not locked if copytoram=y

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-03-01 10:39:01 -03:00
Gerardo Exequiel Pozzi
b7ca4bf281 Rename archiso-early hook to archiso_early
To make compatible with disablehooks= param. Since "hook_archiso-early"
is not a valid variable name.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-18 00:10:39 -03:00
Gerardo Exequiel Pozzi
be521f8658 Removed a non-working option: copytoram
Keep the code clean.
For more reference see FS#17182 to view what is the issue

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-17 19:24:27 -03:00
Gerardo Exequiel Pozzi
6462dc6e70 Fix coding style in archiso hook
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-17 19:23:27 -03:00
Gerardo Exequiel Pozzi
211f201644 Pass $newroot as part of the $mountpoint avoiding a global variable
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-17 19:09:00 -03:00
Gerardo Exequiel Pozzi
7d7dad06e2 Take advantage of module autoloading when mounting images as loop
* Make first /dev/loop0 device at archiso install hook.
* Remove unneeded losetup, all is done directly via mount.
* Images are now mounted on /tmpfs/mnt/image-name instead of
/tmpfs/mnt/loopN, removing unneeded counter.
* Add some variables to make code more readable.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-17 19:07:14 -03:00
Gerardo Exequiel Pozzi
59d7a39994 Drop to recovery shell when mounting main media filesystem fails.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-17 19:05:44 -03:00
Gerardo Exequiel Pozzi
b880be1ae9 Implement mount hook function in archiso hook.
Next version of mkinitcpio > 0.6.2 implements mount hook functionality.
So can avoid skipping normal flow of main init script, and removing common
end code with it.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-16 16:59:18 -03:00
Gerardo Exequiel Pozzi
991a5c6972 Fixed offset of partition on iso
Split from commit 00dda7d4 from Svenstaro repo: changed -offset for mkarchiso
from default 0 to 1 so that the other partition on the usb device can
still be edited after dd'ing to it

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-08 03:47:50 -03:00
Gerardo Exequiel Pozzi
5f0614b42f Remove special handling for vfat, all done via blkid
* Add archisodevide= boot option (suggested by brain0)
(if declared use it, if not use /dev/archiso created via udev rule)
* Removed redundant modprobe commands,
(modules are loaded automatically on mount -t)
* Other minor changes

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-06 19:27:16 -06:00
Gerardo Exequiel Pozzi
1baefc75a6 Update archiso hooks to work with next mkinitcpio 0.6
Some basic changes to make archiso hooks work with the next mkinitcpio 0.6
Tested under KVM, a ""2010.02"" and works fine with it.

NOTE: current mkinitcpio-0.5.99.2-2 does not include "losetup", maybe
will be included in next version, see #[1]. For now must be added manually.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-06 19:27:16 -06:00
Gerardo Exequiel Pozzi
19af41afb4 Fix indentation of previus commit
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-12-04 15:02:44 -03:00
Gerardo Exequiel Pozzi
5f8999e3ea Abort mkarchiso if isolinux.cfg is not found.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-12-02 02:35:26 -03:00
Gerardo Exequiel Pozzi
9350558f60 Removed unused gen_grubscan script and grub reference in mkarchiso
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-12-01 21:28:42 -03:00
Gerardo Exequiel Pozzi
ce454c4c72 Use 11 chars for fslabel for VFAT compatibility
Also use ARCH_YYYYMM format instead of random chars, removing pwgen dep.
Closing FS#14919.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-12-01 13:27:40 -08:00
Gerardo Exequiel Pozzi
2b9993073c Add an error message when mounting aufs fails, then exit 1
Closes FS#13381.

Waiting 30 seconds for device /dev/archiso ...
SUCCESS: Mounted archiso volume successfully.
squashfs: version 4.0 (2009/01/31) Phillip Lougher
aufs 2-standalone.tree-20090907
:: Mounting root (aufs) filesystem
aufs au_xino_do_write:371:mount[407]: I/O Error, write failed (4294967268)
aufs au_xino_set:1115:mount[407]: I/O Error, failed creating xino(-5).
mount: Invalid argument
ERROR: while mounting root (aufs) filesystem.
Kernel panic - not syncing: Attempted to kill init!

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-12-01 13:16:54 -08:00
Aaron Griffin
693f2ea0b8 More removal of old bootloader support
Only support syslinux now. Grub and other things can still
be managed manually by running mkisofs manually.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-11-30 15:14:27 -08:00
Sven-Hendrik Haase
f77ddc0e9c Removed pwgen dependency 2009-11-30 15:14:09 -08:00
Sven-Hendrik Haase
ca52931e3a mkarchiso: cleaned up to use isohybrid only 2009-11-30 13:15:33 -08:00
Sven-Hendrik Haase
961d4cb670 mkarchiso: cleanup opts, user dir creation
As in title, this patch cleans up opt flags that exist for no reason and
adds additional flags to modify the disk meta info which would otherwise
be hardcoded.

I wasn't quite sure about the user directory part but it doesn't seem
like a good idea to put that part into the script and therefore I
commented it out. It would probably interfere with rc.local scripts that
take care of skel copying. I replaced the part after the TODO with a
safe guard to make sure that people who are not aware of the changes
will not be caught by surprise.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-11-23 12:51:13 -08:00
Gerardo Exequiel Pozzi
ce2242da7e Silent modprobe loop loading in mkarchiso
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-11-19 03:37:29 -03:00
Gerardo Exequiel Pozzi
38d828f749 Only lock the optical drive if mounted from this
Check if FSTYPE is iso9660 or UDF, and only in this case look the optical drive.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-11-17 02:57:51 -03:00
Gerardo Exequiel Pozzi
ed97ef03a4 Rename ramdisk_size parameter to tmpfs_size to avoid conflict
Rename ramdisk_size parameter to tmpfs_size to avoid conflict with
the kernel parameter that is for old ramdisk based blockdevs (/dev/ramN)
and confusion to users.

The kernel parameter ramdisk_size=N is in "N * k size", while tmpfs
size=N is in "N * [ k | m | g ] byte size" or "in N% of RAM",
like is used by default on archiso.

This parameter is used only for tmpfs in size option.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-11-17 00:48:26 -03:00
Gerardo Exequiel Pozzi
f32a5c5b20 Avoid force/rebuild of squashfs images if already updated.
Check if there are any modification of files/directories inside
the target directory for squashfs image.

Implements in some way this item in TODO:
* Add 'needsupdate' function to check if a squashfs image in the
  iso dir is up to date, if so, skip it; else rebuild it. No more
  need for the -f flag

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-11-09 21:41:13 -03:00
Gerardo Exequiel Pozzi
3f1ee07d84 Support custom isomounts in archiso hook.
Implement this feature request:
FS#16835 - isomounts file whithin archiso hook is inflexible

Add an optional "isomounts" kernel command line parameter.
In this way, can have differents combinations of
kernels/ramdisk/filesystems.sqfs on the same media.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-10-26 02:02:59 -03:00
Gerardo Exequiel Pozzi
7dd1aa150d Fix small typo in install/archiso for initcpio
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-10-21 03:22:39 -03:00
Gerardo Exequiel Pozzi
db1dde541c Fix how mkarchiso makes usb image
The current implementation in how partition is created for ext2 img
it looks a bit bad.

This patch makes the partition in more standarized way, respecting
cylinder alignement:
* The size of resulting image will be in cylinder multiple ~8MB.
* Use fdisk instead of sfdisk (sfdisk write some bad information)
* Make the result image in one pass, instead of concatenating.

Also the advantage is that with this can add another partitions
without any issues in the usb-flash-drive with this .img.

For example of current situation:

qemu-system-x86_64 -hda archlinux-avr.toolchain.img -serial stdio
---------------------------------------------------------------------
[root@avr ~]# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 223 MB, 223974400 bytes
59 heads, 41 sectors/track, 180 cylinders
Units = cylinders of 2419 * 512 = 1238528 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         181      218693+  83  Linux
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 1, 1) logical=(0, 1, 23)
Partition 1 has different physical/logical endings:
     phys=(27, 58, 41) logical=(180, 49, 21)

Command (m for help): v
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 1, 1) logical=(0, 1, 23)
Partition 1 has different physical/logical endings:
     phys=(27, 58, 41) logical=(180, 49, 21)
Partition 1: previous sectors 437449 disagrees with total 67731
62 unallocated 512-byte sectors

Command (m for help):
---------------------------------------------------------------------

qemu-system-x86_64 -hda archlinux-avr.toolchain-fix.img -serial stdio
---------------------------------------------------------------------
[root@avr ~]# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 230 MB, 230307840 bytes
255 heads, 63 sectors/track, 28 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5c94ca4f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          28      224878+  83  Linux

Command (m for help): v
62 unallocated 512-byte sectors
---------------------------------------------------------------------

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-10-21 00:46:39 -03:00
Gerhard Brauer
fd93e7c9bd Added vfat support to mount /dev/archiso
fstype from klibc don't detect a vfat formatted blockdevice when try to
mount /dev/archiso to /bootmnt. Some users don't use the recommened
method with dd to bring the image to their USB stick. If they for ex.
use Unetbootin to put the iso image on their (v)fat formatted stick they
got lost with a kernel panic cause fstype won't detect vfat, so the
mount and the later squashfs bindings traps.

Signed-off-by: Gerhard Brauer <gerbra@archlinux.de>
2009-08-25 15:54:10 +02:00
Aaron Griffin
1dbbd6afcb Fix mount loop test for bindings
test -f will fail if we wanted to bind to a directory,
so use test -r instead.

See FS#15356

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-10 12:05:15 -07:00
Aaron Griffin
2aca746d58 Ensure bootmnt is bound properly into device root
Missing slash caused bootmnt to be bound to /real_rootbootmnt
instead of /real_root/bootmnt

See FS#15356

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-10 12:03:25 -07:00
Gerhard Brauer
8d57752ced Use a label when generating the image and pass it to the commandline
This will generate a label ARCHISO_$randomstring using the pwgen
utility and add this label to the kernel command line.
A new label will be generated for each image, so it can be uniquely
identified.
Patch from brain0 <thomas@archlinux.org>

Signed-off-by: Gerhard Brauer <gerbra@archlinux.de>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-27 11:03:38 -07:00
Gerhard Brauer
9794a6fb7c Use the archisolabel= command line option to mount the archiso device.
If the archisolabel= option is specified on the kernel commandline,
a device /dev/archiso will be created and will be used to boot the
live system.
Patch from brain0 <thomas@archlinux.org>

Signed-off-by: Gerhard Brauer <gerbra@archlinux.de>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-27 11:03:38 -07:00
Gerhard Brauer
73dc6b4b1b Enabled -C option in mkarchiso
This flag allows to specify a own pacman.conf using during mkarchiso.

Signed-off-by: Gerhard Brauer <gerbra@archlinux.de>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-27 11:03:38 -07:00
Gerhard Brauer
d49b3da829 Fix mkisofs quiet parameter
Option syntax for quiet mode in mkisofs has changed

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-29 10:34:02 -07:00
Sven-Hendrik Haase
6be0f68611 Fix a typo in the archiso hook
remount,append=: should be remount,append:

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-12 07:28:57 -07:00
Sven-Hendrik Haase
da5452723e Updated deps, Makefile, TODO
Done to better reflect and indicate current progress.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-08 14:32:06 -07:00
Aaron Griffin
71d8575fae Replace aufs 'add' with 'append'
Change via AUR package

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-08 12:36:28 -07:00
Aaron Griffin
91fb1fef4f Missed aufs module in mkinitcpio install script
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-04-17 09:19:15 -07:00
Aaron Griffin
8d10415b04 Replace unionfs with aufs
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-04-14 14:38:11 -05:00
Aaron Griffin
b3d8310dcb Fix a typo in the archiso-early hook
Wrong slash! No idea how that happened :)

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-30 10:50:43 -08:00
Aaron Griffin
f852276274 Increment usbdelay by 1 before sleeping
This should give us *just a bit* more delay before actually trying to do
things with the usb devices. Annoying, but will probably be effective

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-29 09:08:36 -08:00
Loui Chang
7a98a216de Fix typos, formatting, and vague language where possible.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
[Fixed menu.lst: LiveCD -> Live CD -aaron]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-26 22:10:09 -06:00
Aaron Griffin
8a37489379 Advanced USB delay handling
USB boot delay is now handled with the usbdelay kernel param (default=0)

We use the built in delay of usb-storage to control this. by setting the
module's delay param. If your USB device doesn't work on first boot, try
setting usbdelay=10 or so

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-24 20:17:54 -06:00