Changes between Version 5 and Version 6 of BuildOnOpenSuse


Ignore:
Timestamp:
Feb 26, 2011, 9:42:31 PM (9 years ago)
Author:
stappers
Comment:

Please focus on 1 "Xeno Build Wiki page"

Legend:

Unmodified
Added
Removed
Modified
  • BuildOnOpenSuse

    v5 v6  
    1 This page is about creating a build environment on OpenSUSE which will allow you to build DebWrt for your router of choice.
    2 I am not 100% sure, but I believe this guide should allow you to build DebWrt on any Linux system.
    3 This page is current at the time of writing [20 Feb 2011].
     1Content moved to XenoBuild
    42
    5 = Prerequisites & Assumptions =
    6 
    7 * You have an up to date OpenSUSE system
    8 * You know your way around the system
    9 * You have a lot of patience
    10 * You want your DebWrt router to be Debian Squeeze based
    11 
    12 = Debootstrap =
    13 
    14 Download current release of debootstrap.
    15 {{{
    16 cd ~
    17 wget http://ftp.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.26_all.deb
    18 }}}
    19 
    20 Unpack the archive
    21 {{{
    22 cd /
    23 ar p ~/debootstrap_1.0.26_all.deb data.tar.gz | tar zx
    24 }}}
    25 
    26 Now you should have access to debootstrap. Make sure it works:
    27 {{{
    28 # sudo debootstrap --version
    29 root's password:
    30 debootstrap 1.0.26
    31 }}}
    32 
    33 If not - make sure you have {{{/usr/sbin}}} added to your PATH variable.
    34 
    35 = Create your build environment =
    36 
    37 Go somewhere you have few spare GB of disk space and set up your build environment there.
    38 For me it was {{{/srv/krystian/x}}} so if you see this path somewhere in my listings, know this is path to my build directory.
    39 To make things easier let's just assign a variable name to it: {{{DEBWRT_BUILD}}}
    40 {{{
    41 export DEBWRT_BUILD=/path/to/your/build/dir
    42 }}}
    43 
    44 Create the build environment:
    45 {{{
    46 sudo debootstrap --arch=amd64 squeeze $DEBWRT_BUILD
    47 }}}
    48 You might want to adjust the --arch parameter to suite your architecture.
    49 Plase note that Debian uses amd64 name for x86_64 architecture.
    50 After a moment you should have your build environment created.
    51 
    52 = Configure the environment =
    53 
    54 First thing to do is to chroot to your new environment and set your locale to C.
    55 
    56 {{{
    57 sudo chroot $DEBWRT_BUILD
    58 export LANG=C
    59 mount -t proc proc /proc
    60 }}}
    61 
    62 == Installing required packages ==
    63 
    64 Install few packages which are needed during the build. Please note, there are probably packages missing from this listing,
    65 so in case you get an error somewhere down the road about something missing... install it.
    66 If you get an error saying a package is not found, just use aptitude and search for it as there might be a typo.
    67 
    68 {{{
    69 apt-get install sudo fakeroot gawk python unzip flex zlibc build-essential libncurses5-dev subversion zlib1g-dev git debootstrap
    70 }}}
    71 You will be asked whether you want to install from unverified source. Answer yes.
    72 
    73 {{{
    74 apt-get install makedev
    75 }}}
    76 
    77 You might get few strange messages after installing makedev, like:
    78 {{{
    79 Can not write log, openpty() failed (/dev/pts not mounted?)
    80 Setting up makedev (2.3.1-89) ...
    81 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    82 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    83 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    84 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    85 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    86 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    87 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    88 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    89 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    90 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    91 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    92 .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
    93 }}}
    94 Just ignore them.
    95 
    96 
    97 == Add and configure a user ==
    98 
    99 Now add a user, which will be used during the build process
    100 {{{
    101 # adduser debwrt
    102 Adding user `debwrt' ...
    103 Adding new group `debwrt' (1002) ...
    104 Adding new user `debwrt' (1002) with group `debwrt' ...
    105 Creating home directory `/home/debwrt' ...
    106 Copying files from `/etc/skel' ...
    107 Enter new UNIX password:
    108 Retype new UNIX password:
    109 passwd: password updated successfully
    110 Changing the user information for debwrt
    111 Enter the new value, or press ENTER for the default
    112         Full Name []:
    113         Room Number []:
    114         Work Phone []:
    115         Home Phone []:
    116         Other []:
    117 Is the information correct? [Y/n]
    118 }}}
    119 
    120 Password doesn't really matter, since we will never use it.
    121 Now it's time to allow our user to use sudo without password.
    122 You can use {{{visudo}}} to add this line to the file:
    123 {{{
    124 debwrt ALL=NOPASSWD: ALL
    125 }}}
    126 
    127 Since we will be working in /usr/src directory, we want to make sure our user has proper rights in this directory.
    128 Since this is a chrooted env used only for build purposes I am just going to change owner:
    129 
    130 {{{
    131 chown -R debwrt /usr/src
    132 }}}
    133 
    134 == Build DebWrt ==
    135 
    136 Change user to debwrt and download DebWrt sources:
    137 
    138 {{{
    139 su debwrt
    140 cd /usr/src
    141 svn checkout https://svn.debwrt.net/debwrt/trunk debwrt
    142 cd debwrt
    143 }}}
    144 
    145 You will probably want to change the device for which we are going to build the release, so:
    146 {{{
    147 make menuconfig
    148 }}}
    149 
    150 and adjust DebWrt settings to your needs. I am not gonig to cover in here any particular settings.
    151 There are other wiki pages which cover all of that. What we want to achieve here is a proper build with no customizations.
    152 
    153 After you set everything up:
    154 
    155 {{{
    156 make
    157 }}}
    158 
    159 This should take a little bit of time and you should end up with an output like:
    160 
    161 {{{
    162 Make DebWrt completed
    163 
    164 DEBWRTVERSION : angel - 2.0-1 - [ 20 February 2011 (r174) ]
    165 TARGET_ARCH   : mips
    166 BOARD         : ar71xx
    167 SUB_BOARD     : generic_WNDR3700
    168 LINUX_VERSION :  (default)
    169 }}}
    170 
    171 And you are done.
    172 If there was something wrong with the build, maybe there's something you have to install or check current tickets on DebWrt for known issues.
     3this page will be removed half way March 2011