/srv/irclogs.ubuntu.com/2007/01/03/#ubuntu-installer.txt

=== mpt [n=mpt@121-72-134-135.dsl.telstraclear.net] has joined #ubuntu-installer
=== siretart [i=siretart@ubuntu/member/siretart] has left #ubuntu-installer []
=== allmanj [n=allmanj@66.249.86.140] has joined #ubuntu-installer
allmanjhey - i've been asked to modify the ubuntu installer to create a second user (without sudo privileges) and prompt for a password12:18
allmanji'm thinking i can somehow get this into the main menu, hopefully by dropping a script of some type in somewhere and not by creating a udeb (but if this is the preferred method i guess i can do this)12:19
allmanjunfortunately i can't really find how to do this. any hints appreciated...12:19
cjwatsonallmanj: do you need UI for it?12:28
cjwatsonoh, you said prompt12:29
cjwatsonallmanj: prompting without a udeb is difficult because there's no other easy way to get templates in; the only way you can prompt without a udeb is if you can somehow arrange to reuse an existing template12:29
cjwatsonallmanj: is the username fixed?12:30
allmanjthe username is fixed, yes12:31
allmanjcan i not use something like debconf-loadtemplate?12:31
cjwatsonno, doesn't work properly12:33
cjwatsontrust me on this, it's complex :-)12:33
allmanj:( dang!12:33
cjwatsonyou're not sunk, though12:33
allmanjoh?12:34
cjwatsonif the username is fixed, then the existing user-setup text should work reasonably well?12:34
cjwatsonunless you need extra text?12:34
cjwatson_Description: Choose a password for the new user:12:34
cjwatson A good password will contain a mixture of letters, numbers and punctuation12:34
allmanjno - i just need to make sure it's clear that the first time it prompts for a password it's for the first user, and the second time, for the second user12:34
cjwatson and should be changed at regular intervals.12:34
cjwatsonhmm, ok, you might need extra text then12:34
cjwatsonI think you will have to create a ueb12:35
cjwatsonudeb12:35
cjwatsonyou can't get stuff onto the main menu without a udeb anyway, so ...12:35
allmanj:( i assume i can store it on the cd and load it during startup. So, not modify the initrd?12:36
cjwatsonyeah, any udeb that's Priority: standard or higher is automatically loaded at anna time; you definitely shouldn't modify the initrd for this12:36
cjwatsonit just needs to be in the proper Packages files12:36
allmanjyep - i've already modified the packages on the cd and regenerated the Packages file so i'm happy with that12:37
cjwatsonare you comfortable with creating a udeb, or do you need help?12:37
allmanji'll have a go at creating a simple udeb. I may need a little help though as i suspect i'll get stuck...12:37
cjwatsonwhereabouts do you want it to go in the menu? immediately after user-setup?12:38
allmanjcjwatson - that would seem sensible i think?12:38
allmanjthis seems to have some basic info on creating a udeb: http://people.debian.org/%7Efjp/talks/debconf6/paper/12:39
cjwatsonI'd suggest cloning-and-hacking user-setup, radically simplifying it (you can chuck out loads of stuff), and making your udeb Depends: user-setup-udeb12:39
cjwatsonyes, that's a good paper to read12:39
allmanjgood call - i'll try that12:39
cjwatsonyou can then just use the same installer-menu-item number as user-setup and let the Depends break the tie for menu ordering12:39
allmanjany easy way for me to test my udeb without putting it on the cd and doing an install?12:39
stgraberHere I use an emulator like vmware or qemu, but maybe there is an easier way when testing only debian-installer (I'm testing a complete custom CD)12:42
cjwatsonif you speak the debconf protocol to some basic extent, you can at least test the debconf interaction12:42
cjwatsonDEBIAN_HAS_FRONTEND=1 ./script12:42
cjwatsonand then you can type answers at it in the debconf protocol12:42
cjwatsonit's also possible to set up a slightly more elaborate test environment by installing the cdebconf package and pointing /etc/cdebconf.conf at your own database, which you can then /usr/lib/cdebconf/debconf-loadtemplate into12:44
cjwatsonI usually don't bother with that, but I have a bit more experience with what tends to break udebs so I can get away with shortcutting some things12:45
=== allmanj is a little scared
allmanji'll see how i get on with putting it on the cd and testing it with vmware, but if i have to keep doing it i'll try the cdebconf thingy12:46
allmanji quite possibly will be back in the not-too-distant future sobbing uncontrolably12:47
cjwatsonif you have the CD creation automated, vmware testing will probably be reasonably efficient at least for testing the early phase of your udeb that runs before base-installer12:47
allmanjand if there's an error with my udeb it'll freak out12:47
cjwatsonbut package installation takes a while even in vmware so if you're relying on that make sure that the user creation script (that you've borrowed from user-setup-apply) is pretty solid12:47
cjwatsonnote that you'll need to rename the debian-installer/user-setup-udeb/title template according to the name of your udeb, and the finish-install/progress/user-setup template according to the name of your finish-install script12:49
cjwatsonone day we should probably embark upon a project of making d-i a bit more customiser-friendly ...12:50
allmanji second the motion!12:52
allmanji assume i only need the udeb. The user-setup source package appears to create a deb and a udeb01:19
cjwatsonyes01:26
cjwatsonthe .deb's mostly for ubiquity01:27
allmanjthanks. i've just created a clone of user-passwd (renamed package name and all scripts and template variables) so perhaps i'll get lucky and it'll just work...01:28
=== cr3 [n=marc@pdpc/supporter/bronze/cr3] has joined #ubuntu-installer
allmanji've forgotten how i force it to load an additional udeb.  anna-choose_modules or something?01:51
cjwatsonyou shouldn't need to force it if you use Priority: standard01:55
cjwatsonbut it's anna/choose_modules=blah01:55
cjwatson(modules=blah in feisty)01:56
allmanjand that'll add it to the default list - it won't replace it?01:56
cjwatsonthere's no default value for anna/choose_modules - it's only for extras02:04
allmanjit's looking good. booting into system now - we'll see if it set both passwords appropriately02:24
allmanjonly seems to have created the second user in my modified user-setup:(02:26
allmanjit prompted twice for passwords (4 including verify) but only appears to have created one user02:27
cjwatsonyou need to not use the same templates02:28
cjwatsonor rather you need to rename them02:28
cjwatsonotherwise you'll clobber state saved by user-setup-ask for user-setup-apply02:29
allmanji did rename them?04:02
=== allmanj has been away from desk for a good old while now
cjwatsonperhaps you clobbered user-setup's finish-install script by mistake?04:06
cjwatsonit definitely sounds like something clashed04:06
allmanjhmm. that's possible. though i thought i renamed files. will double check - cheers04:16
allmanjno file name clashes that i can see04:18
allmanjactually... let me double check taht04:19
allmanjdpkg -c certainly reveals no clashes04:21
cjwatsontry booting with DEBCONF_DEBUG=5 to get a full debconf trace - will be somewhat tedious to read but will almost certainly tell you (in syslog) what's going on04:30
allmanji'm going to need it not to reboot so i can grab the logs. any simple way to do that?04:30
cjwatsoneither don't preseed finish-install/reboot_in_progress, or just grab /var/log/installer/syslog after reboot (it's copied across)04:38
allmanjah - i didn't realise it was copied. thanks04:40
=== cr3 [n=marc@pdpc/supporter/bronze/cr3] has joined #ubuntu-installer
allmanjlooking at relevant section of syslog now. can see it reading in passwd/user-password...05:16
cjwatsonthat's what user-setup uses05:17
allmanjyep - going on now to see where it read in the other values...05:18
allmanji can see it reading in the other values dta-passwd/user-password05:20
allmanjboth then say ON STATE from 1 to 805:20
allmanjso i think it's populating the debconf database correctly at least...05:21
allmanjsee it running the prebaseconfig from the modified package...05:22
allmanjand now i see it (at least starting) to run the prebaseconfig from user-setup05:24
allmanjhmm - so it ran the modified one first...05:25
allmanjit runs the script but doesn't create the user...05:26
allmanjso i see dta-passwd/make-user, returns true then it GETs dta-passwd/user-password-crypted05:27
allmanjbut after passwd/make-user (which returns true) it goes to PROGRESS STEP 1 and then moves on to another prebaseconfig script...05:28
cjwatsonit runs them in lexicographical order05:32
cjwatsonbump the number or prepend a z to the name or something if you want it run afterwards (you probably do)05:33
allmanjwell, it shouldn't make a difference which user is created first (in theory). However for some reason the user-setup one seems to skip user creation. The script gets run but it just goes to the next script after reading passwd/make-user (which is true)05:34
allmanjlooking at the apply script...05:36
allmanjis_system_user05:36
allmanjcould that be my problem?05:36
allmanjah - that is indeed it. # Assume NIS, or any uid from 1000 to 29999,  means there is a user.05:37
allmanjso if i make my one run after and skip the is_system_user check i should be ok05:37
allmanji think05:37
cjwatsonoh, right, sure, that's a piece you should remove from your script05:39
cjwatsonyou basically just want to use adduser05:39
=== avoine [n=avoine@modemcable068.14-82-70.mc.videotron.ca] has joined #ubuntu-installer
allmanji've been as lazy as possible and barely touched user-setup. removed bits i think will interfere now and trying again...05:49
allmanjlooks like i got it! thanks for the help!06:25
cjwatsonnp, glad it worked06:29
=== stgraber [n=stgraber@client80-83-51-125.abo.net2000.ch] has joined #ubuntu-installer

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!