Browse Source

create_arm_debootstrap: Just factorize apt install cals

Sebastien Badia 9 years ago
parent
commit
ed3545b87d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      olinux/create_arm_debootstrap.sh

+ 4 - 3
olinux/create_arm_debootstrap.sh

@@ -33,6 +33,7 @@ DEBIAN_RELEASE=jessie
 TARGET_DIR=/olinux/debootstrap
 DEB_HOSTNAME=olinux
 REP=$(dirname $0)
+APT='apt-get install -y --force-yes'
 
 while getopts ":a:b:d:n:t:i:ycp" opt; do
   case $opt in
@@ -116,7 +117,7 @@ fi
 chroot_deb $TARGET_DIR 'apt-get update'
 
 # Add useful packages
-chroot_deb $TARGET_DIR "apt-get install -y --force-yes openssh-server ntp parted locales vim-nox bash-completion rng-tools $PACKAGES"
+chroot_deb $TARGET_DIR "$APT openssh-server ntp parted locales vim-nox bash-completion rng-tools $PACKAGES"
 echo 'HRNGDEVICE=/dev/urandom' >> $TARGET_DIR/etc/default/rng-tools
 echo '. /etc/bash_completion' >> $TARGET_DIR/root/.bashrc
 
@@ -192,7 +193,7 @@ install -m 755 -o root -g root ${REP}/script/firstrun $TARGET_DIR/etc/init.d/
 chroot_deb $TARGET_DIR "insserv firstrun >> /dev/null"
 
 if [ $INSTALL_YUNOHOST ] ; then
-  chroot_deb $TARGET_DIR "apt-get install -y --force-yes git"
+  chroot_deb $TARGET_DIR "$APT git"
   chroot_deb $TARGET_DIR "git clone https://github.com/YunoHost/install_script /tmp/install_script"
   chroot_deb $TARGET_DIR "cd /tmp/install_script && ./autoinstall_yunohostv2"
 fi
@@ -221,7 +222,7 @@ EOT
     mkdir $TARGET_DIR/etc/flash-kernel
     echo $FLASH_KERNEL > $TARGET_DIR/etc/flash-kernel/machine
     echo 'LINUX_KERNEL_CMDLINE="console=tty0 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p60 root=/dev/mmcblk0p1 rootwait sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=0 panic=10 loglevel=6 consoleblank=0"' > $TARGET_DIR/etc/default/flash-kernel
-    chroot_deb $TARGET_DIR 'apt-get install -y --force-yes linux-image-armmp flash-kernel u-boot-sunxi u-boot-tools'
+    chroot_deb $TARGET_DIR "$APT linux-image-armmp flash-kernel u-boot-sunxi u-boot-tools"
   else
     cp ${INSTALL_KERNEL}/*.deb $TARGET_DIR/tmp/
     chroot_deb $TARGET_DIR 'dpkg -i /tmp/*.deb'