SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-03-30 18:51:39

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

HOW TO: Debian netinstall with a custom script

There are basically 2 ways of running debian testing a.k.a. wheezy (or unstable a.k.a. sid) with crunchbang goodies:
1) you can either install #! (based on debian stable a.k.a. squeeze) and then do an upgrade to wheezy (or sid) - see these links if you are interested http://crunchbanglinux.org/forums/topic … o-testing/
http://crunchbanglinux.org/forums/topic … se-to-sid/
2) or you can download and install debian wheezy netinstall and crunchify it to your liking with a custom script. I stumbled upon this method on omns and linux blog so huge thanks to him for introducing me to build-scripts. Since his site is no longer available I decided to write a little how-to about it for other crunchbangers.
You will need
- debian wheezy netinstall image
- custom script (save it, edit it and upload to your dropbox account before installing)
- dropbox account (but this is not entirely indispensable, just more convenient - you could get it to your home folder in debian wheezy netinstall from usb or from another partition...)

STEP 1 - Customizing the script

I prepared 2 scripts for you to choose from:

- one with OPENBOX

#!/bin/sh
# A bash script for a post netinstall of packages on Debian Wheezy.
# You should be logged in as root!
#------------------------------------------------------------
clear
echo "This script has been designed by Stanie to run after"
echo "netinstall installation of Debian Wheezy. It installs"
echo "preferred package set based around the Openbox WM."
echo "Feel free to check it and make any adjustments you want."
echo "!!!Choose either Wheezy or Sid repos (Default = Sid)!!!"
echo ""
echo -n "Run installer now? (Y|n) > "
read a
if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
[ "$a" = "" ]; then
#Set Repositories
#--------
    if [ -f /etc/apt/sources.list ]; then
        cp -f /etc/apt/sources.list /etc/apt/sources.list.original
    fi
    echo "## DEBIAN" > /etc/apt/sources.list
    echo "deb http://ftp.de.debian.org/debian/ sid main contrib non-free" >> /etc/apt/sources.list
    echo "# deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## DEBIAN SECURITY" >> /etc/apt/sources.list
    echo "# deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## DEBIAN MULTIMEDIA" >> /etc/apt/sources.list
    echo "# deb http://www.deb-multimedia.org sid main non-free" >> /etc/apt/sources.list
    echo "# deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## CRUNCHBANG (Compatible with Debian Squeeze)" >> /etc/apt/sources.list
    echo "deb http://packages.crunchbang.org/statler statler main" >> /etc/apt/sources.list
    sleep 2s
#Add Keyrings
#---------------
clear
echo "Adding keyrings before upgrade..."
sleep 2s
wget http://packages.crunchbang.org/statler-dev/crunchbang.key
sleep 2s
apt-key add crunchbang.key
sleep 2s
wget http://deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2012.05.05_all.deb
sleep 2s
dpkg -i deb-multimedia-keyring_2012.05.05_all.deb
sleep 2s
echo ""
echo "keyrings added..."
echo ""
sleep 2s
#Update Repositories
#---------------
clear
echo "Upgrading new repositories before install..."
echo ""
apt-get update
echo ""
echo "All packages updated..."
echo ""
sleep 2s
#Perform Upgrade
#---------------
clear
echo "Upgrading existing packages before install..."
echo ""
apt-get dist-upgrade
echo ""
echo "All packages upgraded..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing base packages..."
echo ""
sleep 2s
apt-get install xorg gdm xfce4-notifyd xfce4-power-manager xfce4-screenshooter xfce4-taskmanager catfish gksu gdebi fakeroot checkinstall terminator ntp synaptic apt-xapian-index disk-manager ntfs-3g gparted gufw bleachbit bash-completion screen figlet whois rpl zenity xfsprogs reiserfsprogs reiser4progs avahi-utils binutils jfsutils debian-keyring firmware-linux firmware-iwlwifi
echo ""
echo "All base packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Openbox packages and #! goodies..."
echo ""
sleep 2s
apt-get install lxinput lxappearance scrot viewnior openbox obconf obmenu obapps gmrun suckless-tools tint2 gsimplecal fbxkb nitrogen crunchbang-bin-scripts crunchbang-configs
echo ""
echo "All Openbox packages and #! goodies installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing File Manager & Archivers..."
echo ""
sleep 2s
apt-get install thunar thunar-archive-plugin thunar-media-tags-plugin ffmpegthumbnailer arj bzip2 lha lzop lbzip2 p7zip p7zip-full p7zip-rar plzip rzip unace-nonfree unalz unrar unzip xz-utils zip zoo
echo ""
echo "All File Manager & Archivers installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Audio/Video packages..."
echo ""
sleep 2s
apt-get install alsa-base xfce4-mixer volumeicon-alsa gstreamer0.10-alsa gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly audacious audacity easytag vlc
echo ""
echo "All Audio/Video packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Graphics & Themes packages..."
echo ""
sleep 2s
apt-get install gimp gcolor2 inkscape ttf-bitstream-vera ttf-dejavu ttf-freefont ttf-mscorefonts-installer oxygencursors gtk2-engines-murrine elementary-icon-theme
echo ""
echo "All Graphics & Themes packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Network packages..."
echo ""
sleep 2s
apt-get install deluge chromium-browser chromium-l10n network-manager-gnome network-manager-openvpn-gnome network-manager-pptp-gnome network-manager-vpnc-gnome xchat
echo ""
echo "All Network packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Office packages..."
echo ""
sleep 2s
apt-get install epdfview galculator geany geany-plugins libreoffice libreoffice-gtk
echo ""
echo "All Office packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Misc packages..."
echo ""
sleep 2s
apt-get install apt-listbugs assogiate conky conky-all kupfer parcellite rcconf secure-delete wipe clamav
echo ""
echo "All Misc packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing packages without recommends..."
echo ""
sleep 2s
apt-get --no-install-recommends install file-roller
echo ""
echo "All packages installed..."
echo ""
sleep 2s

#Clean up downloaded packages
#----------------------------
clear
echo ""
echo "Clean up..."
sleep 1s
apt-get clean


#Prompt for reboot
#-----------------
clear
echo "Installation complete!"
echo "You will now need to reboot your system."
echo ""
echo -n "Reboot now? (Y|n) > "
read a
if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
[ "$a" = "" ]; then
echo "Goodbye."
echo "Rebooting..."
sleep 4s
reboot
exit
else
echo "Issue the following command as root to reboot:"
echo ""
echo "reboot"
echo ""
echo "Goodbye!"
fi
fi
exit

- and one with XFCE

#!/bin/sh
# A bash script for a post netinstall of packages on Debian Wheezy.
# You should be logged in as root!
#------------------------------------------------------------
clear
echo "This script has been designed by Stanie to run after"
echo "netinstall installation of Debian Wheezy. It installs"
echo "preferred package set with the Xfce DE."
echo "Feel free to check it and make any adjustments you want."
echo "!!!Choose either Wheezy or Sid repos (Default = Sid)!!!"
echo ""
echo -n "Run installer now? (Y|n) > "
read a
if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
[ "$a" = "" ]; then
#Set Repositories
#--------
    if [ -f /etc/apt/sources.list ]; then
        cp -f /etc/apt/sources.list /etc/apt/sources.list.original
    fi
    echo "## DEBIAN" > /etc/apt/sources.list
    echo "deb http://ftp.de.debian.org/debian/ sid main contrib non-free" >> /etc/apt/sources.list
    echo "# deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## DEBIAN SECURITY" >> /etc/apt/sources.list
    echo "# deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## DEBIAN MULTIMEDIA" >> /etc/apt/sources.list
    echo "# deb http://www.deb-multimedia.org sid main non-free" >> /etc/apt/sources.list
    echo "# deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## CRUNCHBANG (Compatible with Debian Squeeze)" >> /etc/apt/sources.list
    echo "deb http://packages.crunchbang.org/statler statler main" >> /etc/apt/sources.list
    sleep 2s
#Add Keyrings
#---------------
clear
echo "Adding keyrings before upgrade..."
sleep 2s
wget http://packages.crunchbang.org/statler-dev/crunchbang.key
sleep 2s
apt-key add crunchbang.key
sleep 2s
wget http://deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2012.05.05_all.deb
sleep 2s
dpkg -i deb-multimedia-keyring_2012.05.05_all.deb
sleep 2s
echo ""
echo "keyrings added..."
echo ""
sleep 2s
#Update Repositories
#---------------
clear
echo "Upgrading new repositories before install..."
echo ""
apt-get update
echo ""
echo "All packages updated..."
echo ""
sleep 2s
#Perform Upgrade
#---------------
clear
echo "Upgrading existing packages before install..."
echo ""
apt-get dist-upgrade
echo ""
echo "All packages upgraded..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing base packages..."
echo ""
sleep 2s
apt-get install xorg gdm gksu gdebi fakeroot checkinstall terminator ntp synaptic apt-xapian-index disk-manager ntfs-3g gparted gufw bleachbit bash-completion screen figlet whois rpl zenity xfsprogs reiserfsprogs reiser4progs avahi-utils binutils jfsutils debian-keyring firmware-linux firmware-iwlwifi
echo ""
echo "All base packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing XFCE packages..."
echo ""
sleep 2s
apt-get install xfce4 xfdesktop4 xfce4-datetime-plugin xfce4-places-plugin xfce4-notifyd xfce4-power-manager xfce4-power-manager-plugins xfce4-quicklauncher-plugin xfce4-taskmanager xfce4-weather-plugin xfce4-xkb-plugin xfce4-mixer xfce4-screenshooter catfish ristretto
echo ""
echo "All XFCE packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing File Manager & Archivers..."
echo ""
sleep 2s
apt-get install thunar thunar-archive-plugin thunar-media-tags-plugin ffmpegthumbnailer arj bzip2 lha lzop lbzip2 p7zip p7zip-full p7zip-rar plzip rzip unace-nonfree unalz unrar unzip xz-utils zip zoo
echo ""
echo "All File Manager & Archivers installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Audio/Video packages..."
echo ""
sleep 2s
apt-get install alsa-base xfce4-mixer volumeicon-alsa gstreamer0.10-alsa gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly audacious audacity easytag vlc
echo ""
echo "All Audio/Video packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Graphics & Themes packages..."
echo ""
sleep 2s
apt-get install gimp gcolor2 inkscape ttf-bitstream-vera ttf-dejavu ttf-freefont ttf-mscorefonts-installer oxygencursors gtk2-engines-murrine elementary-icon-theme
echo ""
echo "All Graphics & Themes packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Network packages..."
echo ""
sleep 2s
apt-get install deluge chromium-browser chromium-l10n network-manager-gnome network-manager-openvpn-gnome network-manager-pptp-gnome network-manager-vpnc-gnome xchat
echo ""
echo "All Network packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Office packages..."
echo ""
sleep 2s
apt-get install epdfview galculator geany geany-plugins libreoffice libreoffice-gtk
echo ""
echo "All Office packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing Misc packages..."
echo ""
sleep 2s
apt-get install apt-listbugs assogiate conky conky-all kupfer parcellite rcconf secure-delete wipe clamav
echo ""
echo "All Misc packages installed..."
echo ""
sleep 2s
#------------------------------------
clear
echo "Installing packages without recommends..."
echo ""
sleep 2s
apt-get --no-install-recommends install file-roller
echo ""
echo "All packages installed..."
echo ""
sleep 2s

#Clean up downloaded packages
#----------------------------
clear
echo ""
echo "Clean up..."
sleep 1s
apt-get clean


#Prompt for reboot
#-----------------
clear
echo "Installation complete!"
echo "You will now need to reboot your system."
echo ""
echo -n "Reboot now? (Y|n) > "
read a
if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
[ "$a" = "" ]; then
echo "Goodbye."
echo "Rebooting..."
sleep 4s
reboot
exit
else
echo "Issue the following command as root to reboot:"
echo ""
echo "reboot"
echo ""
echo "Goodbye!"
fi
fi
exit

Before using the script you may like to edit it to suit your own needs. For example I added Debian multimedia repos to sources.list - but I use it only when I need something particular so I disable this during install. I also prefer file-roller (without recommends) to squeeze, deluge to transmission, xfce4-notifyd (easily adjustable through command xfce4-notifyd-config) to notify-osd and gdm to lightdm (because gdm allows you to easily switch between installed languages - is this possible with lightdm yet?).

WARNING: As you can see debian sid is default - so if you want wheezy go to line 22 and add hash symbol in front of the repo and uncomment the ones in lines 23 and 26. Also not all of you use mirrors for germany so instead of de use yours - like us, uk. And I don't see a need for source code in my sources.list in case you are wondering...
I also divided the installation process into categories Audio/Video, Office, etc. for a better view. You will be asked if you want to install chosen packages in every category, so if you want to approve the install only once delete the categories and make one huge list of all packages. You can even add openbox section into xfce script (or vice versa) and install both openbox WM and xfce DE at once. It is really up to you.
Save it e.g. as debian-openbox.sh or debian-xfce.sh, upload it to your dropbox and write down the path to it. Now you are ready to go.

STEP 2 - Netinstall

Download and install a basic netinstall using an image from here http://www.debian.org/devel/debian-installer/
Choose netinst CD image - for most of you either i386 or amd64.
The installation is quite straightforward. I've had a few problems with graphical install so go with install instead. In section "Choose software to install" uncheck Debian desktop environment and leave only Laptop (if you need it) and Standard system utilities. After reboot the system will start in tty1. And now comes the script part.

STEP 3 - Running the script

Download your script from dropbox with wget:

If you want to edit it or check once more use nano.
Make it executable with

chmod +x debian-openbox.sh

You will have to run it as root! BTW debian does not come with sudo out of the box. Use command su and login instead!
As root write

./debian-openbox.sh

Now let the script do its work and when it is finished - reboot.

STEP 4 - Solving known problems

A) XFCE difficulties

Last time I checked there were no problems either in wheezy or sid. The only thing out of order is the gtk3 apps ugliness and your user missing from sudoers (so that you can use sudo).

- To make gtk3 look better choose a theme like greybird (that works both with gtk2 and gtk3) and create a folder gtk-3.0 in your ~/.config directory. Place settings.ini in there with a similar content to this:

[Settings]
gtk-theme-name = greybird
gtk-application-prefer-dark-theme = false
gtk-font-name = Sans 10
gtk-icon-theme-name = elementary
gtk-cursor-theme-name = oxy-black
gtk-button-images = 0
gtk-menu-images = 0
gtk-auto-mnemonics = 0

- To use sudo type su in terminal and then command visudo
There are a few options how to do it, but my preferred way is to write another line below
root ALL=(ALL:ALL) ALL in User privilege specification

yourusername ALL=(ALL:ALL) ALL


B) OPENBOX difficulties (most changes will be applied after logout or reboot)

This is not so easy peasy as with xfce. But not too terrible either.

- First of all you may encounter difficulty during login in gdm. If you are automatically logged out with a comment like "Your session was shorter then 10 secs..." just change session from default to openbox and make it default.

- Exit cb-welcome script or open another terminal and allow sudo (see above)

- Gtk3 ugliness (solution above + if you want your root apps to have nicer look run

gksu lxappearance

in terminal and change that theme as well)

- network-manager applet has 2 icons in tint2 panel
Write in terminal

gksu thunar /etc/xdg/autostart

You will see either Network Manager or Network - open it with geany and scroll down. Add OPENBOX in NotShowIn and save it

NotShowIn=KDE;OPENBOX;

- Don't know if this effects only sid or wheezy as well, but cb-exit (exit in your menu) won't work; or at least reboot and shutdown button. You can find a solution in this thread http://crunchbanglinux.org/forums/topic … -oblogout/
My preference is to tinker a little bit with cb-exit script

gksu geany /usr/bin/cb-exit

and change the execs according to jelloir's proposed openbox menu in post 14 from the abovementioned thread. I usually comment out #! repo after successful installation so there is no need to worry of it being overwritten without my knowledge.

- BTW don't forget to edit your openbox menu.


So there you have it. It really is not so hard. It takes about 1 hour to do a complete netinstall with my custom script so it is definitely faster than upgrade. And I can choose the packages so no nautilus or other rubbish without my permission. But I definitely wouldn't recommend it to new users.

As always back up and don't expect an effortless course because accidents happen ;-)
Let me know your ideas, comments and corrections. Feedback is always appreciated.


EDIT 1: Added file-roller without recommends to XFCE script.

EDIT 2: Suckless-tools no longer collide with ncurses-term! The problematic version was ncurses-term 5.9-5. In DEBIAN SID there is v. 5.9-7 and in WHEEZY v. 5.9-6 so that is one less problem in OPENBOX camp. I deleted that part from OPENBOX difficulties to avoid confusion.

EDIT 3: Updated deb-multimedia-keyring and deb-multimedia repo in both scripts!

Last edited by Stanie (2012-08-23 21:44:21)


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

Help fund CrunchBang, donate to the project!

#2 2012-03-31 09:44:14

zengrapefruit
#! Junkie
Registered: 2009-12-11
Posts: 272

Re: HOW TO: Debian netinstall with a custom script

Nice one, Stanie. smile

Whenever I install CB, I always have to remove over 300gb worth of stuff, only to put 300gb worth of (different) stuff back.

Because of this, I've tried to do a net install myself a few times but always got stuck at some point. Your guide should be a massive help.

Cheers.

Offline

#3 2012-03-31 10:10:36

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

^ Thanks, zengrapefruit.
You shouldn't remove only stuff you won't need anymore when preparing for an upgrade - for example file-roller will pull with it nautilus during upgrade so it is prudent to remove even stuff with possible conflicts and then download it again later with sudo apt-get --no-install-recommends install.
This and one serious dependency loop/hell on older machines are the reasons I went with netinstall + build script over upgrade.


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#4 2012-04-04 01:33:18

busprof
#! Member
Registered: 2011-03-13
Posts: 68

Re: HOW TO: Debian netinstall with a custom script

Very nice work, Stanie.  The Openbox version works quite well.  I am going to use your script as a base for a Window Maker version over the next few days.  Thanks for sharing this!

Offline

#5 2012-04-04 06:06:51

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

^ You're welcome, busprof. Glad it went well for you wink


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#6 2012-04-04 06:08:24

Ozitraveller
#! CrunchBanger
From: Far from the madding crowd!
Registered: 2011-04-26
Posts: 214

Re: HOW TO: Debian netinstall with a custom script

Nice job Stanie smile

I have a similar script that takes me from debian testing to sid

- Don't know if this effects only sid or wheezy as well, but cb-exit (exit in your menu) won't work; or at least reboot and shutdown button. You can find a solution in this thread http://crunchbanglinux.org/forums/topic … -oblogout/
My preference is to tinker a little bit with cb-exit script
gksu geany /usr/bin/cb-exit
and change the execs according to jelloir's proposed openbox menu in post 14 from the abovementioned thread. I usually comment out #! repo after successful installation so there is no need to worry of it being overwritten without my knowledge.

I can recommend this. If you don't have hal installed then this is the way to go.

Offline

#7 2012-05-01 19:19:23

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

Just a little update for Openbox camp:
Latest ncurses-term v. 5.9-7 in debian sid no longer seems to collide with suckless-tools! So this problem is solved. I will add this info the how-to also.


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#8 2012-05-09 06:06:36

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

There was a change in debian-multimedia-keyring a few days ago. The new one is deb-multimedia-keyring_2012.05.05_all.deb instead of debian-multimedia-keyring_2010.12.26_all.deb. Also its path is slightly different.

EDIT: Well it seems, that not only keyring was updated bud the whole debian multimedia repo domain as well. Instead of debian-multimedia.org they recommend to replace it with deb-multimedia.org. But don't worry, they will maintain both of them and keep them synchronized for now - details in the link above.

I have updated both openbox and xfce script accordingly.

Last edited by Stanie (2012-05-15 17:49:43)


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#9 2012-09-26 23:47:02

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

Hi Stanie!

Can I use/run your script in a x64 bit system?
Or do I need to change some lines?

What lines do I need to change to use your script for window maker?

Well too many questions I think!?! big_smile

Thanks

Last edited by gunt (2012-09-27 00:00:22)

Offline

#10 2012-09-27 01:06:39

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

I'm trying to run the openbox script and I'm getting this error

./debian-openbox.sh: line1: Syntax error: redirection unexpected

It seems it has to do with the bin bash

I google it and find this  http://stackoverflow.com/questions/2462 … unexpected

Does your script reference /bin/bash or /bin/sh in its hash bang line? The default system shell in Ubuntu is dash, not bash, so if you have #!/bin/sh then your script will be using a different shell than you expect. Dash does not have the <<< redirection operator.

I change it but I have the same error

Offline

#11 2012-09-27 02:00:17

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

It was dropbox, I try to edit it and it show a lot of code with javascript so i upload to my server instead.
And is running as a i type. Lets see what happens.

Offline

#12 2012-09-28 17:45:05

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

Hello gunt,

make sure you have all the important lines in the script (especially the first line with #!/bin/sh) intact. I have tried a slightly modified version with both Openbox and XFCE about a week ago without any probs.
I only have 32bit but it should work with 64 as well. Let me know if you encounter any errors.

I am not familiar with WindowMaker so I can't tell you what to add, but you can install these packages after installation and then switch to it and use it instead of Openbox. You will surely find a HowTo in here - just a quick search gave me this result.
You can of course change the part with "Installing Openbox packages and #! goodies..." and replace at least some of them with the packages needed for WindowMaker...


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#13 2012-10-02 17:11:43

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

@Stanie thanks for your response

I use your openbox script. I change

http://ftp.de.debian.org/debian/

 

with the new redirector from debian

http://http.debian.net/debian

In the  78 line of your script I change gdm for slim

clear
echo "Installing base packages..."
echo ""
sleep 2s
# SLIM INSTEAD GDM
apt-get install xorg slim xfce4-notifyd xfce4-power-manager xfce4-screenshooter xfce4-taskmanager catfish gksu gdebi fakeroot checkinstall terminator ntp synaptic apt-xapian-index disk-manager ntfs-3g gparted gufw bleachbit bash-completion screen figlet whois rpl zenity xfsprogs reiserfsprogs reiser4progs avahi-utils binutils jfsutils debian-keyring firmware-linux firmware-iwlwifi
echo ""
echo "All base packages installed..."
echo ""
sleep 2s

In the 88 line I change

crunchbang-bin-scripts crunchbang-configs   to   cb-metapackage cb-configs

According to corenominal waldorf update post
http://crunchbanglinux.org/forums/post/260816/#p260816

clear
echo "Installing Openbox packages and #! goodies..."
echo ""
sleep 2s
apt-get install lxinput lxappearance scrot viewnior openbox obconf obmenu obapps gmrun suckless-tools tint2 gsimplecal fbxkb nitrogen cb-metapackage cb-configs
echo ""
echo "All Openbox packages and #! goodies installed..."
echo ""
sleep 2s

And change other to my needs


I try many many times with gdm, and it failed.  "Failed to execute login command"
I try with gdm, slim and lightDm, with lightdm I log in succesful.
But when I switch to slim I got again the same message 

 "Failed to execute login command"

This is what i did.
1.  I enter in recover mode.
2. Uninstall Slim this way

apt-get purge slim
aptitude purge ~c
apt-get install slim

3. Edit the xinitrc file. commenting

#. /etc/X11/Xsession
 and add exec openbox-session
#!/bin/sh

# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)

# invoke global X session script
#. /etc/X11/Xsession
exec openbox-session

Then reboot enter my user and password
only shell

and run startx. It works!! It run very well.
Now I will decide to try to fix this or install lightdm

If anyone have the same error.
This is your option to enter again to the openbox-session

Last edited by gunt (2012-10-02 17:13:48)

Offline

#14 2012-10-02 19:47:56

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

^ Glad it worked for you and that you found a way to login after all. For anyone having the same trouble, here is the original thread

And I assume that in your sources.list you have now

deb http://packages.crunchbang.org/waldorf waldorf main
instead of
deb http://packages.crunchbang.org/statler statler main

Like you I also use this script with waldorf configs. But till now I have installed only a few
cb-conky cb-exit cb-lock cb-pipemenus cb-tint2 cb-welcome cb-wmhacks with my old openbox settings... Thanks for letting me know about cb-configs. I didn't know about this welcome addition. Will definitely try it in the near future, but cb-metapackage seems to want to pull way too many dependencies with it - over 100 packages and most of them I do not need so I will skip this one big_smile


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#15 2012-10-03 18:02:52

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

@Stanie

Your assume is right!! smile

I'm using

waldor waldorf main

Yes, cb-metapackes = too many dependencies

I'll skip that, too.

Offline

#16 2012-10-04 15:59:31

busprof
#! Member
Registered: 2011-03-13
Posts: 68

Re: HOW TO: Debian netinstall with a custom script

gunt wrote:

What lines do I need to change to use your script for window maker?

@gunt

I have a modified version of Stanie's script that installs a Window Maker environment.   Here's the script:

#!/bin/sh
# A bash script for a post netinstall of packages on Debian Wheezy.
# You should be logged in as root!
#------------------------------------------------------------
clear
echo "This script has been designed by Stanie and modified by"
echo "busprof to run after a netinstall installation of Debian Wheezy."
echo "It installs a preferred set of packages with the Window Maker window manager."
echo "Feel free to check it and make any adjustments you want."
echo ""
echo "Please note that this script is intended for 64-bit (AMD64) systems ONLY."
echo "While most of the script is generic and will work on 32 or 64-bit systems, there"
echo "is one dockapp (wmsystemtray) that is currently only available for 64-bit systems."
echo "You are free to run this and see what happens -- I think the worst that might occur"
echo "is that the installation of wmsystemtray will fail but the rest of the install will"
echo "be okay - but YOU HAVE BEEN WARNED!!"
sleep 2s
echo ""
echo "!!!This script defaults to the Wheezy (testing) version of Debian.  If you want!!!"
echo "!!!the Squeeze (stable) version, stop the installer NOW and edit this script to indicate!!!"
echo "!!!the Squeeze (stable) repos instead of the Wheezy (testing) repos!!!"
echo -n "Run installer now? (Y|n) > "
read a
if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
[ "$a" = "" ]; then
#Set Repositories
#------------------------------------------------------------
    if [ -f /etc/apt/sources.list ]; then
        cp -f /etc/apt/sources.list /etc/apt/sources.list.original
    fi
    echo "## DEBIAN" > /etc/apt/sources.list
    echo "#deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free" >> /etc/apt/sources.list
    echo "deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    echo "## DEBIAN SECURITY" >> /etc/apt/sources.list
    echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list
    echo "" >> /etc/apt/sources.list
    sleep 2s
#Update Repositories
#-------------------------------------------------------------
clear
echo "Upgrading repository package lists before install..."
echo ""
aptitude update
echo ""
echo "All packages updated..."
echo ""
sleep 2s
#Perform Upgrade
#--------------------------------------------------------------
clear
echo "Upgrading existing packages before install..."
echo ""
aptitude upgrade
echo ""
echo "All packages upgraded..."
echo ""
sleep 2s
#------------------------------------------------------------
clear
echo "Installing base packages..."
echo ""
sleep 2s
aptitude install xorg xdm gksu gdebi fakeroot checkinstall terminator ntp synaptic apt-xapian-index disk-manager ntfs-3g gparted gufw  bash-completion screen byobu figlet whois rpl zenity xfsprogs avahi-utils binutils jfsutils debian-keyring firmware-linux firmware-iwlwifi sudo
echo ""
echo "All base packages installed..."
echo ""
sleep 2s
#------------------------------------------------------------
#Preparing user environment for Window Maker
#------------------------------------------------------------
clear
echo ""
echo "Creating directory ~/GNUstep..."
mkdir ~/GNUstep
echo "Directory ~/GNUstep created."
echo ""
sleep 2s
#------------------------------------------------------------
#Install Window Maker Packages
#------------------------------------------------------------
clear
echo "Installing Window Maker packages and assorted dockapps..."
echo ""
sleep 2s
aptitude install wmaker wmaker-common wmaker-data wmacpi wmbutton wmclock wmctrl wmmixer wmnd wmtemp wmtime wmwave wmweather wmwork wmxres
echo ""
echo "All Window Maker packages installed..."
echo ""
sleep 2s
#------------------------------------------------------------
#Add wmsystemtray Dockapp From Paul Seelig's deb File Repository <thanks Paul!>
#------------------------------------------------------------
clear
echo "Adding wmsystemtray deb file..."
sleep 2s
wget http://www.rumbero.org/wmlive/dockapps/wmsystemtray_1.2-1_amd64.deb
sleep 1s
echo "Installing wmsystemtray..."
dpkg -i wmsystemtray_1.2-1_amd64.deb
sleep 2s
echo ""
echo "wmsystemtray installed <thanks Paul Seelig for the deb file!>"
echo "wmsystemtray provides a much-needed tray for Window Maker."
echo "Upon first run, you will need to run wmsystemtray from a terminal"
echo "or from an Execute dialog and add wmsystemtray to your dock."
echo "Set wmsystemtray to start every time Window Maker is started to"
echo "provide a convenient place for tray-aware applications to place"
echo "their tray icons."
echo ""
sleep 4s
#----------------------------------------------------------------
clear
echo "Installing File Manager & Archivers..."
echo ""
sleep 2s
aptitude install thunar thunar-archive-plugin thunar-media-tags-plugin ffmpegthumbnailer arj bzip2 lzop p7zip p7zip-full p7zip-rar plzip rzip unace-nonfree unalz unrar unzip xz-utils zip zoo cabextract
echo ""
echo "All File Manager & Archivers installed..."
echo ""
sleep 2s
#-----------------------------------------------------------------
clear
echo "Installing Audio/Video packages..."
echo ""
sleep 2s
aptitude install alsa-base volumeicon-alsa gstreamer0.10-alsa gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly audacious audacity easytag vlc
echo ""
echo "All Audio/Video packages installed..."
echo ""
sleep 2s
#-----------------------------------------------------------------
clear
echo "Installing Graphics & Themes packages..."
echo ""
sleep 2s
aptitude install gimp gcolor2 inkscape ttf-bitstream-vera ttf-dejavu fonts-freefont-ttf ttf-mscorefonts-installer oxygencursors gtk2-engines gtk2-engines-murrine human-icon-theme nuvola-icon-theme
echo ""
echo "All Graphics & Themes packages installed..."
echo ""
sleep 2s
#-----------------------------------------------------------------
clear
echo "Installing Network packages..."
echo ""
sleep 2s
aptitude install deluge chromium-browser chromium-browser-l10n flashplugin-nonfree network-manager-gnome network-manager-openvpn-gnome network-manager-pptp-gnome network-manager-vpnc-gnome xchat elinks links2
echo ""
echo "All Network packages installed..."
echo ""
sleep 2s
#-----------------------------------------------------------------
clear
echo "Installing Office packages..."
echo ""
sleep 2s
aptitude install cups epdfview galculator mousepad default-jre libreoffice xournal
echo ""
sleep 1s
echo "All Office packages installed..."
echo ""
sleep 2s
#-----------------------------------------------------------------
clear
echo "Installing Misc packages..."
echo ""
sleep 2s
aptitude install apt-listbugs assogiate kupfer parcellite rcconf secure-delete wipe clamav
echo ""
echo "All Misc packages installed..."
echo ""
sleep 2s
#-----------------------------------------------------------------
clear
echo "Installing packages without recommends..."
echo ""
sleep 2s
aptitude install -R file-roller
echo ""
echo "All packages installed..."
echo ""
sleep 2s

#Clean up downloaded packages
#------------------------------------------------------------------
clear
echo ""
echo "Clean up..."
sleep 1s
aptitude clean
echo ""
echo "The package cache is now clean."
sleep 1s

#Add user to lpadmin (line printer admin) group
#-----------------
echo ""
echo "We will now add the primary user to the line printer admin group"
echo "so the user may install a printer if desired without resorting to"
echo "additional work."
echo ""
read -p "Enter the user name you assigned during initial installation: " user
usermod -a -G lpadmin "$user"
echo""
sleep 1s
echo "User was added to the line printer admin group."
echo ""
sleep 1s
#-------------------------------------------------------------
echo""
clear
echo "Downloading a list of installed dockapps for future reference..."
sleep 2s
wget http://dl.dropbox.com/u/19849146/dockapplist.txt
echo "The file dockapplist.txt has been saved to ~/"
echo ""
echo "Please open the file after system installation to view the available"
echo "dockapps.  You must open these dockapps via the command line on first"
echo "use.  You may 'dock' them once they are opened. They will appear on the"
echo "dock each time you start your system thereafter."
sleep 4s
#Prompt for reboot
#-----------------
clear
echo "Installation complete!"
echo "You will now need to reboot your system."
echo ""
echo -n "Reboot now? (Y|n) > "
read a
if [ "$a" = "y" ] || [ "$a" = "Y" ] || \
[ "$a" = "" ]; then
echo "Goodbye."
echo "Rebooting..."
sleep 4s
reboot
exit
else
echo "Issue the following command as root to reboot:"
echo ""
echo "reboot"
echo ""
echo "Goodbye!"
fi
fi
exit

This will get you an initial desktop that looks like this:

tZnIzeg

Bit with just a few minutes more work, you can have something like this:

tZnI0Mg

Thanks again Stanie for the great scripting - It was easy to modify for other window managers!

I have included a set of dockapps such as wmclock and wmsystemtray in the script.  The script downloads a text file that gives you a list of included dockapps and a brief description of what they do.  You'll have to start these manually (using the "run"  menu item or from a terminal) but once they are started you can pin them to the dock and set them to autostart  on each system start if you so desire.

@gunt - you will have to modify the menu using WPrefs - Window Maker's proplist menu format does not pick up all installed applications so manual editing is necessary.

Enjoy!

Last edited by busprof (2012-10-04 22:50:16)

Offline

#17 2012-10-04 20:49:19

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: HOW TO: Debian netinstall with a custom script

^ Very nice, busprof.

Just a few comments to your script, if I may:
I would change Debian security repo in your sources.list

echo "## DEBIAN SECURITY" >> /etc/apt/sources.list
echo "#deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list
echo "" >> /etc/apt/sources.list

You point to Wheezy and then to Squeeze in Security...
I also wouldn't mix Debian Wheezy netinstall with Squeeze repos later on. If you prefer stable go rather with Squeeze netinstall and then continue with your custom script.

Thanks for sharing, great job! Pity it is primarily for 64-bit. Will have to wait to try it out once I buy a new machine...


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#18 2012-10-04 21:26:31

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

@busprof  thank you very much for the script.
It's very nice. That is what was i looking for!

@gunt - you will have to modify the menu using WPrefs - 
Window Maker's proplist menu format does not pick up 
all installed applications so manual editing is necessary.

Perfect! I will do that!

Offline

#19 2012-10-04 22:54:37

busprof
#! Member
Registered: 2011-03-13
Posts: 68

Re: HOW TO: Debian netinstall with a custom script

Stanie wrote:

I would change Debian security repo in your sources.list

::slaps forehead with hand:: Thanks for catching that, Stanie.  I've changed the Window Maker install script to reflect the Wheezy repo for the security updates.

On the 64-bit issue - the only issue that MAY impact a 32-bit install is the wmsystemtray version I've included.  This was Paul Seelig's compile for his Window Maker Live CD project, and Paul has kindly made it available since Debian no longer provides a version of this very useful dockapp.

I'm going to try running the script again tomorrow on a 32-bit system and I'll post the results here.

Thanks again for the catch.  This is why it's never good to proof your own work big_smile

Offline

#20 2012-10-04 23:34:25

gunt
Member
Registered: 2012-01-30
Posts: 27

Re: HOW TO: Debian netinstall with a custom script

Just to point out that I resolve that issue editing the xinitrc file.

But that was with squeeze net installation.

Today I try with the wheezy installer. And that did not solve the problem.

I search around  and find blessed words in this post http://crunchbanglinux.org/forums/topic … g-lxinput/   from arinlares

I have the same problem.  The only other thing I've found was a blog post who had somebody else fix it for them.

Personally, I can log in with slim, but all I get is the slim background and the message "Failed to execute login command." before getting kicked back to the login screen.  I have uninstalled lxinput, and still have the problem.

I'm using Waldorf, but our issues are caused by the same mysterious problem.  For now, I'm just going to install LightDM and call it good.

EDIT:  I didn't pay attention when I installed lxinput.  It pulls in lxsession, which is configured by update-alternatives to be the default x-session-manager.  So, what you can do is simple.  Run the following in a terminal:
sudo update-alternatives --config x-session-manager

Select the number for openbox-session (in my case, it was 2), and press enter.  Log in again, and it'll work.  It wasn't lxinput breaking anything, it was Debian doing its thing.  I can boot with SLiM now.

Run the code

sudo update-alternatives --config x-session-manager

as root in recover mode and choose number 2  >>>> openbox session

I though it was something during the installation but everything is perfect now. And it runs blazing fast.

And it works again!! Feeling happy!

Arinlares said: it was Debian doing its thing.
Blessed words!!!

Offline

#21 2013-11-20 11:06:33

tshann
#! Member
Registered: 2009-09-07
Posts: 96

Re: HOW TO: Debian netinstall with a custom script

Love this, can't wait to try it.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo