Changes between Version 6 and Version 7 of XenoBuild


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

paste, the work from k.szczesny

Legend:

Unmodified
Added
Removed
Modified
  • XenoBuild

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