···34 in <link xlink:href="https://www.kernel.org/doc/Documentation/kernel-parameters.txt">
35 the kernel documentation</link> for more details).</para>
36 </listitem>
0000037</itemizedlist>
38</para>
39
···34 in <link xlink:href="https://www.kernel.org/doc/Documentation/kernel-parameters.txt">
35 the kernel documentation</link> for more details).</para>
36 </listitem>
37+ <listitem>
38+ <para>If you want to load the contents of the ISO to ram after bootin
39+ (So you can remove the stick after bootup) you can append the parameter
40+ <literal>copytoram</literal>to the <literal>options</literal> field.</para>
41+ </listitem>
42</itemizedlist>
43</para>
44
+19
nixos/modules/system/boot/stage-1-init.sh
···154 fi
155 ln -s "$root" /dev/root
156 ;;
000157 esac
158done
159···473 # Wait once more for the udev queue to empty, just in case it's
474 # doing something with $device right now.
475 udevadm settle
0000000000000000476477 mountFS "$device" "$mountPoint" "$options" "$fsType"
478done
···154 fi
155 ln -s "$root" /dev/root
156 ;;
157+ copytoram)
158+ copytoram=1
159+ ;;
160 esac
161done
162···476 # Wait once more for the udev queue to empty, just in case it's
477 # doing something with $device right now.
478 udevadm settle
479+480+ # If copytoram is enabled: skip mounting the ISO and copy its content to a tmpfs.
481+ if [ -n "$copytoram" ] && [ "$device" = /dev/root ] && [ "$mountPoint" = /iso ]; then
482+ fsType=$(blkid -o value -s TYPE "$device")
483+ fsSize=$(blockdev --getsize64 "$device")
484+485+ mkdir -p /tmp-iso
486+ mount -t "$fsType" /dev/root /tmp-iso
487+ mountFS tmpfs /iso size="$fsSize" tmpfs
488+489+ cp -r /tmp-iso/* /mnt-root/iso/
490+491+ umount /tmp-iso
492+ rmdir /tmp-iso
493+ continue
494+ fi
495496 mountFS "$device" "$mountPoint" "$options" "$fsType"
497done