[arch-releng] [PATCH 0/3] Misc improvements/fixes.
Patches avail at git://github.com/djgera/archiso.git in "djgera" branch. [PATCH 2/3] Rename directories and parameteres to be more descriptive. This will help if mounts --move are implemented.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index c7a6829..23ae4e2 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -75,16 +75,6 @@ run_hook () { archiso_mount_handler() { newroot="${1}" - msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." - mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs - msg "done." - - if [ "${copytoram}" = "y" ]; then - msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." - mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs - msg "done." - fi - msg ":: Waiting for boot device..." while ! poll_device ${archisodevice} 30; do echo "ERROR: boot device didn't show up after 30 seconds..." @@ -118,6 +108,16 @@ archiso_mount_handler() { launch_interactive_shell fi + if [ "${copytoram}" = "y" ]; then + msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." + mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs + msg "done." + fi + + msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." + mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs + msg "done." + msg ":: Mounting root (aufs) filesystem" /bin/mount -t aufs -o dirs=/tmpfs=rw none "${newroot}" if [ $? -ne 0 ]; then -- 1.7.1.1
* squashfs images that will be part of read-only branchs for union mount in / are mounted on /ro_branch/{image_name} instead of /tmpfs/mnt/{image_name} (and avoid empty dirs on live env under /mnt) * tmpfs that will be part of read-write branch for union mount in / is mounted on /rw_branch instead of /tmpfs * tmpfs that is for store *.sqfs images when copytoram=y, is mounted on /copytoram instead of /tmpfs.sqfs * tmpfs_size= parameter renamed to rw_branch_size= * tmpfs_sqfs_size= parameter renamed to copytoram_size= Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 24 ++++++++++---------- archiso/install/archiso | 5 ++- archiso2dual/isolinux.cfg | 4 +- .../syslinux-iso/boot-files/isolinux/isolinux.cfg | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 23ae4e2..ef8dc58 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -22,12 +22,12 @@ _mnt_squashfs() { mnt="${2}" img_fullname="${img##*/}"; img_name="${img_fullname%.*}" - tmp_mnt="/tmpfs/mnt/${img_name}" + tmp_mnt="/ro_branch/${img_name}" if [ "${copytoram}" = "y" ]; then msg -n ":: Copying squashfs image to RAM..." - /bin/cp "${img}" "/tmpfs.sqfs/${img_fullname}" - img="/tmpfs.sqfs/${img_fullname}" + /bin/cp "${img}" "/copytoram/${img_fullname}" + img="/copytoram/${img_fullname}" msg "done." fi @@ -46,12 +46,12 @@ run_hook () { arch="$(uname -m)" fi - if [ "x${tmpfs_size}" = "x" ]; then - tmpfs_size="75%" + if [ "x${rw_branch_size}" = "x" ]; then + rw_branch_size="75%" fi - if [ "x${tmpfs_sqfs_size}" = "x" ]; then - tmpfs_sqfs_size="75%" + if [ "x${copytoram_size}" = "x" ]; then + copytoram_size="75%" fi if [ "x${archisobasedir}" != "x" ]; then @@ -109,17 +109,17 @@ archiso_mount_handler() { fi if [ "${copytoram}" = "y" ]; then - msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." - mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs + msg -n ":: Mounting /copytoram (tmpfs) filesystem, size=${copytoram_size}..." + mount -t tmpfs -o "size=${copytoram_size}",mode=0755 copytoram /copytoram msg "done." fi - msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." - mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs + msg -n ":: Mounting rw_branch (tmpfs) filesystem, size=${rw_branch_size}..." + mount -t tmpfs -o "size=${rw_branch_size}",mode=0755 rw_branch /rw_branch msg "done." msg ":: Mounting root (aufs) filesystem" - /bin/mount -t aufs -o dirs=/tmpfs=rw none "${newroot}" + /bin/mount -t aufs -o dirs=/rw_branch=rw none "${newroot}" if [ $? -ne 0 ]; then echo "ERROR: while mounting root (aufs) filesystem." exit 1 diff --git a/archiso/install/archiso b/archiso/install/archiso index 9b45080..7ad9d06 100644 --- a/archiso/install/archiso +++ b/archiso/install/archiso @@ -10,8 +10,9 @@ install () BINARIES="" FILES="" - add_dir /tmpfs - add_dir /tmpfs.sqfs + add_dir /rw_branch + add_dir /ro_branch + add_dir /copytoram add_dir /bootmnt add_device /lib/udev/devices/loop0 b 7 0 diff --git a/archiso2dual/isolinux.cfg b/archiso2dual/isolinux.cfg index 6dd4bbb..071c87b 100644 --- a/archiso2dual/isolinux.cfg +++ b/archiso2dual/isolinux.cfg @@ -38,7 +38,7 @@ perform system maintenance. ENDTEXT MENU LABEL Boot Arch Linux (i686) KERNEL /boot/i686/vmlinuz26 -APPEND initrd=/boot/i686/archiso.img archisolabel=XXX tmpfs_size=75% locale=en_US.UTF-8 +APPEND initrd=/boot/i686/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 # Next line should be uncommented when prepare enviroment to boot from PXE. #IPAPPEND 3 @@ -49,7 +49,7 @@ perform system maintenance. ENDTEXT MENU LABEL Boot Arch Linux (x86_64) KERNEL /boot/x86_64/vmlinuz26 -APPEND initrd=/boot/x86_64/archiso.img archisolabel=XXX tmpfs_size=75% locale=en_US.UTF-8 +APPEND initrd=/boot/x86_64/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 # Next line should be uncommented when prepare enviroment to boot from PXE. #IPAPPEND 3 diff --git a/configs/syslinux-iso/boot-files/isolinux/isolinux.cfg b/configs/syslinux-iso/boot-files/isolinux/isolinux.cfg index dd9ef86..3cac5da 100644 --- a/configs/syslinux-iso/boot-files/isolinux/isolinux.cfg +++ b/configs/syslinux-iso/boot-files/isolinux/isolinux.cfg @@ -38,7 +38,7 @@ perform system maintenance. ENDTEXT MENU LABEL Boot Arch Linux KERNEL /boot/vmlinuz26 -APPEND initrd=/boot/archiso.img archisolabel=XXX tmpfs_size=75% locale=en_US.UTF-8 +APPEND initrd=/boot/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 # Next line should be uncommented when prepare enviroment to boot from PXE. #IPAPPEND 3 -- 1.7.1.1
A shell prompt is at least better than a kernel panic :) Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index ef8dc58..4d6682a 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -27,12 +27,20 @@ _mnt_squashfs() { if [ "${copytoram}" = "y" ]; then msg -n ":: Copying squashfs image to RAM..." /bin/cp "${img}" "/copytoram/${img_fullname}" + if [ $? -ne 0 ]; then + echo "ERROR: while copy ${img} to /copytoram/${img_fullname}" + launch_interactive_shell + fi img="/copytoram/${img_fullname}" msg "done." fi mkdir -p "${tmp_mnt}" /bin/mount -r -t squashfs "${img}" "${tmp_mnt}" + if [ $? -ne 0 ]; then + echo "ERROR: while mounting ${img} to ${tmp_mnt}" + launch_interactive_shell + fi if [ "/${mnt#/*/}" = "/" ]; then _mnt_aufs "${tmp_mnt}" "${mnt}" @@ -41,7 +49,7 @@ _mnt_squashfs() { fi } -run_hook () { +run_hook() { if [ "x${arch}" = "x" ]; then arch="$(uname -m)" fi @@ -122,7 +130,7 @@ archiso_mount_handler() { /bin/mount -t aufs -o dirs=/rw_branch=rw none "${newroot}" if [ $? -ne 0 ]; then echo "ERROR: while mounting root (aufs) filesystem." - exit 1 + launch_interactive_shell fi msg ":: Mounting images" -- 1.7.1.1
participants (1)
-
Gerardo Exequiel Pozzi