index : archiso32 | |
Archlinux32 iso tools | gitolite user |
summaryrefslogtreecommitdiff |
author | Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> | 2011-11-28 12:28:03 -0300 |
---|---|---|
committer | Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> | 2011-11-28 12:28:03 -0300 |
commit | 76dea1654eafdf6544899edcad839a7d22bcddce (patch) | |
tree | 3abe9ac330109be76756ffccf27e11c0fb6211c6 /archiso | |
parent | 8eb4c624dc41f47f93a04d9e42f531e0642e228b (diff) |
-rw-r--r-- | archiso/Makefile | 4 | ||||
-rw-r--r-- | archiso/hooks/archiso_pxe_nfs | 26 | ||||
-rw-r--r-- | archiso/install/archiso_pxe_nfs | 14 |
diff --git a/archiso/Makefile b/archiso/Makefile index 0dbbbf8..11aff53 100644 --- a/archiso/Makefile +++ b/archiso/Makefile @@ -22,6 +22,8 @@ install-hooks: 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_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 install -D -m 644 install/archiso_loop_mnt $(DESTDIR)/lib/initcpio/install/archiso_loop_mnt @@ -49,6 +51,8 @@ uninstall: 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_nfs + rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_nfs rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt rm -f $(DESTDIR)/lib/initcpio/install/archiso_loop_mnt rm -rf $(DESTDIR)/usr/share/archiso/ diff --git a/archiso/hooks/archiso_pxe_nfs b/archiso/hooks/archiso_pxe_nfs new file mode 100644 index 0000000..a053672 --- /dev/null +++ b/archiso/hooks/archiso_pxe_nfs @@ -0,0 +1,26 @@ +# vim: set ft=sh: + +run_hook() { + if [[ -n "${ip}" && -n "${archiso_nfs_srv}" ]]; then + + archiso_nfs_srv=$(eval echo ${archiso_nfs_srv}) + [[ -n "${archiso_nfs_opt}" ]] && archiso_nfs_opt="-o ${archiso_nfs_opt}" + + mount_handler="archiso_nfs_mount_handler" + fi +} + +archiso_nfs_mount_handler() { + newroot="${1}" + mkdir -p "/run/archiso/bootmnt" + msg ":: Mounting '${archiso_nfs_srv}'" + # Do not put "${archiso_nfs_opt}" nfsmount fails! + if ! nfsmount ${archiso_nfs_opt} "${archiso_nfs_srv}" "/run/archiso/bootmnt"; then + echo "ERROR: Mounting '${archiso_nfs_srv}'" + 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_mount_handler ${newroot} +} diff --git a/archiso/install/archiso_pxe_nfs b/archiso/install/archiso_pxe_nfs new file mode 100644 index 0000000..52be9f3 --- /dev/null +++ b/archiso/install/archiso_pxe_nfs @@ -0,0 +1,14 @@ +# vim: set ft=sh: + +build() { + MODULES="nfs" + SCRIPT="archiso_pxe_nfs" + + add_binary "/lib/initcpio/nfsmount" "/bin/nfsmount" +} + +help() { + cat <<HELPEOF + This hook loads the necessary modules for boot via PXE and NFS. +HELPEOF +} |