[arch-releng] [RFC] one more step forward to become archiso as self-pxe-server...
Hello Current releng images are enabled to be used as self-PXE-server enviroment with: dnsmasq: For DHCP and TFTP nbd: for NBD nfs-utils: for NFS I like to add (They do not carry any extra dependency) Name : vsftpd Installed Size : 216.00 K Name : darkhttpd Installed Size : 36.00 K With these two tiny packages we will cover all protocols supported by archiso at this moment. The wiki page[#1] describe how to use live-enviroment to do this tasks. This also makes my life much easier when I want to test these things :) Any objections? Thanks. [#1] https://wiki.archlinux.org/index.php/Archiso_as_pxe_server#HTTP.2FFTP_and_NF... -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 02.12.2011 23:20, schrieb Gerardo Exequiel Pozzi:
Hello
Current releng images are enabled to be used as self-PXE-server enviroment with:
dnsmasq: For DHCP and TFTP nbd: for NBD nfs-utils: for NFS
I like to add (They do not carry any extra dependency)
Name : vsftpd Installed Size : 216.00 K Name : darkhttpd Installed Size : 36.00 K
I don't see the point in adding FTP - HTTP is superior in any way. Other than that: Our .sfs images are rather tiny, you will barely notice the difference, so no objections from me.
On 12/02/2011 07:30 PM, Thomas Bächler wrote:
Hello
Current releng images are enabled to be used as self-PXE-server enviroment with:
dnsmasq: For DHCP and TFTP nbd: for NBD nfs-utils: for NFS
I like to add (They do not carry any extra dependency)
Name : vsftpd Installed Size : 216.00 K Name : darkhttpd Installed Size : 36.00 K I don't see the point in adding FTP - HTTP is superior in any way. Other
Am 02.12.2011 23:20, schrieb Gerardo Exequiel Pozzi: than that: Our .sfs images are rather tiny, you will barely notice the difference, so no objections from me.
OK, I will only add darkhttp. If HTTP works then also FTP will work from the point of view of the hook. geek comment: maybe it just fit in the multiple of current ISO padding size :P -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 03.12.2011 02:08, schrieb Gerardo Exequiel Pozzi:
I don't see the point in adding FTP - HTTP is superior in any way. Other than that: Our .sfs images are rather tiny, you will barely notice the difference, so no objections from me.
OK, I will only add darkhttp. If HTTP works then also FTP will work from the point of view of the hook.
Indeed. My concerns with FTP again: 1) gPXE/iPXE do not support FTP as it seems (only HTTP). 2) In general, FTP is more problematic from the network point-of-view, as it needs to open two connections. 3) HTTP is more stable than FTP from my experience.
geek comment: maybe it just fit in the multiple of current ISO padding size :P
I prefer to remaster the ISO onto USB (copy /arch, install syslinux) or netboot it over the internet. My concern therefore is the size of the .sfs files, not the actual .iso.
On 12/03/2011 07:17 AM, Thomas Bächler wrote: > Am 03.12.2011 02:08, schrieb Gerardo Exequiel Pozzi: >>> I don't see the point in adding FTP - HTTP is superior in any way. Other >>> than that: Our .sfs images are rather tiny, you will barely notice the >>> difference, so no objections from me. >>> >> OK, I will only add darkhttp. If HTTP works then also FTP will work from >> the point of view of the hook. > Indeed. My concerns with FTP again: > 1) gPXE/iPXE do not support FTP as it seems (only HTTP). Yes. Support it. but is normally not built-in, like HTTPS. Note: gPXE is not activelly maintained. I still use gpxe because of the nice online generator. iPXE is the active a fork. Indeed qemu switched to iPXE in this year. > 2) In general, FTP is more problematic from the network point-of-view, > as it needs to open two connections. > 3) HTTP is more stable than FTP from my experience. I agree. I will remove the word FTP from the README and the wiki. Just let the user to discover that: "hey it use curl!, so I can use FTP HTTPS and others....." What do you think about rename hook archiso_pxe_curl -> archiso_pxe_http and also bootparm archiso_curl_url= -> archiso_http_srv= ? > >> geek comment: maybe it just fit in the multiple of current ISO padding >> size :P > I prefer to remaster the ISO onto USB (copy /arch, install syslinux) or > netboot it over the internet. My concern therefore is the size of the > .sfs files, not the actual .iso. > Sure, my comment was a joke ;) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 12/03/2011 10:20 AM, Gerardo Exequiel Pozzi wrote: > On 12/03/2011 07:17 AM, Thomas Bächler wrote: >> Am 03.12.2011 02:08, schrieb Gerardo Exequiel Pozzi: >>>> I don't see the point in adding FTP - HTTP is superior in any way. >>>> Other >>>> than that: Our .sfs images are rather tiny, you will barely notice the >>>> difference, so no objections from me. >>>> >>> OK, I will only add darkhttp. If HTTP works then also FTP will work >>> from >>> the point of view of the hook. >> Indeed. My concerns with FTP again: >> 1) gPXE/iPXE do not support FTP as it seems (only HTTP). > Yes. Support it. but is normally not built-in, like HTTPS. > > Note: gPXE is not activelly maintained. I still use gpxe because of > the nice online generator. > iPXE is the active a fork. Indeed qemu switched to iPXE in this year. >> 2) In general, FTP is more problematic from the network point-of-view, >> as it needs to open two connections. >> 3) HTTP is more stable than FTP from my experience. > I agree. > > I will remove the word FTP from the README and the wiki. Just let the > user to discover that: > "hey it use curl!, so I can use FTP HTTPS and others....." > > What do you think about rename hook archiso_pxe_curl -> archiso_pxe_http > and also bootparm archiso_curl_url= -> archiso_http_srv= ? Also maybe "get the complete iso via http then loopmount" can be removed (this was the first RFC implementation of boot via http). Now that we have the posibility of fetch only needed *sfs and unified directory tree, doing such the looks a bit irrelevant. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Some clanups made, and make it for HTTP only (from the user point of view). Of course, still works for FTP (but shhh!)
This was the first implementation that downloads the complete ISO, but now we have the posibility of download only needed *.sfs files. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- README | 7 ++--- archiso/hooks/archiso_pxe_curl | 54 ++++++++++++++-------------------------- 2 files changed, 22 insertions(+), 39 deletions(-) diff --git a/README b/README index 9de113d..c8f7331 100644 --- a/README +++ b/README @@ -89,10 +89,9 @@ INDEX ** hooks/archiso_pxe_curl -* archiso_curl_url= Set an HTTP/FTP URL of an ISO file (first form), - or a path (must end with /) where ${archisobasedir} - is found with all *.sfs files (second form). - In the IP part if ${pxeserver} is used, PXE IP will be used. +* archiso_curl_url= Set an HTTP/FTP URL (must end with /) where ${archisobasedir} + is found with all *.sfs files. + In the IP/domain part if ${pxeserver} is used, use PXE IP. Default: (unset) * curlspace_size= Set the size of tmpfs of "curlspace" where the specified ISO image or *.sfs files are downloaded. diff --git a/archiso/hooks/archiso_pxe_curl b/archiso/hooks/archiso_pxe_curl index 858bacb..8f3711c 100644 --- a/archiso/hooks/archiso_pxe_curl +++ b/archiso/hooks/archiso_pxe_curl @@ -13,13 +13,13 @@ run_hook() { # Fetch a file with CURL # # $1 URL -# $2 Destination directory inside curlspace +# $2 Destination directory inside curlspace/${archisobasedir} _curl_get() { local _url="${1}" local _dst="${2}" msg ":: Downloading '${_url}'" - if ! curl -f -o "/run/archiso/curlspace/${_dst}/${_url##*/}" --create-dirs "${_url}"; then + if ! curl -f -o "/run/archiso/curlspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then echo "ERROR: Downloading '${_url}'" echo " Falling back to interactive prompt" echo " You can try to fix the problem manually, log out when you are finished" @@ -34,44 +34,28 @@ archiso_pxe_curl_mount_handler () { mkdir -p "/run/archiso/curlspace" mount -t tmpfs -o size="${curlspace_size}",mode=0755 curlspace "/run/archiso/curlspace" - # Check if URL ends in / - if [[ "${archiso_curl_url}" != "${archiso_curl_url%/}" ]]; then + local _aitab_url="${archiso_curl_url}${aitab#/run/archiso/bootmnt/}" + local _aitab_file="/run/archiso/curlspace/${aitab#/run/archiso/bootmnt/}" - local _aitab_url="${archiso_curl_url}${aitab#/run/archiso/bootmnt/}" - local _aitab_file="/run/archiso/curlspace/${aitab#/run/archiso/bootmnt/}" + _curl_get "${_aitab_url}" "/" - _curl_get "${_aitab_url}" "${archisobasedir}" - - local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size - while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do - [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue - [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue - if [[ "${aitab_fs_type}" != "none" ]]; then - _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "${archisobasedir}/${aitab_arch}" - else - _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "${archisobasedir}/${aitab_arch}" - fi - done < "${_aitab_file}" - - if [[ "${checksum}" == "y" ]]; then - _curl_get "${archiso_curl_url}${archisobasedir}/checksum.${arch}.md5" "${archisobasedir}" + local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size + while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do + [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue + [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue + if [[ "${aitab_fs_type}" != "none" ]]; then + _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/${aitab_arch}" + else + _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "/${aitab_arch}" fi + done < "${_aitab_file}" - mkdir -p "/run/archiso/bootmnt" - mount -o bind /run/archiso/curlspace /run/archiso/bootmnt - else - local _dev_loop + if [[ "${checksum}" == "y" ]]; then + _curl_get "${archiso_curl_url}${archisobasedir}/checksum.${arch}.md5" "/" + fi - _curl_get "${archiso_curl_url}" "/" + mkdir -p "/run/archiso/bootmnt" + mount -o bind /run/archiso/curlspace /run/archiso/bootmnt - _dev_loop=$(losetup -f) - if ! losetup "${_dev_loop}" "/run/archiso/curlspace/${archiso_curl_url##*/}"; then - echo "ERROR: Setting loopback device '${_dev_loop}'" - echo " for file '/run/archiso/curlspace/${archiso_curl_url##*/}'" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi - fi archiso_mount_handler ${newroot} } -- 1.7.7.4
Am 03.12.2011 22:33, schrieb Gerardo Exequiel Pozzi:
This was the first implementation that downloads the complete ISO, but now we have the posibility of download only needed *.sfs files.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
I would never use this feature, no idea if anyone would. If you really want to clean up code, go for it.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- README | 6 ++-- archiso/Makefile | 8 ++-- archiso/hooks/archiso_pxe_curl | 61 -------------------------------------- archiso/hooks/archiso_pxe_http | 61 ++++++++++++++++++++++++++++++++++++++ archiso/install/archiso_pxe_curl | 18 ----------- archiso/install/archiso_pxe_http | 18 +++++++++++ configs/releng/build.sh | 2 +- configs/releng/mkinitcpio.conf | 2 +- 8 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 archiso/hooks/archiso_pxe_curl create mode 100644 archiso/hooks/archiso_pxe_http delete mode 100644 archiso/install/archiso_pxe_curl create mode 100644 archiso/install/archiso_pxe_http diff --git a/README b/README index c8f7331..19fdf46 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ INDEX * hooks/archiso * hooks/archiso_pxe_common * hooks/archiso_pxe_nbd - * hooks/archiso_pxe_curl + * hooks/archiso_pxe_http * hooks/archiso_pxe_nfs * hooks/archiso_loop_mnt * Boot parameters (only for configs/releng) @@ -87,7 +87,7 @@ INDEX Default: (unset) -** hooks/archiso_pxe_curl +** hooks/archiso_pxe_http * archiso_curl_url= Set an HTTP/FTP URL (must end with /) where ${archisobasedir} is found with all *.sfs files. @@ -163,7 +163,7 @@ if nothing is specified on command line. + mkinitcpio-nfs-utils for ipconfig * archiso_pxe_nbd + nbd for nbd-client -* archiso_pxe_curl +* archiso_pxe_http + curl for curl * archiso_pxe_nfs + mkinitcpio-nfs-utils for nfsmount diff --git a/archiso/Makefile b/archiso/Makefile index a073adf..cf7cd05 100644 --- a/archiso/Makefile +++ b/archiso/Makefile @@ -20,8 +20,8 @@ install-hooks: install -D -m 644 install/archiso_pxe_common $(DESTDIR)/lib/initcpio/install/archiso_pxe_common install -D -m 644 hooks/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd install -D -m 644 install/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd - install -D -m 644 hooks/archiso_pxe_curl $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_curl - install -D -m 644 install/archiso_pxe_curl $(DESTDIR)/lib/initcpio/install/archiso_pxe_curl + install -D -m 644 hooks/archiso_pxe_http $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_http + install -D -m 644 install/archiso_pxe_http $(DESTDIR)/lib/initcpio/install/archiso_pxe_http install -D -m 644 hooks/archiso_pxe_nfs $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nfs install -D -m 644 install/archiso_pxe_nfs $(DESTDIR)/lib/initcpio/install/archiso_pxe_nfs install -D -m 644 hooks/archiso_loop_mnt $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt @@ -50,8 +50,8 @@ uninstall: rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_common rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd - rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_curl - rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_curl + rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_http + rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_http rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nfs rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_nfs rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt diff --git a/archiso/hooks/archiso_pxe_curl b/archiso/hooks/archiso_pxe_curl deleted file mode 100644 index 8f3711c..0000000 --- a/archiso/hooks/archiso_pxe_curl +++ /dev/null @@ -1,61 +0,0 @@ -# vim: set ft=sh: - -run_hook() { - if [[ -n "${ip}" && -n "${archiso_curl_url}" ]]; then - - archiso_curl_url=$(eval echo ${archiso_curl_url}) - [[ -z "${curlspace_size}" ]] && curlspace_size="75%" - - mount_handler="archiso_pxe_curl_mount_handler" - fi -} - -# Fetch a file with CURL -# -# $1 URL -# $2 Destination directory inside curlspace/${archisobasedir} -_curl_get() { - local _url="${1}" - local _dst="${2}" - - msg ":: Downloading '${_url}'" - if ! curl -f -o "/run/archiso/curlspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then - echo "ERROR: Downloading '${_url}'" - echo " Falling back to interactive prompt" - echo " You can try to fix the problem manually, log out when you are finished" - launch_interactive_shell - fi -} - -archiso_pxe_curl_mount_handler () { - newroot="${1}" - - msg ":: Mounting /run/archiso/curlspace (tmpfs) filesystem, size='${curlspace_size}'" - mkdir -p "/run/archiso/curlspace" - mount -t tmpfs -o size="${curlspace_size}",mode=0755 curlspace "/run/archiso/curlspace" - - local _aitab_url="${archiso_curl_url}${aitab#/run/archiso/bootmnt/}" - local _aitab_file="/run/archiso/curlspace/${aitab#/run/archiso/bootmnt/}" - - _curl_get "${_aitab_url}" "/" - - local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size - while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do - [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue - [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue - if [[ "${aitab_fs_type}" != "none" ]]; then - _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/${aitab_arch}" - else - _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "/${aitab_arch}" - fi - done < "${_aitab_file}" - - if [[ "${checksum}" == "y" ]]; then - _curl_get "${archiso_curl_url}${archisobasedir}/checksum.${arch}.md5" "/" - fi - - mkdir -p "/run/archiso/bootmnt" - mount -o bind /run/archiso/curlspace /run/archiso/bootmnt - - archiso_mount_handler ${newroot} -} diff --git a/archiso/hooks/archiso_pxe_http b/archiso/hooks/archiso_pxe_http new file mode 100644 index 0000000..7149013 --- /dev/null +++ b/archiso/hooks/archiso_pxe_http @@ -0,0 +1,61 @@ +# vim: set ft=sh: + +run_hook() { + if [[ -n "${ip}" && -n "${archiso_curl_url}" ]]; then + + archiso_curl_url=$(eval echo ${archiso_curl_url}) + [[ -z "${curlspace_size}" ]] && curlspace_size="75%" + + mount_handler="archiso_pxe_http_mount_handler" + fi +} + +# Fetch a file with CURL +# +# $1 URL +# $2 Destination directory inside curlspace/${archisobasedir} +_curl_get() { + local _url="${1}" + local _dst="${2}" + + msg ":: Downloading '${_url}'" + if ! curl -f -o "/run/archiso/curlspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then + echo "ERROR: Downloading '${_url}'" + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + launch_interactive_shell + fi +} + +archiso_pxe_http_mount_handler () { + newroot="${1}" + + msg ":: Mounting /run/archiso/curlspace (tmpfs) filesystem, size='${curlspace_size}'" + mkdir -p "/run/archiso/curlspace" + mount -t tmpfs -o size="${curlspace_size}",mode=0755 curlspace "/run/archiso/curlspace" + + local _aitab_url="${archiso_curl_url}${aitab#/run/archiso/bootmnt/}" + local _aitab_file="/run/archiso/curlspace/${aitab#/run/archiso/bootmnt/}" + + _curl_get "${_aitab_url}" "/" + + local aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size + while read aitab_img aitab_mnt aitab_arch aitab_sfs_comp aitab_fs_type aitab_fs_size; do + [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue + [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue + if [[ "${aitab_fs_type}" != "none" ]]; then + _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/${aitab_arch}" + else + _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "/${aitab_arch}" + fi + done < "${_aitab_file}" + + if [[ "${checksum}" == "y" ]]; then + _curl_get "${archiso_curl_url}${archisobasedir}/checksum.${arch}.md5" "/" + fi + + mkdir -p "/run/archiso/bootmnt" + mount -o bind /run/archiso/curlspace /run/archiso/bootmnt + + archiso_mount_handler ${newroot} +} diff --git a/archiso/install/archiso_pxe_curl b/archiso/install/archiso_pxe_curl deleted file mode 100644 index a9342ae..0000000 --- a/archiso/install/archiso_pxe_curl +++ /dev/null @@ -1,18 +0,0 @@ -# vim: set ft=sh: - -build () -{ - MODULES="" - BINARIES="" - FILES="" - SCRIPT="archiso_pxe_curl" - - add_binary "/usr/bin/curl" -} - -help () -{ -cat<<HELPEOF - This hook loads the necessary modules for boot via PXE and HTTP/FTP with curl. -HELPEOF -} diff --git a/archiso/install/archiso_pxe_http b/archiso/install/archiso_pxe_http new file mode 100644 index 0000000..9731732 --- /dev/null +++ b/archiso/install/archiso_pxe_http @@ -0,0 +1,18 @@ +# vim: set ft=sh: + +build () +{ + MODULES="" + BINARIES="" + FILES="" + SCRIPT="archiso_pxe_http" + + add_binary "/usr/bin/curl" +} + +help () +{ +cat<<HELPEOF + This hook loads the necessary modules for boot via PXE and HTTP/FTP with curl. +HELPEOF +} diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 1251c79..4967863 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -28,7 +28,7 @@ make_packages() { make_setup_mkinitcpio() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then local _hook - for _hook in archiso archiso_shutdown archiso_pxe_common archiso_pxe_nbd archiso_pxe_curl archiso_pxe_nfs archiso_loop_mnt; do + for _hook in archiso archiso_shutdown archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_loop_mnt; do cp /lib/initcpio/hooks/${_hook} ${work_dir}/root-image/lib/initcpio/hooks cp /lib/initcpio/install/${_hook} ${work_dir}/root-image/lib/initcpio/install done diff --git a/configs/releng/mkinitcpio.conf b/configs/releng/mkinitcpio.conf index 5570ed6..12a656d 100644 --- a/configs/releng/mkinitcpio.conf +++ b/configs/releng/mkinitcpio.conf @@ -1,2 +1,2 @@ -HOOKS="base udev memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_curl archiso_pxe_nfs archiso_kms pata scsi sata virtio usb fw pcmcia filesystems usbinput" +HOOKS="base udev memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms pata scsi sata virtio usb fw pcmcia filesystems usbinput" COMPRESSION="xz" -- 1.7.7.4
Also rename curlspace_size= to archiso_http_spc= Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- README | 5 +-- archiso/hooks/archiso_pxe_http | 28 ++++++++++++------------ archiso/install/archiso_pxe_http | 2 +- configs/releng/syslinux.dual/archiso_head.cfg | 2 +- configs/releng/syslinux.dual/archiso_pxe32.cfg | 13 +---------- configs/releng/syslinux.dual/archiso_pxe64.cfg | 13 +---------- configs/releng/syslinux/archiso_head.cfg | 2 +- configs/releng/syslinux/archiso_pxe.cfg | 13 +---------- 8 files changed, 22 insertions(+), 56 deletions(-) diff --git a/README b/README index 19fdf46..d23ade7 100644 --- a/README +++ b/README @@ -89,12 +89,11 @@ INDEX ** hooks/archiso_pxe_http -* archiso_curl_url= Set an HTTP/FTP URL (must end with /) where ${archisobasedir} +* archiso_http_srv= Set an HTTP URL (must end with /) where ${archisobasedir} is found with all *.sfs files. In the IP/domain part if ${pxeserver} is used, use PXE IP. Default: (unset) -* curlspace_size= Set the size of tmpfs of "curlspace" where the specified - ISO image or *.sfs files are downloaded. +* archiso_http_spc= Set the size of tmpfs where *.sfs files are downloaded. Default: "75%" diff --git a/archiso/hooks/archiso_pxe_http b/archiso/hooks/archiso_pxe_http index 7149013..ae56210 100644 --- a/archiso/hooks/archiso_pxe_http +++ b/archiso/hooks/archiso_pxe_http @@ -1,10 +1,10 @@ # vim: set ft=sh: run_hook() { - if [[ -n "${ip}" && -n "${archiso_curl_url}" ]]; then + if [[ -n "${ip}" && -n "${archiso_http_srv}" ]]; then - archiso_curl_url=$(eval echo ${archiso_curl_url}) - [[ -z "${curlspace_size}" ]] && curlspace_size="75%" + archiso_http_srv=$(eval echo ${archiso_http_srv}) + [[ -z "${archiso_http_spc}" ]] && archiso_http_spc="75%" mount_handler="archiso_pxe_http_mount_handler" fi @@ -13,13 +13,13 @@ run_hook() { # Fetch a file with CURL # # $1 URL -# $2 Destination directory inside curlspace/${archisobasedir} +# $2 Destination directory inside httpspace/${archisobasedir} _curl_get() { local _url="${1}" local _dst="${2}" msg ":: Downloading '${_url}'" - if ! curl -f -o "/run/archiso/curlspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then + if ! curl -f -o "/run/archiso/httpspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then echo "ERROR: Downloading '${_url}'" echo " Falling back to interactive prompt" echo " You can try to fix the problem manually, log out when you are finished" @@ -30,12 +30,12 @@ _curl_get() { archiso_pxe_http_mount_handler () { newroot="${1}" - msg ":: Mounting /run/archiso/curlspace (tmpfs) filesystem, size='${curlspace_size}'" - mkdir -p "/run/archiso/curlspace" - mount -t tmpfs -o size="${curlspace_size}",mode=0755 curlspace "/run/archiso/curlspace" + msg ":: Mounting /run/archiso/httpspace (tmpfs) filesystem, size='${archiso_http_spc}'" + mkdir -p "/run/archiso/httpspace" + mount -t tmpfs -o size="${archiso_http_spc}",mode=0755 httpspace "/run/archiso/httpspace" - local _aitab_url="${archiso_curl_url}${aitab#/run/archiso/bootmnt/}" - local _aitab_file="/run/archiso/curlspace/${aitab#/run/archiso/bootmnt/}" + local _aitab_url="${archiso_http_srv}${aitab#/run/archiso/bootmnt/}" + local _aitab_file="/run/archiso/httpspace/${aitab#/run/archiso/bootmnt/}" _curl_get "${_aitab_url}" "/" @@ -44,18 +44,18 @@ archiso_pxe_http_mount_handler () { [[ "${aitab_img#\#}" != "${aitab_img}" ]] && continue [[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue if [[ "${aitab_fs_type}" != "none" ]]; then - _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/${aitab_arch}" + _curl_get "${archiso_http_srv}${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/${aitab_arch}" else - _curl_get "${archiso_curl_url}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "/${aitab_arch}" + _curl_get "${archiso_http_srv}${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "/${aitab_arch}" fi done < "${_aitab_file}" if [[ "${checksum}" == "y" ]]; then - _curl_get "${archiso_curl_url}${archisobasedir}/checksum.${arch}.md5" "/" + _curl_get "${archiso_http_srv}${archisobasedir}/checksum.${arch}.md5" "/" fi mkdir -p "/run/archiso/bootmnt" - mount -o bind /run/archiso/curlspace /run/archiso/bootmnt + mount -o bind /run/archiso/httpspace /run/archiso/bootmnt archiso_mount_handler ${newroot} } diff --git a/archiso/install/archiso_pxe_http b/archiso/install/archiso_pxe_http index 9731732..a636f3b 100644 --- a/archiso/install/archiso_pxe_http +++ b/archiso/install/archiso_pxe_http @@ -13,6 +13,6 @@ build () help () { cat<<HELPEOF - This hook loads the necessary modules for boot via PXE and HTTP/FTP with curl. + This hook loads the necessary modules for boot via PXE and HTTP. HELPEOF } diff --git a/configs/releng/syslinux.dual/archiso_head.cfg b/configs/releng/syslinux.dual/archiso_head.cfg index 6514c42..faa2588 100644 --- a/configs/releng/syslinux.dual/archiso_head.cfg +++ b/configs/releng/syslinux.dual/archiso_head.cfg @@ -5,7 +5,7 @@ MENU BACKGROUND boot/syslinux/splash.png MENU WIDTH 78 MENU MARGIN 4 -MENU ROWS 8 +MENU ROWS 6 MENU VSHIFT 10 MENU TABMSGROW 14 MENU CMDLINEROW 14 diff --git a/configs/releng/syslinux.dual/archiso_pxe32.cfg b/configs/releng/syslinux.dual/archiso_pxe32.cfg index 56820d9..4bdeefa 100644 --- a/configs/releng/syslinux.dual/archiso_pxe32.cfg +++ b/configs/releng/syslinux.dual/archiso_pxe32.cfg @@ -28,16 +28,5 @@ ENDTEXT MENU LABEL Boot Arch Linux (i686) (HTTP) LINUX boot/i686/vmlinuz INITRD boot/i686/archiso.img -APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=http://${pxeserver}/ -IPAPPEND 3 - -LABEL arch32_ftp -TEXT HELP -Boot the Arch Linux (i686) live medium (Using FTP). It allows you to install Arch Linux or -perform system maintenance. -ENDTEXT -MENU LABEL Boot Arch Linux (i686) (FTP) -LINUX boot/i686/vmlinuz -INITRD boot/i686/archiso.img -APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=ftp://${pxeserver}/ +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ IPAPPEND 3 diff --git a/configs/releng/syslinux.dual/archiso_pxe64.cfg b/configs/releng/syslinux.dual/archiso_pxe64.cfg index 762fbc1..1676236 100644 --- a/configs/releng/syslinux.dual/archiso_pxe64.cfg +++ b/configs/releng/syslinux.dual/archiso_pxe64.cfg @@ -28,16 +28,5 @@ ENDTEXT MENU LABEL Boot Arch Linux (x86_64) (HTTP) LINUX boot/x86_64/vmlinuz INITRD boot/x86_64/archiso.img -APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=http://${pxeserver}/ -IPAPPEND 3 - -LABEL arch64_ftp -TEXT HELP -Boot the Arch Linux (x86_64) live medium (Using FTP). It allows you to install Arch Linux or -perform system maintenance. -ENDTEXT -MENU LABEL Boot Arch Linux (x86_64) (FTP) -LINUX boot/x86_64/vmlinuz -INITRD boot/x86_64/archiso.img -APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=ftp://${pxeserver}/ +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ IPAPPEND 3 diff --git a/configs/releng/syslinux/archiso_head.cfg b/configs/releng/syslinux/archiso_head.cfg index 6514c42..faa2588 100644 --- a/configs/releng/syslinux/archiso_head.cfg +++ b/configs/releng/syslinux/archiso_head.cfg @@ -5,7 +5,7 @@ MENU BACKGROUND boot/syslinux/splash.png MENU WIDTH 78 MENU MARGIN 4 -MENU ROWS 8 +MENU ROWS 6 MENU VSHIFT 10 MENU TABMSGROW 14 MENU CMDLINEROW 14 diff --git a/configs/releng/syslinux/archiso_pxe.cfg b/configs/releng/syslinux/archiso_pxe.cfg index 78e494d..8bb60ed 100644 --- a/configs/releng/syslinux/archiso_pxe.cfg +++ b/configs/releng/syslinux/archiso_pxe.cfg @@ -28,16 +28,5 @@ ENDTEXT MENU LABEL Boot Arch Linux (HTTP) LINUX boot/%ARCH%/vmlinuz INITRD boot/%ARCH%/archiso.img -APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=http://${pxeserver}/ -IPAPPEND 3 - -LABEL arch_ftp -TEXT HELP -Boot the Arch Linux live medium (Using FTP). It allows you to install Arch Linux or -perform system maintenance. -ENDTEXT -MENU LABEL Boot Arch Linux (FTP) -LINUX boot/%ARCH%/vmlinuz -INITRD boot/%ARCH%/archiso.img -APPEND archisobasedir=%INSTALL_DIR% archiso_curl_url=ftp://${pxeserver}/ +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ IPAPPEND 3 -- 1.7.7.4
Am 03.12.2011 22:33, schrieb Gerardo Exequiel Pozzi:
Also rename curlspace_size= to archiso_http_spc=
Meh, now I have to adjust my netboot configuration files.
On 12/04/2011 10:56 AM, Thomas Bächler wrote:
Am 03.12.2011 22:33, schrieb Gerardo Exequiel Pozzi:
Also rename curlspace_size= to archiso_http_spc=
Meh, now I have to adjust my netboot configuration files.
Yes, I will merge this all patches in about 3 hours. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 04.12.2011 21:24, schrieb Gerardo Exequiel Pozzi:
On 12/04/2011 10:56 AM, Thomas Bächler wrote:
Am 03.12.2011 22:33, schrieb Gerardo Exequiel Pozzi:
Also rename curlspace_size= to archiso_http_spc=
Meh, now I have to adjust my netboot configuration files.
Yes, I will merge this all patches in about 3 hours.
For the time being, I'll have the both old and the new option.
participants (2)
-
Gerardo Exequiel Pozzi
-
Thomas Bächler