Commit 6fef4006 authored by Thiago H. S. Picharski's avatar Thiago H. S. Picharski

Merge remote branch 'ubiquity-le/master'

Signed-off-by: 's avatarThiago H. S. Picharski <thsp08@c3sl.ufpr.br>
parents c4877bb5 e9434fb1
#!/bin/bash
# gerar.sh
# Copyright (c) 2006 by Bruno Ribas <ribas@ufpr.br>
DIRTMP=$(mktemp -d)
VERSAO=$(cat VERSAO)
#arrumar versao
#$1 tipo de incremento
MAJOR=$(echo $VERSAO| cut -d'.' -f1)
MINOR=$(echo $VERSAO| cut -d'.' -f2)
REVISION=$(echo $VERSAO| cut -d'.' -f3)
case $1 in
Minor)
((MINOR++))
REVISION=0
;;
Major)
((MAJOR++))
MINOR=0
REVISION=0
;;
help)
echo "Uso: $0 Major|Minor|Revision"
echo ' Major - Altera versao Major'
echo ' Minor - Altera versao Minor'
exit
;;
*)
((REVISION++))
;;
esac
VERSAO="${MAJOR}.${MINOR}.${REVISION}"
echo "$VERSAO" > VERSAO
#Compila a documentacao do pacote no diretorio doc/
#cd doc/
#hevea -text *.tex
#hevea -text *.tex
#cd ../
cp -r pacote $DIRTMP
#Copia a documentacao compilada para dentro do pacote.
#cp doc/*.txt $DIRTMP/pacote/usr/share/doc/prd-*
cd $DIRTMP
find . -name ".svn" -exec rm -rf {} \; &>/dev/null
sed -i -e "s/^Version:/Version: $VERSAO/" pacote/DEBIAN/control
fakeroot dpkg -b pacote .
cd -
cp $DIRTMP/*deb .
rm -rf $DIRTMP
# vim:tabstop=4:shiftwidth=4:encoding=iso-8859-1
Package: ubiquity-le
Version:
Architecture: i386
Maintainer: LE Maintainer <le-maintainer@c3sl.ufpr.br>
Installed-Size: 13648
Depends: libc6 (>= 2.8), libdebconfclient0, libdebian-installer4 (>= 0.68ubuntu3), libiw30 (>= 30~pre1), libparted0debian1 (>= 2.2-1), libxml2 (>= 2.7.4), debconf (>= 1.4.72ubuntu5), upstart-job, python (>= 2.6), python-central (>= 0.6.11), ubiquity-artwork-2.2.25, laptop-detect, lsb-release, ubiquity-casper, python-apt (>= 0.6.16.2ubuntu4), console-setup (>= 1.34ubuntu15), iso-codes, passwd, adduser, os-prober, rdate, ntfsprogs, ecryptfs-utils, cryptsetup, python-pyicu, reiserfsprogs, language-selector-common (>= 0.4.16)
Recommends: grub-pc | grub, dmraid
Conflicts: ubiquity, espresso, espresso-grub, espresso-kbd-chooser, espresso-keyboard-setup, espresso-locale, espresso-timezone, espresso-utils, espresso-yaboot, partman, ubuntu-express, user-setup (<< 0.05ubuntu6)
Replaces: ubiquity, espresso, espresso-grub, espresso-kbd-chooser, espresso-keyboard-setup, espresso-locale, espresso-timezone, espresso-utils, espresso-yaboot, partman, ubiquity-frontend-gtk (<< 0.99.82), ubuntu-express, user-setup (<< 0.05ubuntu6)
Section: admin
Priority: optional
Description: LE live CD installer
This is a costumized version of ubiquity from the Ubuntu, designed to install
the Linux Educacional (LE).
Installing this package on a normal system is unlikely to be useful.
Bugs: http://bugzilla.c3sl.ufpr.br/
Python-Version: current, >= 2.6
#! /bin/sh
set -e
. /usr/share/debconf/confmodule
if [ -e /etc/rc2.d/S20ubiquity ]; then
update-rc.d -f ubiquity remove >/dev/null 2>&1
fi
# Automatically added by dh_installinit
update-rc.d -f ubiquity remove >/dev/null || exit $?
# End automatically added section
# Automatically added by dh_pycentral
rm -f /var/lib/pycentral/ubiquity-le.pkgremove
if which pycentral >/dev/null 2>&1; then
pycentral pkginstall ubiquity-le
if grep -qs '^ubiquity-le$' /var/lib/pycentral/delayed-pkgs; then
sed -i '/^ubiquity-le$/d' /var/lib/pycentral/delayed-pkgs
fi
fi
# End automatically added section
exit 0
#!/bin/sh
set -e
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "/etc/init.d/ubiquity" ] && [ ! -L "/etc/init.d/ubiquity" ]; then
if [ "`md5sum \"/etc/init.d/ubiquity\" | sed -e \"s/ .*//\"`" != \
"`dpkg-query -W -f='${Conffiles}' ubiquity | sed -n -e \"\\\\' /etc/init.d/ubiquity '{s/ obsolete$//;s/.* //p}\"`" ]
then
echo "Obsolete conffile /etc/init.d/ubiquity has been modified by you, renaming to .dpkg-bak"
mv -f "/etc/init.d/ubiquity" "/etc/init.d/ubiquity.dpkg-bak"
else
rm -f "/etc/init.d/ubiquity"
fi
fi
fi
# End automatically added section
# Automatically added by dh_pycentral
case "$1" in
install|upgrade)
mkdir -p /var/lib/pycentral
echo '# the presence of this file allows calling pkgremove on upgrade' \
> /var/lib/pycentral/ubiquity-le.pkgremove
esac
# End automatically added section
#!/bin/sh
set -e
# Automatically added by dh_pycentral
case "$1" in remove|upgrade)
pkgremove=y
esac
if [ -f /var/lib/pycentral/ubiquity-le.pkgremove ] || [ -f /var/lib/pycentral/pkgremove ]; then
pkgremove=y
fi
if [ "$pkgremove" = y ]; then
if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
pycentral pkgremove ubiquity-le
else
flist=$(tempfile)
slist=$(tempfile)
dpkg -L ubiquity-le | tee $flist | \
while read n; do
case "$n" in
/usr/share/pyshared/*)
n2=${n#/usr/share/pyshared/*}
case "$n" in
*.py) echo "p $n";;
*) [ -d "$n" ] && echo "d $n2" || echo "f $n2"
esac
;;
*) continue
esac
done > $slist
if [ -s $slist ]; then
for d in /usr/lib/python[0-9].[0-9]/????-packages; do
case "$d" in */python2.1/*|*/python2.2/*) continue; esac
while read t n; do
case "$t" in
p) rm -f $d/$n $d/${n}[co];;
d) rmdir $d/$n 2>/dev/null || true;;
*) rm -f $d/$n
esac
done < $slist
done
fi
awk '/\/usr\/share\/pyshared/ {next} /\.py$/ {print $0"c\n" $0"o"}' $flist \
| xargs -r rm -f >&2
rm -f $flist $slist
fi
rm -f /var/lib/pycentral/ubiquity-le.pkgremove
fi
# End automatically added section
This diff is collapsed.
#!/bin/sh
. /lib/partman/lib/base.sh
. /lib/partman/lib/recipes.sh
. /lib/partman/lib/auto-shared.sh
devs="$1"
clean_method
for dev in $devs; do
cd $dev
[ -f size ] || exit 1
size=$(cat size)
target="$(humandev $(cat device)) - $(cat model)"
if [ -z "$2" ]; then
# Only one parameter. Being run for initial autopartitioning.
target="$target: $(longint2human $size)"
free_size=$(convert_to_megabytes $size)
choose_recipe default "$target" "$free_size" || exit $?
auto_init_disks "$dev" || exit $?
get_last_free_partition_infos $dev
else
# Two parameters, being run on selected free space.
free_space=$2
open_dialog PARTITION_INFO $free_space
read_line x1 x2 free_size x3 x4 x5 x6
close_dialog
target="$target: $(longint2human $free_size) ($(longint2human $size))"
free_size=$(convert_to_megabytes $free_size)
choose_recipe default "$target" "$free_size" || exit $?
fi
perform_recipe $dev $free_space $recipe || exit $?
done
# default to accepting the autopartitioning
menudir_default_choice /lib/partman/choose_partition finish finish || true
#! /bin/sh
. /lib/partman/lib/base.sh
. /lib/partman/lib/resize.sh
. /lib/partman/lib/recipes.sh
# busybox wants mount -o move; util-linux wants mount --move. Sigh.
if [ -d /lib/debian-installer ]; then
mount_move='-o move'
else
mount_move='--move'
fi
modprobe loop >/dev/null 2>&1 || true
# Set up working directory.
if type mktemp >/dev/null 2>&1; then
recipe_dir="$(mktemp -d /tmp/partman-auto-loop.XXXXXX)"
trap "rm -rf $recipe_dir" EXIT HUP INT QUIT TERM
else
recipe_dir=/tmp
fi
# Fetch parameters.
disk="$1"
cd $disk
if ! db_get partman-auto-loop/partition || [ -z "$RET" ]; then
logger -t partman-auto-loop "Error: No partition number specified in partman-auto-loop/partition"
exit 1
fi
partition="$RET"
if ! db_get partman-auto-loop/recipe || [ -z "$RET" ]; then
logger -t partman-auto-loop "Error: No recipe specified in partman-auto-loop/recipe"
exit 1
fi
recipe="$RET"
echo "$recipe" >"$recipe_dir/loop_recipe"
# Find the requested partition.
db_progress START 0 5 partman-auto/text/automatically_partition
db_progress INFO partman-auto/progress/info
partition_id=
partition_fs=
open_dialog PARTITIONS
while { read_line num id size type fs path name; [ "$id" ]; }; do
if [ "$num" = "$partition" ]; then
partition_id="$id"
partition_fs="$fs"
# go ahead and read all remaining input
fi
done
close_dialog
if [ -z "$partition_id" ]; then
logger -t partman-auto-loop "Error: Partition number $partition not found in $disk"
exit 1
fi
# Set up the requested partition in partman.
existing=no
for j in $(
for i in /lib/partman/valid_filesystems/*; do
[ -x $i ] || continue
$i $disk $partition_id existing
done
); do
if [ "$j" = "$partition_fs" ]; then
existing=yes
fi
done
if [ "$existing" = no ]; then
logger -t partman-auto-loop "Error: No filesystem on $disk/$partition_id"
exit 1
fi
echo keep >$partition_id/method
rm -f $partition_id/format
>$partition_id/use_filesystem
echo $partition_fs >$partition_id/filesystem
mkdir -p $partition_id/options
echo / >$partition_id/mountpoint
update_partition $disk $partition_id
# Is there enough space to perform the recipe?
dev="$disk"
oldid="$partition_id"
recipe_new=
firstword=
imagepaths=
for word in $(cat "$recipe_dir/loop_recipe"); do
case $word in
.)
recipe_new="${recipe_new:+$recipe_new }\$imagepath{ $firstword } $word"
firstword=
;;
*)
if [ "$firstword" ]; then
recipe_new="${recipe_new:+$recipe_new }$word"
else
firstword="$word"
imagepaths="${imagepaths:+$imagepaths }$word"
fi
;;
esac
done
echo "$recipe_new" >"$recipe_dir/loop_recipe_new"
decode_recipe "$recipe_dir/loop_recipe_new" loop
db_progress STEP 1
fstab="$(
for i in /lib/partman/fstab.d/*; do
[ -x "$i" ] || continue
$i
done |
while read fs mp type options dump pass; do
case $mp in
(/)
echo $fs $mp $type $options $dump $pass
;;
esac
done
)"
if [ -z "$fstab" ]; then
logger -t partman-auto-loop "Error: No fstab output for $disk/$partition_id"
exit 1
fi
mkdir -p /target
mountpoint="$(grep "^${fstab%% *} [^ ]* [^ ]* [^ ]*rw" /proc/mounts | cut -d ' ' -f2 | head -n1)" || mountpoint=
if [ "$mountpoint" = /target ]; then
# nothing to do
:
elif [ "$mountpoint" ]; then
if ! mount $mount_move "$mountpoint" /target; then
logger -t partman-auto-loop "Error: Failed to move $mountpoint to /target"
exit 1
fi
unmount_cmd='umount /target'
else
for m in /lib/partman/mount.d/*; do
[ -x "$m" ] || continue
unmount_cmd="$($m "$fstab")"
if [ "$?" = 0 ]; then
break
fi
done
fi
if [ -d /var/run ]; then
pidof mount.ntfs >> /var/run/sendsigs.omit
pidof mount.ntfs-3g >> /var/run/sendsigs.omit
fi
# TODO: handle errors if no mount succeeded
mkdir -p /host
mount $mount_move /target /host # TODO error handling
# Don't try to mount this again later.
rm -f $partition_id/mountpoint
# Ensure there is enough free space.
check_free_space=false
requires_disk_space(){
[ "$1" != 0 ] || return
path="$(echo "$*" | sed 's/.*\$imagepath{ *\([^ }]*\) *}.*/\1/')"
[ "$path" != "$*" ] || return
case $path in
/*) ;;
*) path="/$path" ;;
esac
[ -f "/host$path" ] && return
check_free_space=true
}
foreach_partition 'requires_disk_space $*'
# Skip resize_range check if images are already created.
if [ $check_free_space = true ]; then
case $partition_fs in
linux-swap|fat16|fat32|hfs|hfs+|hfsx)
get_resize_range
;;
ext2|ext3|ext4)
if ! search-path tune2fs; then
logger -t partman-auto-loop "Error: tune2fs not found"
exit 1
fi
if ! search-path resize2fs; then
logger -t partman-auto-loop "Error: resize2fs not found"
exit 1
fi
if ! get_ext2_resize_range; then
logger -t partman-auto-loop "Error: Failed to get ext2 resize range for $disk/$partition_id"
exit 1
fi
;;
ntfs)
if ! search-path ntfsresize; then
logger -t partman-auto-loop "Error: ntfsresize not found"
exit 1
fi
if ! get_ntfs_resize_range; then
db_input critical partman-auto-loop/unclean_ntfs || true
db_go || true
logger -t partman-auto-loop "Error: Failed to get NTFS resize range for $disk/$partition_id"
reboot
exit 1
fi
;;
*)
logger -t partman-auto-loop "Cannot calculate free space on filesystems of type $partition_fs"
exit 1
;;
esac
free_size="$(expr \( "$cursize" - "$minsize" \) \* 9 / 10)"
# convert to megabytes
free_size="$(expr 0000000"$free_size" : '0*\(..*\)......$')"
if [ $(min_size) -gt $free_size ]; then
logger -t partman-auto-loop "Error: partman-auto-loop/recipe too large ($(min_size) > $free_size)"
exit 1
fi
fi
# Ensure that no old loop images are present and mountable.
found_images=
mkdir -p /tmpmountpoint
for path in $imagepaths; do
case $path in
/*) ;;
*) path="/$path" ;;
esac
if [ -e "/host$path" ]; then
if mount -t auto -o loop,ro /host$path /tmpmountpoint 2>/dev/null; then
found_images="${found_images:+$found_images }$path"
umount /tmpmountpoint || true
rmdir /tmpmountpoint || true
fi
fi
done
if [ "$found_images" ]; then
db_progress STOP
db_subst partman-auto-loop/unclean_host PARTITION "$partition"
db_subst partman-auto-loop/unclean_host DISK "$disk"
db_subst partman-auto-loop/unclean_host IMAGES "$found_images"
db_input critical partman-auto-loop/unclean_host || true
db_capb
db_go || true
db_capb backup
umount /host || true
exit 1
fi
db_progress STEP 1
expand_scheme
db_progress STEP 1
clean_method
db_progress STEP 1
setup_loop () {
[ "$1" != 0 ] || return
path="$(echo "$*" | sed 's/.*\$imagepath{ *\([^ }]*\) *}.*/\1/')"
[ "$path" != "$*" ] || return
case $path in
/*) ;;
*) path="/$path" ;;
esac
if [ ! -f "/host$path" ]; then
mkdir -p "/host${path%/*}"
if [ "$4" = "linux-swap" ]; then
# swap requires a file with no holes
dd if=/dev/zero of="/host$path" bs="1000000" count="$1"
else