mirror of https://github.com/CIRCL/Circlean
Use a newer version of Rasbpian (2013-09-10)
Also switch to pdf2htmlEX-0.9 and libpoppler37 (0.22.5-2)pull/10/head
parent
c61883d1c1
commit
d506ebb688
|
@ -15,11 +15,13 @@ tar -cvpzf backup.tar.gz -C fs/ .
|
||||||
tar -xzf backup.tar.gz -C ${CHROOT_PATH}/
|
tar -xzf backup.tar.gz -C ${CHROOT_PATH}/
|
||||||
cp deb/led ${CHROOT_PATH}/usr/sbin/led
|
cp deb/led ${CHROOT_PATH}/usr/sbin/led
|
||||||
|
|
||||||
losetup -o $((122880 * 512)) /dev/loop0 NEW_FINAL_2013-02-09-wheezy-raspbian.img
|
# needed just once, make sure the size of the partition is correct
|
||||||
|
#losetup -o $((122880 * 512)) /dev/loop0 FINAL_2013-09-10-wheezy-raspbian.img
|
||||||
|
e2fsck -f /dev/loop0
|
||||||
resize2fs /dev/loop0
|
resize2fs /dev/loop0
|
||||||
losetup -d /dev/loop0
|
#losetup -d /dev/loop0
|
||||||
|
|
||||||
#sudo dd bs=4M if=NEW_FINAL_2013-02-09-wheezy-raspbian.img of=/dev/sdd
|
#sudo dd bs=4M if=FINAL_2013-09-10-wheezy-raspbian.img of=/dev/sdd
|
||||||
|
|
||||||
# /!\ always try to mount the root partition on the SD, it is usually broken.
|
# /!\ always try to mount the root partition on the SD, it is usually broken.
|
||||||
# if it is, use fdisk to remove the second partition and recreate it (you will
|
# if it is, use fdisk to remove the second partition and recreate it (you will
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
pdfCopyDirty()
|
|
||||||
{
|
|
||||||
# copy all pdf's over to their relative same locations
|
|
||||||
find $1 -iname "*.pdf" -printf 'X=`echo %h | sed -f $GH/sedKillSpace -e s:${1}::`; mkdir -p ${2}${X}; F=`echo %f | sed -f $GH/sedKillSpace`; cp -fv "%p" ${2}$X/$F \n' | while read l; do eval $l; done
|
|
||||||
# extract all the txt we can from potentially evil pdf's
|
|
||||||
find $2 -iname "*.pdf" -printf 'echo %p extracting text to %p-extracted.txt; $JAVA -jar $GH/pdfbox-app-1.7.1.jar ExtractText %p %p-extracted.txt 2> /dev/null \n' | while read l; do eval $l; done
|
|
||||||
}
|
|
||||||
|
|
||||||
pdfCopyClean()
|
|
||||||
{
|
|
||||||
# convert pdf's on the fly from src to relative dst location
|
|
||||||
find $1 -iname "*.pdf" -printf 'X=`echo %h | sed -f $GH/sedKillSpace -e s:${1}::`; mkdir -p ${2}${X}; F=`echo %f | sed -f $GH/sedKillSpace`; echo "%p" extracting text to ${2}$X/$F-extracted.txt; $JAVA -jar $GH/pdfbox-app-1.7.1.jar ExtractText "%p" ${2}$X/$F-extracted.txt 2> /dev/null \n' | while read l; do eval $l; done
|
|
||||||
}
|
|
||||||
|
|
||||||
copySafeFiles()
|
|
||||||
{
|
|
||||||
TYPES="\
|
|
||||||
jpg jpeg gif png tif tga raw \
|
|
||||||
mp4 avi mov \
|
|
||||||
mp3 wav \
|
|
||||||
txt xml csv tsv \
|
|
||||||
"
|
|
||||||
for type in $TYPES
|
|
||||||
do
|
|
||||||
find $1 -iname "*.$type" -printf 'X=`echo %h | sed -f $GH/sedKillSpace -e s:${1}::`; mkdir -p ${2}${X}; F=`echo %f | sed -f $GH/sedKillSpace`; cp -fv "%p" ${2}$X/$F \n' | while read l; do eval $l; done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
convertCopyFiles()
|
|
||||||
{
|
|
||||||
# wordy documents
|
|
||||||
TYPES="doc docx odt sxw rtf wpd htm html"
|
|
||||||
FILTER=Text; OUT=txt
|
|
||||||
convertCopyFilesHelper $1 $2 $3 $TYPES $OUT $FILTER
|
|
||||||
|
|
||||||
# spreadsheets
|
|
||||||
TYPES="xls xslx ods sxc"
|
|
||||||
FILTER=calc_pdf_Export; OUT=pdf
|
|
||||||
convertCopyFilesHelper $1 $2 $3 $TYPES $OUT $FILTER
|
|
||||||
|
|
||||||
# presentation files
|
|
||||||
TYPES="ppt pptx odp sxi"
|
|
||||||
FILTER=impress_pdf_Export; OUT=pdf
|
|
||||||
convertCopyFilesHelper $1 $2 $3 $TYPES $OUT $FILTER
|
|
||||||
}
|
|
||||||
convertCopyFilesHelper()
|
|
||||||
{
|
|
||||||
for type in $TYPES
|
|
||||||
do
|
|
||||||
find $1 -iname "*.$type" -printf 'X=`echo %h | sed -f $GH/sedKillSpace -e s:${1}::`; mkdir -p ${3}${X}; F=`echo %f | sed -f $GH/sedKillSpace`; cp -fv "%p" ${3}$X/$F \n' | while read l; do eval $l; done
|
|
||||||
find $3 -iname "*.$type" -printf 'X=`echo %h | sed s:${3}::`; mkdir -p ${2}${X}; soffice --headless --convert-to ${type}-extraced.$OUT:$FILTER %p --outdir ${2}${X} \n' | while read l; do eval $l; done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
unpackZip()
|
|
||||||
{
|
|
||||||
find $1 -iname "*.zip" -printf 'X=`echo %h | sed -f $GH/sedKillSpace -e s:${1}::`; mkdir -p ${3}${X}; F=`echo %f | sed -f $GH/sedKillSpace`; cp -fv "%p" ${3}$X/$F \n' | while read l; do eval $l; done
|
|
||||||
find $3 -iname "*.zip" -printf 'X=`echo %h | sed s:${3}::`; mkdir -p ${ZIPTEMP}/${X}/UNZIPPED_%f/; unzip "%p" -d ${ZIPTEMP}${X}/UNZIPPED_%f/ 2> /dev/null; \n' | while read l; do eval $l; done
|
|
||||||
find $3 -iname "*.zip" -printf 'rm -rf %p \n' | while read l; do eval $l; done
|
|
||||||
|
|
||||||
if [ -d ${ZIPTEMP} ]; then
|
|
||||||
if [ $COPYDIRTYPDF -eq 1 ]; then
|
|
||||||
pdfCopyDirty $ZIPTEMP $targetDir
|
|
||||||
else
|
|
||||||
pdfCopyClean $ZIPTEMP $targetDir
|
|
||||||
fi
|
|
||||||
copySafeFiles $ZIPTEMP $2 $3
|
|
||||||
convertCopyFiles $ZIPTEMP $2 $3
|
|
||||||
rm -rf ${TEMP}/*
|
|
||||||
rm -rf ${ZIPTEMP}/*
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
s:\ :_:g
|
|
|
@ -8,6 +8,6 @@ apt-get update
|
||||||
apt-get dist-upgrade
|
apt-get dist-upgrade
|
||||||
apt-get autoremove
|
apt-get autoremove
|
||||||
apt-get install libreoffice p7zip-full libfontforge1
|
apt-get install libreoffice p7zip-full libfontforge1
|
||||||
dpkg -i libpoppler28*.deb pdf2htmlex*.deb
|
dpkg -i libpoppler37*.deb pdf2htmlex*.deb
|
||||||
|
|
||||||
chown -R kitten:kitten /home/kitten
|
chown -R kitten:kitten /home/kitten
|
||||||
|
|
|
@ -3,12 +3,16 @@
|
||||||
# change locales to en_US.UTF-8
|
# change locales to en_US.UTF-8
|
||||||
dpkg-reconfigure locales
|
dpkg-reconfigure locales
|
||||||
|
|
||||||
|
# Increase size of image. See resize_img.md
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get dist-upgrade
|
apt-get dist-upgrade
|
||||||
apt-get autoremove
|
apt-get autoremove
|
||||||
|
|
||||||
echo "deb http://ftp.de.debian.org/debian experimental main" >> /etc/apt/sources.list
|
echo "deb http://ftp.de.debian.org/debian experimental main" >> /etc/apt/sources.list
|
||||||
echo "deb-src http://ftp.de.debian.org/debian experimental main" >> /etc/apt/sources.list
|
echo "deb-src http://ftp.de.debian.org/debian experimental main" >> /etc/apt/sources.list
|
||||||
|
# Force User
|
||||||
|
su root
|
||||||
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
|
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
|
||||||
gpg -a --export 8B48AD6246925553 | apt-key add -
|
gpg -a --export 8B48AD6246925553 | apt-key add -
|
||||||
gpg --keyserver pgpkeys.mit.edu --recv-key AED4B06F473041FA
|
gpg --keyserver pgpkeys.mit.edu --recv-key AED4B06F473041FA
|
||||||
|
|
|
@ -19,14 +19,14 @@ set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# If you use a partition...
|
# If you use a partition...
|
||||||
PARTITION_ROOTFS='/dev/mmcblk0p2'
|
#PARTITION_ROOTFS='/dev/mmcblk0p2'
|
||||||
PARTITION_BOOT='/dev/mmcblk0p1'
|
#PARTITION_BOOT='/dev/mmcblk0p1'
|
||||||
#PARTITION_ROOTFS='/dev/sdd2'
|
PARTITION_ROOTFS='/dev/sdd2'
|
||||||
#PARTITION_BOOT='/dev/sdd1'
|
PARTITION_BOOT='/dev/sdd1'
|
||||||
|
|
||||||
# If you use the img
|
# If you use the img
|
||||||
##### Debian
|
##### Debian
|
||||||
#IMAGE='2013-02-09-wheezy-raspbian.img'
|
IMAGE='2013-09-10-wheezy-raspbian.img'
|
||||||
OFFSET_ROOTFS=$((122880 * 512))
|
OFFSET_ROOTFS=$((122880 * 512))
|
||||||
OFFSET_BOOT=$((8192 * 512))
|
OFFSET_BOOT=$((8192 * 512))
|
||||||
##### Arch
|
##### Arch
|
||||||
|
|
|
@ -3,12 +3,12 @@ Add empty space to the image
|
||||||
|
|
||||||
Add 2Gb
|
Add 2Gb
|
||||||
|
|
||||||
> dd if=/dev/zero bs=1024k count=2048 >> 2013-02-09-wheezy-raspbian.img
|
> dd if=/dev/zero bs=1024k count=2048 >> 2013-09-10-wheezy-raspbian.img
|
||||||
|
|
||||||
Expend partition size
|
Expend partition size
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
> fdisk 2013-02-09-wheezy-raspbian.img
|
> fdisk 2013-09-10-wheezy-raspbian.img
|
||||||
|
|
||||||
Command (m for help): *p*
|
Command (m for help): *p*
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ Resize partition
|
||||||
|
|
||||||
> df | grep /mnt/arm
|
> df | grep /mnt/arm
|
||||||
|
|
||||||
/dev/loop2 3927752 1955672 1794172 53% /mnt/arm_rPi
|
/dev/loop0 3927752 1955672 1794172 53% /mnt/arm_rPi
|
||||||
/dev/loop3 57288 18960 38328 34% /mnt/arm_rPi/boot
|
/dev/loop1 57288 18960 38328 34% /mnt/arm_rPi/boot
|
||||||
|
|
||||||
sudo resize2fs /dev/loop2
|
sudo resize2fs /dev/loop0
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Force the User
|
||||||
|
su root
|
||||||
|
|
||||||
apt-get -b source -t experimental poppler
|
apt-get -b source -t experimental poppler
|
||||||
|
|
||||||
# Note: libpoppler-private-dev is not listed in the dependencies of pdf2htmlEX
|
# Note: libpoppler-private-dev is not listed in the dependencies of pdf2htmlEX
|
||||||
# but still needed because of poppler-config.h
|
# but still needed because of poppler-config.h
|
||||||
dpkg -i libpoppler-dev* libpoppler28* libpoppler-private-dev*
|
dpkg -i libpoppler-dev* libpoppler37* libpoppler-private-dev*
|
||||||
|
|
||||||
cd pdf2htmlEX/
|
cd pdf2htmlEX/
|
||||||
git pull
|
git pull
|
||||||
|
|
Loading…
Reference in New Issue