2015年6月27日星期六

Network Manager Configuration for BLFS 7.7

Update: 2015.12.13: fix some errors for icon theme

After we install the Network Manager (Networking Utilities), we have to modify the system configuration in order to allow the Network Manager fully control the network setting.

1. Remove the LFS network setup files
In the “7.5 General Network Configuration” section of LFS, we have created some “ifconfig.*” files for different network interfaces. Those files conflict with Network Manager so we have to remove them. Network Manager will create the configuration files in the “/etc/NetworkManager/system-connections” directory.

2. Install icons files for Network Manager Applet
Network Manager Applet (GNOME Applications) can be used with XFACE and LXDE. This software requires Adwaita Icon theme (GNOME Libraries and Utilities) to display all icons.

3. Update icons files for Network Manager Applet
run the following command:
gtk-update-icon-cache -qt /usr/share/icons/hicolor

4. Fix Polkit-gnome autostart problem for LXDE
If you use LXDE and the polkit daemon ("/usr/lib/polkit-1/polkitd --no-debug") is not started automatically, we have to modify the automatic startup file for polkit-gnome agent (/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop):
The line "OnlyShowIn=GNOME;XFCE;Unity;" is changed to "OnlyShowIn=GNOME;XFCE;Unity;LXDE;"

5. Setup Polkit-gnome
In order to gain the permission for other users to setup and modify the network setting, we have to setup PolicyKit permission. Here are some references for the setup:
NetworkManager – ArchWiki
Polkit Reference Manual

For example, create a new group NNNNN and then add the users to this group:
usermod –a –G NNNNN user_xxxxx

And create a file in “/etc/polkit-1/rules.d/” directory that the content is:
polkit.addRule(function(action, subject) {
  if(action.id.indexOf(“org.freedesktop.NetworkManager”) == 0 && subject.IsInGroup(“NNNNN”)) {
    return polkit.Result.YES;
  }
});

Then the members of the group NNNNN will gain the permission to modify and setup the network setting by Network Manager Applet.

Display background image for Grub2 under LFS system

1. Install Unicode Font file (PF2 format)

Download the Unicode font file (BDF format) from GNU Unifont Glyphs and then run the following command to generate a Unicode Font file (PF2 format, the output font size is set to 16, output file name is “unicode.pf2” and the input file name is “unifont.bdf”)

grub-mkfont –s 16 –o unicode.pf2 unifont.bdf

Then copy the output file (unicode.pf2) to “/boot/grub/fonts” directory.

(If grub-mkfont is not found, add the option "--enable-grub-mkfont" when you re-build the grub tool.)

2. Setup grub.cfg

In the grub.cfg, add the following codes to display the background image (in this example, the image file is “/boot/grub/bg.png”):

if loadfont unicode; then
  set gfxmode=auto
  insmod vbe
  insmod vga
  insmod gfxterm
  set locale_dir=/boot/grub/locale
  set lang=en_US
  insmod gettext
  terminal_output gfxterm

  insmod png
  background_image /boot/grub/bg.png
fi

Then the grub2 should display the image file.

If your system uses Plymouth after grub2, you can add the line "set gfxpayload=keep" in the grub.cfg so the image file will be kept until plymouth is running.
(Warning: Do not add this line if plymouth or X window system is not ran automatically because you will not get the terminal in text mode)

2015年6月22日星期一

Setup Bootsplash for BLFS 7.7 with Plymouth

My note for bootsplash setup for BLFS 7.7

EverNote Version

2015年6月14日星期日

Setup Plymouth under BLFS 7.7 with VMware

My note for Plymouth setup for BLFS 7.7

EverNote Version


Fix bad display error for xauth

When xauth shows the error message: "bad display name "xxxxx:0" in "add" command because of "unknown host" error", you can try to ping xxxxx and then you will get the "unknown host" error.

In order to fix this error, we have to edit the file "/etc/hosts" and add the IP address for the xxxxx. For example,
127.0.0.1   xxxxx

Then the problem should be fixed.