Affichage des articles dont le libellé est linux. Afficher tous les articles
Affichage des articles dont le libellé est linux. Afficher tous les articles

dimanche, janvier 07, 2018

Replacing a Raspberry Pi by an Odroid C2 for HEVC support

My mediacenter was, since some years now, a Raspberry Pi with OpenElec.
But more and more of available contents are using HEVC (H.265) video codecs, then not supported on this platform. I was looking for a same size factor replacement with HEVC support, then I've started to test the Pine64 but was very disappointed by the poor support of its graphic drivers under Linux (only a very slow Android image was able to decode HEVC on this board).
Hopefully I've found a good candidate into LibreElec (an OpenElec fork)'s list of supported hardware: HardKernel Odroid C2.

The migration step I've followed was this one:
  1. Upgrading my old OpenElec (7.0.1) to the latest one (8.0.4) on the Raspberry Pi
  2. Switching (upgrading) OpenElec to LibreElec on the Raspberry Pi
  3. Backuping LibreElec configuration into an USB key
  4. Installing LibreElec on the Odroid C2
  5. Restoring LibreElec configurations from the USB key: all my network shares, database, settings were restored.
And now I can enjoy to play HEVC movies downloaded from YGGTorrent.

mercredi, juin 24, 2015

Serial-PXE-TFTP install of FreeBSD(BSDRP,Xsense,NAS4Free)/OpenBSD/Centos


Remote  installation of multiples Operating systems using only:
  • FreeBSD server with a PXE and TFTP services
  • Serial console: IPMI Serial-over-LAN (sol)

I didn't found an easy way for PXE+TFTP (only!) serial remote installation for NetBSD or DragonFly.
FreeBSD was very complex too (need to recompile bootloader for TFTP and serial usage), but hopefully mfsBSD hides this problem.
OpenBSD and CentOS, by providing ramdisk natively and easy way of configuring their bootloader, were the most admin-friendly.


This step will install an all-in-once DHCP/TFTP server:
pkg install dnsmasq
Then, create a small configuration file (example with "bce1" as NIC and local subnet in
cat > /usr/local/etc/dnsmasq.conf <<EOF
pxe-service=x86PC, "pxelinux", pxelinux

And start it:
sysrc dnsmasq_enable=yes
service dnsmasq start


This step will install pxelinux binaries and configure PXE menu:
mkdir /tftpboot
cd /tftpboot
unzip -d syslinux
cp syslinux/bios/memdisk/memdisk /tftpboot
cp syslinux/bios/core/pxelinux.0 /tftpboot
cp syslinux/bios/com32/elflink/ldlinux/ldlinux.c32 /tftpboot
cp syslinux/bios/com32/menu/menu.c32 /tftpboot
cp syslinux/bios/com32/libutil/libutil.c32 /tftpboot
cp syslinux/bios/com32/modules/pxechn.c32 /tftpboot
cp syslinux/bios/com32/lib/libcom32.c32 /tftpboot

cp syslinux/bios/com32/chain/chain.c32 /tftpboot
cp syslinux/bios/com32/modules/reboot.c32 /tftpboot/
rm -rf syslinux
mkdir /tftpboot/pxelinux.cfg
cat > /tftpboot/pxelinux.cfg/default <<EOF

SERIAL 0 115200
UI menu.c32
LABEL freebsd
 MENU LABEL mfsbsd (FreeBSD, pfSense, BSDRP, NAS4Free, etc...)
 KERNEL memdisk
 APPEND initrd=/mfsbsd-10.1-RELEASE-amd64.img harddisk raw
LABEL openbsd
 KERNEL pxechn.c32
 APPEND ::/openbsd/pxeboot
LABEL netbsd
 KERNEL pxechn.c32
 APPEND ::/netbsd/pxeboot_ia32_com0.bin
LABEL centos
 MENU LABEL Centos 7
 kernel centos/vmlinuz
 append initrd=centos/initrd.img method= devfs=nomount ip=dhcp console=ttyS0,115200 earlyprint=serial,ttyS0,115200
LABEL local
 MENU LABEL local disk
 KERNEL chain.c32

LABEL reboot
 MENU LABEL reboot
 KERNEL reboot.c32


Download mfsBSD image and enable serial port:
fetch -o /tftpboot/mfsbsd-10.1-RELEASE-amd64.img
mdconfig -a -t vnode -f mfsbsd-10.1-RELEASE-amd64.img
mount /dev/md0a /mnt/
echo "-S115200 -h" > /mnt/boot.config

umount /mnt
mdconfig -d -u 0


Download OpenBSD's pxeboot and RamDisk image, then enable serial port:
mkdir /tftpboot/openbsd/
fetch -o /tftpboot/openbsd/pxeboot
fetch -o /tftpboot/openbsd/bsd.rd
mkdir /tftpboot/etc
cat > /tftpboot/etc/boot.conf <<EOF
stty com0 115200
set tty com0
boot tftp:/openbsd/bsd.rd


Download CentOS kernel and RamDisk:
mkdir /tftpboot/centos
fetch -o /tftpboot/centos/initrd.img
fetch -o /tftpboot/centos/vmlinuz

Installing BSDRP, pfSense, OPNsense, NAS4Free, or any nanoBSD

From mfsbsd, just dd their serial nanobsd/embedded image to the local hard drive.
For installing FreeBSD: just uses bsdinstall

Debugging PXE/TFTP process

From the server, start a tcpdump accepting only bootps and tftp packets:
tcpdump -ni bce1 -vv port bootps or port tftp

vendredi, février 11, 2011

How to enable receiving UDP syslog message on Ubuntu

After loosing lot's of my precious time, here is how to enable receiving remote syslog message on a Ubuntu server 10.04 LTS:

  1. Create a new file in /etc/rsyslog.d/ and call it udp_server as example:
    • vim /etc/rsyslog.d/udp_server
  2. Add these 2 lines:
    • $ModLoad imudp
    • $UDPServerRun 514
  3. Restart rsyslog: sudo service rsyslog restart
  4. Check that it's working:
    • echo "FreeBSD rocks!" | nc -w0 -u 514
    • sudo tail /var/log/messages

Don't modify the file /etc/rsyslog.conf, it's not used at all !