# drm-kmod



## In_over_my_head (Sep 3, 2019)

Hello, 

Apologies if this is a bit vague and if it has been asked about before.  I have for a number of weeks been attempting to install FreeBSD 12.0, after a lot of frustration I have got it to boot on an old (~7yr old) laptop of mine.  I have got to the point where I am attempting to install KDE5 but before that I have tried to see if startx works first, it doesn't.  

I have an odd dual AMD graphics set-up (a Radeon HD 6400M/7400M with an APU whose model I don't remember) so I tried to install the drm-kmod package as the xorg var log file didn't seem to be able to find a usable driver, but when I do I get:

[1/3] Extracting gpu-firmware-kmod-g20190620: 0%
[1/3] pkg: Fail to create /boot/modules:No such file or directory
[1/3] Extracting gpu-firmware-kmod-g20190620: 100%

Having found this problem yesterday, I wiped the drive, reinstalled FreeBSD again and before rebooting the system, I created this directory in case it was some odd permissions issue, but I get the same message.

If anyone more competent than me (i.e. everyone) has an idea how I could fix this I would be grateful.

Thank you


----------



## Shadow53 (Sep 4, 2019)

This looks somewhat similar to an issue I had previously with a Root-on-ZFS setup where there was a separate bootpool that failed to load every boot. Running 
	
	



```
zpool import bootpool
```
 (the pool might be named something different, 
	
	



```
zpool import -a
```
 should help if that first command fails) should cause the folders under /boot to show up correctly.

For me, this happened because I configured the installer to use the 
	
	



```
MBR (BIOS)
```
 partition scheme. Reinstalling and using 
	
	



```
GPT (BIOS)
```
 caused the issue to go away.


----------



## Alain De Vos (Sep 4, 2019)

mkdir /boot/modules


----------



## Shadow53 (Sep 5, 2019)

Alain De Vos said:


> mkdir /boot/modules



I wouldn't. This seems symptomatic of a larger issue that needs to be fixed, such as the one I mentioned previously.


----------



## In_over_my_head (Sep 28, 2019)

My apologies for the late reply.

Thank you very much for your replies.  I have tried the mkdir option, I used a bit of a blunt force method of wiping the drive via a SATA/USB converter in Linux Mint (dd if of) and after reinstalling via the wizard.  I then manually made the /boot/modules dir but I still get the same pkg: Fail to create /boot/modules:No such file or directory error message.

After trying the zpool import -a (well, I followed the on-screen instructions and used option -f instead) I rebooted and tried installing the drm-kmod package again, but I get the same error message.

The problem with the GPT(BIOS) install is that my system doesn't recognise it.  I spent weeks (yes, I am that much of a noob) coming to the conclusion that is was a GPT/MBR issue (even though my motherboard supports UEFI, if enabled).  So, after installation I end up with a message along the lines of (please install bootable media or device), this is what I have resorted to the MBR(BIOS) option.

Thanks again for your suggestions, if you have anymore I'd be grateful


----------



## George (Sep 30, 2019)

Super old graphics cards are not supported by drm-kmod (but by drm-legacy-kmod).

This article says you need "AMD Radeon HD7000 AMD GPU or newer".






						Drm Kmod Primer
					

Getting Started With drm-kmod



					freebsddesktop.github.io
				






> I have an odd dual AMD graphics set-up


Its odd that your dual card is both older and newer than Version 7000. You might want to consult the mailing list on this one.


----------



## sidetone (Sep 30, 2019)

You got that error, because to build that, you need to build kernel sources first. Then build that driver for your console and basic part of the driver.

Then, for your xorg, you would just install an additional x11-drivers/xf86-video-ati.

Here's a list of ones that need the kmod port:


			Graphics/AMD-GPU-Matrix - FreeBSD Wiki
		




In_over_my_head said:


> dual AMD graphics set-up (a Radeon HD 6400M/7400M


You'll have to be more specific. Two cards? and the second one is 7400M? or HD 7400?

Also, wiping the drive for getting that error is excessive. You can `make clean` in the /usr/ports/graphics/gpu-firmware-kmod/ directory.


----------



## In_over_my_head (Oct 3, 2019)

Thanks chaps/chapettes for your words of advice.

The make and model of my laptop is Samsung NP305E7A-S01UK.  The dedicated card is an AMD 6470M, as for the on-board APU effort, all I remember is that is ends in a 'G'



sidetone said:


> You got that error, because to build that, you need to build kernel sources first. Then build that driver for your console and basic part of the driver.



That sounds a little too involved with regards to what I am currently capable of, I will need to read a lot more.  Tbh this whole GUI installation process is waaaaaaaaaaaaaay more involved than I thought it would be.  Would it have made more sense for me to install an older version of FreeBSD, or maybe another BSD variant entirely?



Elazar said:


> Super old graphics cards are not supported by drm-kmod (but by drm-legacy-kmod).



Ahh OK, that would probably go some way to fixing the problem, but I fear that I will end up with the same permissions issue stated earlier in this thread.

At least there's some avenue for progress here, which I didn't have before.

Many thanks for your time and responses.


----------



## sidetone (Oct 3, 2019)

Use graphics/drm-kmod, instead, for the card you listed. It will install the right one for the version of FreeBSD you use. If it's not that one, try different ones, until you see it loaded when typing `kldstat` after reboot.

For the version I used to install, I needed kernel sources. I don't remember if this one needs it. but to get it, if you still get error messages, it's not very difficult. Use svn, which will install kernel sources in /usr/src. Use the FreeBSD handbook to use the svn that comes with the base system.

I use net/svnup, which is easier for me, than the svn that comes in the base system, to update /usr/src. To configure svnup, see /usr/local/etc/svnup.conf, svnup.conf(5). It installs, svnup.conf.sample, which you copy to svnup.conf, then edit it.
My svnup.conf has this included:

```
[release]
branch=base/releng/12.0
target=/usr/src
```
Then you would type, for instance, `svnup release`, depending on the header in parenthesis.


----------



## SirDice (Oct 3, 2019)

sidetone said:


> For the version I used to install, I needed kernel sources. I don't remember if this one needs it.


You only need the FreeBSD sources if you build kernel modules from ports. It's not needed when you install the packages. The graphics/drm-mod port/package is a kernel module, so if you build it from ports you will always need the right version source in /usr/src.


----------



## In_over_my_head (Oct 5, 2019)

SirDice said:


> You only need the FreeBSD sources if you build kernel modules from ports. It's not needed when you install the packages. The graphics/drm-mod port/package is a kernel module, so if you build it from ports you will always need the right version source in /usr/src.



SirDice, have you encountered such a driver problem before?  What would prevent FreeBSD from being able to install a pkg like this, or indeed create or even access an existing directory /boot/modules?  Are AMD-based systems notoriously fiddly for FreeBSD users?

Many thanks


----------



## SirDice (Oct 7, 2019)

In_over_my_head said:


> What would prevent FreeBSD from being able to install a pkg like this, or indeed create or even access an existing directory /boot/modules?


See post #2.



In_over_my_head said:


> Are AMD-based systems notoriously fiddly for FreeBSD users?


CPU/GPU is completely irrelevant in this case.


----------



## In_over_my_head (Oct 10, 2019)

SirDice said:


> See post #2.



Ok, in that case I will abandon trying to install FreeBSD as neither of those solutions worked (albeit I used zpool import -f instead of -a and couldn't implement the latter after the former) and the GPT(BIOS) option isn't viable for me as it simply will not boot after installation.

Thanks again for taking your time to respond to my queries


----------

