Commit 5c1c4ad7 authored by Lucas Manika Koeb's avatar Lucas Manika Koeb

ubiquity-le: Initial commit

Signed-off-by: default avatarLucas Manika Koeb <lmk08@c3sl.ufpr.br>
parent 67f4a11d
#!/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: 2.0.7
Architecture: i386
Maintainer: LE Maintainer <le-maintainer@c3sl.ufpr.br>
Installed-Size: 14193
Depends: libc6 (>= 2.15), libdebconfclient0 (>= 0.145), libdebian-installer4 (>= 0.79ubuntu2), libiw30 (>= 30~pre1), libparted0debian1 (>= 2.2-1), libxml2 (>= 2.7.4), debconf (>= 1.4.72ubuntu5), upstart-job, python (>=2.7.1-0ubuntu2), ubiquity-frontend-le, ubiquity-le-artwork, laptop-detect, lsb-release, ubiquity-casper, python-apt (>= 0.7.100.3~), console-setup (>= 1.70ubuntu5), iso-codes, passwd, adduser, os-prober, rdate, ntfs-3g (>= 1:2011.1.15AR.4+2011.4.12-1) | ntfsprogs, ecryptfs-utils, cryptsetup, python-pyicu (>= 1.0), reiserfsprogs, language-selector-common (>= 0.4.16), archdetect-deb, dpkg-repack, apt-clone, wget, grub-common, realpath, dbus-x11
Recommends: grub-pc | grub | grub-efi, dmraid, btrfs-tools
Conflicts: 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: espresso, espresso-grub, espresso-kbd-chooser, espresso-keyboard-setup, espresso-locale, espresso-timezone, espresso-utils, espresso-yaboot, partman, ubiquity, ubuntu-express, user-setup (<< 0.05ubuntu6)
Section: admin
Priority: optional
Description: LE live CD installer
This is a simple live CD installer designed to integrate well with Debian-
and LE-based systems, and to reuse code from d-i for ease of
maintenance.
.
Installing this package on a normal system is unlikely to be useful.
This diff is collapsed.
#! /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_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p ubiquity-le /usr/lib/ubiquity -V 2.7-
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
#!/bin/sh
set -e
# Automatically added by dh_python2:
if which pyclean >/dev/null 2>&1; then
pyclean -p ubiquity-le
else
dpkg -L ubiquity | grep \.py$ | while read file
do
rm -f "${file}"[co] >/dev/null
done
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 /run ]; then
mkdir -p /run/sendsigs.omit.d
pidof mount.ntfs >> /run/sendsigs.omit.d/ntfs-3g
pidof mount.ntfs-3g >> /run/sendsigs.omit.d/ntfs-3g
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 3>&-; 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
dd if=/dev/zero of="/host$path" bs="1000000" seek="$1" count=0
fi
fi
if ! losetup -f "/host$path"; then
shift
continue
fi
if [ "$4" = linux-swap ]; then
loops="/host$path"
else
loops="$(echo /dev/loop* /dev/loop/*)"
fi
for loop in $loops; do