Browse Source

Merge pull request #1 from sbadia/security

Configure security repository by default
Émile Morel 10 years ago
parent
commit
1c450e9fbc
5 changed files with 27 additions and 26 deletions
  1. 7 7
      Dockerfile
  2. 6 6
      README.md
  3. 5 4
      olinux/create_arm_debootstrap.sh
  4. 8 8
      olinux/create_sunxi_boot_files.sh
  5. 1 1
      olinux/uEnv.txt

+ 7 - 7
Dockerfile

@@ -2,18 +2,18 @@ FROM debian:stable
 #FROM emile/wheezy
 MAINTAINER Émile_morel
 
-# U-boot part 
+# U-boot part
 RUN echo deb http://www.emdebian.org/debian unstable main > /etc/apt/sources.list.d/emdebian.list
-ENV DEBIAN_FRONTEND noninteractive 
-ENV DEBCONF_NONINTERACTIVE_SEEN true 
-ENV LC_ALL C 
-ENV LANGUAGE C 
-ENV LANG C 
+ENV DEBIAN_FRONTEND noninteractive
+ENV DEBCONF_NONINTERACTIVE_SEEN true
+ENV LC_ALL C
+ENV LANGUAGE C
+ENV LANG C
 RUN apt-get update
 RUN apt-get install --force-yes -y emdebian-archive-keyring
 RUN apt-get update
 
-RUN apt-get install --force-yes -y gcc-4.7-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git vim libusb-1.0-0-dev pkg-config bc 
+RUN apt-get install --force-yes -y gcc-4.7-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git vim libusb-1.0-0-dev pkg-config bc
 
 RUN ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc
 

+ 6 - 6
README.md

@@ -5,7 +5,7 @@ Bootstrap a minimal debian rootfs with sunxi kernel and boot files. For now
 only 3 olinuxino boards are available. All scripts in this repository are
 generic so it's easy to add a new boad. Please make a pull request if you
 create and test a new board. I need reviewer for olinuxino lime2 and micro
-olinuxino boards. 
+olinuxino boards.
 
 Thanks to [lukas2511](https://github.com/lukas2511/olinuxino-a20-micro) for
 quick bootstrap.
@@ -22,7 +22,7 @@ cd sunxi-debian && sudo docker build -t debian:olinux .
 
 We cannot perform a debootstrap in dockerfile because dockerfile doesn't accept
 privileged mode. For more details see [docker
-issue](https://github.com/docker/docker/issues/1916) 
+issue](https://github.com/docker/docker/issues/1916)
 
 To build the minimal debian rootfs run:
 
@@ -33,7 +33,7 @@ sudo docker run --privileged -i -t -v $(pwd)/olinux/:/olinux/ debian:olinux sh .
 Optional arguments:
 + -n <name> hostnane
 + -a <packages> add additional packages
-+ -d <release> debian release (wheezy, jessie...)  
++ -d <release> debian release (wheezy, jessie...)
 
 # Build sunxi kernel and boot files
 
@@ -61,7 +61,7 @@ mmc=/dev/sdc
 ## Partitioning
 
 Make 2 partitions; one for boot files (kernel, file with custom boot args...),
-and another for root fs. 
+and another for root fs.
 
 ```shell
 parted -s ${mmc} mklabel msdos
@@ -136,9 +136,9 @@ your home server so get an eye on [yunohost](https://yunohost.org/#/) ;)
 ## You probably want to Build your own docker image
 
 - Because it's quick and easy; tutorial [here](http://www.aossama.com/build-debian-docker-image-from-scratch/)
-- Because you shoudn't trust regitry images; demonstration [here](https://joeyh.name/blog/entry/docker_run_debian/) 
+- Because you shoudn't trust regitry images; demonstration [here](https://joeyh.name/blog/entry/docker_run_debian/)
 
-## External links 
+## External links
 
 - [how-to-create-bare-minimum-debian-wheezy-rootfs-from-scratch](http://olimex.wordpress.com/2014/07/21/how-to-create-bare-minimum-debian-wheezy-rootfs-from-scratch/)
 - [building-a-pure-debian-armhf-rootfs](http://blog.night-shade.org.uk/2013/12/building-a-pure-debian-armhf-rootfs/)

+ 5 - 4
olinux/create_arm_debootstrap.sh

@@ -36,7 +36,7 @@ while getopts ":a:d:n:" opt; do
       name=$OPTARG
       ;;
     \?)
-      show_usage        
+      show_usage
       ;;
   esac
 done
@@ -53,16 +53,17 @@ mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
 update-binfmts --enable
 cp /usr/bin/qemu-arm-static $targetdir/usr/bin/
 cp /etc/resolv.conf $targetdir/etc
-chroot $targetdir /debootstrap/debootstrap --second-stage 
+chroot $targetdir /debootstrap/debootstrap --second-stage
 
 # Configure debian apt repository
 cat <<EOT > $targetdir/etc/apt/sources.list
 deb http://ftp.fr.debian.org/debian $distro main contrib non-free
+deb http://security.debian.org/ $distro/updates main contrib non-free
 EOT
 cat <<EOT > $targerdir/etc/apt/apt.conf.d/71-no-recommends
 APT::Install-Suggests "0";
 EOT
-chroot $targetdir apt-get update 
+chroot $targetdir apt-get update
 
 # Add ssh server and ntp client
 chroot $targetdir apt-get install -y --force-yes openssh-server ntp $packages
@@ -82,7 +83,7 @@ echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> $targetdir/etc/inittab
 # add 'olinux' for root password
 sed -i -e 's/root:*/root:$6$20Vo8onH$rsNB42ksO1i84CzCTt8e90ludfzIFiIGygYeCNlHYPcDOwvAEPGQQaQsK.GYU2IiZNHG.e3tRFizLmD5lnaHH/' $targetdir/etc/shadow
 
-# add hostname 
+# add hostname
 echo $name > $targetdir/etc/hostname
 
 # Remove useless files

+ 8 - 8
olinux/create_sunxi_boot_files.sh

@@ -12,7 +12,7 @@ cat <<EOF
 
 # OPTIONS
 
-  -o		offline mode				(mandatory) 
+  -o		offline mode				(mandatory)
   -t		olinux type (lime, lime2, micro) 	(default: lime)
 
 EOF
@@ -28,7 +28,7 @@ while getopts ":ot:" opt; do
       olinux=$OPTARG
       ;;
     \?)
-      show_usage        
+      show_usage
       ;;
   esac
 done
@@ -40,9 +40,9 @@ clone_or_pull (){
   if [ "$offline" ] ; then
     cd /olinux/sunxi/$name/ && make clean
     return 0
-  fi 
-  if [ -d /olinux/sunxi/$name/ ] ; then 
-    cd /olinux/sunxi/$name/ && make clean && git pull --depth 1 
+  fi
+  if [ -d /olinux/sunxi/$name/ ] ; then
+    cd /olinux/sunxi/$name/ && make clean && git pull --depth 1
   else
     git clone --depth 1 $repo/$project /olinux/sunxi/$name/
   fi
@@ -70,14 +70,14 @@ cd /olinux/sunxi/u-boot && make CROSS_COMPILE=arm-linux-gnueabihf $u_boot_config
 clone_or_pull linux-sunxi.git https://github.com/linux-sunxi
 cp /olinux/a20_defconfig /olinux/sunxi/linux-sunxi/arch/arm/configs/.
 cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm a20_defconfig
-cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 uImage  
+cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 uImage
 cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 INSTALL_MOD_PATH=out modules
 cd /olinux/sunxi/linux-sunxi/ && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 INSTALL_MOD_PATH=out modules_install
 
 # Sunxi board configs
 clone_or_pull sunxi-boards.git https://github.com/linux-sunxi
-# Sunxi tools 
+# Sunxi tools
 clone_or_pull sunxi-tools.git https://github.com/linux-sunxi
 cd /olinux/sunxi/sunxi-tools/ && make
 cd /olinux/sunxi/ && rm -f script.bin && ./sunxi-tools/fex2bin sunxi-boards/sys_config/$sunxi_board_config script.bin
-cd /olinux/sunxi/ && chmod +x script.bin 
+cd /olinux/sunxi/ && chmod +x script.bin

+ 1 - 1
olinux/uEnv.txt

@@ -7,5 +7,5 @@ kernel=uImage
 loglevel=8
 panicarg=panic=10
 root=/dev/mmcblk0p2 rootwait
-extraargs=sunxi_ve_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=0 
+extraargs=sunxi_ve_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=0
 setargs=setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}