index : mkinitcpio-archiso32 | |
Archlinux32 initcpio scripts used by archiso | 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 | 01eef8777a8a160456236abbd83bb6ffe61babcf (patch) | |
tree | 079cde49e107ae93c216195966a6bff5333721c5 | |
parent | 8d084c989984fda351503258de3f43089293e4e8 (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 +} |