PDA

View Full Version : [ubuntu] unable to boot custom liveCD



jibixbzh
September 2nd, 2010, 06:24 PM
Hello there,



In order to let other colleagues try tools I use, I would like to build a customised live-DVD of Ubuntu. The goal is to incorporate two versions of the open-source command-line hydrodynamics software OpenFOAM within it. Traditionally, this software is designed to be installed in one's home directory, to be customised and enhanced easily. Hence the method I try to apply, based on http://doc.ubuntu-fr.org/personnaliser_livecd (in French, itself based on https://help.ubuntu.com/community/LiveCDCustomization) :


Build a first modificated ubuntu live-iso with the stuff necessary for compilation installed on it, i.e.:

extract the official ubuntu iso and its squashfs filesystem,
chroot this system to install the packages I need to compile OpenFOAM.
Add to the <my_new_system>/etc/skel the source files of OpenFOAM,
Reconstruct the squash filesystem and then the iso.


Boot a virtual machine with this iso, and

mount a (virtual) device on the virtual ~/OpenFOAM folder
extract and compile OpenFOAM in this folder,





Integrate these files in the /etc/skel/ directory of the custom system, where the personal files should be.



rebuild a 2nd, final, customised ubuntu system with that.




The scripts I wrote for that are attached to that post.
I perform steps 1, 3, and 4 on a 2GB ram virtual machine with VirtualBox OSE, both guest and host being ubuntu 10.04 systems (32bits for guest while 64 for host, that is why I used a virtual machine).
Step 2 is performed the same way, mounting a 6GB virtual hard disk ext4 partition on the /home/ubuntu/OpenFOAM folder of the virtual live machine, where OpenFOAM is compiled. Being on a live session, this is necessary for having enought disc space anyway (4 GB were used).



Everything works perfect until the end of step 3: my first system runs OK with the whole added packages, the source files are situated in the right place. I can compile perfectly, and the obtained binaries work fine then on that virtual system.
But when I try to boot the system I've built with those binaries added in, It doesn't work any more, due to group/user errors:


1st error: “GLib-WARNING **: getpwuid_r(): failed due to unknown user id (0)”
The “Adding live session user” step lasts a long time and finally fails, displaying (see http://ubuntuone.com/p/ESD):

groupdel: group 'ubuntu' does not exist
adduser: 'groupdel ubuntu' returned error code 6. Exiting.
usermod: user 'ubuntu' does not exist
install: invalid user 'ubuntu'
install: invalid user 'ubuntu'
Done








Then I have a lot of “sudo: unknown user: ubuntu” errors (see http://ubuntuone.com/p/ESE)
After that, “init: ureadahead-other main process (XXX) terminated with status 4” errors (where XXX takes its value in 845 846 and maybe more (see http://ubuntuone.com/p/ESG).
Then, instead of being automatically logged in, I have a log-in screen but without any user (see http://ubuntuone.com/p/ESH). It sounds logical since the “ubuntu” user couldn't be created. I've tried to log in as root (and “ubuntu too”) but didn't manage to.
If I go to a tty, since it's expected to log-in itself, I just have an “Authentication failure” list :-s (see http://ubuntuone.com/p/ESI)

As indicated in https://help.ubuntu.com/community/LiveCDCustomization, I've checked for uid > 999 and I had one so I changed it to 500:

root@lucid32-virtual:/# awk -F: '$3 > 999' /etc/passwd
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
root@lucid32-virtual:/# awk -F: '$3 == 1' /etc/passwd
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
root@lucid32-virtual:/# awk -F: '$3 == 500' /etc/passwd
root@lucid32-virtual:/# usermod -u 500 nobody
root@lucid32-virtual:/# awk -F: '$3 > 999' /etc/passwd
root@lucid32-virtual:/# awk -F: '$3 == 500' /etc/passwd nobody:x:500:65534:nobody:/nonexistent:/bin/sh
root@lucid32-virtual:/# awk -F: '$4 > 999' /etc/passwd
sync:x:4:65534:sync:/bin:/bin/sync
nobody:x:500:65534:nobody:/nonexistent:/bin/sh
kernoops:x:109:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
sshd:x:115:65534::/var/run/sshd:/usr/sbin/nologin

but that didn't solve the problem, so I also changed the corresponding gid:

root@lucid32-virtual:/# usermod -g500 -u500 nobody
usermod: el grupo 500 no existe
according to http://it.toolbox.com/blogs/locutus/how-to-change-a-users-uid-and-gid-26368 I changed the group ID 65534 to 500 editing directly the /etc/group file:
root@lucid32-virtual:/etc# nano group
root@lucid32-virtual:/# awk -F: '$4 > 999' /etc/passwd
sync:x:4:65534:sync:/bin:/bin/sync
nobody:x:500:65534:nobody:/nonexistent:/bin/sh
kernoops:x:109:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
sshd:x:115:65534::/var/run/sshd:/usr/sbin/nologin
root@lucid32-virtual:/etc# usermod -g500 -u500 nobody
root@lucid32-virtual:/etc# usermod -g500 sync
root@lucid32-virtual:/etc# usermod -g500 kernoops
root@lucid32-virtual:/etc# usermod -g500 sshd

but it didn't change anything either :-s



I have found a few problem a bit similar on the web:
-> one without a lot of details neither any solution (http://ubuntuforums.org/showthread.php?t=1469704&highlight=sudo%3A+unknown+user%3A+ubuntu)
-> other in a post about ubuntu 10.04 boot bugs (http://ubuntuforums.org/showthread.php?t=1465768&highlight=sudo%3A+unknown+user%3A+ubuntu), but the mentioned solution (booting in with acpi=off and noapic) didn't work for me :-s



I tried a few times changing details but always get this same behaviour. It works adding other kind of files in the skel dir, such as the source files, but doesn't work with the compiled stuff. I can't understand why...

does anyone has an idea ?

barinov2000
September 28th, 2010, 11:09 AM
have you tried REMASTERSYS?
http://www.geekconnection.org/remastersys/
latest version for karmic also works in lucid :)

jibixbzh
September 28th, 2010, 07:03 PM
No, I hadn't, thanks for the link!