Can't set hostname through preseed.cfg in Weezy
I am installing Debain Stable/Weezy (netinstall) in VirtualBOX using preseed.cfg on a i386 host and I am having a few problems. 1. Software deselection What is the correct command for no installed packages (bare CLI)? tasksel tasksel/first multiselect none -or- tasksel tasksel/first multiselect "" -or- tasksel tasksel/first multiselect 2. Hostname I tried both d-i netcfg/hostname somehost -and- d-i netcfg/get_hostname string somehost but in both cases the host gets set as "debian". I tried both at the same time but still the host is set as "debian". I use "d-i netcfg/choose_interface select auto" for network settings. Thank you and happy celebrations.
Including git commands in preseed
I'm working on i386, Debian testing net install, in VirtualBox, through "auto url=". I would like for the preseed to do the following. apt-get update && apt-get dist-upgrade -y clone https://github.com/project cd /folder/ git checkout project I tried this scheme but when I logon there is no folder named "project" meaning clone command was not successful. d-i preseed/late_command string apt-get update && apt-get dist-upgrade -y d-i preseed/late_command string in-target git clone https://github.com/project I would rather use preseed than a script. Thanks for the help.
RE: Including git commands in preseed
Some text was missing in the previous message, sorry about that. --- I'm working on i386, Debian testing net install, in VirtualBox, through "auto url=". I would like for the preseed to do the following. ***apt-get update && **apt-get dist-upgrade -y **clone https://github.com/project **cd /folder/ **git checkout project I tried this scheme but when I logon there is no folder named "project" meaning clone command was not successful. d-i preseed/late_command string apt-get update && apt-get dist-upgrade -y d-i preseed/late_command string in-target git clone https://github.com/project I would rather use preseed than a script. Thanks for the help.
RE: Including git commands in preseed
Thank you Zenaan for the link. You are right, I am very inexperienced when it comes to git however the command used with the preseed was "git clone https://github.com/project"; (d-i preseed/late_command string in-target git clone https://github.com/project). I just forgot to type it in the email :) The problem is that when ran through preseed, there is no project directory. If I enter the command manually, all good, project folder is created.
RE: Including git commands in preseed
For whatever reason "d-i preseed/late_command string in-target git clone https://github.com/adrelanos/Whonix";, like Eero suggested, doesn't work. No folder is created. I did find the solution though. You need to set the target directory and it works then. d-i preseed/late_command string in-target git clone https://github.com/project /root/project The directory needs to be defined. If not, like with the option below, it won't work. d-i preseed/late_command string in-target git clone https://github.com/project /root
RE: Including git commands in preseed
OK, new problem. If choose to install in user (/usr/ or /user/ as opposed to /root/) no directory is created. Command used: d-i preseed/late_command string in-target git clone https://github.com/project /usr/project Any idea how to make the cloning work in /usr/?
RE: Including git commands in preseed
I have included git install in the preseed (d-i pkgsel/include string git). After I log on, running "git" offers a list of available git commands (bisect, branch,.tag) so the installation that way is successful. I was able to find the solution (for now). The problem was that the directory was not set correctly. /usr/ won't work but /home/user will. Command: d-i preseed/late_command string in-target git clone https://github.com/project /home/user/folder for cd /folder I will probably have to use script (cd folder) and start it with source ./scriptnamew. Just sh ./ doesn't work for changing directories. I agree that script would be easier overall, it's just I am a bit shaky on how to start. Let me check if I understood your syntax correctly. "wget -O/target/var/tmp/bootstrap" This creates a file called bootstrap in the selected directory? "http://despair.proulx.com/medley/medley-bootstrap;"; Location from where wget should fetch the script? "in-target sh /var/tmp/bootstrap" No idea what this does. Auto start?
Setting up automatic logon after installation.
I want to install Debian in such a way that the system will automatically login (not requiring of me to enter username and password)) as user when the installation is finished. I'm installing a pretty bare system with netinst, no DE, no X manager, just CLI, with nothing selected at taskel in preseed. Is there a way I can configure my preseed file that after installion the system will automatically login as user? I tried disabling root account and adding what I believe was autologon option but it didn't work. d-i passwd/root-login boolean false d-i passwd/auto-login boolean true I have defined the username and password of user via preseed. d-i passwd/user-fullname string user d-i passwd/username string user
RE: Including git commands in preseed
Thanks for the detailed answer Bob. I tried different things gathered from the Internet, even copying your exact command, but to no avail. "d-i preseed/late_command string wget -O/target/var/tmp/bootstrap http://file; in-target sh /var/tmp/bootstrap" Error 127. I believe the problem is that wget needs in-target, as in "wget in -target -O". I'm doing this on Jessie. "d-i preseed/late_command string in-target wget -O /var/tmp/bootstrap http://file; in-target sh /var/tmp/bootstrap" Stops (hangs, freezes, does not continue) at 16% during the preseed part of the installation (script is 1kb and I left the install process running at 16% for an hour). "d-i preseed/late_command string in-target wget -O /var/tmp/bootstrap http://file;"; Downloads the file but does not start it automatically (logical regarding the command). "d-i preseed/late_command string in-target wget -O /var/tmp/bootstrap http://file; sh /var/tmp/bootstrap;" Works if I write it in terminal (wget part, after installation of course) but as part of the preseed, it says "failed with exit code 2". Logical since "in-target" is missing "d-i preseed/late_command string in-target wget -O etc/postInstall.sh http://file;chmod 700 /target/etc/postInstall.sh" Downloads the file but does not start it automatically. "d-i preseed/late_command string in-target wget -O root/script.sh https://raw.github.com/drgdel/test/master/test; chmod 700 /target/root/script.sh; in-target sh /root/script.sh" Stops (hangs, freezes, does not continue) at 16% during the preseed part of the installation (script is 1kb and I left the install process running at 16% for an hour). "d-i preseed/late_command string wget -O /target/root/late_command.sh https://raw.github.com/drgdel/test/master/test; \ in-target chmod 755 /root/late_command.sh; in-target /root/late_command.sh" Error 127. I'm open any new suggestions that would enable me to wget the script and then make it run automatically as I login.
RE: Setting up automatic logon after installation.
Just something I found on the internet Brian. Thanks for the hint Andrei! It seems you need to edit inittab, comment out #1:2345:respawn:/sbin/getty 38400 tty1 and add 1:2345:respawn:/bin/login -f username tty1 /dev/tty1 2>&1 sudo nano /etc/inittab #1:2345:respawn:/sbin/getty 38400 tty1 1:2345:respawn:/bin/login -f username tty1 /dev/tty1 2>&1 Works for me now I just have to figure out how to autostart this everytime.
RE: Including git commands in preseed
Sorry for the confusion, http://file indicates the actual URL fo the file. My simple test script is located at https://raw.github.com/drgdel/a/master/1 Content: #!/bin/bash echo Hello World Preseed entry take 1: d-i preseed/late_command string in-target wget -O /var/tmp/hello https://raw.github.com/drgdel/a/master/1; in-target sh /var/tmp/hello The installation downloaded the script but there is no auto run (no matter if I log as root or user). Typing sh /var/tmp/hello when logged, runs the script. There seems to be some progress since when using the same preseed line with a more complex script (check my last email) the install got stuck at 16% but still no auto-launch. Preseed entry take 2: d-i preseed/late_command string in-target wget -O root/script.sh https://raw.github.com/drgdel/a/master/1; chmod 700 /target/root/script.sh; in-target sh /root/script.sh The installation downloaded the script but there is no auto run (no matter if I log as root or user). Typing sh ./script.sh when logged, runs the script. There seems to be some progress since when using the same preseed line with a more complex script (check my last email) the install got stuck at 16% but still no auto-launch. I tried the preseed entry take 2 with your suggested script (same syntax just changed 1 for 2 in the ). d-i preseed/late_command string in-target wget -O root/script.sh https://raw.github.com/drgdel/a/master/2; chmod 700 /target/root/script.sh; in-target sh /root/script.sh https://raw.github.com/drgdel/a/master/2 Content: #!/bin/sh exec /var/tmp/bootstrap.out 2>&1 echo Hello World exit 0 It created a file containing the text Hello World. No autorun. I tried your command, verbatim (aside from URL) on Weezy and Jessie but again error 127. d-i preseed/late_command string wget -O/target/var/tmp/bootstrap https://raw.github.com/drgdel/a/master/1; in-target sh /var/tmp/bootstrap So while there is a problem with the script, I can't get even a simple one to boot automatically.
RE: Including git commands in preseed
Hm, it seems I haven't clearly clarified what I want to do. I'm using preseed file (through "auto url=" option) to install Debian Jessie in a VM. I would like to configure preseed in such way that it accomplishes two things. 1. It downloads a script from github (we figured out that part) 2. Starts the downloaded script when I log ("debian login") for the first time on the freshly installed system. I have successfully accomplished 1. (download) but not 2. (autorun). Thanks for your patience.
RE: Including git commands in preseed
> What does that mean to you? Do you mean when you log into the system > at the login prompt? That is confusingly written but that is how I > translate it when I read it. If so then that is NOT what late_command > does. It will NEVER do what you are asking because that is not what > late_command does. Igor explained it better than I could. Coming from Windows I was thinking "autorun" as the script writing "Hello World" on the screen when I log in as user. > use the preseed to add a script during installation which will then run upon users login when > the freshly installed system reboots. I have been using Hello World script to reduce problems that might arise from using a complex script but later I would like to use this setup for autologin. #!/bin/bash sed -i '54d' /etc/inittab echo "1:2345:respawn:/bin/login -f user tty1 /dev/tty1 2>&1" >> /etc/inittab
RE: Including git commands in preseed
d-i preseed/late_command string in-target sed -i 's,1:2345:respawn:/sbin/getty .*tty1 *$,1:2345:respawn:/sbin/getty -a user 38400 tty1,' /etc/inittab; Works like a charm on Wheezy! Thank you everybody and a special thanks to Bob for the working code!
Alias setup through preseed in Wheezy
1. I would like to set d-i preseed/late_command in such way that a line containing alias instructions would get added to ~/.bashrc. That way alias would be active when I first login after the installation (typing 'myalias' would start script1). I tried d-i preseed/late_command string in-target echo "alias myalias='sh ./script1'" >> /home/user/.bashrc but it failed with "Exit code 1" I tried d-i preseed/late_command string in-target sed -i '1i alias myalias='sh ./script1'' /home/user/.bashrc but it failed with "Exit code 2" I suspect that one of the attempts failed due some sort of syntax error. 2. Is there a way to make that alias run automatically when the user logs in? With "run automatically" I mean that alias would execute script1 as soon as the user logs on without requiring the user to type 'myalias'. I'm using network install Wheezy ISO. Thank you.
RE: Alias setup through preseed in Wheezy
> 1. My username is "user" and hand-editing works fine but I want the preseed to do the work for me. > 2. I wasn't clear here. I don't want to invoke the script directly. I want for the script (or alias which then run the script) to start without any user input at all. User logs on, script starts. No typing. Like you have "Start softwareX when Windows starts" option in that OS. > Date: Thu, 23 Jan 2014 11:13:46 -0700 > From: jr...@salford-systems.com > To: debian-user@lists.debian.org > Subject: Re: Alias setup through preseed in Wheezy > > On Thu, 23 Jan 2014, Todd Maurice wrote: > > > 1. > > I would like to set d-i preseed/late_command in such way that a line > > containing alias instructions would get added to ~/.bashrc. That way alias > > would be active when I first login after the installation (typing 'myalias' > > would start script1). > > > > > > I tried > > d-i preseed/late_command string in-target echo "alias myalias='sh > > ./script1'" >> /home/user/.bashrc > > > > but it failed with "Exit code 1" > > > > > > I tried > > d-i preseed/late_command string in-target sed -i '1i alias myalias='sh > > ./script1'' /home/user/.bashrc > > > > but it failed with "Exit code 2" > > > > I suspect that one of the attempts failed due some sort of syntax error. > > > > > Unless your username is "user", it looks like you're going to have a > problem writing to a file in a non-existent directory. On the whole I > think you'd be better off hand-editing $HOME/.bashrc in your favorite text > editor. It's only one line of code and you get to verify that it was > entered correctly. > > I'm not a bash user (ksh has long been my usual shell), but the line will > look something like: > > alias myalias="sh ./script1" > > > 2. > > Is there a way to make that alias run automatically when the user logs in? > > With "run automatically" I mean that alias would execute script1 as soon as > > the user logs on without requiring the user to type 'myalias'. > > > You simply invoke the script in your $HOME/.profile, like so: > > #We can't assume the script is in the current directory > #The source command executes the commands contained in the script without > #spawning a new process > source $HOME/script1 > > > > --| > John L. Ries | > Salford Systems | > Phone: (619)543-8880 x107 | > or (435)867-8885 | > --| > > > > > -- > To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org > with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org > Archive: > http://lists.debian.org/alpine.LSU.2.11.1401231103120.12032@falcor.salford.riesenhaus.local >