User login

Raspberry Pi receipts

Receipts

  • # Compile the kernel (on Debian/Ubuntu)
  • sudo apt-get install git-core gcc-4.6-arm-linux-gnueabi
    sudo ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-linux-gnueabi-gcc
    mkdir raspberrypi
    cd raspberrypi/
    git clone "https://github.com/raspberrypi/tools.git"
    git clone "https://github.com/raspberrypi/linux.git"
    cd linux/
    make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-
    make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- bcmrpi_cutdown_defconfig
    make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig
    vi .config
    sudo apt-get install libncurses5-dev
    make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig
    # make changes to the config
    make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -k -j3
    mkdir modules
    make modules_install ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- INSTALL_MOD_PATH=../modules/
    cd ../tools/mkimage/
    ls
    sudo apt-get install python2.7
    which python2.7
    sudo ln -s /usr/bin/python2.7 /usr/bin/python2
    ./imagetool-uncompressed.py ../../linux/arch/arm/boot/Image
    scp kernel.img pi@192.168.10.111:/tmp/
    ls ../modules/lib/modules/
    cd ../modules/lib/modules/
    sudo tar zcvf mod.tgz 3.6.11-cutdown+
    
    #
    
    sudo setxkbmap no
    
    #set locale switch key combination:
    setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ru
    
  • # Manipulate services
  • 
    # disable SNMP server:
    sudo update-rc.d snmpd disable
    
    # disable SAMBA server:
    sudo update-rc.d samba disable
    
  • # Running mode
  • 
    # Start without X (terminal mode):
    # does not work: sudo update-rc.d lightdm disable
    sudo systemctl set-default multi-user.target
    # sudo systemctl disable lightdm
    
    # Start X server:
    sudo service lightdm start
    
  • # Partitioning
  • 
    # Resize root partition:
    sudo fdisk /dev/mmcblk0
    
    Command (m for help): p
    #Disk /dev/mmcblk0: 29 GiB, 31167873024 bytes, 60874752 sectors
    #Units: sectors of 1 * 512 = 512 bytes
    #Sector size (logical/physical): 512 bytes / 512 bytes
    #I/O size (minimum/optimal): 512 bytes / 512 bytes
    #Disklabel type: dos
    #Disk identifier: 0xec5294f5
    
    #Device         Boot  Start     End Sectors  Size Id Type
    #/dev/mmcblk0p1        8192  131071  122880   60M  c W95 FAT32 (LBA)
    #/dev/mmcblk0p2      131072 7878655 7747584  3.7G 83 Linux
    
    Command (m for help): d
    #Partition number (1,2, default 2): 2
    
    #Partition 2 has been deleted.
    
    Command (m for help): n
    #Partition type
    #   p   primary (1 primary, 0 extended, 3 free)
    #   e   extended (container for logical partitions)
    Select (default p): p
    Partition number (2-4, default 2):
    First sector (2048-60874751, default 2048): 131072
    Last sector, +sectors or +size{K,M,G,T,P} (131072-60874751, default 60874751):
    
    #Created a new partition 2 of type 'Linux' and of size 29 GiB.
    
    Command (m for help): p
    #Disk /dev/mmcblk0: 29 GiB, 31167873024 bytes, 60874752 sectors
    #Units: sectors of 1 * 512 = 512 bytes
    #Sector size (logical/physical): 512 bytes / 512 bytes
    #I/O size (minimum/optimal): 512 bytes / 512 bytes
    #Disklabel type: dos
    #Disk identifier: 0xec5294f5
    
    #Device         Boot  Start      End  Sectors Size Id Type
    #/dev/mmcblk0p1        8192   131071   122880  60M  c W95 FAT32 (LBA)
    #/dev/mmcblk0p2      131072 60874751 60743680  29G 83 Linux
    
    
    Command (m for help): w
    
    sudo resize2fs /dev/mmcblk0p2