(* Fedora gives an error if this file doesn't exist. *)
sh "touch /etc/resolv.conf";
-(*
- (* We can run /mnt/root/etc/init.d/network in a chroot environment,
- * however this won't work directly because the architecture of the
- * binaries under /mnt/root (eg. /mnt/root/sbin/ip) might not match
- * the architecture of the live CD kernel. In particular, a 32 bit
- * live CD cannot run 64 bit binaries. So we also have to bind-mount
- * the live CD's /bin, /sbin, /lib etc. over the equivalents in
- * /mnt/root.
- *)
- let bind dir =
- if is_dir dir = Some true then
- sh ("mount -o bind " ^ quote dir ^ " " ^ quote ("/mnt/root" ^ dir))
- in
- let unbind dir =
- if is_dir dir = Some true then sh ("umount -l " ^ quote ("/mnt/root" ^ dir))
- in
- let dirs = [
- "/bin"; "/sbin"; "/lib"; "/lib64";
- "/usr/bin"; "/usr/sbin"; "/usr/lib"; "/usr/lib64";
- "/proc"; "/sys"
- ] in
- List.iter bind dirs;
- let status = shwithstatus "chroot /mnt/root /etc/init.d/network start" in
- List.iter unbind dirs;
-*)
-
- (* Simpler way to do the above.
- * NB. Lazy unmount is required because dhclient keeps its current
+ (* NB. Lazy unmount is required because dhclient keeps its current
* directory open on /etc/sysconfig/network-scripts/
*)
sh "mount -o bind /mnt/root/etc /etc";