-
Notifications
You must be signed in to change notification settings - Fork 178
eSim on Ubuntu 25.04 #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RISHABH12005
wants to merge
6
commits into
FOSSEE:master
Choose a base branch
from
RISHABH12005:installer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
eSim on Ubuntu 25.04 #420
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
017f866
Rename README.md to Report.md
RISHABH12005 b0ae0db
REDME.md
RISHABH12005 3191e94
README.md
RISHABH12005 a1dfc56
Merge branch 'FOSSEE:master' into master
RISHABH12005 2a11b6b
Merge branch 'FOSSEE:master' into master
RISHABH12005 ee67014
Add files via upload
RISHABH12005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,234 @@ | ||
| #!/bin/bash | ||
|
|
||
| config_dir="$HOME/.esim" | ||
| config_file="config.ini" | ||
| eSim_Home=`pwd` | ||
| ngspiceFlag=0 | ||
|
|
||
|
|
||
| ############################################### | ||
| # ERROR | ||
| ############################################### | ||
| error_exit() { | ||
| echo -e "\n\nError! Kindly resolve above error(s) and try again." | ||
| echo -e "\nAborting Installation...\n" | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # CREATE CONFIG FILE | ||
| ############################################### | ||
| createConfigFile() { | ||
|
|
||
| if [ -d $config_dir ]; then | ||
| rm $config_dir/$config_file && touch $config_dir/$config_file | ||
| else | ||
| mkdir $config_dir && touch $config_dir/$config_file | ||
| fi | ||
|
|
||
| echo "[eSim]" >> $config_dir/$config_file | ||
| echo "eSim_HOME = $eSim_Home" >> $config_dir/$config_file | ||
| echo "LICENSE = %(eSim_HOME)s/LICENSE" >> $config_dir/$config_file | ||
| echo "KicadLib = %(eSim_HOME)s/library/kicadLibrary.tar.xz" >> $config_dir/$config_file | ||
| echo "IMAGES = %(eSim_HOME)s/images" >> $config_dir/$config_file | ||
| echo "VERSION = %(eSim_HOME)s/VERSION" >> $config_dir/$config_file | ||
| echo "MODELICA_MAP_JSON = %(eSim_HOME)s/library/ngspicetoModelica/Mapping.json" >> $config_dir/$config_file | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # INSTALL NGHDL | ||
| ############################################### | ||
| installNghdl() { | ||
| echo "Installing NGHDL..." | ||
| unzip -o nghdl.zip | ||
| cd nghdl/ | ||
| chmod +x install-nghdl.sh | ||
|
|
||
| trap "" ERR | ||
| ./install-nghdl.sh --install | ||
| trap error_exit ERR | ||
|
|
||
| ngspiceFlag=1 | ||
| cd ../ | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # INSTALL SKY130 | ||
| ############################################### | ||
| installSky130Pdk() { | ||
| echo "Installing SKY130 PDK..." | ||
|
|
||
| tar -xJf library/sky130_fd_pr.tar.xz | ||
| sudo rm -rf /usr/share/local/sky130_fd_pr | ||
|
|
||
| echo "Copying SKY130 PDK..." | ||
| sudo mkdir -p /usr/share/local/ | ||
| sudo mv sky130_fd_pr /usr/share/local/ | ||
| sudo chown -R $USER:$USER /usr/share/local/sky130_fd_pr/ | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # FIXED KICAD INSTALL | ||
| ############################################### | ||
| installKicad() { | ||
|
|
||
| ubuntu_version=$(lsb_release -rs) | ||
|
|
||
| echo "Installing KiCad..." | ||
|
|
||
| # If skip flag from main script | ||
| if [[ "$ESIM_SKIP_KICAD" == "1" ]]; then | ||
| echo "KiCad installation skipped (handled by main installer)." | ||
| return | ||
| fi | ||
|
|
||
| # Ubuntu 24.04 → KiCad 8 PPA | ||
| if [[ "$ubuntu_version" == "24.04" ]]; then | ||
| echo "Ubuntu 24.04 detected — installing KiCad 8 via PPA..." | ||
| sudo add-apt-repository -y ppa:kicad/kicad-8.0-releases | ||
| sudo apt update | ||
| sudo apt install -y kicad kicad-footprints kicad-libraries \ | ||
| kicad-symbols kicad-templates | ||
| return | ||
| fi | ||
|
|
||
| # Fallback for older versions | ||
| echo "Installing KiCad from Ubuntu repo..." | ||
| sudo apt update | ||
| sudo apt install -y kicad kicad-footprints kicad-libraries \ | ||
| kicad-symbols kicad-templates | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # INSTALL DEPENDENCIES | ||
| ############################################### | ||
| installDependency() { | ||
|
|
||
| set +e | ||
| trap "" ERR | ||
|
|
||
| echo "Updating apt index..." | ||
| sudo apt-get update | ||
|
|
||
| set -e | ||
| trap error_exit ERR | ||
|
|
||
| sudo apt install -y python3-virtualenv | ||
| virtualenv $config_dir/env | ||
|
|
||
| source $config_dir/env/bin/activate | ||
|
|
||
| pip install --upgrade pip | ||
|
|
||
| sudo apt-get install -y xterm python3-psutil python3-pyqt5 python3-matplotlib python3-setuptools python3-pip | ||
|
|
||
| pip3 install watchdog | ||
| pip3 install --upgrade https://github.com/hdl/pyhdlparser/tarball/master | ||
| pip3 install makerchip-app | ||
| pip3 install sandpiper-saas | ||
| pip3 install hdlparse | ||
| pip3 install matplotlib | ||
| pip3 install PyQt5 | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # COPY KICAD LIB | ||
| ############################################### | ||
| copyKicadLibrary() { | ||
|
|
||
| if [[ "$ESIM_SKIP_KICAD" == "1" ]]; then | ||
| echo "Skipping KiCad library copy." | ||
| return | ||
| fi | ||
|
|
||
| tar -xJf library/kicadLibrary.tar.xz | ||
|
|
||
| mkdir -p ~/.config/kicad/6.0 | ||
|
|
||
| cp kicadLibrary/template/sym-lib-table ~/.config/kicad/6.0/ | ||
| sudo cp -r kicadLibrary/eSim-symbols/* /usr/share/kicad/symbols/ | ||
|
|
||
| rm -rf kicadLibrary | ||
| sudo chown -R $USER:$USER /usr/share/kicad/symbols/ | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # CREATE DESKTOP ICON | ||
| ############################################### | ||
| createDesktopStartScript() { | ||
|
|
||
| echo '#!/bin/bash' > esim-start.sh | ||
| echo "cd $eSim_Home/src/frontEnd" >> esim-start.sh | ||
| echo "source $config_dir/env/bin/activate" >> esim-start.sh | ||
| echo "python3 Application.py" >> esim-start.sh | ||
|
|
||
| sudo chmod 755 esim-start.sh | ||
| sudo cp -vp esim-start.sh /usr/bin/esim | ||
| rm esim-start.sh | ||
|
|
||
| echo "[Desktop Entry]" > esim.desktop | ||
| echo "Version=1.0" >> esim.desktop | ||
| echo "Name=eSim" >> esim.desktop | ||
| echo "Exec=esim %u" >> esim.desktop | ||
| echo "Terminal=true" >> esim.desktop | ||
| echo "Type=Application" >> esim.desktop | ||
| echo "Icon=$config_dir/logo.png" >> esim.desktop | ||
| echo "Categories=Development;" >> esim.desktop | ||
|
|
||
| sudo chmod 755 esim.desktop | ||
| sudo cp -vp esim.desktop /usr/share/applications/ | ||
| cp -vp esim.desktop $HOME/Desktop/ | ||
|
|
||
| gio set $HOME/Desktop/esim.desktop "metadata::trusted" true | ||
| chmod a+x $HOME/Desktop/esim.desktop | ||
| rm esim.desktop | ||
|
|
||
| cp -vp images/logo.png $config_dir | ||
| } | ||
|
|
||
|
|
||
| ############################################### | ||
| # MAIN LOGIC | ||
| ############################################### | ||
|
|
||
| if [[ $# -ne 1 ]]; then | ||
| echo "USAGE:" | ||
| echo "./install-eSim.sh --install" | ||
| echo "./install-eSim.sh --uninstall" | ||
| exit 1 | ||
| fi | ||
|
|
||
| option=$1 | ||
|
|
||
|
|
||
| # ----------- INSTALL MODE -------------- | ||
| if [[ $option == "--install" ]]; then | ||
|
|
||
| set -e | ||
| set -E | ||
| trap error_exit ERR | ||
|
|
||
| echo -n "Is your internet connection behind proxy? (y/n): " | ||
| read getProxy | ||
|
|
||
| if [[ $getProxy == "y" || $getProxy == "Y" ]]; then | ||
| echo "Proxy not recommended — skipping." | ||
| fi | ||
|
|
||
| createConfigFile | ||
| installDependency | ||
| installKicad | ||
| copyKicadLibrary | ||
| installNghdl | ||
| installSky130Pdk | ||
| createDesktopStartScript | ||
|
|
||
| echo "----------------- eSim Installed Successfully -----------------" | ||
| fi | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| #!/bin/bash | ||
|
|
||
| # ============================================================ | ||
| # Function to detect Ubuntu version | ||
| # ============================================================ | ||
| get_ubuntu_version() { | ||
| VERSION_ID=$(grep "^VERSION_ID" /etc/os-release | cut -d '"' -f 2) | ||
| FULL_VERSION=$(lsb_release -rs) | ||
| echo "Detected Ubuntu Version: $FULL_VERSION" | ||
| } | ||
|
|
||
| # ============================================================ | ||
| # KiCad fix for Ubuntu 25.04 | ||
| # ============================================================ | ||
| install_kicad_for_25() { | ||
| echo "" | ||
| echo "===============================================" | ||
| echo " Ubuntu 25.04 detected — KiCad PPA NOT SUPPORTED" | ||
| echo " Installing KiCad from Ubuntu repository..." | ||
| echo "===============================================" | ||
| echo "" | ||
|
|
||
| sudo apt update | ||
| sudo apt install -y kicad kicad-footprints kicad-libraries \ | ||
| kicad-symbols kicad-templates | ||
|
|
||
| echo "KiCad installation complete." | ||
| } | ||
|
|
||
| # ============================================================ | ||
| # Function to run proper installer | ||
| # ============================================================ | ||
| run_version_script() { | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/install-eSim-scripts" | ||
|
|
||
| case $VERSION_ID in | ||
| "22.04") SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" ;; | ||
| "23.04") SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh" ;; | ||
| "24.04") SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh" ;; | ||
| "25.04") | ||
| echo "Ubuntu 25.04 detected — enabling compatibility mode." | ||
| SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh" | ||
| ;; | ||
| *) | ||
| echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| # Special Fix for KiCad | ||
| if [[ "$VERSION_ID" == "25.04" ]]; then | ||
| install_kicad_for_25 | ||
| export ESIM_SKIP_KICAD=1 | ||
| else | ||
| export ESIM_SKIP_KICAD=0 | ||
| fi | ||
|
|
||
| # Execute final script | ||
| echo "Running: $SCRIPT $ARGUMENT" | ||
| bash "$SCRIPT" "$ARGUMENT" | ||
| } | ||
|
|
||
| # ============================================================ | ||
| # MAIN LOGIC | ||
| # ============================================================ | ||
|
|
||
| if [[ $# -ne 1 ]]; then | ||
| echo "Usage: $0 --install | --uninstall" | ||
| exit 1 | ||
| fi | ||
|
|
||
| ARGUMENT=$1 | ||
| if [[ "$ARGUMENT" != "--install" && "$ARGUMENT" != "--uninstall" ]]; then | ||
| echo "Usage: $0 --install | --uninstall" | ||
| exit 1 | ||
| fi | ||
|
|
||
| get_ubuntu_version | ||
| run_version_script | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess there is some file exist. if u see this tthere is somewhere install-esim.sh. So i guess u need to udpate that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please discuss that with the maintainer.