aboutsummaryrefslogtreecommitdiff
path: root/repo
diff options
context:
space:
mode:
authorIbrahim Mkusa <ibrahimmkusa@gmail.com>2024-08-10 18:47:12 -0400
committerIbrahim Mkusa <ibrahimmkusa@gmail.com>2024-08-10 18:47:12 -0400
commit845965a1206e8b628f12d983a39386d93b33e212 (patch)
tree70ada75f081c74a4a9d892f4557bbe610dec8d48 /repo
parent05bc215be13604b5623167db3935b07a3acea04c (diff)
Add locally availables repos to system
Diffstat (limited to 'repo')
-rw-r--r--repo/add_repo_from_iso.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/repo/add_repo_from_iso.sh b/repo/add_repo_from_iso.sh
new file mode 100644
index 0000000..de3d554
--- /dev/null
+++ b/repo/add_repo_from_iso.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+#description: common method for creating a repository from iso files(USB, dvd)
+
+# Make sure the dvd/iso is available to the system as a CD or anywhere in the
+# file system
+# copy it to a local location
+if="/dev/sr0"
+of="/ubuntu22.iso" # contents are in iso9660 filesystem. Need to be mounted later
+repo_location="/repo" # location mounted on the filesystem
+sudo mkdir $repo_location
+sudo dd if=$if of=$of bs=1M status='progress'
+
+# Automount iso contents to repo_location to have available to machine
+# unquoted delimiter in the here doc allows variable substitution
+sudo cat >> /etc/fstab <<EOF
+$of $repo_location iso9660 defaults 0 0
+EOF
+
+# verify /etc/stab changes and mount everything
+sudo mount -a
+ls $repo_location