[arch-releng] [DRAFT] [archiso] Add archiso_shutdown hook.

Thomas Bächler thomas at archlinux.org
Fri Aug 26 03:00:54 EDT 2011


Am 26.08.2011 07:49, schrieb Gerardo Exequiel Pozzi:
> On 08/24/2011 08:23 PM, Gerardo Exequiel Pozzi wrote:
>> STATUS:
>>      Works for standard boot and with cow_device :)
>> TODO:
>>      Testing needed for archiso_loop_mnt and archiso_pxe_nbd
>>      Also for copytoram=y, and mix of options/hooks.
>> NEEDS:
>>      This commit [#2] in initscripts to work (no release at this time).
>>      Also this other [#3] for mkinitcpio (fix /run that is mounted as
>> noexec)
>>
>> This hook is based on work from Tom Gundersen[#1], but adapted for
>> archiso things.
>>
>> Motivation for this is for unmount property all filesystem, mostly for
>> dm-snapshot persistent.
>>
>> [#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
>>
> 
>> +
>> +# Lazy unmount /oldroot and all things inside.
>> +umount -l /oldroot
>> +
>> +# Remove all dm-snapshot devices.
>> +dmsetup remove_all
>> +
>> +# Detach each loop device in reverse order (archiso start from 100 to
>> N).
>> +for _lup in $(ls -r /dev/loop???); do
>> +    losetup -d ${_lup}
>> +done
>> +
>>
> @Thomas: If you do not want lazy unmount, then these are the commands
> needed.

Looks good to me. I am not against lazy umount in principle, if you have
a way of making sure that the umount finished.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-releng/attachments/20110826/42117eae/attachment.asc>


More information about the arch-releng mailing list