[arch-releng] [RFC] [archiso] Populate /run/aif/AIF_IGNORE_DEVS with archiso virtual devices
The file /run/aif/AIF_IGNORE_DEVS can be used by AIF to filter the device list in the "Prepare Hard Drives" step. --- archiso/hooks/archiso | 4 ++++ archiso/hooks/archiso_loop_mnt | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 2635a4c..6d2eb07 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -19,6 +19,8 @@ _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 + mkdir -p /run/aif/ + echo /dev/loop${loop_dev_count} >> /run/aif/AIF_IGNORE_DEVS echo /dev/loop${loop_dev_count} } @@ -58,6 +60,8 @@ _mnt_fs() { rw_dev=$(_make_loop_dev "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} + mkdir -p /run/aif/ + echo /dev/mapper/${dm_snap_name} >> /run/aif/AIF_IGNORE_DEVS msg ":: Mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'" if ! mount "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" ; then diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index e52dc69..b326092 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,6 +28,8 @@ archiso_loop_mount_handler () { losetup -d ${_dev_loop} umount /run/archiso/img_dev else + mkdir -p /run/aif/ + echo ${_dev_loop} >> /run/aif/AIF_IGNORE_DEVS echo ${_dev_loop} > /run/archiso/img_dev_loop fi } -- 1.7.9
On 02/05/2012 08:32 AM, Thomas Bächler wrote:
The file /run/aif/AIF_IGNORE_DEVS can be used by AIF to filter the device list in the "Prepare Hard Drives" step. --- archiso/hooks/archiso | 4 ++++ archiso/hooks/archiso_loop_mnt | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 2635a4c..6d2eb07 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -19,6 +19,8 @@ _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 + mkdir -p /run/aif/ + echo /dev/loop${loop_dev_count}>> /run/aif/AIF_IGNORE_DEVS echo /dev/loop${loop_dev_count} }
@@ -58,6 +60,8 @@ _mnt_fs() { rw_dev=$(_make_loop_dev "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} + mkdir -p /run/aif/ + echo /dev/mapper/${dm_snap_name}>> /run/aif/AIF_IGNORE_DEVS
msg ":: Mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'" if ! mount "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" ; then diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index e52dc69..b326092 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,6 +28,8 @@ archiso_loop_mount_handler () { losetup -d ${_dev_loop} umount /run/archiso/img_dev else + mkdir -p /run/aif/ + echo ${_dev_loop}>> /run/aif/AIF_IGNORE_DEVS echo ${_dev_loop}> /run/archiso/img_dev_loop fi } This does not fit with future "[archiso] Refactor: Use losetup from util-linux" [#1].
I guess should also add device node where /dev/disk/by-label/ARCH_ points to. Anyway, I prefer to call /run/archiso/block_devices (or something like that) [#1] http://mailman.archlinux.org/pipermail/arch-releng/2012-January/002347.html -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 05.02.2012 15:51, schrieb Gerardo Exequiel Pozzi:
On 02/05/2012 08:32 AM, Thomas Bächler wrote:
The file /run/aif/AIF_IGNORE_DEVS can be used by AIF to filter the device list in the "Prepare Hard Drives" step. --- archiso/hooks/archiso | 4 ++++ archiso/hooks/archiso_loop_mnt | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 2635a4c..6d2eb07 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -19,6 +19,8 @@ _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 + mkdir -p /run/aif/ + echo /dev/loop${loop_dev_count}>> /run/aif/AIF_IGNORE_DEVS echo /dev/loop${loop_dev_count} }
@@ -58,6 +60,8 @@ _mnt_fs() { rw_dev=$(_make_loop_dev "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} + mkdir -p /run/aif/ + echo /dev/mapper/${dm_snap_name}>> /run/aif/AIF_IGNORE_DEVS
msg ":: Mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'" if ! mount "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" ; then diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index e52dc69..b326092 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,6 +28,8 @@ archiso_loop_mount_handler () { losetup -d ${_dev_loop} umount /run/archiso/img_dev else + mkdir -p /run/aif/ + echo ${_dev_loop}>> /run/aif/AIF_IGNORE_DEVS echo ${_dev_loop}> /run/archiso/img_dev_loop fi } This does not fit with future "[archiso] Refactor: Use losetup from util-linux" [#1].
That wasn't on the main archiso tree.
I guess should also add device node where /dev/disk/by-label/ARCH_ points to.
Yes, the boot device should be added as well.
Anyway, I prefer to call /run/archiso/block_devices (or something like that)
AIF is not supposed to depend on archiso, so an aif-specific path like /run/aif/ would be best IMO.
On 02/05/2012 12:01 PM, Thomas Bächler wrote:
Am 05.02.2012 15:51, schrieb Gerardo Exequiel Pozzi:
On 02/05/2012 08:32 AM, Thomas Bächler wrote:
The file /run/aif/AIF_IGNORE_DEVS can be used by AIF to filter the device list in the "Prepare Hard Drives" step. --- archiso/hooks/archiso | 4 ++++ archiso/hooks/archiso_loop_mnt | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 2635a4c..6d2eb07 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -19,6 +19,8 @@ _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 + mkdir -p /run/aif/ + echo /dev/loop${loop_dev_count}>> /run/aif/AIF_IGNORE_DEVS echo /dev/loop${loop_dev_count} }
@@ -58,6 +60,8 @@ _mnt_fs() { rw_dev=$(_make_loop_dev "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} + mkdir -p /run/aif/ + echo /dev/mapper/${dm_snap_name}>> /run/aif/AIF_IGNORE_DEVS
msg ":: Mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'" if ! mount "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" ; then diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index e52dc69..b326092 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,6 +28,8 @@ archiso_loop_mount_handler () { losetup -d ${_dev_loop} umount /run/archiso/img_dev else + mkdir -p /run/aif/ + echo ${_dev_loop}>> /run/aif/AIF_IGNORE_DEVS echo ${_dev_loop}> /run/archiso/img_dev_loop fi } This does not fit with future "[archiso] Refactor: Use losetup from util-linux" [#1]. That wasn't on the main archiso tree.
I guess should also add device node where /dev/disk/by-label/ARCH_ points to. Yes, the boot device should be added as well.
Anyway, I prefer to call /run/archiso/block_devices (or something like that) AIF is not supposed to depend on archiso, so an aif-specific path like /run/aif/ would be best IMO.
AIF is supposed to run on any enviroment. Is the work of AIF to find how each enviroment is setup. You can run any installer inside archiso (there are some interesting and simple scripts contributed in our community). -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Sun, 05 Feb 2012 12:20:55 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
AIF is supposed to run on any enviroment. Is the work of AIF to find how each enviroment is setup.
This seems a bit exaggerated to me.
You can run any installer inside archiso (there are some interesting and simple scripts contributed in our community).
okay so several installers can run in archiso and aif can run in several environments. then we name it without using archiso NOR aif, something like: /run/installer-ignore-devs ?
On 02/07/2012 04:46 AM, Dieter Plaetinck wrote:
On Sun, 05 Feb 2012 12:20:55 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
AIF is supposed to run on any enviroment. Is the work of AIF to find how each enviroment is setup. This seems a bit exaggerated to me.
You can run any installer inside archiso (there are some interesting and simple scripts contributed in our community).
okay so several installers can run in archiso and aif can run in several environments. then we name it without using archiso NOR aif, something like:
/run/installer-ignore-devs
?
ok -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 02/09/2012 12:33 AM, Gerardo Exequiel Pozzi wrote:
On 02/07/2012 04:46 AM, Dieter Plaetinck wrote:
On Sun, 05 Feb 2012 12:20:55 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
AIF is supposed to run on any enviroment. Is the work of AIF to find how each enviroment is setup. This seems a bit exaggerated to me.
You can run any installer inside archiso (there are some interesting and simple scripts contributed in our community).
okay so several installers can run in archiso and aif can run in several environments. then we name it without using archiso NOR aif, something like:
/run/installer-ignore-devs
?
ok
Or a better thing: In archiso* hooks make /run/archiso/used_block_devices and from archiso "releng" profile symlink /run/installer-ignore-devs -> /run/archiso/used_block_devices via tmpfiles. In this way, we keep everything in its place and all happy :) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Mon, 13 Feb 2012 19:01:41 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
On 02/09/2012 12:33 AM, Gerardo Exequiel Pozzi wrote:
On 02/07/2012 04:46 AM, Dieter Plaetinck wrote:
On Sun, 05 Feb 2012 12:20:55 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
AIF is supposed to run on any enviroment. Is the work of AIF to find how each enviroment is setup. This seems a bit exaggerated to me.
You can run any installer inside archiso (there are some interesting and simple scripts contributed in our community).
okay so several installers can run in archiso and aif can run in several environments. then we name it without using archiso NOR aif, something like:
/run/installer-ignore-devs
?
ok
Or a better thing:
In archiso* hooks make /run/archiso/used_block_devices and from archiso "releng" profile symlink /run/installer-ignore-devs -> /run/archiso/used_block_devices via tmpfiles. In this way, we keep everything in its place and all happy :)
I don't really understand what you mean, but you know what you're talking about, so go ahead :) Dieter
NOTE: Not tested yet, but should work(tm). This list includes block devices of ( /run/archiso/used_block_devices ): * 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}) Aditionally all loop devices except for backing COW files, all are setup as read-only. In configs/releng profile, a symlink is made at boot-time for AIF: /run/aif/ignore_devs -> /run/archiso/used_block_devices --- archiso/hooks/archiso | 20 ++++++++++++++++---- archiso/hooks/archiso_loop_mnt | 3 ++- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..22b67e9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -10,7 +10,8 @@ _mnt_fs() { mkdir -p "${newroot}${mnt}" - ro_dev=$(losetup --find --show "${img}") + 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 @@ -30,6 +31,7 @@ _mnt_fs() { 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} @@ -39,6 +41,7 @@ _mnt_fs() { launch_interactive_shell else echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab + echo /dev/mapper/${dm_snap_name} >> /run/archiso/used_block_devices fi } @@ -46,7 +49,8 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" + local sfs_dev mkdir -p "${mnt}" @@ -60,7 +64,9 @@ _mnt_sfs() { msg "done." fi msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}" &> /dev/null ; then + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev} >> /run/archiso/used_block_devices + if ! mount -r "${sfs_dev}" "${mnt}" &> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -137,7 +143,12 @@ run_hook() { archiso_mount_handler() { local newroot="${1}" - mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + 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." @@ -170,6 +181,7 @@ archiso_mount_handler() { 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}..." diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..808100d 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -15,7 +15,7 @@ archiso_loop_mount_handler () { msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" - if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + 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 @@ -27,5 +27,6 @@ archiso_loop_mount_handler () { umount /run/archiso/img_dev else echo ${_dev_loop} > /run/archiso/img_dev_loop + echo $(readlink -f ${img_dev}) >> /run/archiso/used_block_devices fi } diff --git a/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices new file mode 100644 index 0000000..e2b9fc1 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_devs +} + +add_hook multi_end symlink_used_block_devices -- 1.7.9.1
On Tue, 21 Feb 2012 20:01:30 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
NOTE: Not tested yet, but should work(tm).
This list includes block devices of ( /run/archiso/used_block_devices ): * 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})
Aditionally all loop devices except for backing COW files, all are setup as read-only.
In configs/releng profile, a symlink is made at boot-time for AIF: /run/aif/ignore_devs -> /run/archiso/used_block_devices --- archiso/hooks/archiso | 20 ++++++++++++++++---- archiso/hooks/archiso_loop_mnt | 3 ++- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..22b67e9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -10,7 +10,8 @@ _mnt_fs() {
mkdir -p "${newroot}${mnt}"
- ro_dev=$(losetup --find --show "${img}") + 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 @@ -30,6 +31,7 @@ _mnt_fs() { 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}
@@ -39,6 +41,7 @@ _mnt_fs() { launch_interactive_shell else echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab + echo /dev/mapper/${dm_snap_name} >> /run/archiso/used_block_devices fi }
@@ -46,7 +49,8 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" + local sfs_dev
mkdir -p "${mnt}"
@@ -60,7 +64,9 @@ _mnt_sfs() { msg "done." fi msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}" &> /dev/null ; then + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev} >> /run/archiso/used_block_devices + if ! mount -r "${sfs_dev}" "${mnt}" &> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -137,7 +143,12 @@ run_hook() { archiso_mount_handler() { local newroot="${1}"
- mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + 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." @@ -170,6 +181,7 @@ archiso_mount_handler() {
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}..." diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..808100d 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -15,7 +15,7 @@ archiso_loop_mount_handler () { msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
- if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + 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 @@ -27,5 +27,6 @@ archiso_loop_mount_handler () { umount /run/archiso/img_dev else echo ${_dev_loop} > /run/archiso/img_dev_loop + echo $(readlink -f ${img_dev}) >> /run/archiso/used_block_devices fi } diff --git a/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices new file mode 100644 index 0000000..e2b9fc1 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_devs +} + +add_hook multi_end symlink_used_block_devices
Hey G, seems like there's some small edits in here that have nothing to do with the actual block device listing changeset? Dieter
On 02/22/2012 04:39 AM, Dieter Plaetinck wrote:
On Tue, 21 Feb 2012 20:01:30 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
NOTE: Not tested yet, but should work(tm).
This list includes block devices of ( /run/archiso/used_block_devices ): * 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})
Aditionally all loop devices except for backing COW files, all are setup as read-only.
In configs/releng profile, a symlink is made at boot-time for AIF: /run/aif/ignore_devs -> /run/archiso/used_block_devices --- archiso/hooks/archiso | 20 ++++++++++++++++---- archiso/hooks/archiso_loop_mnt | 3 ++- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..22b67e9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -10,7 +10,8 @@ _mnt_fs() {
mkdir -p "${newroot}${mnt}"
- ro_dev=$(losetup --find --show "${img}") + 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 @@ -30,6 +31,7 @@ _mnt_fs() { 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}
@@ -39,6 +41,7 @@ _mnt_fs() { launch_interactive_shell else echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0">> ${newroot}/etc/fstab + echo /dev/mapper/${dm_snap_name}>> /run/archiso/used_block_devices fi }
@@ -46,7 +49,8 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" + local sfs_dev
mkdir -p "${mnt}"
@@ -60,7 +64,9 @@ _mnt_sfs() { msg "done." fi msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}"&> /dev/null ; then + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev}>> /run/archiso/used_block_devices + if ! mount -r "${sfs_dev}" "${mnt}"&> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -137,7 +143,12 @@ run_hook() { archiso_mount_handler() { local newroot="${1}"
- mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + 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." @@ -170,6 +181,7 @@ archiso_mount_handler() {
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}..." diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..808100d 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -15,7 +15,7 @@ archiso_loop_mount_handler () { msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
- if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + 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 @@ -27,5 +27,6 @@ archiso_loop_mount_handler () { umount /run/archiso/img_dev else echo ${_dev_loop}> /run/archiso/img_dev_loop + echo $(readlink -f ${img_dev})>> /run/archiso/used_block_devices fi } diff --git a/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices new file mode 100644 index 0000000..e2b9fc1 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_devs +} + +add_hook multi_end symlink_used_block_devices Hey G, seems like there's some small edits in here that have nothing to do with the actual block device listing changeset?
Dieter
Yes, --read-only loops. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Wed, 22 Feb 2012 08:08:10 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
On 02/22/2012 04:39 AM, Dieter Plaetinck wrote:
On Tue, 21 Feb 2012 20:01:30 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
NOTE: Not tested yet, but should work(tm).
This list includes block devices of ( /run/archiso/used_block_devices ): * 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})
Aditionally all loop devices except for backing COW files, all are setup as read-only.
In configs/releng profile, a symlink is made at boot-time for AIF: /run/aif/ignore_devs -> /run/archiso/used_block_devices --- archiso/hooks/archiso | 20 ++++++++++++++++---- archiso/hooks/archiso_loop_mnt | 3 ++- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..22b67e9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -10,7 +10,8 @@ _mnt_fs() {
mkdir -p "${newroot}${mnt}"
- ro_dev=$(losetup --find --show "${img}") + 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 @@ -30,6 +31,7 @@ _mnt_fs() { 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}
@@ -39,6 +41,7 @@ _mnt_fs() { launch_interactive_shell else echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0">> ${newroot}/etc/fstab + echo /dev/mapper/${dm_snap_name}>> /run/archiso/used_block_devices fi }
@@ -46,7 +49,8 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" + local sfs_dev
mkdir -p "${mnt}"
@@ -60,7 +64,9 @@ _mnt_sfs() { msg "done." fi msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}"&> /dev/null ; then + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev}>> /run/archiso/used_block_devices + if ! mount -r "${sfs_dev}" "${mnt}"&> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -137,7 +143,12 @@ run_hook() { archiso_mount_handler() { local newroot="${1}"
- mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + 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." @@ -170,6 +181,7 @@ archiso_mount_handler() {
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}..." diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..808100d 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -15,7 +15,7 @@ archiso_loop_mount_handler () { msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
- if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + 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 @@ -27,5 +27,6 @@ archiso_loop_mount_handler () { umount /run/archiso/img_dev else echo ${_dev_loop}> /run/archiso/img_dev_loop + echo $(readlink -f ${img_dev})>> /run/archiso/used_block_devices fi } diff --git a/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices new file mode 100644 index 0000000..e2b9fc1 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_devs +} + +add_hook multi_end symlink_used_block_devices Hey G, seems like there's some small edits in here that have nothing to do with the actual block device listing changeset?
Dieter
Yes, --read-only loops.
seems to me like you need 3 commits: 1) for syntactical changes, only this: - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" 2) for the read only loop devices 3) for the used_block_devices stuff Dieter
On 02/22/2012 08:22 AM, Dieter Plaetinck wrote:
On Wed, 22 Feb 2012 08:08:10 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
On 02/22/2012 04:39 AM, Dieter Plaetinck wrote:
On Tue, 21 Feb 2012 20:01:30 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
NOTE: Not tested yet, but should work(tm).
This list includes block devices of ( /run/archiso/used_block_devices ): * 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})
Aditionally all loop devices except for backing COW files, all are setup as read-only.
In configs/releng profile, a symlink is made at boot-time for AIF: /run/aif/ignore_devs -> /run/archiso/used_block_devices --- archiso/hooks/archiso | 20 ++++++++++++++++---- archiso/hooks/archiso_loop_mnt | 3 ++- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..22b67e9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -10,7 +10,8 @@ _mnt_fs() {
mkdir -p "${newroot}${mnt}"
- ro_dev=$(losetup --find --show "${img}") + 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 @@ -30,6 +31,7 @@ _mnt_fs() { 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}
@@ -39,6 +41,7 @@ _mnt_fs() { launch_interactive_shell else echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0">> ${newroot}/etc/fstab + echo /dev/mapper/${dm_snap_name}>> /run/archiso/used_block_devices fi }
@@ -46,7 +49,8 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" + local sfs_dev
mkdir -p "${mnt}"
@@ -60,7 +64,9 @@ _mnt_sfs() { msg "done." fi msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}"&> /dev/null ; then + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev}>> /run/archiso/used_block_devices + if ! mount -r "${sfs_dev}" "${mnt}"&> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -137,7 +143,12 @@ run_hook() { archiso_mount_handler() { local newroot="${1}"
- mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + 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." @@ -170,6 +181,7 @@ archiso_mount_handler() {
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}..." diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..808100d 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -15,7 +15,7 @@ archiso_loop_mount_handler () { msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
- if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + 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 @@ -27,5 +27,6 @@ archiso_loop_mount_handler () { umount /run/archiso/img_dev else echo ${_dev_loop}> /run/archiso/img_dev_loop + echo $(readlink -f ${img_dev})>> /run/archiso/used_block_devices fi } diff --git a/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices new file mode 100644 index 0000000..e2b9fc1 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_devs +} + +add_hook multi_end symlink_used_block_devices Hey G, seems like there's some small edits in here that have nothing to do with the actual block device listing changeset?
Dieter
Yes, --read-only loops.
seems to me like you need 3 commits: 1) for syntactical changes, only this: - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" 2) for the read only loop devices 3) for the used_block_devices stuff
Dieter
Any relevant comment about /run/aif/ignore_devs ? I think is more important than how tell the history. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 02/22/2012 12:48 PM, Gerardo Exequiel Pozzi wrote:
On 02/22/2012 08:22 AM, Dieter Plaetinck wrote:
On Wed, 22 Feb 2012 08:08:10 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
On 02/22/2012 04:39 AM, Dieter Plaetinck wrote:
On Tue, 21 Feb 2012 20:01:30 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
NOTE: Not tested yet, but should work(tm).
This list includes block devices of ( /run/archiso/used_block_devices ): * 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})
Aditionally all loop devices except for backing COW files, all are setup as read-only.
In configs/releng profile, a symlink is made at boot-time for AIF: /run/aif/ignore_devs -> /run/archiso/used_block_devices --- archiso/hooks/archiso | 20 ++++++++++++++++---- archiso/hooks/archiso_loop_mnt | 3 ++- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..22b67e9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -10,7 +10,8 @@ _mnt_fs() {
mkdir -p "${newroot}${mnt}"
- ro_dev=$(losetup --find --show "${img}") + 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 @@ -30,6 +31,7 @@ _mnt_fs() { 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}
@@ -39,6 +41,7 @@ _mnt_fs() { launch_interactive_shell else echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0">> ${newroot}/etc/fstab + echo /dev/mapper/${dm_snap_name}>> /run/archiso/used_block_devices fi }
@@ -46,7 +49,8 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" + local sfs_dev
mkdir -p "${mnt}"
@@ -60,7 +64,9 @@ _mnt_sfs() { msg "done." fi msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}"&> /dev/null ; then + sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev}>> /run/archiso/used_block_devices + if ! mount -r "${sfs_dev}" "${mnt}"&> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -137,7 +143,12 @@ run_hook() { archiso_mount_handler() { local newroot="${1}"
- mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" + 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." @@ -170,6 +181,7 @@ archiso_mount_handler() {
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}..." diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..808100d 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -15,7 +15,7 @@ archiso_loop_mount_handler () { msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
- if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + 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 @@ -27,5 +27,6 @@ archiso_loop_mount_handler () { umount /run/archiso/img_dev else echo ${_dev_loop}> /run/archiso/img_dev_loop + echo $(readlink -f ${img_dev})>> /run/archiso/used_block_devices fi } diff --git a/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices
new file mode 100644 index 0000000..e2b9fc1 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_devs +} + +add_hook multi_end symlink_used_block_devices Hey G, seems like there's some small edits in here that have nothing to do with the actual block device listing changeset?
Dieter
Yes, --read-only loops.
seems to me like you need 3 commits: 1) for syntactical changes, only this: - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" 2) for the read only loop devices 3) for the used_block_devices stuff
Dieter
Any relevant comment about /run/aif/ignore_devs ? I think is more important than how tell the history.
This is how finally looks booting core.iso from cdrom. [root@archiso ~]# cat /run/aif/ignore_block_devices /dev/sr0 /dev/loop0 /dev/loop1 /dev/loop2 /dev/mapper/arch_root-image /dev/loop3 /dev/loop4 /dev/loop5 /dev/mapper/arch_lib-modules /dev/loop6 /dev/loop7 /dev/loop8 /dev/mapper/arch_usr-share /dev/loop9 /dev/loop10 [root@archiso ~]# I done some more changes/fixes so... a rain of RFC patches is comming. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
what's the status of this patch? when will it go into archiso? Dieter
On 03/09/2012 12:08 PM, Dieter Plaetinck wrote:
what's the status of this patch? when will it go into archiso?
Dieter
Yes, when util-linux in [testing] hits [core]. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Fri, 09 Mar 2012 13:54:45 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
On 03/09/2012 12:08 PM, Dieter Plaetinck wrote:
what's the status of this patch? when will it go into archiso?
Dieter
Yes, when util-linux in [testing] hits [core].
is it not possible to push it to the git repository nonetheless? that would allow me to start working on the aif side. nothing will break by merely having this in git right? Dieter
On 03/10/2012 07:05 AM, Dieter Plaetinck wrote:
On Fri, 09 Mar 2012 13:54:45 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
On 03/09/2012 12:08 PM, Dieter Plaetinck wrote:
what's the status of this patch? when will it go into archiso?
Dieter
Yes, when util-linux in [testing] hits [core].
is it not possible to push it to the git repository nonetheless? that would allow me to start working on the aif side. nothing will break by merely having this in git right?
Dieter
You can start working just now, this is a simple list of devices in a know location. I can push this as said before, but you need to pass two boot params to workaround: earlymodules=loop loop.max_loop=16 Also as you know, all these changes are on my "experimental", l branch at git://github.com/djgera/archiso.git -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 03/10/2012 01:35 PM, Gerardo Exequiel Pozzi wrote:
On 03/10/2012 07:05 AM, Dieter Plaetinck wrote:
On Fri, 09 Mar 2012 13:54:45 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
On 03/09/2012 12:08 PM, Dieter Plaetinck wrote:
what's the status of this patch? when will it go into archiso?
Dieter
Yes, when util-linux in [testing] hits [core].
is it not possible to push it to the git repository nonetheless? that would allow me to start working on the aif side. nothing will break by merely having this in git right?
Dieter
You can start working just now, this is a simple list of devices in a know location.
I can push this as said before, but you need to pass two boot params to workaround: earlymodules=loop loop.max_loop=16
Also as you know, all these changes are on my "experimental", l branch at git://github.com/djgera/archiso.git
Pushed! 36f327c..25c535f master -> master -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (3)
-
Dieter Plaetinck
-
Gerardo Exequiel Pozzi
-
Thomas Bächler