[arch-releng] [RFC][archiso] A rain of patches
Note if you want to test this without using util-linux 2.21 (not released yet), must use these boot params: earlymodules=loop loop.max_loop=16 Currently archiso_shutdown is broken due recent /lib -> /usr/lib of udev. One patch in this series fixes it, this is mostly important when using cow_device otherwise there is no harm. If there any plans to make new officials images soon (before util-linux 2.21), I like to push all these patches, plus adding temporary workaround (mentioned boot params) to syslinux.cfg.
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> --- archiso/hooks/archiso | 37 +++---------------------------------- archiso/hooks/archiso_loop_mnt | 10 ++++------ archiso/install/archiso | 1 + 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 2635a4c..3518d16 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -1,27 +1,3 @@ -# Initialize loopback device logic (we using on-demand mode) -# args: none -_init_loop_dev() { - loop_dev_count=99 - loop_dev_range=$(cat /sys/block/loop0/range) - loop_dev_minor=$((loop_dev_count*loop_dev_range)) -} - -# Call this function before _make_loop_dev() each time. -# args: none -_next_loop_dev() { - loop_dev_count=$((loop_dev_count+1)) - loop_dev_minor=$((loop_dev_count*loop_dev_range)) -} - -# Setup a loopback device for image passed as argument and echo the path to loopback device used. -# args: /path/to/image_file -_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 - echo /dev/loop${loop_dev_count} -} - # args: source, newroot, mountpoint _mnt_fs() { local img="${1}" @@ -34,8 +10,7 @@ _mnt_fs() { mkdir -p "${newroot}${mnt}" - _next_loop_dev - ro_dev=$(_make_loop_dev "${img}") + ro_dev=$(losetup --find --show "${img}") ro_dev_size=$(blockdev --getsz ${ro_dev}) if [[ "${cow_persistent}" == "P" ]]; then @@ -54,8 +29,7 @@ _mnt_fs() { dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${ro_dev_size} &> /dev/null fi - _next_loop_dev - rw_dev=$(_make_loop_dev "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") + rw_dev=$(losetup --find --show "/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} @@ -85,9 +59,8 @@ _mnt_sfs() { img="/run/archiso/copytoram/${img_fullname}" msg "done." fi - _next_loop_dev msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r $(_make_loop_dev "${img}") "${mnt}" &> /dev/null ; then + if ! mount -r "${img}" "${mnt}" &> /dev/null ; then echo "ERROR: while mounting '${img}' to '${mnt}'" launch_interactive_shell fi @@ -130,8 +103,6 @@ _verify_checksum() { } run_hook() { - modprobe loop - [[ -z "${arch}" ]] && arch="$(uname -m)" [[ -z "${cowspace_size}" ]] && cowspace_size="75%" [[ -z "${copytoram_size}" ]] && copytoram_size="75%" @@ -166,8 +137,6 @@ run_hook() { archiso_mount_handler() { local newroot="${1}" - _init_loop_dev - mountpoint -q "/run/archiso/bootmnt" || _mnt_dev "${archisodevice}" "/run/archiso/bootmnt" "-r" if [[ ! -f "${aitab}" ]]; then diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index e52dc69..664f3a5 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -10,15 +10,13 @@ run_hook () { archiso_loop_mount_handler () { newroot="${1}" + local _dev_loop + msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" - _dev_loop=$(losetup -f) - if ! losetup "${_dev_loop}" "/run/archiso/img_dev/${img_loop}"; then - echo "ERROR: Setting loopback device '${_dev_loop}'" - echo " for file '/run/archiso/img_dev/${img_loop}'" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" + if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then + echo "ERROR: Setting loopback device for file '/run/archiso/img_dev/${img_loop}'" launch_interactive_shell fi diff --git a/archiso/install/archiso b/archiso/install/archiso index 3b4e223..db0fc3a 100644 --- a/archiso/install/archiso +++ b/archiso/install/archiso @@ -8,6 +8,7 @@ build () add_binary /lib/udev/cdrom_id add_binary /sbin/blockdev add_binary /sbin/dmsetup + add_binary /sbin/losetup add_binary /bin/mountpoint add_file /lib/udev/rules.d/60-cdrom_id.rules -- 1.7.9.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/install/archiso | 8 ++++---- archiso/install/archiso_pxe_http | 2 +- archiso/install/archiso_pxe_nbd | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/archiso/install/archiso b/archiso/install/archiso index db0fc3a..25eccea 100644 --- a/archiso/install/archiso +++ b/archiso/install/archiso @@ -6,10 +6,10 @@ build () FILES="" add_binary /lib/udev/cdrom_id - add_binary /sbin/blockdev - add_binary /sbin/dmsetup - add_binary /sbin/losetup - add_binary /bin/mountpoint + add_binary blockdev + add_binary dmsetup + add_binary losetup + add_binary mountpoint add_file /lib/udev/rules.d/60-cdrom_id.rules add_file /lib/udev/rules.d/10-dm.rules diff --git a/archiso/install/archiso_pxe_http b/archiso/install/archiso_pxe_http index a636f3b..38a8ee5 100644 --- a/archiso/install/archiso_pxe_http +++ b/archiso/install/archiso_pxe_http @@ -7,7 +7,7 @@ build () FILES="" SCRIPT="archiso_pxe_http" - add_binary "/usr/bin/curl" + add_binary curl } help () diff --git a/archiso/install/archiso_pxe_nbd b/archiso/install/archiso_pxe_nbd index 4227623..747e5b9 100644 --- a/archiso/install/archiso_pxe_nbd +++ b/archiso/install/archiso_pxe_nbd @@ -7,7 +7,8 @@ build () FILES="" SCRIPT="archiso_pxe_nbd" - add_binary "/usr/sbin/nbd-client" "/bin/nbd-client" + add_binary nbd-client + add_file "/lib/initcpio/archiso_pxe_nbd" "/archiso_pxe_nbd" } -- 1.7.9.1
* 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> --- archiso/archiso_shutdown | 2 +- archiso/install/archiso | 16 +++++----------- archiso/install/archiso_loop_mnt | 15 +++++---------- archiso/install/archiso_pxe_common | 19 ++++++++----------- archiso/install/archiso_pxe_http | 13 +++++-------- archiso/install/archiso_pxe_nbd | 14 ++++++-------- archiso/install/archiso_pxe_nfs | 6 ++++-- archiso/install/archiso_shutdown | 9 +++++++-- 8 files changed, 41 insertions(+), 53 deletions(-) diff --git a/archiso/archiso_shutdown b/archiso/archiso_shutdown index de1197e..26220a6 100644 --- a/archiso/archiso_shutdown +++ b/archiso/archiso_shutdown @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/ash # /oldroot depends on things inside /oldroot/run/archiso... mkdir /oldrun diff --git a/archiso/install/archiso b/archiso/install/archiso index 25eccea..878839b 100644 --- a/archiso/install/archiso +++ b/archiso/install/archiso @@ -1,9 +1,8 @@ -build () -{ - MODULES="cdrom loop dm-snapshot" +#!/bin/bash - BINARIES="" - FILES="" +build() { + MODULES="cdrom loop dm-snapshot" + SCRIPT="archiso" add_binary /lib/udev/cdrom_id add_binary blockdev @@ -15,11 +14,6 @@ build () add_file /lib/udev/rules.d/10-dm.rules add_file /lib/udev/rules.d/95-dm-notify.rules add_file /lib/initcpio/udev/11-dm-initramfs.rules /lib/udev/rules.d/11-dm-initramfs.rules - - # Add an empty fstab to avoid mount warning when -o remount is used (this should go to install/base) - : > "$BUILDROOT/etc/fstab" - - SCRIPT="archiso" } -# vim:ft=sh:ts=4:sw=4:et: +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/install/archiso_loop_mnt b/archiso/install/archiso_loop_mnt index 886cbb8..4141043 100644 --- a/archiso/install/archiso_loop_mnt +++ b/archiso/install/archiso_loop_mnt @@ -1,18 +1,13 @@ -# vim: set ft=sh: - -build () -{ - MODULES="" - - BINARIES="" - FILES="" +#!/bin/bash +build() { SCRIPT="archiso_loop_mnt" } -help () -{ +help() { cat<<HELPEOF This hook loads the necessary modules for boot via loop device. HELPEOF } + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/install/archiso_pxe_common b/archiso/install/archiso_pxe_common index ce54f7a..b37e5a1 100644 --- a/archiso/install/archiso_pxe_common +++ b/archiso/install/archiso_pxe_common @@ -1,33 +1,30 @@ -# vim: set ft=sh: +#!/bin/bash -build () -{ +build() { MODULES="${MODULES} $(comm -2 -3 <(checked_modules "/drivers/net/" | sort) \ <(find $MODULEDIR/kernel/drivers/net/{irda,phy,wimax,wireless} \ -name '*.ko*' \ -exec bash -c 'printf "%s\n" "${@%%.ko*}" | sed "s@.*/@@;s@-@_@" | sort' _ {} +) \ | grep -v -e 'ppp_' -e 'plip' -e 'pppoe')" - BINARIES="" - FILES="" SCRIPT="archiso_pxe_common" - # Add here for now, but this should go to "install/base". - add_dir /tmp - add_dir /etc - add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig" + add_binary /lib/initcpio/ipconfig /bin/ipconfig # Add hosts support files+dns add_symlink /lib/libnss_files.so.2 $(readlink /lib/libnss_files.so.2) add_binary $(readlink -f /lib/libnss_files.so.2) add_symlink /lib/libnss_dns.so.2 $(readlink /lib/libnss_dns.so.2) add_binary $(readlink -f /lib/libnss_dns.so.2) + + add_dir /etc echo "hosts: files dns" > $BUILDROOT/etc/nsswitch.conf } -help () -{ +help() { cat<<HELPEOF This hook loads the necessary modules for boot via PXE. HELPEOF } + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/install/archiso_pxe_http b/archiso/install/archiso_pxe_http index 38a8ee5..9e2ff65 100644 --- a/archiso/install/archiso_pxe_http +++ b/archiso/install/archiso_pxe_http @@ -1,18 +1,15 @@ -# vim: set ft=sh: +#!/bin/bash -build () -{ - MODULES="" - BINARIES="" - FILES="" +build() { SCRIPT="archiso_pxe_http" add_binary curl } -help () -{ +help() { cat<<HELPEOF This hook loads the necessary modules for boot via PXE and HTTP. HELPEOF } + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/install/archiso_pxe_nbd b/archiso/install/archiso_pxe_nbd index 747e5b9..0784e2c 100644 --- a/archiso/install/archiso_pxe_nbd +++ b/archiso/install/archiso_pxe_nbd @@ -1,20 +1,18 @@ -# vim: set ft=sh: +#!/bin/bash -build () -{ +build() { MODULES="nbd" - BINARIES="" - FILES="" SCRIPT="archiso_pxe_nbd" add_binary nbd-client - add_file "/lib/initcpio/archiso_pxe_nbd" "/archiso_pxe_nbd" + add_file /lib/initcpio/archiso_pxe_nbd /archiso_pxe_nbd } -help () -{ +help() { cat<<HELPEOF This hook loads the necessary modules for boot via PXE and NBD. HELPEOF } + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/install/archiso_pxe_nfs b/archiso/install/archiso_pxe_nfs index 52be9f3..f7b6f5d 100644 --- a/archiso/install/archiso_pxe_nfs +++ b/archiso/install/archiso_pxe_nfs @@ -1,10 +1,10 @@ -# vim: set ft=sh: +#!/bin/bash build() { MODULES="nfs" SCRIPT="archiso_pxe_nfs" - add_binary "/lib/initcpio/nfsmount" "/bin/nfsmount" + add_binary /lib/initcpio/nfsmount /bin/nfsmount } help() { @@ -12,3 +12,5 @@ help() { This hook loads the necessary modules for boot via PXE and NFS. HELPEOF } + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/install/archiso_shutdown b/archiso/install/archiso_shutdown index 49dfc8c..7ef3137 100644 --- a/archiso/install/archiso_shutdown +++ b/archiso/install/archiso_shutdown @@ -1,9 +1,12 @@ +#!/bin/bash + build() { SCRIPT="archiso_shutdown" - add_binary /lib/initcpio/archiso_shutdown /shutdown + + add_file /lib/initcpio/archiso_shutdown /shutdown } -help () { +help() { cat <<HELPEOF This hook will create a shutdown initramfs in /run/initramfs that we can pivot to on shutdown in order to unmount / and @@ -11,3 +14,5 @@ and others mount points, dm-snapshot devices and loopback devices. Mostly usefull for dm-snapshot persistent. HELPEOF } + +# vim: set ft=sh ts=4 sw=4 et: -- 1.7.9.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- configs/releng/packages.i686 | 2 +- configs/releng/packages.x86_64 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/releng/packages.i686 b/configs/releng/packages.i686 index ab5bfc9..88820b7 100644 --- a/configs/releng/packages.i686 +++ b/configs/releng/packages.i686 @@ -1,6 +1,6 @@ aif b43-fwcutter -btrfs-progs-unstable +btrfs-progs crda darkhttpd ddrescue diff --git a/configs/releng/packages.x86_64 b/configs/releng/packages.x86_64 index ab5bfc9..88820b7 100644 --- a/configs/releng/packages.x86_64 +++ b/configs/releng/packages.x86_64 @@ -1,6 +1,6 @@ aif b43-fwcutter -btrfs-progs-unstable +btrfs-progs crda darkhttpd ddrescue -- 1.7.9.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 3518d16..af3d58d 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -46,7 +46,7 @@ _mnt_fs() { _mnt_sfs() { local img="${1}" local mnt="${2}" - local img_fullname="${img##*/}"; + local img_fullname="${img##*/}" mkdir -p "${mnt}" -- 1.7.9.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 19 +++---------------- 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index af3d58d..bd7aea7 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -8,8 +8,6 @@ _mnt_fs() { local dm_snap_name="${dm_snap_prefix}_${img_name}" local ro_dev ro_dev_size rw_dev - mkdir -p "${newroot}${mnt}" - ro_dev=$(losetup --find --show "${img}") ro_dev_size=$(blockdev --getsz ${ro_dev}) @@ -33,13 +31,8 @@ _mnt_fs() { echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name} - msg ":: Mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'" - if ! mount "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" ; then - echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'" - launch_interactive_shell - else - echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab - fi + _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" + echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab } # args: /path/to/image_file, mountpoint @@ -48,8 +41,6 @@ _mnt_sfs() { local mnt="${2}" local img_fullname="${img##*/}" - mkdir -p "${mnt}" - if [[ "${copytoram}" == "y" ]]; then msg -n ":: Copying squashfs image to RAM..." if ! cp "${img}" "/run/archiso/copytoram/${img_fullname}" ; then @@ -59,11 +50,7 @@ _mnt_sfs() { img="/run/archiso/copytoram/${img_fullname}" msg "done." fi - msg ":: Mounting '${img}' (SquashFS) to '${mnt}'" - if ! mount -r "${img}" "${mnt}" &> /dev/null ; then - echo "ERROR: while mounting '${img}' to '${mnt}'" - launch_interactive_shell - fi + _mnt_dev "${img}" "${mnt}" "-r" } # args: device, mountpoint, flags -- 1.7.9.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 2 +- archiso/hooks/archiso_loop_mnt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index bd7aea7..54c3223 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -8,7 +8,7 @@ _mnt_fs() { local dm_snap_name="${dm_snap_prefix}_${img_name}" local ro_dev ro_dev_size rw_dev - ro_dev=$(losetup --find --show "${img}") + ro_dev=$(losetup --find --show --read-only "${img}") ro_dev_size=$(blockdev --getsz ${ro_dev}) if [[ "${cow_persistent}" == "P" ]]; then diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 664f3a5..4fa2910 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 -- 1.7.9.1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 54c3223..abe9932 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -40,6 +40,7 @@ _mnt_sfs() { local img="${1}" local mnt="${2}" local img_fullname="${img##*/}" + local sfs_dev if [[ "${copytoram}" == "y" ]]; then msg -n ":: Copying squashfs image to RAM..." @@ -50,7 +51,8 @@ _mnt_sfs() { img="/run/archiso/copytoram/${img_fullname}" msg "done." fi - _mnt_dev "${img}" "${mnt}" "-r" + sfs_dev=$(losetup --find --show --read-only "${img}") + _mnt_dev "${sfs_dev}" "${mnt}" "-r" } # args: device, mountpoint, flags -- 1.7.9.1
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> --- archiso/hooks/archiso | 13 ++++++++++++- archiso/hooks/archiso_loop_mnt | 3 +++ 2 files changed, 15 insertions(+), 1 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index abe9932..df5bb10 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -9,6 +9,7 @@ _mnt_fs() { local ro_dev ro_dev_size rw_dev 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 @@ -28,10 +29,12 @@ _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} _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" + echo /dev/mapper/${dm_snap_name} >> /run/archiso/used_block_devices echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab } @@ -52,6 +55,7 @@ _mnt_sfs() { msg "done." fi sfs_dev=$(losetup --find --show --read-only "${img}") + echo ${sfs_dev} >> /run/archiso/used_block_devices _mnt_dev "${sfs_dev}" "${mnt}" "-r" } @@ -126,7 +130,13 @@ 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." @@ -159,6 +169,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 4fa2910..61ddcd4 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -14,6 +14,9 @@ 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 [[ "${copytoram}" != "y" ]]; then + echo $(readlink -f ${img_dev}) >> /run/archiso/used_block_devices + fi 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}'" -- 1.7.9.1
This is just a symlink to /run/archiso/used_block_devices Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- .../rc.d/functions.d/symlink_used_block_devices | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/symlink_used_block_devices 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..f6b6062 --- /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_block_devices +} + +add_hook multi_end symlink_used_block_devices -- 1.7.9.1
* 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> --- archiso/archiso_shutdown | 13 +++++-------- archiso/hooks/archiso_shutdown | 10 +++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/archiso/archiso_shutdown b/archiso/archiso_shutdown index 26220a6..c430014 100644 --- a/archiso/archiso_shutdown +++ b/archiso/archiso_shutdown @@ -10,10 +10,8 @@ umount $(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r) # Remove all dm-snapshot devices. dmsetup remove_all -# Remove all loopback devices made for dm-snapshots devices -# other misc loops like used for pure squashfs images -# and unmount/detach *.fs.sfs images. -for _lup in $(ls -r /dev/loop[1-9][0-9][0-9]); do +# Remove all loopback devices. +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do if ! losetup -d ${_lup} 2> /dev/null; then umount -d ${_lup} fi @@ -24,11 +22,10 @@ umount /oldrun/archiso/cowspace # Unmount boot device if needed (no copytoram=y used) if [[ ! -d /oldrun/archiso/copytoram ]]; then - umount /oldrun/archiso/bootmnt - # Detach img_loop= and unmount img_dev= (archiso_loop_mnt hook) - if [[ -f /oldrun/archiso/img_dev_loop ]]; then - losetup -d $(cat /oldrun/archiso/img_dev_loop) + if [[ -d /oldrun/archiso/img_dev ]]; then umount /oldrun/archiso/img_dev + else + umount /oldrun/archiso/bootmnt fi if [[ -f /oldrun/archiso/nbd_client.pid ]]; then nbd-client -d /dev/nbd0 diff --git a/archiso/hooks/archiso_shutdown b/archiso/hooks/archiso_shutdown index 1cc6e0e..1b2689b 100644 --- a/archiso/hooks/archiso_shutdown +++ b/archiso/hooks/archiso_shutdown @@ -2,15 +2,15 @@ run_hook () { msg -n ":: Creating shutdown ramfs..." - mkdir -p /run/initramfs/usr/bin - mkdir /run/initramfs/usr/sbin - mkdir /run/initramfs/bin - mkdir /run/initramfs/sbin - mkdir /run/initramfs/lib + for _dir in bin lib sbin usr/bin usr/lib usr/sbin; do + mkdir -p /run/initramfs/${_dir} + done cp /bin/busybox /run/initramfs/bin/ cp /lib/ld-* /run/initramfs/lib/ cp /lib/lib* /run/initramfs/lib/ + cp /usr/lib/lib* /run/initramfs/usr/lib/ cp /sbin/dmsetup /run/initramfs/sbin/ + cp /sbin/losetup /run/initramfs/sbin/ if [[ -x /bin/nbd-client ]]; then cp /bin/nbd-client /run/initramfs/bin/ fi -- 1.7.9.1
On Thu, Feb 23, 2012 at 12:30:50AM -0300, Gerardo Exequiel Pozzi wrote:
* 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> --- archiso/archiso_shutdown | 13 +++++-------- archiso/hooks/archiso_shutdown | 10 +++++----- 2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/archiso/archiso_shutdown b/archiso/archiso_shutdown index 26220a6..c430014 100644 --- a/archiso/archiso_shutdown +++ b/archiso/archiso_shutdown @@ -10,10 +10,8 @@ umount $(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r) # Remove all dm-snapshot devices. dmsetup remove_all
-# Remove all loopback devices made for dm-snapshots devices -# other misc loops like used for pure squashfs images -# and unmount/detach *.fs.sfs images. -for _lup in $(ls -r /dev/loop[1-9][0-9][0-9]); do +# Remove all loopback devices. +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do
Eek. Please don't do this. I have bad experiences with tac, particularly in initscripts on shutdown, because there was nowhere for tac to write to (it creates a temporary file when it reads from a pipe). "for" is no way to iterate over lines of output, either. It's a little more long winded, but I'm always in favor of doing this "correctly": mapfile -t loopdevs </oldrun/archiso/used_block_devices for (( i=${loopdevs[*]}-1; i>=0; i-- )); do if [[ ${loopdevs[i]} = /dev/loop* ]] && ! loosetup -d "${loopdevs[i]}" 2>/dev/null; then umount -d "${loopdevs[i]}" fi done unset loopdevs i
if ! losetup -d ${_lup} 2> /dev/null; then umount -d ${_lup} fi @@ -24,11 +22,10 @@ umount /oldrun/archiso/cowspace
# Unmount boot device if needed (no copytoram=y used) if [[ ! -d /oldrun/archiso/copytoram ]]; then - umount /oldrun/archiso/bootmnt - # Detach img_loop= and unmount img_dev= (archiso_loop_mnt hook) - if [[ -f /oldrun/archiso/img_dev_loop ]]; then - losetup -d $(cat /oldrun/archiso/img_dev_loop) + if [[ -d /oldrun/archiso/img_dev ]]; then umount /oldrun/archiso/img_dev + else + umount /oldrun/archiso/bootmnt fi if [[ -f /oldrun/archiso/nbd_client.pid ]]; then nbd-client -d /dev/nbd0 diff --git a/archiso/hooks/archiso_shutdown b/archiso/hooks/archiso_shutdown index 1cc6e0e..1b2689b 100644 --- a/archiso/hooks/archiso_shutdown +++ b/archiso/hooks/archiso_shutdown @@ -2,15 +2,15 @@ run_hook () { msg -n ":: Creating shutdown ramfs..."
- mkdir -p /run/initramfs/usr/bin - mkdir /run/initramfs/usr/sbin - mkdir /run/initramfs/bin - mkdir /run/initramfs/sbin - mkdir /run/initramfs/lib + for _dir in bin lib sbin usr/bin usr/lib usr/sbin; do + mkdir -p /run/initramfs/${_dir} + done cp /bin/busybox /run/initramfs/bin/ cp /lib/ld-* /run/initramfs/lib/ cp /lib/lib* /run/initramfs/lib/ + cp /usr/lib/lib* /run/initramfs/usr/lib/ cp /sbin/dmsetup /run/initramfs/sbin/ + cp /sbin/losetup /run/initramfs/sbin/ if [[ -x /bin/nbd-client ]]; then cp /bin/nbd-client /run/initramfs/bin/ fi -- 1.7.9.1
On 02/23/2012 11:55 AM, Dave Reisner wrote:
On Thu, Feb 23, 2012 at 12:30:50AM -0300, Gerardo Exequiel Pozzi wrote:
* 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> --- archiso/archiso_shutdown | 13 +++++-------- archiso/hooks/archiso_shutdown | 10 +++++----- 2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/archiso/archiso_shutdown b/archiso/archiso_shutdown index 26220a6..c430014 100644 --- a/archiso/archiso_shutdown +++ b/archiso/archiso_shutdown @@ -10,10 +10,8 @@ umount $(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r) # Remove all dm-snapshot devices. dmsetup remove_all
-# Remove all loopback devices made for dm-snapshots devices -# other misc loops like used for pure squashfs images -# and unmount/detach *.fs.sfs images. -for _lup in $(ls -r /dev/loop[1-9][0-9][0-9]); do +# Remove all loopback devices. +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do Eek. Please don't do this. I have bad experiences with tac, particularly in initscripts on shutdown, because there was nowhere for tac to write to (it creates a temporary file when it reads from a pipe). "for" is no way to iterate over lines of output, either. It's a little more long winded, but I'm always in favor of doing this "correctly":
mapfile -t loopdevs</oldrun/archiso/used_block_devices for (( i=${loopdevs[*]}-1; i>=0; i-- )); do if [[ ${loopdevs[i]} = /dev/loop* ]]&& ! loosetup -d "${loopdevs[i]}" 2>/dev/null; then umount -d "${loopdevs[i]}" fi done unset loopdevs i
True about tac (from coreutils) but tac (from busybox) looks like does not use tempfile [#1] The problem here is that such shell code is for bash, here is ash from busybox. Thanks for review. [#1] http://git.busybox.net/busybox/tree/coreutils/tac.c
if ! losetup -d ${_lup} 2> /dev/null; then umount -d ${_lup} fi @@ -24,11 +22,10 @@ umount /oldrun/archiso/cowspace
# Unmount boot device if needed (no copytoram=y used) if [[ ! -d /oldrun/archiso/copytoram ]]; then - umount /oldrun/archiso/bootmnt - # Detach img_loop= and unmount img_dev= (archiso_loop_mnt hook) - if [[ -f /oldrun/archiso/img_dev_loop ]]; then - losetup -d $(cat /oldrun/archiso/img_dev_loop) + if [[ -d /oldrun/archiso/img_dev ]]; then umount /oldrun/archiso/img_dev + else + umount /oldrun/archiso/bootmnt fi if [[ -f /oldrun/archiso/nbd_client.pid ]]; then nbd-client -d /dev/nbd0 diff --git a/archiso/hooks/archiso_shutdown b/archiso/hooks/archiso_shutdown index 1cc6e0e..1b2689b 100644 --- a/archiso/hooks/archiso_shutdown +++ b/archiso/hooks/archiso_shutdown @@ -2,15 +2,15 @@ run_hook () { msg -n ":: Creating shutdown ramfs..."
- mkdir -p /run/initramfs/usr/bin - mkdir /run/initramfs/usr/sbin - mkdir /run/initramfs/bin - mkdir /run/initramfs/sbin - mkdir /run/initramfs/lib + for _dir in bin lib sbin usr/bin usr/lib usr/sbin; do + mkdir -p /run/initramfs/${_dir} + done cp /bin/busybox /run/initramfs/bin/ cp /lib/ld-* /run/initramfs/lib/ cp /lib/lib* /run/initramfs/lib/ + cp /usr/lib/lib* /run/initramfs/usr/lib/ cp /sbin/dmsetup /run/initramfs/sbin/ + cp /sbin/losetup /run/initramfs/sbin/ if [[ -x /bin/nbd-client ]]; then cp /bin/nbd-client /run/initramfs/bin/ fi -- 1.7.9.1
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Thu, Feb 23, 2012 at 12:13:53PM -0300, Gerardo Exequiel Pozzi wrote:
On 02/23/2012 11:55 AM, Dave Reisner wrote:
On Thu, Feb 23, 2012 at 12:30:50AM -0300, Gerardo Exequiel Pozzi wrote:
* 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> --- archiso/archiso_shutdown | 13 +++++-------- archiso/hooks/archiso_shutdown | 10 +++++----- 2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/archiso/archiso_shutdown b/archiso/archiso_shutdown index 26220a6..c430014 100644 --- a/archiso/archiso_shutdown +++ b/archiso/archiso_shutdown @@ -10,10 +10,8 @@ umount $(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r) # Remove all dm-snapshot devices. dmsetup remove_all
-# Remove all loopback devices made for dm-snapshots devices -# other misc loops like used for pure squashfs images -# and unmount/detach *.fs.sfs images. -for _lup in $(ls -r /dev/loop[1-9][0-9][0-9]); do +# Remove all loopback devices. +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do Eek. Please don't do this. I have bad experiences with tac, particularly in initscripts on shutdown, because there was nowhere for tac to write to (it creates a temporary file when it reads from a pipe). "for" is no way to iterate over lines of output, either. It's a little more long winded, but I'm always in favor of doing this "correctly":
mapfile -t loopdevs</oldrun/archiso/used_block_devices for (( i=${loopdevs[*]}-1; i>=0; i-- )); do if [[ ${loopdevs[i]} = /dev/loop* ]]&& ! loosetup -d "${loopdevs[i]}" 2>/dev/null; then umount -d "${loopdevs[i]}" fi done unset loopdevs i
True about tac (from coreutils) but tac (from busybox) looks like does not use tempfile [#1]
The problem here is that such shell code is for bash, here is ash from busybox.
Thanks for review.
derp. carry on.
[#1] http://git.busybox.net/busybox/tree/coreutils/tac.c
if ! losetup -d ${_lup} 2> /dev/null; then umount -d ${_lup} fi @@ -24,11 +22,10 @@ umount /oldrun/archiso/cowspace
# Unmount boot device if needed (no copytoram=y used) if [[ ! -d /oldrun/archiso/copytoram ]]; then - umount /oldrun/archiso/bootmnt - # Detach img_loop= and unmount img_dev= (archiso_loop_mnt hook) - if [[ -f /oldrun/archiso/img_dev_loop ]]; then - losetup -d $(cat /oldrun/archiso/img_dev_loop) + if [[ -d /oldrun/archiso/img_dev ]]; then umount /oldrun/archiso/img_dev + else + umount /oldrun/archiso/bootmnt fi if [[ -f /oldrun/archiso/nbd_client.pid ]]; then nbd-client -d /dev/nbd0 diff --git a/archiso/hooks/archiso_shutdown b/archiso/hooks/archiso_shutdown index 1cc6e0e..1b2689b 100644 --- a/archiso/hooks/archiso_shutdown +++ b/archiso/hooks/archiso_shutdown @@ -2,15 +2,15 @@ run_hook () { msg -n ":: Creating shutdown ramfs..."
- mkdir -p /run/initramfs/usr/bin - mkdir /run/initramfs/usr/sbin - mkdir /run/initramfs/bin - mkdir /run/initramfs/sbin - mkdir /run/initramfs/lib + for _dir in bin lib sbin usr/bin usr/lib usr/sbin; do + mkdir -p /run/initramfs/${_dir} + done cp /bin/busybox /run/initramfs/bin/ cp /lib/ld-* /run/initramfs/lib/ cp /lib/lib* /run/initramfs/lib/ + cp /usr/lib/lib* /run/initramfs/usr/lib/ cp /sbin/dmsetup /run/initramfs/sbin/ + cp /sbin/losetup /run/initramfs/sbin/ if [[ -x /bin/nbd-client ]]; then cp /bin/nbd-client /run/initramfs/bin/ fi -- 1.7.9.1
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 02/23/2012 12:22 PM, Dave Reisner wrote:
On Thu, Feb 23, 2012 at 12:13:53PM -0300, Gerardo Exequiel Pozzi wrote:
On 02/23/2012 11:55 AM, Dave Reisner wrote:
On Thu, Feb 23, 2012 at 12:30:50AM -0300, Gerardo Exequiel Pozzi wrote:
* 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> --- archiso/archiso_shutdown | 13 +++++-------- archiso/hooks/archiso_shutdown | 10 +++++----- 2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/archiso/archiso_shutdown b/archiso/archiso_shutdown index 26220a6..c430014 100644 --- a/archiso/archiso_shutdown +++ b/archiso/archiso_shutdown @@ -10,10 +10,8 @@ umount $(mount | awk '$3 ~/^\/oldroot/ {print $3}' | sort -r) # Remove all dm-snapshot devices. dmsetup remove_all
-# Remove all loopback devices made for dm-snapshots devices -# other misc loops like used for pure squashfs images -# and unmount/detach *.fs.sfs images. -for _lup in $(ls -r /dev/loop[1-9][0-9][0-9]); do +# Remove all loopback devices. +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do Eek. Please don't do this. I have bad experiences with tac, particularly in initscripts on shutdown, because there was nowhere for tac to write to (it creates a temporary file when it reads from a pipe). "for" is no way to iterate over lines of output, either. It's a little more long winded, but I'm always in favor of doing this "correctly":
mapfile -t loopdevs</oldrun/archiso/used_block_devices for (( i=${loopdevs[*]}-1; i>=0; i-- )); do if [[ ${loopdevs[i]} = /dev/loop* ]]&& ! loosetup -d "${loopdevs[i]}" 2>/dev/null; then umount -d "${loopdevs[i]}" fi done unset loopdevs i True about tac (from coreutils) but tac (from busybox) looks like does not use tempfile [#1]
The problem here is that such shell code is for bash, here is ash from busybox.
Thanks for review.
derp. carry on.
Hehe, anyway, in a future, I want to use losetup --detach-all (new in 2.21), then umount -d, without looking at the list. For now, this code just works and makes posible to use current losetup (booting with extra/workaround bootparams of course). Thanks you. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Superseded by /run/archiso/used_block_devices Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso_loop_mnt | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 61ddcd4..f38d0d6 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -10,15 +10,13 @@ run_hook () { archiso_loop_mount_handler () { newroot="${1}" - local _dev_loop - msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" if [[ "${copytoram}" != "y" ]]; then echo $(readlink -f ${img_dev}) >> /run/archiso/used_block_devices fi - if ! _dev_loop=$(losetup --find --show --read-only "/run/archiso/img_dev/${img_loop}"); then + if ! losetup --find --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 @@ -26,9 +24,6 @@ archiso_loop_mount_handler () { archiso_mount_handler ${newroot} if [[ "${copytoram}" == "y" ]]; then - losetup -d ${_dev_loop} - umount /run/archiso/img_dev - else - echo ${_dev_loop} > /run/archiso/img_dev_loop + umount -d /run/archiso/img_dev fi } -- 1.7.9.1
On 02/23/2012 12:30 AM, Gerardo Exequiel Pozzi wrote:
Superseded by /run/archiso/used_block_devices
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso_loop_mnt | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 61ddcd4..f38d0d6 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -10,15 +10,13 @@ run_hook () { archiso_loop_mount_handler () { newroot="${1}"
- local _dev_loop - msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" if [[ "${copytoram}" != "y" ]]; then echo $(readlink -f ${img_dev})>> /run/archiso/used_block_devices fi
- if ! _dev_loop=$(losetup --find --show --read-only "/run/archiso/img_dev/${img_loop}"); then + if ! losetup --find --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 @@ -26,9 +24,6 @@ archiso_loop_mount_handler () { archiso_mount_handler ${newroot}
if [[ "${copytoram}" == "y" ]]; then - losetup -d ${_dev_loop} - umount /run/archiso/img_dev - else - echo ${_dev_loop}> /run/archiso/img_dev_loop + umount -d /run/archiso/img_dev fi }
oops, I made a mistake here. img_dev is not _dev_loop! Resending... -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Superseded by /run/archiso/used_block_devices Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso_loop_mnt | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 61ddcd4..a02cfac 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,7 +28,5 @@ archiso_loop_mount_handler () { if [[ "${copytoram}" == "y" ]]; then losetup -d ${_dev_loop} umount /run/archiso/img_dev - else - echo ${_dev_loop} > /run/archiso/img_dev_loop fi } -- 1.7.9.1
On Thu, 23 Feb 2012 00:52:22 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Superseded by /run/archiso/used_block_devices
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso_loop_mnt | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 61ddcd4..a02cfac 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,7 +28,5 @@ archiso_loop_mount_handler () { if [[ "${copytoram}" == "y" ]]; then losetup -d ${_dev_loop} umount /run/archiso/img_dev - else - echo ${_dev_loop} > /run/archiso/img_dev_loop fi }
maybe it's just me, but this patch and the previous version doesn't seem to have anything to do with the introduction of /run/archiso/used_block_devices other than this, all patches seem good to me! Dieter
On 02/23/2012 09:31 AM, Dieter Plaetinck wrote:
On Thu, 23 Feb 2012 00:52:22 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
Superseded by /run/archiso/used_block_devices
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso_loop_mnt | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt index 61ddcd4..a02cfac 100644 --- a/archiso/hooks/archiso_loop_mnt +++ b/archiso/hooks/archiso_loop_mnt @@ -28,7 +28,5 @@ archiso_loop_mount_handler () { if [[ "${copytoram}" == "y" ]]; then losetup -d ${_dev_loop} umount /run/archiso/img_dev - else - echo ${_dev_loop}> /run/archiso/img_dev_loop fi } maybe it's just me, but this patch and the previous version doesn't seem to have anything to do with the introduction of /run/archiso/used_block_devices
other than this, all patches seem good to me!
Dieter
From patch 11 :) +for _lup in $(grep ^/dev/loop /oldrun/archiso/used_block_devices | tac); do ... - if [[ -f /oldrun/archiso/img_dev_loop ]]; then - losetup -d $(cat /oldrun/archiso/img_dev_loop) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 23.02.2012 04:30, schrieb Gerardo Exequiel Pozzi:
Superseded by /run/archiso/used_block_devices
^Superseeded
On 02/23/2012 06:41 AM, Thomas Bächler wrote:
Am 23.02.2012 04:30, schrieb Gerardo Exequiel Pozzi:
Superseded by /run/archiso/used_block_devices ^Superseeded
really? I can not found "superseeded". http://www.thefreedictionary.com/superseded -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 23.02.2012 15:46, schrieb Gerardo Exequiel Pozzi:
On 02/23/2012 06:41 AM, Thomas Bächler wrote:
Am 23.02.2012 04:30, schrieb Gerardo Exequiel Pozzi:
Superseded by /run/archiso/used_block_devices ^Superseeded
really? I can not found "superseeded".
You are right. I must have been really tired.
On Thu, 23 Feb 2012 00:30:39 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Note if you want to test this without using util-linux 2.21 (not released yet), must use these boot params: earlymodules=loop loop.max_loop=16
Currently archiso_shutdown is broken due recent /lib -> /usr/lib of udev. One patch in this series fixes it, this is mostly important when using cow_device otherwise there is no harm.
If there any plans to make new officials images soon (before util-linux 2.21), I like to push all these patches, plus adding temporary workaround (mentioned boot params) to syslinux.cfg.
when will util-linux 2.21 land? if it's within the year, then yes, I think I'm aiming for a release before util-linux 2.21. Dieter
On Thu, Feb 23, 2012 at 01:33:35PM +0100, Dieter Plaetinck wrote:
On Thu, 23 Feb 2012 00:30:39 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Note if you want to test this without using util-linux 2.21 (not released yet), must use these boot params: earlymodules=loop loop.max_loop=16
Currently archiso_shutdown is broken due recent /lib -> /usr/lib of udev. One patch in this series fixes it, this is mostly important when using cow_device otherwise there is no harm.
If there any plans to make new officials images soon (before util-linux 2.21), I like to push all these patches, plus adding temporary workaround (mentioned boot params) to syslinux.cfg.
when will util-linux 2.21 land? if it's within the year, then yes, I think I'm aiming for a release before util-linux 2.21.
Dieter
u-l was supposed to be released yesterday. It wasn't, but it should be soon™.
On 02/23/2012 12:01 PM, Dave Reisner wrote:
On Thu, Feb 23, 2012 at 01:33:35PM +0100, Dieter Plaetinck wrote:
On Thu, 23 Feb 2012 00:30:39 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
Note if you want to test this without using util-linux 2.21 (not released yet), must use these boot params: earlymodules=loop loop.max_loop=16
Currently archiso_shutdown is broken due recent /lib -> /usr/lib of udev. One patch in this series fixes it, this is mostly important when using cow_device otherwise there is no harm.
If there any plans to make new officials images soon (before util-linux 2.21), I like to push all these patches, plus adding temporary workaround (mentioned boot params) to syslinux.cfg.
when will util-linux 2.21 land? if it's within the year, then yes, I think I'm aiming for a release before util-linux 2.21.
Dieter u-l was supposed to be released yesterday. It wasn't, but it should be soon™.
2.21 yupiiiiiii! -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (4)
-
Dave Reisner
-
Dieter Plaetinck
-
Gerardo Exequiel Pozzi
-
Thomas Bächler