Updating Xorg with KMS instructions question.

Hello,

I am wishing to install X.Org on a laptop with FreeBSD 9.1 that uses a Mobile Intel GMA 4500M graphics adapter.

In the past I have managed to get X working on this system without any special modifications, but it was not stable. In particular, the system would hang when I tried to log out and my only way of shutting down was to pull the plug. This would have eventually ruined my hard disk, so I had to stop using FreeBSD altogether. Now I am going to try again from scratch to get this system working properly.

I have read other threads here that show that to get an Intel graphics card to work properly, the default kernel needs to be rebuilt. Many people with this particular problem are referred to this thread: http://forums.freebsd.org/showpost.php?p=187947&postcount=3. The problem is that these instructions were posted on August 22nd 2012 and since then it appears that the handbook has been substantially updated.

In particular:
1. Checkout FreeBSD 9.1 or 9-Stable (or HEAD): See Handbook Section 25.6
2. Checkout a current snapshot of ports: See Handbook Section 5.5

Now, the current handbook Section 25.6 has no entry. Section 25 refers to "DTrace" and only goes up to section 25.5. Furthermore, Section 5.5 now explains "PKGNG for binary package management".

To follow the instructions in the original thread, I just need to be clear about the current sections of the handbook that I need to follow. Could someone please clarify this?
 
Edited. Incidentally, it is not necessary to rebuild the kernel if you already have FreeBSD 9.1.
 
wblock@ said:
Edited. Incidentally, it is not necessary to rebuild the kernel if you already have FreeBSD 9.1.

Are you saying that with 9.1-RELEASE, all I need to do is edit /etc/make.conf?

I have already deleted /usr/src and /usr/ports with rm -r and have retrieved 9-STABLE and the latest ports tree using Subversion. So I am probably past the point of no return now anyway. I need to see if the original make command is what I need to use.
 
Fatal error with mergemaster

I carried out the steps of make buildworld, make buildkerneland make installkernel as set out in the handbook at section 24.7.

I just went onto the next step which is to boot into single user mode and run mergemaster -p. The first time I ran this it said that the file system was read only, so I looked online and found that I could mount it using mount -urw / and this is what I did, before running mergemaster -p.

I was presented with some options and was not even sure what to do but it went through after 3 or 4 questions and I exited the mergemaster program.

This is where the problems started.

  1. make installworld
    When I entered this command the error message was 'don't know how to make installworld'. So I just experimented and moved into /usr/src and tried it again. This is the error I get when I enter this command from the src directory:
    Code:
    "Error: Required auditdistd user is missing, see /usr/src/UPDATING.
    *** [installcheck_UGID] Error Code 1
    Stop in /usr/src."
    This file says that auditistd user is added by mergemaster -p but it seems that this did not happen as I may possibly have made a mistake. Now I tried to run mergemaster -p again, but it does not work in the same way as before. I first got a error about /var/tmp/temproot already exists and cannot be written to. So I deleted it (thinking this would clear things up) and tried again. This is exactly what I get when I try the mergemaster -p command:

    Code:
    # mergemaster -p
    
    *** Creating the temporary root environment in /var/tmp/temproot
    *** /var/tmp/temproot ready for use
    *** Creating and populating directory structure in /var/tmp/temproot
    
    install: wheel: Invalid argument
    
    *** FATAL ERROR: Cannot copy files to the temproot environment
    #
  2. I cannot go on to the next steps, which require make installworld, then mergemaster(without arguments) and finally make delete-old
Can anyone tell me how to fix this? If not I will have to do a fresh install of FreeBSD 9.1-RELEASE and start right from the beginning with this.
 
Two things: you may wish to run [cmd=]/usr/src/usr.sbin/mergemaster.sh [/cmd]. Maybe you can make buildworld -DNO_CLEAN -DNOCLEAN and the same parameter with installworld, it might create the directory again with the right permissions; and have you created the auditd user yet? See /usr/src/UPDATING. (Of course, it could be some other fix...)
 
It's better to reboot and perform the installworld in single user mode after booting the new kernel. However, for the past 10-15 years I've never done that and only once did it cause a problem (this was because of the UFS to UFS2 transition). Just follow the mantra, buildworld, buildkernel, mergemaster -p, installkernel, installworld, mergemaster and reboot afterwards. If the system boots properly you can do the delete-old{-libs}.
 
jb_fvwm2 said:
Two things: you may wish to run [cmd=]/usr/src/usr.sbin/mergemaster.sh [/cmd]; Maybe can make buildworld [cmd=] -DNO_CLEAN -DNOCLEAN[/cmd] and the same parameter with installworld, it might create the directory again with the right permissions; and have you created the auditd user yet? see /usr/src/UPDATING. (Of course, it could be some other fix...)
  1. [cmd=]/usr/src/usr.sbin/mergemaster.sh [/cmd]
    I tried this in single user mode and in regular mode and got the message 'Command not found'.
  2. make buildworld took over six hours to complete the first time, but I tried it with the arguments you suggested and get an error code 1: "mtree: line 6: unknown group wheel"
Unfortunately, the instructions for this procedure do not seem to clear at all - though obviously I understand that the handbook can't possibly detail every single step - such a crucial procedure really needs to be painstakingly set out. The UPDATING file even suggests audituserd is added by mergemaster -p - in my case that didn't happen.

After building the system all day yesterday, it seems that I will have to start all over again with a new install as I cannot leave it 'as is'. Thanks for your help anyway.
 
Thanks for helping everyone. This was the first time I rebuilt the system and so was unclear about some of the steps set out in the handbook section 24.7 following make installkernel. So if anyone else tries to do this I have set out the steps here - after that command completes.
  1. Shutdown and reboot into single user mode.
  2. At the prompt type mount -urw /
  3. cd /usr/src
  4. pw useradd -n auditdistd -g audit -c "Auditdistd unprivileged user" -d / var/empty -s /usr/sbin/nologin.
  5. mergemaster -p
  6. In response to the mergemaster script's questions, I left all the default answers in place. That is [Leave till later]. There were around four questions. A message was displayed at the end that said there were two files that needed to be merged by hand. Namely, /var/tmp/temproot/etc/group and /var/tmp/temproot/etc/master.passwd. I am not entirely sure what, if anything, needs to be done about this though.
  7. make installworld
  8. mergemaster with no arguments. This time the mergemaster script asks a lot of questions (roughly 30 or so, perhaps more). Again, I just accepted the default answers [Leave till later] for everything, simply pressed Enter to continue.
  9. make delete-old Again asks if you wish to delete certain files. Each is listed in turn and I entered 'y' to each question. Most questions related to the Clang compiler and there were around 20 files to delete. However, at the end you are told to input make delete-old-libs. At this stage you should not do this until your existing ports have been rebuilt.
  10. Reboot the system into normal mode.
  11. cd /usr/ports/ports-mgmt/portmaster and build it, if it's not already installed.
  12. cd /usr/src and then portmaster -a -f which rebuilds all ports.
  13. Finally make delete-old-libs

That completed the steps that I was not sure about, though my next task is to install the X11 Intel driver and X.Org. Hopefully I should not have any difficulty getting that done. However, the only outstanding issues now are really what I need to do about all of the files that were "left till later" by my mergemaster options. I would appreciate if anyone could advise on this.
 
I usually leave the 'left til later' as-is, I have 2004-2005-etc. files still around. Once in a long while I'll review the older files for deletion. Some, however, may present immediate problems if not brought up to the latest revision, but you would know that probably sooner than later due to some system message or other happenstance. (Others may do it differently.)
 
neilms said:
8. mergemaster with no arguments. This time the mergemaster script asks a lot of questions (roughly 30 or so, perhaps more). Again, I just accepted the default answers [Leave till later] for everything, simply pressed Enter to continue.

If you use the "Leave till later" options you're supposed to update the files you skipped manually after you've finished the update run. This involves going trough all of the files under /var/tmp/temproot and deciding if you want to copy the files from there over the existing files or merging them by manual editing. If you don't update those files you'll end up missing important updates to the configuration files.
 
This is why I use mergemaster -Ui. It automatically upgrades files that have not been modified. And again: mergemaster -p has never, ever been helpful to me, even the one time it could have been (the addition of the auditdistd user).
 
You can set -Ui as the default options if you create a /etc/mergemaster.rc with these lines in it:

Code:
AUTO_INSTALL=yes
AUTO_UPGRADE=yes

Use of -Ui avoids having to inspect files that differ only at the lines with revision control tags but are otherwise the same as the installed files.
 
It can be set that way, but I prefer to add the options. That makes certain that it will do the same thing on a new machine that does not yet have a mergemaster.rc file.

Adding IGNORE_FILES='/etc/master.passwd' to /etc/mergemaster.rc can also act as a safety.
 
Back
Top