Download presentation
Presentation is loading. Please wait.
1
Turn Key Mini Project – SVN and Buildroot TA: Shun-Lee Chang ( 張舜理 ) Important Dates: Demo and your 2-page report: 4/28 (Tue) 14:00 ~ 18:00 TA Office: EECS ( 電資大樓 ) 701 E-mail: changsl@cs.nctu.edu.twchangsl@cs.nctu.edu.tw Contact: #54850 / 0919-972660
2
2 Project Goals Source control by SVN –Practice on your SVN repository –Team work using SVN Root file system –Use “buildroot” to build your own root file system Makefile
3
3 Development Prerequisite OS –The mini-project was verified on Fedora 10 –Run upon VMWare shall be ok, but VERY SLOW Packages –ssh, wget –Development related packages gcc, automake –svn Check its availability by “svn help”
4
4 SVN - Practice Steps 1.Create your repository for “myproj3” svnadmin create /home/userX/myproj3 # assume you have permission to access the above path 2.Check out it svn co file:///home/userX/myproj3 src_myproj3file:///home/userX/myproj3 3.Add some files to src_myproj3 echo “welcome” > src_myproj3/hello 4.Add a new file (by doing so, you can also add a new directory and all files under them) Under src_myproj3: svn add hello 5.Commit it Under src_myproj3: svn commit –m “My first version” 6.Delete src_myproj3 /bin/rm –rf src_myproj3 7.Check out “myproj3” again 8.Modify an existing file –echo “bye” >> src_myproj3/hello 9.Commit it
5
5 SVN – Merge Steps 1.svn co file:///home/userX/myproj3 afile:///home/userX/myproj3 2.svn co file:///home/userX/myproj3 bfile:///home/userX/myproj3 3.Edit a/hello, and replace “welcome” with “welcome 1” 4.Edit b/hello, and replace “bye” with “bye 2” 5.under a: svn commit –m “v2” 6.under b: svn commit –m “v3” 7.under b: svn update 8.under b: svn commit –m “v3” 9.svn co file:///home/userX/myproj3 cfile:///home/userX/myproj3 Please answer the following questions in the mini-project report –Q1: What happens in step 6 ? –Q2: What happens in step 7 ? –Q3: What is the content of the file “hello” under directories a, b, and c ?
6
6 SVN – Conflict Steps 1.svn co file:///home/userX/myproj3 dfile:///home/userX/myproj3 2.svn co file:///home/userX/myproj3 efile:///home/userX/myproj3 3.Edit d/hello, and replace “bye 2” with “good morning” 4.Edit e/hello, and replace “bye 2” with “bye bye” 5.under d: svn commit –m “v4” 6.under e: svn update # enter “p” (postpone) if any question arises 7.Check e/hello, e/hello.mine, and e/hello.r* 8.Edit e/hello, remove all lines except “welcome 1” and “bye bye” 9.under e: svn commit –m “v4” 10.Delete e/hello.mine, e/hello.mine, and e/hello.r* 11.under e: svn commit –m “v4” 12.svn co file:///home/userX/myproj3 ffile:///home/userX/myproj3 Please answer the following questions in the mini-project report –Q4: What happens in step 6 ? Compare the result here and Q2. –Q5: List all files under directory e after step 6 –Q6: Try to explain the filename and content in files: e/hello.mine, e/hello.r* –Q7: What happens in step 9 ? –Q8: What is the content of “f/hello?”
7
7 SVN – Version Steps 1.svn co file:///home/userX/myproj3 z -r 2file:///home/userX/myproj3 Please answer the following questions in the mini-project report –Q9: What is the content of “z/hello?” –Q10: What does “-r 2” mean in the above command?
8
8 Team Work using SVN Scenario –You join a team project, and share the source code with other members. –You have to “add a feature” for this project. Steps (on your Linux) 1.Check out our team-work source svn co svn+ssh://nsd2009@140.113.88.181/home/nsd2009/proj3 Password is “pwd2009” 2.Follow the instructions in Readme.txt –Show your results at demo time
9
9 (Optional) Bonus Study “websvn,” –Install a websvn service You might need to disable SELINUX if not familiar with it –Demo your websvn at the demo time Your web server shall be accessible from 140.113.88.181 –Write the installation steps, any problem you met, and your solutions in the mini-project report
10
10
11
11 Buildroot – Control the Source Code Steps 1.Download & decompress the buildroot source code http://buildroot.uclibc.org/ 2.Control the original source code by svn –Be careful, don’t miss “.defconfig” Hint: Create an empty project, and then move exiting files into the svn-controlled directory Answer the question in your mini-project report –Q11: Write the procedure of step 2
12
12 Buildroot – Compiling Steps 1.Switch to the svn-controlled directory, e.g., buildroot/ 2.make menuconfig In the “Package Selection for the target” menu, a.Turn on “customize” b.Turn on “thttpd” and “bash” in some sub-menu Hint: either brute-force search or search “thttpd” in package/Config.in first 3.Save the configuration (using Exit) Answer the question in your mini-project report –Q12: How do you turn on “thttpd?”
13
13 Buildroot - Customization Steps 1.Read package/customize/customize.mk 2.mkdir package/customize/source/a 3.Edit package/customize/source/a/intro.htm, and insert HTML content like the following text 4.Switch to buildroot/, and execute “make” 5.…(drink a cup of coffee) … Answer the question in your mini-project report –Q13: Try to explain the logic in customize.mk Hello, I am TA, Shun-Lee Chang
14
14 Buildroot – Test Your File System Output –Uncompressed FS $buildroot/project_build_i686/uclibc/root –Image $buildroot/binaries/uclibc/rootfs.i686.ext2 Steps 1.ls / 2.Be superuser (root) 3.mount –t ext2 –o loop binaries/uclibc/rootfs.i686.ext2 /mnt 4.chroot /mnt 5.ls / 6.ls -al /a 7.Execute, “thttpd -p 48311 -dd /a” 8.Turn off your firewall (or allow Internet access to port 48311 ) 9.Browse http://your_ip:48311/intro.htm Answer the following questions in your mini-project report –Q14: Which step cause the output difference in step 1 and 5? –Q15: List files of step 6 –Q16: Try to explain how buildroot generates the directory “/a”
15
15 Buildroot – Size of File System Steps 1.umount /mnt 2.ls -l binaries/uclibc/rootfs.i686.ext2 3.dd if=/dev/zero of=package/customize/source/a/bigfile count=4096 bs=1024 # It creates a 4MB file 4.rm build_i686/.customize 5./bin/rm –rf project_build_i686/uclibc/root/a 6.make 7.ls -l binaries/uclibc/rootfs.i686.ext2 Answer the following question in your mini-project report –Q17: Compare the results of step 2 and 7
16
16 Buildroot – Demo Time Demo your running “thttpd” service Demo environment –If your Linux has a public IP It must be accessible from 140.113.88.181 Demo through the browser on my PC –If your Linux is run upon VMWare on a notebook Demo on your notebook –Otherwise, Copy your buildroot’s image into a CF card or put it on a ftp/web site where I can access Mount/Demo on my PC
17
17 Term Project Build an embedded firewall (iptables) with transparent proxies (squid, dansguardian) by BuildRoot (Bonus) Run your root file system on “PCM 7230” –The options “arm” + “xscale” does not work
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.