[arch-releng] [PATCH] Update archiso hooks to work with next mkinitcpio 0.6

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Thu Feb 4 21:00:29 EST 2010


On 02/04/2010 08:28 PM, Thomas Bächler wrote:
> Am 04.02.2010 23:00, schrieb Gerardo Exequiel Pozzi:
>    
>> 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 at yahoo.com.ar>
>> ---
>>   archiso/hooks/archiso       |   22 ++++++++++++----------
>>   archiso/hooks/archiso-early |    2 +-
>>   2 files changed, 13 insertions(+), 11 deletions(-)
>>
>> diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
>> index bed8f7a..5b102d7 100644
>> --- a/archiso/hooks/archiso
>> +++ b/archiso/hooks/archiso
>> @@ -9,7 +9,7 @@ _mnt_bind()
>>   # args: /path/to/image_file
>>   _mnt_squashfs()
>>   {
>> -    /bin/modprobe -q loop>/dev/null 2>&1
>> +    /sbin/modprobe -q loop>/dev/null 2>&1
>>
>>       img="${1}"
>>       base_img="${img##*/}";
>> @@ -27,7 +27,7 @@ _mnt_squashfs()
>>       while [ ! -e "/dev/loop${LOOP_NUM}" ]; do
>>           sleep 1
>>       done
>> -    if ! /bin/losetup "/dev/loop${LOOP_NUM}" ${img}; then
>> +    if ! /sbin/losetup "/dev/loop${LOOP_NUM}" ${img}; then
>>           echo "ERROR: Cannot mount loop device /dev/loop${LOOP_NUM}"
>>           break
>>       fi
>>      
> My local config already has losetup, it's just not commited yet.
>    
Perfect!
>    
>> @@ -70,7 +70,7 @@ run_hook ()
>>         PS1="ramfs$ " /bin/sh -i
>>       done
>>
>> -    eval $(fstype<  /dev/archiso 2>/dev/null)
>> +    FSTYPE=$(blkid -o value -s TYPE /dev/archiso 2>/dev/null)
>>       if [ -n "${FSTYPE}" ]; then
>>           if [ "${FSTYPE}" = "unknown" ]; then
>>               # First try mounting then with vfat, maybe someone put the image on
>>      
> We can revert Gerhard's last commit now, blkid will detect vfat just
> fine, while klibc/fstype didn't.
>    
I suspected that you say, archiso hook will look a bit smaller. :)
>    
>> diff --git a/archiso/hooks/archiso-early b/archiso/hooks/archiso-early
>> index d57b73b..edd554b 100644
>> --- a/archiso/hooks/archiso-early
>> +++ b/archiso/hooks/archiso-early
>> @@ -2,7 +2,7 @@
>>   run_hook ()
>>   {
>>     if [ -n "${archisolabel}" ]; then
>> -    echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", IMPORT{program}=\"vol_id --export \$tempnode\"">  /lib/udev/rules.d/00-archiso-device.rules
>> +    echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", IMPORT{program}=\"/sbin/blkid -o udev \$tempnode\"">  /lib/udev/rules.d/00-archiso-device.rules
>>       echo "ENV{ID_FS_LABEL_ENC}==\"${archisolabel}\", SYMLINK+=\"archiso\"">>  /lib/udev/rules.d/00-archiso-device.rules
>>     fi
>>   }
>>      
> I was thinking about dropping the special udev rule and using blkid to
> find the right device, it has an option for that. I also thought about a
> failsafe mechanism in case the label is incorrect.
>    
This sound interesting. Are you talking about blkid -t LABEL="xyz" ?
> For now, we can apply this patch as it is, but we should base it on
> archiso with commit fd93e7c9bd614a026f1d661f359012a4c1e080d7 reverted,
> as per the comment above.
>
>    
Good. Anyway the idea of this patch is "to improvise" (I missed [RFC] in 
the title), doing only trivial changes to make things just works, 
details will come :)

http://github.com/djgera/archiso/tree/experimental [based on "master" 
and "djgera" (things pending for master)]


Thanks for your feedback.

-- 
Gerardo Exequiel Pozzi ( djgera )
http://www.djgera.com.ar
KeyID: 0x1B8C330D
Key fingerprint = 0CAA D5D4 CD85 4434 A219  76ED 39AB 221B 1B8C 330D



More information about the arch-releng mailing list