-def check_uid_root():
- """Check for root permissions"""
- if not os.geteuid()==0:
- sys.exit("Error: please run this script with uid 0 (root).")
+
+def install_mbr(target):
+ """Install a default master boot record on given target"""
+ print("TODO")
+
+
+def loopback_mount(iso, target):
+ """Loopback mount specified ISO on given target"""
+ print("mount -o loop %s %s") % (iso, target)
+
+
+def check_for_vat(partition):
+ """Check whether specified partition is VFAT/FAT16 filesystem"""
+ try:
+ udev_info = subprocess.Popen(["/lib/udev/vol_id", "-t",
+ partition],stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ filesystem = udev_info.communicate()[0].rstrip()
+
+ if udev_info.returncode == 2:
+ print("failed to read device %s - wrong UID / permissions?") % partition
+ return 1
+
+ if filesystem != "vfat":
+ return(1)
+
+ # TODO: check for ID_FS_VERSION=FAT16?
+
+ except OSError:
+ print("Sorry, /lib/udev/vol_id not available.")
+ return 1
+
+def copy_grml_files(target):
+ """Copy files from ISO on given target"""
+ print("TODO")
+
+
+def uninstall_files(device):
+ print("TODO")
+