2013/7/19,2013/8/1
#Debian(x86)上 管理者権限で実行 apt-get remove libreoffice-core -y;apt-get autoremove -y;apt-get update;apt-get upgrade -y apt-get install live-build live-boot live-config apt-cacher-ng -y apt-get install tree less -y mkdir ~/debian-live cd ~/debian-live #もっとも簡単なdebian-liveをつくる(コンソールベースでdebian-liveがうごく) lb config && lb build #USBメモリに書き込む #USBメモリをUSBポートに接続 #/dev/sdxはsdb,sdc等としてUSBメモリを指定 dd if=binary.iso of=/dev/sdx bs=4096このUSBメモリを使うとシンプルなDebianが起動する。
#Debian(x86)上 管理者権限で実行 cd ~/debian-live lb config --bootappend-live \ "boot=live config persistence noeject live-config.utc=no live-config.locales=ja_JP.UTF-8 live-config.keyboard-layouts=jp live-config.keyboard-model=jp106 live-config.keyboard-layout=jp live-config.timezone=Asia/Tokyo" lb config --binary-images hdd lb config --parent-archive-areas "main contrib non-free" lb config --archive-areas "main contrib non-free" lb config --parent-mirror-bootstrap "http://ftp.jp.debian.org/debian/" lb config --parent-mirror-binary "http://ftp.jp.debian.org/debian/" lb config --mirror-bootstrap "http://ftp.jp.debian.org/debian/" lb config --mirror-binary "http://ftp.jp.debian.org/debian/" lb config --mirror-chroot "http://ftp.jp.debian.org/debian/" lb config --tasksel aptitude --tasks "japanese japanese-desktop" mkdir config/package-lists cd config/package-lists echo "task-japanese" > xfce-japanese.list.chroot echo "task-japanese-desktop" >> xfce-japanese.list.chroot echo "task-xfce-desktop" >> xfce-japanese.list.chroot echo "less" >> xfce-japanese.list.chroot echo "tree" >> xfce-japanese.list.chroot echo "make" >> xfce-japanese.list.chroot echo "openssh-client openssh-server" >> xfce-japanese.list.chroot cd ~/debian-live/ mkdir -p config/includes.chroot/etc mkdir -p config/includes.chroot/etc/default cp /etc/bash.bashrc config/includes.chroot/etc cp -a /etc/skel/ config/includes.chroot/etc echo "/opt/microchip/mplabx/mplab_ide/bin/mplab_ide --jdkhome /opt/microchip/mplabx/sys/java/jre1.7.0_17 --nosplash" > config/includes.chroot/etc/skel/mplab chmod 755 config/includes.chroot/etc/skel/mplab echo "Asia/Tokyo" > config/includes.chroot/etc/timezone cp /etc/default/keyboard config/includes.chroot/etc/default/keyboard cd ~/debian-live time lb clean --all time lb build;date #最初は120分くらい 2回目以降は90分くらい #----------------- #USBメモリに書き込む /dev/sdxに注意 umount /dev/sdx1 /dev/sdx2 time dd if=binary.img of=/dev/sdx bs=4096 fdisk /dev/sdx mkfs.ext4 /dev/sdx2 -L persistence #tune2fs -L persistence /dev/sdx2 mount -t ext4 /dev/sdx2 /mnt echo "/ union" >/mnt/persistence.conf umount /mnt
#----------------- #Debian Liveを起動 #PICkit2,PICkit3,MPLABxを使うための設定 sudo echo "deb http://deb.urriellu.net/ any main" >> /etc/apt/source.list sudo apt-get update sudo apt-get install urriellu-keyring sudo apt-get update sudo apt-get install pk2cmd usbutils sudo echo 'ATTR{idVendor}=="04d8", ATTR{idProduct}=="0033", OWNER="root",GROUP="root",MODE="0666"' > /etc/udev/rules.d/71-microchip.rules sudo echo "blacklist pcspkr" >> /etc/modprobe.d/alsa-base-blacklist.conf #MPLABx,xc8をインストール #xc16,xc32はインストールしない wget http://www.takahashi.lab/~nt/technicalnote/debian7/mplabx/MPLABX-v1_80-linux-installer.run wget http://www.takahashi.lab/~nt/technicalnote/debian7/mplabx/xc8-v1.12-linux.run chmod 755 MPLABX-v1_80-linux-installer.run xc8-v1.12-linux.run ./MPLABX-v1_80-linux-installer.run ./xc8-v1.12-linux.run
cd /media/persistence/ tar cf ~/20130801.tar *すでにbinary.imgとアーカイブを用意したので、これを使用してもよい。
#wget http://www.maibun.org/~nt/technicalnote/debian7/mylive/binary.img #wget http://www.maibun.org/~nt/technicalnote/debian7/mylive/20130801.tar #binary.imgを書き込む umount /dev/sdx1 /dev/sdx2 time dd if=binary.img of=/dev/sdx bs=4096 echo n >fdisk.option;echo p>>fdisk.option;echo 2 >>fdisk.option;echo >>fdisk.option;echo >>fdisk.option;echo w>>fdisk.option fdisk /dev/sdx < fdisk.option mkfs.ext4 /dev/sdx2 -L persistence mount -t ext4 /dev/sdx2 /mnt #アーカイブを復元 tar xf 20130801.tar -C /mnt sync umount /dev/sdx*