Moved installing of desktop packages to custom_debootstrap

Separate cache file name for desktop rootfs
Changed rootfs cache tar exclusions
This commit is contained in:
zador-blood-stained
2015-12-23 20:48:41 +03:00
parent c613a9f23b
commit c3f5d3758b
2 changed files with 34 additions and 22 deletions

View File

@@ -74,20 +74,24 @@ else
mount $LOOP"p1" $DEST/cache/sdcard/boot
fi
# rootfs cache file name
[[ $BUILD_DESKTOP == yes ]] && local variant_desktop=yes
local cache_fname="$DEST/cache/rootfs/$RELEASE${variant_desktop:+_desktop}.tgz"
# Uncompress from cache
if [ -f "$DEST/cache/rootfs/$RELEASE.tgz" ]; then
filemtime=`stat -c %Y $DEST/cache/rootfs/$RELEASE.tgz`
if [ -f "$cache_fname" ]; then
filemtime=`stat -c %Y $cache_fname`
currtime=`date +%s`
diff=$(( (currtime - filemtime) / 86400 ))
display_alert "Extracting $RELEASE from cache" "$diff days old" "info"
pv -p -b -r -c -N "$RELEASE.tgz" "$DEST/cache/rootfs/$RELEASE.tgz" | pigz -dc | tar xp -C $DEST/cache/sdcard/
pv -p -b -r -c -N "$RELEASE.tgz" "$cache_fname" | pigz -dc | tar xp -C $DEST/cache/sdcard/
if [ "$diff" -gt "3" ]; then
chroot $DEST/cache/sdcard /bin/bash -c "apt-get update" | dialog --backtitle "$backtitle" --title "Force package update ..." --progressbox 20 70
fi
fi
# If we don't have a filesystem cached, let's make em
if [ ! -f "$DEST/cache/rootfs/$RELEASE.tgz" ]; then
if [ ! -f "$cache_fname" ]; then
# debootstrap base system
debootstrap --include=openssh-server,debconf-utils --arch=armhf --foreign $RELEASE $DEST/cache/sdcard/ | dialog --backtitle "$backtitle" --title "Debootstrap $DISTRIBUTION $RELEASE base system to image template ..." --progressbox 20 70
@@ -134,6 +138,7 @@ module-init-tools mtp-tools nano ntfs-3g ntp parted pkg-config pciutils pv pytho
sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils vlan wireless-tools weather-util weather-util-data wget \
wpasupplicant iptables dvb-apps libdigest-sha-perl libproc-processtable-perl w-scan apt-transport-https sysbench libusb-dev dialog fake-hwclock"
# additional distributios-specific packages
case $RELEASE in
wheezy)
PAKETKI="$PAKETKI libnl-dev"
@@ -146,6 +151,29 @@ case $RELEASE in
;;
esac
# additional desktop packages
if [[ $BUILD_DESKTOP == yes ]]; then
# common packages
PACKAGES="$PACKAGES xserver-xorg xserver-xorg-core xfonts-base xinit nodm x11-xserver-utils xfce4 lxtask xterm mirage radiotray wicd thunar-volman galculator \
gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin gcj-jre-headless xfce4-screenshooter libgnome2-perl"
# release specific desktop packages
case $RELEASE in
wheezy)
PACKAGES="$PACKAGES mozo pluma iceweasel icedove"
;;
jessie)
PACKAGES="$PACKAGES mozo pluma iceweasel libreoffice-writer libreoffice-java-common icedove"
;;
trusty)
PACKAGES="$PACKAGES libreoffice-writer libreoffice-java-common thunderbird firefox gnome-icon-theme-full tango-icon-theme gvfs-backends"
;;
esac
# hardware acceleration support packages
# cache is not LINUXCONFIG and BRANCH specific, so installing anyway
#if [[ $LINUXCONFIG == *sun* && $BRANCH != "next" ]] &&
PACKAGES="$PACKAGES xorg-dev xutils-dev x11proto-dri2-dev xutils-dev libdrm-dev libvdpau-dev"
fi
# generate locales and install packets
display_alert "Install locales" "$DEST_LANG" "info"
LC_ALL=C LANGUAGE=C LANG=C chroot $DEST/cache/sdcard /bin/bash -c "apt-get -y -qq install locales"
@@ -175,8 +203,8 @@ KILLPROC=$(ps -uax | pgrep ntpd | tail -1); if [ -n "$KILLPROC" ]; then k
KILLPROC=$(ps -uax | pgrep dbus-daemon | tail -1); if [ -n "$KILLPROC" ]; then kill -9 $KILLPROC; fi
display_alert "Closing debootstrap process and preparing cache." "" "info"
tar cp --directory=$DEST/cache/sdcard/ --exclude='dev/*' --exclude='proc/*' --exclude='run/*' --exclude='tmp/*' \
--exclude='mnt/*' . | pv -p -b -r -s $(du -sb $DEST/cache/sdcard/ | cut -f1) -N "$RELEASE.tgz" | pigz > $DEST/cache/rootfs/$RELEASE.tgz
tar cp --directory=$DEST/cache/sdcard/ --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
--exclude='./mnt/*' --exclude='./sys/*' . | pv -p -b -r -s $(du -sb $DEST/cache/sdcard/ | cut -f1) -N "$RELEASE.tgz" | pigz > $cache_fname
fi
#
# mount proc, sys and dev

View File

@@ -19,15 +19,9 @@ display_alert "Installing desktop" "XFCE" "info"
umount $DEST/cache/sdcard/tmp >/dev/null 2>&1
mount --bind $SRC/lib/bin/ $DEST/cache/sdcard/tmp
# Declare office packages if any
OFFICE_PACKETS="libreoffice-writer libreoffice-java-common"
# Debian Wheezy
#--------------------------------------------------------------------------------------------------------------------------------
if [[ $RELEASE == "wheezy" ]]; then
BASIC_PACKETS="xserver-xorg xserver-xorg-core xfonts-base xinit nodm x11-xserver-utils xfce4 mozo pluma wicd thunar-volman \
galculator iceweasel libgnome2-perl gcj-jre-headless gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin \
xfce4-screenshooter icedove radiotray mirage xterm lxtask"
# copy wallpapers and default desktop settings
d=$DEST/cache/sdcard/usr/share/xfce4/backdrops/
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
@@ -38,9 +32,6 @@ fi
# Debian Jessie
#--------------------------------------------------------------------------------------------------------------------------------
if [[ $RELEASE == "jessie" ]]; then
BASIC_PACKETS="xserver-xorg xserver-xorg-core xfonts-base xinit nodm x11-xserver-utils xfce4 mozo pluma wicd thunar-volman \
galculator iceweasel libgnome2-perl gcj-jre-headless gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin \
$OFFICE_PACKETS xfce4-screenshooter icedove radiotray mirage xterm lxtask"
# copy wallpapers
d=$DEST/cache/sdcard/usr/share/backgrounds/xfce/
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
@@ -51,10 +42,6 @@ fi
# Ubuntu trusty
#--------------------------------------------------------------------------------------------------------------------------------
if [[ $RELEASE == "trusty" ]]; then
BASIC_PACKETS="xserver-xorg xserver-xorg-core xfonts-base xinit nodm x11-xserver-utils xfce4 wicd thunar-volman galculator \
libgnome2-perl gcj-jre-headless gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin \
$OFFICE_PACKETS xfce4-screenshooter thunderbird firefox radiotray mirage gnome-icon-theme-full \
tango-icon-theme xterm lxtask gvfs-backends"
# copy wallpapers and default desktop settings
d=$DEST/cache/sdcard/usr/share/backgrounds/xfce/
test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
@@ -62,8 +49,6 @@ test -d "$d" || mkdir -p "$d" && cp $SRC/lib/bin/armbian*.jpg "$d"
chroot $DEST/cache/sdcard /bin/bash -c "tar xfz /tmp/trusty-desktop.tgz -C /root/"
fi
install_packet "$BASIC_PACKETS" "Installing desktop"
# Install custom icons and theme
#cp $SRC/lib/bin/vibrancy-colors_2.4-trusty-Noobslab.com_all.deb /tmp/kernel
#cp $SRC/lib/bin/NumixHolo.zip /tmp/kernel
@@ -86,7 +71,6 @@ sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=true/g" -i $DEST/cache/sdcard/etc/defaul
# Compile Turbo Frame buffer for sunxi
if [[ $LINUXCONFIG == *sun* && $BRANCH != "next" ]]; then
install_packet "xorg-dev xutils-dev x11proto-dri2-dev xutils-dev libdrm-dev libvdpau-dev" "Installing support libraries"
# quemu bug walkaround
git clone https://github.com/ssvb/xf86-video-fbturbo.git $DEST/cache/sdcard/tmp/xf86-video-fbturbo
chroot $DEST/cache/sdcard /bin/bash -c "cd /tmp/xf86-video-fbturbo && autoreconf -vi"