メモ。

ただのメモです。

How to install fbterm on CentOS7 x86_64

Environment

Procedure

$ yum groupinstall -y "Development Tools"
$ yum install -y freetype-devel
$ yum install -y fontconfig-devel
$ yum install -y gpm-devel

$ yum install -y epel-release

$ wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
$ rpm -Uvh remi-release-7.rpm
$ yum check-update
$ yum install -y --enablerepo=remi  libx86-devel

$ yum -y install vlgothic-*

$ git clone https://github.com/izmntuk/fbterm.git fbterm.git

$ cd fbterm.git
 
$ ./configure
$ make
$ make install

$ vim /etc/default/grub

> GRUB_CMDLINE_LINUX="nomodeset"
< GRUB_CMDLINE_LINUX="vga=0x314 nomodeset"


$ grub2-mkconfig -o /boot/grub2/grub.cfg

$ reboot

dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylibによりbrew upgrade出来ない。

環境

f:id:b7craft:20170812084011p:plain

brew upgradeを実行すると、libjpeg.8.dylibがloadされてないってメッセージが出る。

$ brew update && brew upgrade
Already up-to-date.
==> Upgrading 5 outdated packages, with result:
homebrew/php/composer 1.5.1, hdf5 1.10.1_2, imagemagick 7.0.6-6, octave 4.2.1_4, homebrew/php/php70 7.0.22_14
dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
  Referenced from: /usr/local/opt/php70/bin/php
  Reason: image not found
composer: PHP Phar support is required for this formula
Error: An unsatisfied requirement failed this build.

libjpeg.8.dylibを探す。

$ sudo find / -name libjpeg.8.dylib
Password:
/usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib

シンボリックリンクを貼る。

$ ln -s /usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib /usr/local/opt/jpeg/lib/
$ ll /usr/local/opt/jpeg/lib/libjpeg.8.dylib 
lrwxr-xr-x  1 User  admin  45  8 12 08:24 /usr/local/opt/jpeg/lib/libjpeg.8.dylib -> /usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib

$ brew update && brew upgradeを実行する。

Already up-to-date.
==> Upgrading 5 outdated packages, with result:
homebrew/php/composer 1.5.1, hdf5 1.10.1_2, imagemagick 7.0.6-6, octave 4.2.1_4, homebrew/php/php70 7.0.22_14
==> Upgrading homebrew/php/composer 
==> Downloading https://homebrew.bintray.com/bottles-php/composer-1.5.1.sierra.b
######################################################################## 100.0%
==> Pouring composer-1.5.1.sierra.bottle.1.tar.gz
==> Caveats
      composer no longer depends on the homebrew php Formulas since the last couple of macOS releases
      contains a php version compatible with composer. If this has been part of your workflow
      previously then please make the appropriate changes and `brew install php71` or other appropriate
      Homebrew PHP version.
==> Summary
🍺  /usr/local/Cellar/composer/1.5.1: 5 files, 1.8MB
==> Upgrading hdf5 
==> Downloading https://homebrew.bintray.com/bottles/hdf5-1.10.1_2.sierra.bottle
######################################################################## 100.0%
==> Pouring hdf5-1.10.1_2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/hdf5/1.10.1_2: 265 files, 14.6MB
==> Upgrading imagemagick 
==> Downloading https://homebrew.bintray.com/bottles/imagemagick-7.0.6-6.sierra.
######################################################################## 100.0%
==> Pouring imagemagick-7.0.6-6.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/imagemagick/7.0.6-6: 1,522 files, 22.7MB
==> Upgrading octave 
==> Installing dependencies for octave: flac, libogg, libvorbis, libsndfile, portaudio
==> Installing octave dependency: flac
==> Downloading https://homebrew.bintray.com/bottles/flac-1.3.2.sierra.bottle.ta
######################################################################## 100.0%
==> Pouring flac-1.3.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/flac/1.3.2: 53 files, 1.8MB
==> Installing octave dependency: libogg
==> Downloading https://homebrew.bintray.com/bottles/libogg-1.3.2.sierra.bottle.
######################################################################## 100.0%
==> Pouring libogg-1.3.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libogg/1.3.2: 96 files, 457.5KB
==> Installing octave dependency: libvorbis
==> Downloading https://homebrew.bintray.com/bottles/libvorbis-1.3.5_1.sierra.bo
######################################################################## 100.0%
==> Pouring libvorbis-1.3.5_1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libvorbis/1.3.5_1: 159 files, 2.3MB
==> Installing octave dependency: libsndfile
==> Downloading https://homebrew.bintray.com/bottles/libsndfile-1.0.28.sierra.bo
######################################################################## 100.0%
==> Pouring libsndfile-1.0.28.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libsndfile/1.0.28: 48 files, 1.8MB
==> Installing octave dependency: portaudio
==> Downloading https://homebrew.bintray.com/bottles/portaudio-19.6.0.sierra.bot
######################################################################## 100.0%
==> Pouring portaudio-19.6.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/portaudio/19.6.0: 33 files, 452.7KB
==> Installing octave
==> Downloading https://homebrew.bintray.com/bottles/octave-4.2.1_4.sierra.bottl
######################################################################## 100.0%
==> Pouring octave-4.2.1_4.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/octave/4.2.1_4: 2,182 files, 37.4MB
==> Upgrading homebrew/php/php70 
==> Downloading https://homebrew.bintray.com/bottles-php/php70-7.0.22_14.sierra.
######################################################################## 100.0%
==> Pouring php70-7.0.22_14.sierra.bottle.tar.gz
==> Caveats

The php.ini file can be found in:
    /usr/local/etc/php/7.0/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

      PATH="/usr/local/bin:$PATH"

PHP70 Extensions will always be compiled against this PHP. Please install them using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file:
  export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"

✩✩✩✩ FPM ✩✩✩✩

To launch php-fpm on startup:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/opt/php70/homebrew.mxcl.php70.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist

The control script is located at /usr/local/opt/php70/sbin/php70-fpm

OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

  PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'homebrew-php.josegonzalez.php70.plist' in old versions of this formula.

With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system you have to install php with the --with-httpd24 option. See  brew options php70 for more details.

To have launchd start homebrew/php/php70 now and restart at login:
  brew services start homebrew/php/php70
==> Summary
🍺  /usr/local/Cellar/php70/7.0.22_14: 337 files, 38.6MB

出来た。


参考

laravel5.1でlaralib\L5scaffoldを使う

vendor/laralib/l5scaffold/src/Commands/ScaffoldMakeCommand.phpを修正するところがポイント。

$ composer create-project laravel/laravel <PROJECT> "5.1.*"
$ composer require 'laralib/l5scaffold' --dev

$ vim vendor/laralib/l5scaffold/src/Commands/ScaffoldMakeCommand.php

use Illuminate\Support\Composer;
        ↓
use Illuminate\Foundation\Composer;  //修正

$ vim config/app.php

# providerのところ

Laralib\L5scaffold\GeneratorsServiceProvider::class,  //追加

CentOS7.x LiveCDで遊ぶ (2)

CentOS7.x LiveCDで遊ぶ(1) - メモ。の続き。 squashes.imgを解凍して得られるex3fs.imgを適当なディレクトリへマウントすると、以下の様なディレクトリを確認出来る。

 $ mount -o loop,rw  squashfs-root/LiveOS/ext3fs.img /mnt
 $ cd /mnt
 $ ls /mnt
 bin   dev  home  lib64       media  opt   root  sbin  sys  usr
 boot  etc  lib   lost+found  mnt    proc  run   srv   tmp  var
  1. initスクリプト(/mnt/etc/init.d/livesys)の96, 97行目で利用している関数findPersistentHomeを追っていくと、persistenthome=UUID=XXXXXXXXXXや persistenthome=LABEL=/homeで指定した区画をホームディレクトリとしてマウント出来ることがわかる。

  2. 指定した区画をホームディレクトリとしてマウントするには、grub.cfgもしくは、syslinux.cfg(両方でも良い)のkernel lineへpersistenthome=......を追記する。

    例 kernel ........... persistenthome=LABEL=/HOME

$ nl -b a  /mnt/etc/init.d/livesys
     1  #
     2  # live: Init script for live image
     3  #
     4  # chkconfig: 345 00 99
     5  # description: Init script for live image.
     6  ### BEGIN INIT INFO
     7  # X-Start-Before: display-manager
     8  ### END INIT INFO
     9  
    10  . /etc/init.d/functions
    11  
    12  if ! strstr "`cat /proc/cmdline`" rd.live.image || [ "$1" != "start" ]; then
    13      exit 0
    14  fi
    15  
    16  if [ -e /.liveimg-configured ] ; then
    17      configdone=1
    18  fi
    19  
    20  exists() {
    21      which $1 >/dev/null 2>&1 || return
    22      $*
    23  }
    24  
    25  # Make sure we don't mangle the hardware clock on shutdown
    26  ln -sf /dev/null /etc/systemd/system/hwclock-save.service
    27  
    28  livedir="LiveOS"
    29  for arg in `cat /proc/cmdline` ; do
    30    if [ "${arg##rd.live.dir=}" != "${arg}" ]; then
    31      livedir=${arg##rd.live.dir=}
    32      return
    33    fi
    34    if [ "${arg##live_dir=}" != "${arg}" ]; then
    35      livedir=${arg##live_dir=}
    36      return
    37    fi
    38  done
    39  
    40  # enable swaps unless requested otherwise
    41  swaps=`blkid -t TYPE=swap -o device`
    42  if ! strstr "`cat /proc/cmdline`" noswap && [ -n "$swaps" ] ; then
    43    for s in $swaps ; do
    44      action "Enabling swap partition $s" swapon $s
    45    done
    46  fi
    47  if ! strstr "`cat /proc/cmdline`" noswap && [ -f /run/initramfs/live/${livedir}/swap.img ] ; then
    48    action "Enabling swap file" swapon /run/initramfs/live/${livedir}/swap.img
    49  fi
    50  
    51  mountPersistentHome() {
    52    # support label/uuid
    53    if [ "${homedev##LABEL=}" != "${homedev}" -o "${homedev##UUID=}" != "${homedev}" ]; then
    54      homedev=`/sbin/blkid -o device -t "$homedev"`
    55    fi
    56  
    57    # if we're given a file rather than a blockdev, loopback it
    58    if [ "${homedev##mtd}" != "${homedev}" ]; then
    59      # mtd devs don't have a block device but get magic-mounted with -t jffs2
    60      mountopts="-t jffs2"
    61    elif [ ! -b "$homedev" ]; then
    62      loopdev=`losetup -f`
    63      if [ "${homedev##/run/initramfs/live}" != "${homedev}" ]; then
    64        action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
    65      fi
    66      losetup $loopdev $homedev
    67      homedev=$loopdev
    68    fi
    69  
    70    # if it's encrypted, we need to unlock it
    71    if [ "$(/sbin/blkid -s TYPE -o value $homedev 2>/dev/null)" = "crypto_LUKS" ]; then
    72      echo
    73      echo "Setting up encrypted /home device"
    74      plymouth ask-for-password --command="cryptsetup luksOpen $homedev EncHome"
    75      homedev=/dev/mapper/EncHome
    76    fi
    77  
    78    # and finally do the mount
    79    mount $mountopts $homedev /home
    80    # if we have /home under what's passed for persistent home, then
    81    # we should make that the real /home.  useful for mtd device on olpc
    82    if [ -d /home/home ]; then mount --bind /home/home /home ; fi
    83    [ -x /sbin/restorecon ] && /sbin/restorecon /home
    84    if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
    85  }
    86  
    87  findPersistentHome() {
    88    for arg in `cat /proc/cmdline` ; do
    89      if [ "${arg##persistenthome=}" != "${arg}" ]; then
    90        homedev=${arg##persistenthome=}
    91        return
    92      fi
    93    done
    94  }
    95  
    96  if strstr "`cat /proc/cmdline`" persistenthome= ; then
    97    findPersistentHome
    98  elif [ -e /run/initramfs/live/${livedir}/home.img ]; then
    99    homedev=/run/initramfs/live/${livedir}/home.img
   100  fi
   101  
   102  # if we have a persistent /home, then we want to go ahead and mount it
   103  if ! strstr "`cat /proc/cmdline`" nopersistenthome && [ -n "$homedev" ] ; then
   104    action "Mounting persistent /home" mountPersistentHome
   105  fi
   106  
   107  # make it so that we don't do writing to the overlay for things which
   108  # are just tmpdirs/caches
   109  mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
   110  mount -t tmpfs vartmp /var/tmp
   111  [ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
   112  
   113  if [ -n "$configdone" ]; then
   114    exit 0
   115  fi
   116  
   117  # add fedora user with no passwd
   118  action "Adding live user" useradd $USERADDARGS -c "Live System User" liveuser
   119  passwd -d liveuser > /dev/null
   120  usermod -aG wheel liveuser > /dev/null
   121  
   122  # Remove root password lock
   123  passwd -d root > /dev/null
   124  
   125  # turn off firstboot for livecd boots
   126  systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
   127  systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
   128  systemctl stop firstboot-text.service 2> /dev/null || :
   129  systemctl stop firstboot-graphical.service 2> /dev/null || :
   130  
   131  # don't use prelink on a running live image
   132  sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
   133  
   134  # turn off mdmonitor by default
   135  systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
   136  systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
   137  systemctl stop mdmonitor.service 2> /dev/null || :
   138  systemctl stop mdmonitor-takeover.service 2> /dev/null || :
   139  
   140  # don't enable the gnome-settings-daemon packagekit plugin
   141  gsettings set org.gnome.settings-daemon.plugins.updates active 'false' || :
   142  
   143  # don't start cron/at as they tend to spawn things which are
   144  # disk intensive that are painful on a live image
   145  systemctl --no-reload disable crond.service 2> /dev/null || :
   146  systemctl --no-reload disable atd.service 2> /dev/null || :
   147  systemctl stop crond.service 2> /dev/null || :
   148  systemctl stop atd.service 2> /dev/null || :
   149  
   150  # Mark things as configured
   151  touch /.liveimg-configured
   152  
   153  # add static hostname to work around xauth bug
   154  # https://bugzilla.redhat.com/show_bug.cgi?id=679486
   155  echo "localhost" > /etc/hostname
   156  
   157  # Fixing the lang install issue when other lang than English is selected . See http://bugs.centos.org/view.php?id=7217
   158  /usr/bin/cp /usr/lib/python2.7/site-packages/blivet/size.py /usr/lib/python2.7/site-packages/blivet/size.py.orig
   159  /usr/bin/sed -i "s#return self.humanReadable()#return self.humanReadable().encode('utf-8')#g" /usr/lib/python2.7/site-packages/blivet/size.py
   160  
   161  
   162  
   163  # disable updates plugin
   164  cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE
   165  [org.gnome.settings-daemon.plugins.updates]
   166  active=false
   167  FOE
   168  
   169  # Show the system-config-keyboard tool on the desktop
   170  mkdir /home/liveuser/Desktop -p >/dev/null
   171  cat /usr/share/applications/system-config-keyboard.desktop | sed '/NotShowIn/d' |sed 's/Terminal=false/Terminal=true/' > /home/liveuser/Desktop/system-config-keyboard.desktop
   172  cat /usr/share/applications/liveinst.desktop | sed '/NoDisplay/d' > /home/liveuser/Desktop/liveinst.desktop 
   173  chmod +x /home/liveuser/Desktop/*.desktop
   174  chown -R liveuser:liveuser /home/liveuser
   175  
   176  # Liveuser face
   177  if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then
   178      cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png /home/liveuser/.face
   179      chown liveuser:liveuser /home/liveuser/.face
   180  fi
   181  
   182  # make the installer show up
   183  if [ -f /usr/share/applications/liveinst.desktop ]; then
   184    # Show harddisk install in shell dash
   185    sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop 
   186    # need to move it to anaconda.desktop to make shell happy
   187    #cp /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
   188  fi
   189    cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
   190  [org.gnome.shell]
   191  favorite-apps=['liveinst.desktop','firefox.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop', 'anaconda.desktop']
   192  FOE
   193  
   194  
   195  # set up auto-login
   196  cat > /etc/gdm/custom.conf << FOE
   197  [daemon]
   198  AutomaticLoginEnable=True
   199  AutomaticLogin=liveuser
   200  FOE
   201  
   202  # Turn off PackageKit-command-not-found while uninstalled
   203  if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
   204    sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
   205  fi
   206  
   207  # make sure to set the right permissions and selinux contexts
   208  chown -R liveuser:liveuser /home/liveuser/
   209  restorecon -R /home/liveuser/
   210  
   211  # Fixing default locale to us
   212  localectl set-keymap us
   213  localectl set-x11-keymap us

CentOS7.x LiveCDで遊ぶ (1)

  1. CentOS-7-x86_64-LiveGNOME-1511.isounetbootinで、ブータブルUSBメモリ化する。

  2. 読み込み専用ファイルシステムsquashfs.imgに保存されているCentOSをカスタマイズする。

ディレクトリ構造

作成後のUSBメモリ内のディレクトリ構造は下の様になっている。

 $ tree 
 .
 ├── EFI
 │   └── BOOT
 │       ├── BOOTX64.EFI
 │       ├── fonts
 │       │   └── unicode.pf2
 │       ├── grub.cfg
 │       └── grubx64.efi
 ├── LiveOS
 │   ├── osmin.img
 │   └── squashfs.img
 ├── isolinux
 │   ├── boot.cat
 │   ├── efiboot.img
 │   ├── initrd0.img
 │   ├── isolinux.bin
 │   ├── isolinux.cfg
 │   ├── macboot.img
 │   ├── vesamenu.c32
 │   └── vmlinuz0
 ├── ldlinux.sys
 ├── menu.c32
 ├── syslinux.cfg
 ├── ubnfilel.txt
 ├── ubninit
 ├── ubnkern
 └── ubnpathl.txt
 
 5 directories, 21 files

カスタマイズする。

① 読み込み専用ファイルシステムsquashfs.imgを適当な場所へコピー後、unsquashfsコマンドで解凍する。

 $ unsquashfs  squashfs.img 
 Parallel unsquashfs: Using 8 processors
 1 inodes (65536 blocks) to write
 
 [====================-                                       ] 22252/65536  33%
 
 $ tree  squashfs-root/
 squashfs-root/
 └── LiveOS
     └── ext3fs.img
 
 1 directory, 1 file

② ext3fs.imgを適当なディレクリにマウントする。

 $ mount -o loop,rw  squashfs-root/LiveOS/ext3fs.img /mnt
 $ cd /mnt
 $ ls /mnt
 bin   dev  home  lib64       media  opt   root  sbin  sys  usr
 boot  etc  lib   lost+found  mnt    proc  run   srv   tmp  var

③ /mntをルートディレクトリとして、コンテナを起動する。

 $ systemd-nspawn -D /mnt
 Spawning container mnt on /mnt.
 Press ^] three times within 1s to kill container.

こうすると、yumコマンドで、パッケージもインストール可能となる。コンテナを停止させたければ、exitを入力すればよい。

 $$ exit
 logout
 Container mnt exited successfully.

④ 読み込み専用ファイルシステムsquashfs.imgに加えた変更を保存して、元にあった場所にコピーすれば、完了。

 $ mksquashfs squashfs-root squashfs.img
 Parallel mksquashfs: Using 8 processors
 Creating 4.0 filesystem on squashfs.img, block size 131072.
 [===================/                                        ] 22159/65536  33%

タイトル

大見出し

中見出し

小見出し

標準

  • 箇条書き1
  • 箇条書き2
  • 箇条書き3
  1. 番号付き1
  2. 番号付き2
  3. 番号付き3

リンク 

引用

*1  *2 

 ボールド

イタリック

取り消し線

アンダーライン

 文字の大きさ200%

 文字の大きさ150%

 文字の大きさ100%

 文字の大きさ80%

 

*1:脚注1

*2:脚注2

続きを読む