-
-
Save x0341/e77c3722e7d9bf6559b0047b1e6668b4 to your computer and use it in GitHub Desktop.
Modify CSR 1000v ISO to activate serial console instead of VGA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
[[ ! "$1" =~ .*\.iso ]] && { echo ".iso file name needed"; exit; } | |
TEMP=$(mktemp -d) | |
PDIR=$(pwd) | |
if [[ "$1" =~ ^/ ]]; then | |
SRC=$1 | |
else | |
SRC=$PDIR/$1 | |
fi | |
pushd $TEMP | |
mkdir mnt && mkdir iso | |
sudo mount -o loop $SRC mnt | |
cp -a mnt/* iso | |
sed -i '/^default/s/0/1/' iso/boot/grub/menu.lst | |
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o "new-$(basename $1)" iso | |
sudo umount mnt | |
mv *.iso $PDIR | |
popd | |
rm -rf $TEMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment