![]() |
|
Guides All Guides and HOWTO's. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Hello,
This is my first post on Daemon Forums, I hope it'll be useful for some of you. Hardware: Lenovo Thinkpad T420 CPU: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz RAM: 8 GB DDR3 1333MHz HDD: Western Digital 320GB, 7200 rpm Software: NetBSD 6.0.1 amd64 Note on software: because of the graphics performance, I had to replace the default kernel (delivered as part of NetBSD 6.0.1) with an experimental one (details on this, later). Foreword: I'm not a NetBSD guru, but I have 10+ years of experience with other *nixes(mainly Linux and FreeBSD). Therefore, this tutorial may give a bit more NetBSD-specific details than needed. I'm doing this primarily for myself, for documenting steps I might easily forget in the future. However, this aspect can be useful, especially for someone new to NetBSD ![]() On the other hand, I think Daemon Forums is kind of a select club ![]() Last point, this tutorial is describing my experience with this particular laptop, Thinkpad T420. Anyway, some details will apply to other hardware configurations too... Installation: I decided on NetBSD 6.0.1 amd64 because it is the latest stable release. Why amd64? Because the T420 is a powerful monster with i5 64-bit CPU and I want to get the best out of it. ![]() Informations on how to get the installation ISO are found at netbsd.org/releases/ I've chosen to get the ISO by FTP from the master site, so I downloaded the file: iso.netbsd.org/pub/NetBSD/iso/6.0.1/NetBSD-6.0.1-amd64.iso On the laptop, I prepared 20 GB of unformatted free space: 18GB for the / partition and 2 GB for swap space. A note about swap: although some tutorials recommend to choose 2 X RAM size for the swap partition, from my experience I concluded that a system with 8 GB RAM can and will perfom OK even with no swap space (for the common “classical desktop” use case: X + web browser + media player + office ). Anyway, choosing 1-2 GB of swap space is wise, because you'll most likely experiment with the new system, compiling large programs for example. During installation, I chose these options: - Formatted / partition as FFS, it was the default choice; - Allocated all 18GB to / (so, no separate partitions for /home, /usr, /var, /tmp) - Full installation ( it required around 2.5 - 3 GB, I don't remember exactly how much); - Skipped the boot loader installation on Master Boot Record (which is, I left the MBR untouched); Explanation for skipping the bootloader: the T420 is a triple-boot system. There are two Linux installations and now the NetBSD, and I didn't want to overwrite the GRUB install. The NetBSD can be added to Grub boot menu very easy. Just add these lines in grub config file (usually /boot/grub/menu.lst): Code:
title MyNetBSD root hd(0,6) chainloader +1 boot NOTE: Obviously, the skipping of NetBSD boot loader instalation is my special case, because of the multi-boot laptop. If performing the install with NetBSD as the only OS, just skip the grub hacking and install the boot loader on MBR. Now back to setup of NetBSD: in the install process, all went fine. In the post install configuration phase, I tried to configure the network, but I couldn't figure out how to configure my wireless adapter to connect to my WAP configured with WPA2 encryption. Therefore, I just postponed this step for the first boot. Post-installation impressions and configs: So, here I am after the first boot, with my new NetBSD system. First checkings look OK .. A first pleasant surprise was to see that both my network adapters - wired and wireless - are recognised (ifconfig -a displayed them both). I strongly recommend taking the time to read: Code:
bash-4.2# man 8 afterboot ![]() In the rest of the tutorial, I'll explain the setup procedures for the three elements I consider crucial for a desktop environment: - networking - sound - graphics Wired networking: works perfectly, with not much setup. My router has its integrated DHCP server enabled, so all I had to do is to add “dhcp” in /etc/ifconfig.wm0 (wm0 is the Intel i8254x Gigabit Ethernet card in my T420), then plug-in the UTP cable and restart the network: Code:
bash-4.2# cat /etc/ifconfig.wm0 dhcp bash-4.2# /etc/rc.d/network restart As I said above, I need to connect my laptop to an encrypted WAP (WPA2 encryption), so I'll use the wpa_supplicant and dhclient (both are part of the NetBSD default installation). For wpa_supplicant, first I enabled it to start at boot (as with most BSD's, the /etc/rc.conf is the file that controls the start-up services). So, I added these two lines in /etc/rc.conf: Code:
wpa_supplicant=YES wpa_supplicant_flags="-B -i iwn0 -c/etc/wpa_supplicant.conf" Code:
bash-4.2# cat /etc/wpa_supplicant.conf network={ ssid="home1234" key_mgmt=WPA-PSK psk="yours3cretkeygoesh3re” } For dhclient, the setup is easy. Enable it in /etc/rc.conf and specify the interface in /etc/dhclient.conf: Code:
bash-4.2# cat /etc/rc.conf |grep dhclient dhclient=YES bash-4.2# cat /etc/dhclient.conf lease { interface "iwn0"; } ![]() Some final notes about wireless interface: it works OK with my D-Link DIR-615 WAP, connection is stable in time. The download/upload speeds are not impressive for a Wireless-N card, when compared to the same wifi card on Linux: - download speed: ~ 1.6 MB/s (compared with ~ 1.9 MB/s in Linux) - upload speed: ~ 1 MB/s (compared with ~ 1.5 MB/s in Linux) However, it is very usable. As long as I am able to watch a movie on an FS mounted over the network, I am fully satisfied with the performance. Sound: My Intel HD audio card has been recognised and configured by the NetBSD 6.0.1. I didn't do any manual configuration. Actually, I just installed aumix program, to control the volume. The driver used by the soundcard: hdaudio That's it. For more infos: man 4 hdaudio man 8 hdaudioctl Graphics, Xorg, graphics acceleration: T420 comes with an Intel HD 3000 display adapter. And for me, right after finishing installation and setting up networking, the first unpleasant surprise came: the display resolution was stucked at 1024x768, but the native resolution for the T420 is ... 1600x900(works out-of-the-box in some Linuxes). More than this, no graphic acceleration for this default configuration. NOTE: I created my own “xorg.conf” file using “Xorg -configure” command, I explicity placed “Driver intel” entry there, but no success. X refused to start like that. The only X display driver that seemed to be accepted was “vesa”. After extended googling, I've found that NetBSD does not have proper support for more modern graphics cards, with DRM(Direct Rendering Manager). Here's one of the first google results: Quote:
![]() After more extended googling, I've found this link: groups.google.com/forum/#!topic/muc.lists.netbsd.current-users/-L8qo-kyiS8 So this guy has ported DRM/GEM kernel driver from OpenBSD to NetBSD, and also ported the Xorg intel driver from Linux to NetBSD. Why not giving a try ? ![]() His precompiled kernel + Xorg files are at: ftp.netbsd.org/pub/NetBSD/misc/gsutre/ Here's what I did: 1) I got the most recent version of the precompiled kernel, from the “drmgem-NetBSD-6.99.14-201210251710Z-amd64” folder. So, I went to Quote:
- netbsd-GENERIC-drmgem (the kernel itself) - usr-X11R7-drmgem.tgz (modified /usr/X11R7) Now, exit the X session if it's the case, and from the command line: 2) Make a backup of the current /usr/X11R7 and copy the modified X11R7 to /usr. Code:
bash-4.2# cp -R /usr/X11R7 /usr/X11R7_initial bash-4.2# cd /root/NetBSD-6.99.14-201210251710Z-amd64/ # replace with the path where usr-X11R7-drmgem.tgz is downloaded bash-4.2# tar -xzvf usr-X11R7-drmgem.tgz bash-4.2# cp -R usr/X11R7 /usr/ Code:
bash-4.2# cp netbsd-GENERIC-drmgem /netbsd-drmgen At this point, I rebooted the system, and when the NetBSD boot menu appears, I select “Drop to boot prompt” . From the boot prompt command line: Code:
boot /netbsd-drmgen ![]() So, the thing ported from OpenBSD really works! ![]() Of course, with the modified kernel and modified /usr/X11R7, I can't say I'm running a pure 6.0.1 installation, actually the uname says: Code:
bash-4.2# uname -a NetBSD smallnetbsd 6.99.14 NetBSD 6.99.14 (GENERIC) #0: Sat Oct 27 19:27:36 CEST 2012 instsoft@yosemite:/tmp/netbsd-drmgem.usr/src/sys/arch/amd64/compile/GENERIC amd64 I noticed two bugs during the X usage: 1) When I switch from X to text mode (eg doing Ctrl+Alt+F1) and then switch back to X mode, the desktop is “wrongly” displayed, the mouse pointer is “not in sync” with the desktop surface... Actually, this bug was reported, I saw it during my searches for X fixing. However, considering that it's uncommon to switch from X to text mode, I can say that this is not disturbing. 2) When watching a movie (applies to both DivX avi files and DVD files, I tested them both), sometimes the screen flickers (it's like a less-than-a-second flashy thing). I estimate this happens about 10 times for a 2 hour movie, at random times. Again, considering the duration of this, I can say that I don't find this disturbing. As a status of my graphics with the netbsd-drmgen kernel, have a look at my native resolution and FPS statistics: Code:
bash-4.2# xrandr -q Screen 0: minimum 320 x 200, current 1600 x 900, maximum 4096 x 4096 VGA disconnected (normal left inverted right x axis y axis) LVDS connected 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 174mm 1600x900 60.0*+ HDMI-3 disconnected (normal left inverted right x axis y axis) DP-B disconnected (normal left inverted right x axis y axis) HDMI-4 disconnected (normal left inverted right x axis y axis) HDMI-5 disconnected (normal left inverted right x axis y axis) DP-C disconnected (normal left inverted right x axis y axis) DP-D disconnected (normal left inverted right x axis y axis) bash-4.2# glxgears 1180 frames in 5.0 seconds = 235.946 FPS 1326 frames in 5.0 seconds = 265.053 FPS 1343 frames in 5.0 seconds = 268.492 FPS 1405 frames in 5.0 seconds = 280.885 FPS 1401 frames in 5.0 seconds = 280.066 FPS ![]() Of course, I didn't have the time and means to test some other things such as bluetooth, Gigabit ethernet transfer speed, dual-monitor configuration, and many, many others. But, for getting a working desktop computer, I dare to say I documented the required stuff! ![]() Any comments are welcomed. |
|
|||
![]()
First comment for me, from myself: :P
My apologies for non-formatted URLs. I'm a new user, so I don't have all the features enabled... |
|
||||
![]()
Looks like quite a lot of work to make all these whistles working, good job and thanks for sharing it
![]()
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
![]()
How's battery life on the laptop? and what about the fan? On linux you probably know in order to keep it from spinning constantly at 1800rpm you need to use thinkfan.
|
|
|||
![]()
bsdnotbdsm, Thank you for sharing !
|
|
|||
![]() Quote:
The battery is a 9 months old 6-cell one. Testing conditions: display at maximum brightness all the time, wireless connected continously, doing casual Net surfing activity and compiling software for about 30 minutes(therefore only 30+ minutes of heavy load). Note: I estimate the system was idle for about 1 hour out of those 4.5 hours(screen saver went on), however the wireless was connected continously. Regarding the fan, I don't know (yet) how to get informations about its status in NetBSD. On short: the system is not over-heating when doing casual stuff, it heats when I compile big programs(using pkgsrc) and then I can hear the fan increasing its speed. All in all, heating is not an issue, I assume fan is working OK. |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Your NetBSD Laptop | vermaden | NetBSD General | 39 | 26th December 2024 09:40 AM |
Thinkpad nvram in NetBSD | bamdad | NetBSD Installation and Upgrading | 10 | 19th September 2010 05:49 PM |
NetBSD laptop thread | Mr-Biscuit | Guides | 1 | 10th June 2009 05:51 AM |
Installation problems on X24 laptop | IIMarckus | OpenBSD Installation and Upgrading | 6 | 5th September 2008 07:58 PM |
NetBSD + old laptop adventure | anomie | NetBSD General | 4 | 27th June 2008 01:57 PM |