My problem is as follows: I want to to modify my Ubuntu LiveCD to run several commands at startup, but I'm new to Ubuntu development and don't know how to do this. What is the proper way to run these commands every time I boot Ubuntu?
Here are ex. commands:
sudo rm /home/ubuntu/Desktop/examples.desktop
sudo perl -e 'print("[DesktopEntry]\nVersion=1.0\nType=Application\nTerminal=false\nIcon=xinput_calibrator\nName=Calibraion\nExec=env /usr/bin/xinput_calibrator\n");' > /home/ubuntu/Desktop/Calibrate.desktop
sudo /home/ubuntu/Desktop/Calibrate.desktop
EDIT!!!
I've actually tried modifying rc.local file and it looks like this now:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo rm /home/ubuntu/Desktop/examples.desktop
sudo perl -e 'print("[DesktopEntry]\nVersion=1.0\nType=Application\nTerminal=false\nIcon=xinput_calibrator\nName=Calibraion\nExec=env /usr/bin/xinput_calibrator\n");' > /home/ubuntu/Desktop/Calibrate.desktop
sudo /home/ubuntu/Desktop/Calibrate.desktop
exit 0
But still I don't know if it is going to work. I want to be sure before I'll build iso.
EDIT 2!!!
I've build iso file using this tutorial: https://help.ubuntu.com/community/LiveCDCustomization I've done steps:
- Extract the CD .iso contents
- Extract the Desktop system
- then I've edited the rc.local file and saved
- Assembling the file system ( I've ommited "Regenerate manifest" point)
and now I get error
No init found. Try passing init= bootarg
while booting my LiveCD.
passing init= bootarg results in:
/bin/sh: bootarg: not found
What am I doing wrong?
Thanks
rc.local
. remove them other wise it won't work