From 15876c614736bae1b0217a9b798b3d7986439e90 Mon Sep 17 00:00:00 2001 From: shiva Date: Mon, 3 Jan 2022 13:20:40 +0530 Subject: [PATCH 1/2] Fix : script to write iso to a portable media --- src/write_to_media.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/write_to_media.sh diff --git a/src/write_to_media.sh b/src/write_to_media.sh new file mode 100755 index 000000000..34765f41b --- /dev/null +++ b/src/write_to_media.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# A minimal script which writes the produced iso into usb +# with the help of the dd command + +set -e + +. ./common.sh + +ISO_NAME=$SRC_DIR/minimal_linux_live.iso + +if ! [ -e $ISO_NAME ]; then + echo "You have to build the iso before running this script!" + exit 1 + +elif [ "$#" -ne 1 ]; then + echo "Invocation: $0 [DEVICE_NAME] " + echo "Example: $0 /dev/sda " + exit 1 +else + sudo dd if=$ISO_NAME of=$1 bs=4M && sync +fi + From dba5faf5693500d8ec4b98977a48e8af8fd9e202 Mon Sep 17 00:00:00 2001 From: Shivashish Date: Mon, 3 Jan 2022 13:59:12 +0530 Subject: [PATCH 2/2] Added warnings in write_to_media.sh --- src/write_to_media.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/write_to_media.sh b/src/write_to_media.sh index 34765f41b..e701c77c9 100755 --- a/src/write_to_media.sh +++ b/src/write_to_media.sh @@ -14,10 +14,11 @@ if ! [ -e $ISO_NAME ]; then exit 1 elif [ "$#" -ne 1 ]; then - echo "Invocation: $0 [DEVICE_NAME] " - echo "Example: $0 /dev/sda " + echo "Usage: $0 [DEVICE_NAME] (eg. $0 /dev/sda)" exit 1 else + echo "CAUTION: All data on device $1 will be erased" + echo "You have been warned" sudo dd if=$ISO_NAME of=$1 bs=4M && sync fi