|
Post Last Edited by muf at 2014-8-9 12:23
### To make this image I follow the instructions in the lemaker's wiki.
## http://wiki.lemaker.org/index.ph ... he_bootable_SD_card
## Partitioning and formatting
- Command (m for help): o
- Created a new DOS disklabel with disk identifier 0x1ee7d44d.
Copy the Code
- Command (m for help): n
- Partition type:
- p primary (0 primary, 0 extended, 4 free)
- e extended
- Select (default p):
- Using default response p.
- Partition number (1-4, default 1):
- First sector (2048-15523839, default 2048):
- Last sector, +sectors or +size{K,M,G,T,P} (2048-15523839, default 15523839): +20M
- Created a new partition 1 of type 'Linux' and of size 20 MiB.
Copy the Code
- Command (m for help): n
- Partition type:
- p primary (1 primary, 0 extended, 3 free)
- e extended
- Select (default p):
- Using default response p.
- Partition number (2-4, default 2):
- First sector (43008-15523839, default 43008):
- Last sector, +sectors or +size{K,M,G,T,P} (43008-15523839, default 15523839):
- Created a new partition 2 of type 'Linux' and of size 7.4 GiB.
Copy the Code
- Command (m for help): w
- The partition table has been altered.
- Calling ioctl() to re-read partition table.
- Syncing disks.
Copy the Code
- sudo mkfs.vfat /dev/mmcblk0p1
- sudo mkfs.ext4 /dev/mmcblk0p2
Copy the Code ## http://wiki.lemaker.org/index.php?title=Building_u-boot,_script.bin_and_linux-kernel
## Building u-boot, script.bin and linux-kernel
## toolchain for debian wheezy
- echo "deb http://www.emdebian.org/debian/ unstable main" >> /etc/apt/sources.list
- apt-get install emdebian-archive-keyring
- apt-get update
Copy the Code
- apt-get install gcc-4.7-arm-linux-gnueabihf build-essential pkg-config git debootstrap u-boot-tools libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot kernel-package zlib1g-dev libncurses5-dev
Copy the Code
- ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc
Copy the Code ## u-boot
- git clone https://github.com/LeMaker/u-boot-bananapi.git
- cd u-boot-bananapi
- make CROSS_COMPILE=arm-linux-gnueabihf- Bananapi_config
- make CROSS_COMPILE=arm-linux-gnueabihf-
- cd ..
Copy the Code ## script.bin
- git clone https://github.com/LeMaker/sunxi-tools.git
- git clone https://github.com/LeMaker/sunxi-boards.git
- cd sunxi-tools
- make
- cd ../sunxi-boards
Copy the Code # You can modify the "sys_config/a20/Bananapi.fex" file, like you can change led setting from "heartbeat" to "default-on" if you want.
# modify "fb0_framebuffer_num = 3" and add "sunxi_fb_mem_reserve = 32" in [disp_init] section.
- ../sunxi-tools/fex2bin sys_config/a20/Bananapi.fex script.bin
- cd ..
Copy the Code ## linux kernel
- git clone https://github.com/LeMaker/linux-bananapi.git
- cd linux-bananapi
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun7i_defconfig
Copy the Code # add some useful drivers like USB WiFi, etc ... Attention for some drivers change the Bananapi.fex too.
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules
- make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
- cd ..
Copy the Code ## Bootloader
- sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1k count=1023 seek=1
- sudo dd if=u-boot-bananapi/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
Copy the Code ## Boot Script- sudo mount /dev/mmcblk0p1 /mnt
Copy the Code # adapt the resolution in the file for your screen : disp.screen0_output_mode=EDID:1280x1024p75
- cat > /mnt/uEnv.txt <<EOF
- bootargs=console=ttyS0,115200 disp.screen0_output_mode=EDID:1280x1024p75 hdmi.audio=EDID:0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
- aload_script=fatload mmc 0 0x43000000 script.bin;
- aload_kernel=fatload mmc 0 0x48000000 uImage;bootm 0x48000000;
- uenvcmd=run aload_script aload_kernel
- EOF
Copy the Code ## Install Kernel
- sudo cp -f sunxi-boards/script.bin /mnt
- sudo cp -f linux-bananapi/arch/arm/boot/uImage /mnt
Copy the Code ## http://wiki.lemaker.org/index.ph ... on_root_file_system
## Setting up the Linux distribution root file system
- sudo umount /mnt
- sudo mount /dev/mmcblk0p2 /mnt
Copy the Code ## Using an existing rootfs tarball
- wget http://archlinuxarm.org/os/ArchLinuxARM-sun7i-latest.tar.gz
- sudo tar xzf ArchLinuxARM-sun7i-latest.tar.gz -C /mnt
Copy the Code ## Install Kernel modules
- sudo rm -fr /mnt/lib/firmware/
- sudo cp -fr linux-bananapi/output/lib/firmware /mnt/lib
- sudo rm -fr /mnt/lib/modules/
- sudo cp -fr linux-bananapi/output/lib/modules /mnt/lib
Copy the Code ## http://qdosmsq.dunbar-it.co.uk/b ... n-the-raspberry-pi/
## http://elinux.org/ArchLinux_Install_Guide
## Archlinux system configuration
## Set the hostname
- echo "BPi" > /etc/hostname
Copy the Code ## Change the Root Password## Set your keymap (adapt for your country)- cat > /etc/vconsole.conf <<EOF
- KEYMAP="fr-latin9"
- FONT="lat9w-16"
- EOF
Copy the Code ## Enable your locale- cat > /etc/locale.gen <<EOF
- en_US.UTF-8 UTF-8
- fr_FR.UTF-8 UTF-8
- fr_FR ISO-8859-1
- fr_FR@euro ISO-8859-15
- EOF
- locale-gen
- echo -n "LANG=en_US.UTF-8\nLC_COLLATE=C" >> /etc/locale.conf
Copy the Code ## Clean up service unnecessary for a Pi- systemctl disable haveged.service
- systemctl disable netctl-ifplugd@eth0.service
- rm -f /usr/lib/systemd/system/multi-user.target.wants/shadow.timer
- rm -f /usr/lib/systemd/system/multi-user.target.wants/logrotate.timer
- rm -f /usr/lib/systemd/system/multi-user.target.wants/man-db.timer
- systemctl enable dhcpcd.service
- systemctl enable ntpd
Copy the Code ## load modules for mali drivers- cat > /etc/modules-load.d/mali.conf <<EOF
- ump
- disp_ump
- mali
- mali_drm
- sunxi_cedar_mod
- EOF
Copy the Code ##Enable this just for debugging
# Have boot messages stay on tty1- #mkdir /etc/systemd/system/getty@tty1.service.d/
- #cat > /etc/systemd/system/getty@tty1.service.d/noclear.conf <<EOF
- #[Service]
- #TTYVTDisallocate=no
- #EOF
Copy the Code ## Set your timezone- rm -f /etc/localtime
- ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime
Copy the Code ## Mount sata with "noauto" option. With "automount" there is a bug at boot.- echo "/dev/sda1 /home ext4 defaults,noatime,noauto 0 0" >> /etc/fstab
Copy the Code ## Pacman configuration
# enable the mirror of your country# add "linux-sun7i linux-firmware uboot-cubieboard2" to "IgnorePkg" option## Update system- systemctl start haveged.service
- pacman-key --init
- systemctl stop haveged.service
- pacman -Syu
Copy the Code ## Add user- echo "muf:x:1000:100:,,,:/home/muf:/bin/bash" >> /etec/passwd
- passwd muf
- mkdir /home/muf
- chown -R muf.users /home/muf/
- usermod -a -G audio,games,power,storage,video muf
Copy the Code ## Install sudo- pacman -S sudo
- echo "muf ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
Copy the Code ## install some packages- pacman -S ethtool vim bash-completion git make gcc
Copy the Code ## install X- pacman -S xorg-server xorg-utils xorg-server-utils xorg-xinit xterm xf86-video-fbturbo-git openbox alsa-utils mplayer
Copy the Code ## openbox configuration- echo "exec openbox-session" > ~/.xinitrc
- mkdir -p ~/.config/openbox
- cp -R /etc/xdg/openbox/* ~/.config/openbox
Copy the Code ## keyboard fr for X
# in "/etc/X11/xorg.conf.d/10-keyboard-layout.conf" add :- Option "XkbLayout" "fr"
- Option "XkbVariant" "latin9"
Copy the Code # if not work- echo "setxkbmap -layout fr -variant nodeadkeys" > /home/muf/.config/openbox/autostart
Copy the Code ## libvdpau for sunxi- git clone https://github.com/linux-sunxi/libvdpau-sunxi
- cd libvdpau-sunxi
- make && make install
Copy the Code ## set good permission- cat > /etc/udev/rules.d/50-mali.rules <<EOF
- KERNEL=="mali", MODE="0660", GROUP="video"
- KERNEL=="ump", MODE="0660", GROUP="video"
- KERNEL=="g2d", MODE="0660", GROUP="video"
- KERNEL=="cedar_dev", MODE="0660", GROUP="video"
- KERNEL=="disp", MODE="0660", GROUP="video"
- EOF
Copy the Code ## For test movie in 1080 HD- mplayer -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau /home/video/movie.mkv
Copy the Code |
|