mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-08-15 02:34:08 +00:00
Compare commits
No commits in common. "ubuntu/master" and "0.88" have entirely different histories.
ubuntu/mas
...
0.88
@ -1,4 +0,0 @@
|
||||
debian/*.debhelper*
|
||||
debian/*.substvars
|
||||
debian/files
|
||||
debian/livecd-rootfs
|
164
BuildLiveCD
Executable file
164
BuildLiveCD
Executable file
@ -0,0 +1,164 @@
|
||||
#!/bin/bash
|
||||
BUILD_LOG=~/public_html/BuildLive.out
|
||||
ALWAYS_SEND_LOG=yes
|
||||
|
||||
finish() {
|
||||
[ $? != "0" ] && STATUS="Failed" || STATUS="Successful"
|
||||
if [ "$STATUS" = "Failed" ] || [ "$ALWAYS_SEND_LOG" = "yes" ]; then
|
||||
SEND_LOG=yes
|
||||
fi
|
||||
if [ -e "$LOG" ]; then
|
||||
echo "======================= Log of livefs.sh output follows ======================="
|
||||
cat $LOG
|
||||
fi
|
||||
if [ "$SEND_LOG" = "yes" ]; then
|
||||
exec >/dev/null 2>&1
|
||||
mailx -s "LiveCD: $STATUS $STE:$arg${SUBARCH:+-$SUBARCH} build on ${ARCH}" buildd+porters < "$BUILD_LOG"
|
||||
fi
|
||||
rm -f ~/buildLiveCD.lock
|
||||
nohup ~/bin/pruneLiveCD >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
if [ -n "$SSH_ORIGINAL_COMMAND" ]; then
|
||||
set -- $SSH_ORIGINAL_COMMAND
|
||||
[ ${1##*/} != 'BuildLiveCD' ] && echo bad command >&2 && exit 2
|
||||
shift
|
||||
fi
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
SUBARCH=""
|
||||
SUBARCHARG=""
|
||||
DEFAULTSUITE="karmic"
|
||||
NEWSUITE=""
|
||||
SUITES=""
|
||||
PROPOSED=""
|
||||
if [ "$1" = '-s' ]; then
|
||||
shift
|
||||
SUBARCH="$1"
|
||||
SUBARCHARG="-s$SUBARCH"
|
||||
shift
|
||||
fi
|
||||
if [ "$1" = '-p' ]; then
|
||||
PROPOSED='-p'
|
||||
shift
|
||||
fi
|
||||
if [ "$1" = '-d' ]; then
|
||||
shift
|
||||
NEWSUITE="$1"
|
||||
shift
|
||||
else
|
||||
NEWSUITE="$DEFAULTSUITE"
|
||||
fi
|
||||
for s in $NEWSUITE; do
|
||||
if [ -d build-${s}-live/chroot-${s} ]; then SUITES="$SUITES $s"; fi
|
||||
done
|
||||
if [ -z "$SUITES" ]; then
|
||||
echo "No valid suites to build for" >&2 && exit 1
|
||||
fi
|
||||
for s in $SUITES; do
|
||||
case $s in
|
||||
dapper|edgy|feisty|gutsy|hardy)
|
||||
ARCHARG=""
|
||||
old_suite="yes"
|
||||
;;
|
||||
*)
|
||||
ARCHARG="-a$ARCH"
|
||||
new_suite="yes"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$new_suite" = "yes" ] && [ "$old_suite" = "yes" ]; then
|
||||
echo "Can't build images for suites older than intrepid and suites" >&2
|
||||
echo "greater than hardy at the same time, please use two invocations" >&2
|
||||
exit 1
|
||||
fi
|
||||
if (( $# == 0 )) || [ "X$1" = "Xall" ]; then
|
||||
set -- ubuntu kubuntu kubuntu-netbook edubuntu xubuntu mythbuntu base
|
||||
if [ "$ARCH" = "i386" ]; then
|
||||
set -- ubuntu ubuntu-dvd ubuntu-lpia ubuntu-netbook-remix kubuntu kubuntu-dvd kubuntu-netbook edubuntu edubuntu-dvd xubuntu mythbuntu base
|
||||
fi
|
||||
fi
|
||||
|
||||
case ${ARCH} in
|
||||
hppa|sparc|powerpc) LINUX32=linux32;;
|
||||
*) LINUX32="";;
|
||||
esac
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
*ubuntu|*ubuntu-dvd|kubuntu-netbook|ubuntu-lpia|ubuntu-mid|ubuntu-umpc|ubuntu-mobile|ubuntu-netbook-remix|mythbuntu|base|tocd) ;;
|
||||
*)
|
||||
echo "bad project: $arg" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "`echo $@ | wc -w`" -gt "1" ]; then
|
||||
for arg in "$@"; do
|
||||
$0 $arg
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
lockfile ~/buildLiveCD.lock || exit 1
|
||||
trap "finish" 0
|
||||
trap "rm -f ~/buildLiveCD.lock; exit 1" 1 2 3 15
|
||||
exec > $BUILD_LOG 2>&1
|
||||
set -e
|
||||
|
||||
for STE in $SUITES; do
|
||||
if cd ~/build-${STE}-live 2>/dev/null; then
|
||||
DIR=~/build-${STE}-live/chroot-${STE}/./build/
|
||||
else
|
||||
cd ~/build.live
|
||||
DIR=~/build.live/chroot-${STE}/./build/
|
||||
fi
|
||||
|
||||
for arg in "$@"; do
|
||||
PUBDIR=~/public_html/LiveCD/${STE}/${arg}${SUBARCH:+-$SUBARCH}/
|
||||
mkdir -p ${PUBDIR}
|
||||
|
||||
NOW=$(date +%Y%m%d)
|
||||
if [ -d ${PUBDIR}${NOW} ]; then
|
||||
typeset -i n=1; while [ -d ${PUBDIR}${NOW}.$n ]; do n=n+1; done
|
||||
NOW=${NOW}.$n
|
||||
fi
|
||||
NOW=${NOW}
|
||||
LOG=${PUBDIR}${NOW}/livecd-${NOW}-${ARCH}.out
|
||||
|
||||
rm -f ${PUBDIR}latest
|
||||
ln -sf ${PUBDIR}${NOW} ${PUBDIR}latest
|
||||
mkdir -p ${PUBDIR}${NOW}
|
||||
if $LINUX32 sudo chroot ${DIR%/./*} sh -c "cd /${DIR#*/./} && /usr/sbin/livecd.sh ${SUBARCHARG} ${PROPOSED} -d${STE} ${ARCHARG} $arg" > ${LOG} 2>&1; then
|
||||
rm -f ${PUBDIR}current
|
||||
ln -sf ${NOW} ${PUBDIR}current
|
||||
|
||||
for file in ${DIR}livecd.*; do
|
||||
if [ -f ${file} ]; then
|
||||
ext=${file##*.}
|
||||
base=${file%.*}; base=${base##*/}
|
||||
sudo chown buildd ${file}
|
||||
sudo mv ${file} ${PUBDIR}${NOW}/${base}-${NOW}-${ARCH}.${ext}
|
||||
ln -sf ${base}-${NOW}-${ARCH}.${ext} ${PUBDIR}${NOW}/${base}.${ext}
|
||||
fi
|
||||
done
|
||||
|
||||
for f in ${PUBDIR}${NOW}/livecd.*.cloop-*; do
|
||||
target=${f%-*}
|
||||
if [ ! -f ${target} ]; then
|
||||
for fsbs in 4096:4096 1024:65536; do
|
||||
if [ -f ${target}-${fsbs} ]; then
|
||||
ln -sf ${target##*/}-${fsbs} ${target}
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ! -f ${target} ]; then
|
||||
best=$(ls -ld ${target}-* | sort -k5,5n| awk '{print $NF; quit}')
|
||||
ln -sf ${best##*/} ${target}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
done
|
@ -1,63 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
"""List the packages which could be automatically installed without becoming autoremovable
|
||||
|
||||
Finds all manually installed meta packages, and prints their dependencies
|
||||
which could be marked as automatically installed.
|
||||
"""
|
||||
import sys
|
||||
|
||||
import apt
|
||||
|
||||
|
||||
def is_root(pkg):
|
||||
"""Check if the package is a root package (manually inst. meta)"""
|
||||
section = pkg.candidate.section if pkg.candidate else ""
|
||||
return (pkg.is_installed and
|
||||
not pkg.is_auto_installed and
|
||||
(section == "metapackages" or
|
||||
section.endswith("/metapackages")))
|
||||
|
||||
|
||||
def main():
|
||||
"""Main function"""
|
||||
cache = apt.Cache(rootdir=sys.argv[1] if len(sys.argv) > 1 else None)
|
||||
roots = set(pkg for pkg in cache if is_root(pkg))
|
||||
workset = set(roots)
|
||||
seen = set()
|
||||
ubiquity_depends = set()
|
||||
|
||||
with cache.actiongroup():
|
||||
while True:
|
||||
print("Iteration", file=sys.stderr)
|
||||
to_proc = workset - seen
|
||||
if not to_proc:
|
||||
break
|
||||
for pkg in sorted(to_proc):
|
||||
print(" Visiting", pkg, file=sys.stderr)
|
||||
|
||||
if pkg not in roots and pkg not in ubiquity_depends:
|
||||
if not pkg.is_auto_installed:
|
||||
print(pkg.name)
|
||||
|
||||
for dep in (pkg.installed.dependencies +
|
||||
pkg.installed.recommends):
|
||||
for bdep in dep.or_dependencies:
|
||||
for ver in bdep.target_versions:
|
||||
if ver.package.is_installed:
|
||||
if pkg.name == "ubiquity":
|
||||
ubiquity_depends.add(ver.package)
|
||||
if pkg.name != "ubiquity":
|
||||
# Reprocess this package again, as we did not mark it when we visited it from ubiquity
|
||||
try:
|
||||
ubiquity_depends.remove(ver.package)
|
||||
# This will raise the KeyError here if ubiquity did not depend on it
|
||||
seen.remove(ver.package)
|
||||
except KeyError:
|
||||
pass
|
||||
workset.add(ver.package)
|
||||
|
||||
seen.add(pkg)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
branch=$1
|
||||
dir=$2
|
||||
target="$(readlink -f "${3}")"
|
||||
|
||||
tmpdir="$(mktemp -d)"
|
||||
cd "${tmpdir}"
|
||||
|
||||
cleanup () {
|
||||
rm -rf "${tmpdir}"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
mkdir -p $target
|
||||
|
||||
git clone $branch checkout
|
||||
for po in checkout/$dir/*.po; do
|
||||
msgfmt "${po}" -o "${target}/$(basename "${po}" .po).mo"
|
||||
done
|
1
debian/.gitignore
vendored
1
debian/.gitignore
vendored
@ -1 +0,0 @@
|
||||
files
|
9563
debian/changelog
vendored
9563
debian/changelog
vendored
File diff suppressed because it is too large
Load Diff
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
||||
4
|
54
debian/control
vendored
54
debian/control
vendored
@ -1,55 +1,15 @@
|
||||
Source: livecd-rootfs
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Build-Depends: debhelper-compat (= 13)
|
||||
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
|
||||
Standards-Version: 4.7.0
|
||||
Vcs-Git: https://git.launchpad.net/livecd-rootfs -b ubuntu/master
|
||||
Vcs-Browser: https://git.launchpad.net/livecd-rootfs
|
||||
Rules-Requires-Root: no
|
||||
Build-Depends: debhelper (>=4)
|
||||
Maintainer: Adam Conrad <adconrad@ubuntu.com>
|
||||
Standards-Version: 3.6.1.0
|
||||
Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk
|
||||
|
||||
Package: livecd-rootfs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends},
|
||||
apt-utils,
|
||||
attr,
|
||||
debootstrap,
|
||||
devscripts,
|
||||
distro-info,
|
||||
dosfstools,
|
||||
e2fsprogs,
|
||||
gdisk,
|
||||
genisoimage,
|
||||
germinate (>= 1.25.1),
|
||||
gettext,
|
||||
git,
|
||||
gnupg,
|
||||
grep-dctrl,
|
||||
kpartx,
|
||||
live-build (>= 3.0~a57-1ubuntu31~),
|
||||
lsb-release,
|
||||
lzma,
|
||||
make,
|
||||
mount,
|
||||
mtools [!i386],
|
||||
parted,
|
||||
procps,
|
||||
python3,
|
||||
python3-apt,
|
||||
python3-launchpadlib [!i386],
|
||||
python3-yaml,
|
||||
qemu-utils [!i386],
|
||||
rsync [!i386],
|
||||
snapd (>= 2.39) [!i386],
|
||||
squashfs-tools (>= 1:3.3-1),
|
||||
sudo,
|
||||
u-boot-tools [arm64 armhf],
|
||||
python3-vmdkstream [amd64 i386],
|
||||
xorriso [!i386],
|
||||
xz-utils,
|
||||
zerofree,
|
||||
zstd
|
||||
Breaks: ubuntu-defaults-builder (<< 0.32)
|
||||
Architecture: all
|
||||
Depends: debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release
|
||||
Suggests: partimage
|
||||
Description: construction script for the livecd rootfs
|
||||
livecd-rootfs provides the script used to create the root filesystem
|
||||
on the livecd.
|
||||
|
9
debian/copyright
vendored
9
debian/copyright
vendored
@ -1,4 +1,5 @@
|
||||
live-build/* is copyright (c) 2004-2016 by Canonical Ltd.
|
||||
livecd.sh is copyright (c) 2004-2007 by Canonical Ltd.
|
||||
e2fs-zero.py is copyright (c) 2005 by Paul Sladen
|
||||
|
||||
These programs are free software; you can redistribute and/or modify
|
||||
them under the terms of the GNU General Public License as published by
|
||||
@ -11,12 +12,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License with
|
||||
your Ubuntu system, in /usr/share/common-licenses/GPL-2, or with the
|
||||
your Ubuntu system, in /usr/share/common-licenses/GPL, or with the
|
||||
livecd-rootfs source package as the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301 USA.
|
||||
|
||||
Files: live-build/ubuntu-cpc/hooks/raspi2/mkknlimg
|
||||
Copyright: 2009,2010 Dick Streefland <dick@streefland.net>
|
||||
2014,2015 Raspberry Pi (Trading) Limited <info@raspberrypi.org>
|
||||
License: GPL-2+
|
||||
|
2
debian/dirs
vendored
Normal file
2
debian/dirs
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
usr/sbin
|
||||
usr/share/doc/livecd-rootfs/examples
|
4
debian/gbp.conf
vendored
4
debian/gbp.conf
vendored
@ -1,4 +0,0 @@
|
||||
[DEFAULT]
|
||||
debian-branch=ubuntu/master
|
||||
debian-tag = %(version)s
|
||||
dch-opt = --vendor=debian
|
7
debian/install
vendored
7
debian/install
vendored
@ -1,7 +0,0 @@
|
||||
auto-markable-pkgs usr/share/livecd-rootfs
|
||||
live-build usr/share/livecd-rootfs
|
||||
get-ppa-fingerprint usr/share/livecd-rootfs
|
||||
minimize-manual usr/share/livecd-rootfs
|
||||
checkout-translations-branch usr/share/livecd-rootfs
|
||||
update-source-catalog usr/share/livecd-rootfs
|
||||
sync-mtime usr/share/livecd-rootfs
|
10
debian/livecd-rootfs.lintian-overrides
vendored
10
debian/livecd-rootfs.lintian-overrides
vendored
@ -1,10 +0,0 @@
|
||||
# This is expected and okay
|
||||
livecd-rootfs: service-file-is-not-a-file [usr/share/livecd-rootfs/*.service]
|
||||
livecd-rootfs: uses-dpkg-database-directly [usr/share/livecd-rootfs/live-build/lb_chroot_layered]
|
||||
livecd-rootfs: package-contains-no-arch-dependent-files
|
||||
|
||||
# Developer documentation in an already-expected spot
|
||||
livecd-rootfs: package-contains-documentation-outside-usr-share-doc [usr/share/livecd-rootfs/live-build/ubuntu-cpc/README.cpc.md]
|
||||
|
||||
# This is going to occur quite a bit; we're making a livefs
|
||||
livecd-rootfs: repeated-path-segment * [*]
|
90
debian/rules
vendored
90
debian/rules
vendored
@ -1,18 +1,78 @@
|
||||
#! /usr/bin/make -f
|
||||
%:
|
||||
dh $@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file is public domain software, originally written by Joey Hess.
|
||||
# With liberal additions based on debian-installer's rules.
|
||||
|
||||
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
override_dh_auto_test:
|
||||
dh_auto_test
|
||||
set -e; for x in live-build/auto/*; do \
|
||||
sh -n "$$x"; \
|
||||
done
|
||||
#ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
#VERS=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
|
||||
#CLOOPIMG=livecd-root-${VERS}-${ARCH}.cloopimg
|
||||
|
||||
override_dh_install:
|
||||
dh_install
|
||||
find debian/livecd-rootfs -type f -print0 | \
|
||||
xargs -0r grep -lZ '@DEB_HOST_MULTIARCH@' | \
|
||||
xargs -0r \
|
||||
sed -i 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g'
|
||||
build: build-stamp
|
||||
build-stamp:
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
#$(MAKE)
|
||||
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
#-$(MAKE) clean
|
||||
#-$(MAKE) distclean
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/<packagename>
|
||||
#$(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
|
||||
install -m755 livecd.sh e2fs-zero.py debian/livecd-rootfs/usr/sbin
|
||||
install -m644 BuildLiveCD debian/livecd-rootfs/usr/share/doc/livecd-rootfs/examples
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installcatalogs
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
# dh_undocumented
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_python
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install
|
||||
|
1
debian/source/format
vendored
1
debian/source/format
vendored
@ -1 +0,0 @@
|
||||
3.0 (native)
|
5
debian/source/lintian-overrides
vendored
5
debian/source/lintian-overrides
vendored
@ -1,5 +0,0 @@
|
||||
# This is expected and okay
|
||||
livecd-rootfs source: absolute-symbolic-link-target-in-source * [live-build/*]
|
||||
|
||||
# The description indicates that it's not required in debhelper >= 13, which we have
|
||||
livecd-rootfs source: override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS [debian/rules:*]
|
7
debian/tests/control
vendored
7
debian/tests/control
vendored
@ -1,7 +0,0 @@
|
||||
Tests: default-bootstraps
|
||||
Depends: @, lsb-release
|
||||
Restrictions: needs-root isolation-machine allow-stderr
|
||||
|
||||
Tests: minimized
|
||||
Depends: @, lsb-release
|
||||
Restrictions: needs-root isolation-machine allow-stderr
|
92
debian/tests/default-bootstraps
vendored
92
debian/tests/default-bootstraps
vendored
@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
# autopkgtest check: Build default rootfs for all supported project:subproject pairs
|
||||
# (C) 2017 Canonical Ltd.
|
||||
# Author: Balint Reczey <balint.reczey@canonical.com>
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$SUITE" ]; then
|
||||
SUITE=$(lsb_release -c -s)
|
||||
fi
|
||||
|
||||
# Known project:subproject:template combinations.
|
||||
# Listed subprojects can be combined with other projects as well,
|
||||
# but this list gives reasonable coverage.
|
||||
ALL_TRIPLETS="
|
||||
edubuntu::
|
||||
kubuntu::
|
||||
lubuntu::
|
||||
ubuntu-unity::
|
||||
ubuntu::
|
||||
ubuntu-base::
|
||||
ubuntu-base:buildd:
|
||||
ubuntu-budgie::
|
||||
ubuntu-budgie-desktop::
|
||||
ubuntu-budgie-live::
|
||||
ubuntucinnamon::
|
||||
ubuntu-core:system-image:ubuntu-core
|
||||
ubuntu-cpc::ubuntu-cpc
|
||||
ubuntu-cpc:minimized:ubuntu-cpc
|
||||
ubuntu-dvd::
|
||||
ubuntukylin::
|
||||
ubuntu-mate::
|
||||
ubuntu-mate-core::
|
||||
ubuntu-mate-desktop::
|
||||
ubuntu-mate-live::
|
||||
ubuntu-server:live:ubuntu-server
|
||||
xubuntu::
|
||||
xubuntu:minimal:"
|
||||
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
|
||||
if [ -z "$SELECTED_TRIPLETS" ]; then
|
||||
SELECTED_TRIPLETS="
|
||||
ubuntu-base::
|
||||
ubuntu-cpc::ubuntu-cpc
|
||||
"
|
||||
if [ "$ARCH" = amd64 ]; then
|
||||
SELECTED_TRIPLETS="$SELECTED_TRIPLETS
|
||||
ubuntu::"
|
||||
fi
|
||||
fi
|
||||
|
||||
live_build_rootfs() {
|
||||
PROJECT=${1%%:*}
|
||||
local SUBPROJECT_TMP=${1%:*}
|
||||
SUBPROJECT=${SUBPROJECT_TMP#*:}
|
||||
TEMPLATE=${1##*:}
|
||||
echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
|
||||
cp -a /usr/share/livecd-rootfs/live-build/auto .
|
||||
if [ -n "$TEMPLATE" ]; then
|
||||
cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
|
||||
fi
|
||||
env PROJECT=$PROJECT \
|
||||
SUBPROJECT=$SUBPROJECT \
|
||||
SUITE=$SUITE \
|
||||
ARCH=$ARCH \
|
||||
NOW=$(date '+%Y%m%d') \
|
||||
lb config
|
||||
mkdir chroot
|
||||
# this part needs root rights, but right now the whole script ran as root by autopkgtest
|
||||
env PROJECT=$PROJECT \
|
||||
SUBPROJECT=$SUBPROJECT \
|
||||
ARCH=$ARCH \
|
||||
NOW=$(date '+%Y%m%d') \
|
||||
lb build
|
||||
echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
|
||||
du -sh *
|
||||
echo ""
|
||||
}
|
||||
|
||||
[ -d /adt ] || mkdir /adt
|
||||
WORKDIR=$(mktemp -d -p /adt)
|
||||
trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
|
||||
cd $WORKDIR
|
||||
|
||||
for i in $SELECTED_TRIPLETS; do
|
||||
mkdir $i
|
||||
(cd $i && live_build_rootfs $i)
|
||||
# clean up after build to avoid filling the disk, needs root rights
|
||||
rm -rf $i
|
||||
done
|
||||
|
3
debian/tests/minimized
vendored
3
debian/tests/minimized
vendored
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
env SELECTED_TRIPLETS=ubuntu-cpc:minimized:ubuntu-cpc debian/tests/default-bootstraps
|
235
e2fs-zero.py
Normal file
235
e2fs-zero.py
Normal file
@ -0,0 +1,235 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright Paul Sladen <code@paul.sladen.org>, 2005-05-14
|
||||
# You may use this work under the terms of the GNU GPL.
|
||||
#
|
||||
# Synopsis:
|
||||
# 1. call dumpe2fs /dev/xxxx | grep -E '^( Free blocks: |Block size:)'
|
||||
# 2. decode Block size, eg. 4096 bytes
|
||||
# 3. decode ranges of Free blocks, like: 123, 132-145, 149-150, 167
|
||||
# 4. open '/dev/xxxx' for writing
|
||||
# 5. seek to each location (block_number * block_size) and write lots of NUL
|
||||
# 6. profit
|
||||
|
||||
"""\
|
||||
e2fszero 0.1 (2005-05-14)
|
||||
Usage: e2fs-zero [-h] [-v] [-w|-n] ext2-filesystem
|
||||
Zero unused blocks in an Ext2 Filesystem, to increase compression and rsyncability.
|
||||
-h --help this message
|
||||
-v --verbose extra information
|
||||
-n --dryrun disable writing to the filesystem
|
||||
-w --write enable writing to the filesystem (default)
|
||||
Note: This program relies on 'dumpe2fs' to do the dangerous calculations!
|
||||
NOTE: YES, THIS PROGRAM REALLY WILL OVERWRITE (bits of) YOUR FILESYSTEM WITH NULLS\
|
||||
"""
|
||||
DUMPE2FS = '/sbin/dumpe2fs'
|
||||
import os, sys
|
||||
|
||||
# messages
|
||||
verbose = False
|
||||
# enable writing operations
|
||||
dangerous = False
|
||||
|
||||
def main():
|
||||
global verbose, dangerous, DUMPE2FS
|
||||
|
||||
# catch people who need usage help
|
||||
# this is the worst and more incorrect piece of code in here
|
||||
|
||||
leftover = []
|
||||
for fight in sys.argv[1:]:
|
||||
if fight == '-v' or fight == '--verbose':
|
||||
verbose = True
|
||||
continue
|
||||
elif fight == '-n' or fight == '--dryrun':
|
||||
dangerous = False
|
||||
continue
|
||||
elif fight == '-w' or fight == '--write':
|
||||
dangerous = True
|
||||
continue
|
||||
elif fight[0] == '-':
|
||||
print __doc__
|
||||
sys.exit()
|
||||
leftover.append(fight)
|
||||
|
||||
#print `leftover`
|
||||
|
||||
try:
|
||||
if len(leftover) != 1:
|
||||
raise 'ArgumentError'
|
||||
filesystem = leftover[0]
|
||||
if len(filesystem) <= 0:
|
||||
raise 'NoFilesystemName'
|
||||
except:
|
||||
print >> sys.stderr, __doc__
|
||||
sys.exit()
|
||||
|
||||
# We need access to the filesystem image (either a block device or a very large file)
|
||||
# and we also need to have 'dumpe2fs', otherwise we can't open a pipe() from it.
|
||||
|
||||
try:
|
||||
stat = os.stat(filesystem)
|
||||
stat = os.stat(DUMPE2FS)
|
||||
# Might aswell just let the user see any stderr errors from dumpe2fs,
|
||||
# although annoying it prints a banner first
|
||||
#out, err = os.popen3("%s '%s'" % (DUMPE2FS, filesystem))[1:]
|
||||
sys.stderr.write('calling ')
|
||||
pipe = os.popen("%s '%s'" % (DUMPE2FS, filesystem))
|
||||
except OSError:
|
||||
print >> sys.stderr, "$(PROGRAM): can't access $(filesystem), try --help"
|
||||
|
||||
# We're looking for the following lines from dumpe2fs, in order, and ignoring the rest:
|
||||
# Filesystem volume name: <none>
|
||||
# Free blocks: 134859
|
||||
# Block size: 4096
|
||||
# Free blocks: 1123, 1345-1456, 1567, 1678-1789
|
||||
# Free blocks: 2123-2345, 2456-2567, 2678, 2789
|
||||
|
||||
s = pipe.readline()
|
||||
if s <= 'Filesystem volume name:':
|
||||
raise "Failed to parse correct dumpe2fs output"
|
||||
|
||||
# 'Free blocks:'
|
||||
while not s.startswith('Free blocks:') and len(s) > 0:
|
||||
s = pipe.readline()
|
||||
try:
|
||||
free_blocks = int(s.strip().split(': ')[1])
|
||||
except:
|
||||
raise "Failed to parse unused block count ('Free blocks:')"
|
||||
if verbose:
|
||||
print "Detected filsystem contains %d free blocks" % (free_blocks)
|
||||
|
||||
# 'Block size:'
|
||||
while not s.startswith('Block size:') and len(s) > 0:
|
||||
s = pipe.readline()
|
||||
try:
|
||||
block_size = int(s.strip().split(': ')[1])
|
||||
except:
|
||||
raise "Failed to parse filesystem block-size ('Block size:')"
|
||||
if verbose:
|
||||
print "Detected filsystem block_size = %d bytes" % (block_size)
|
||||
|
||||
# 'Free blocks:' (multiple entries, one per Ext2 "group")
|
||||
free_ranges = []
|
||||
while True:
|
||||
while len(s) and not s.startswith(' Free blocks:'):
|
||||
try:
|
||||
s = pipe.readline()
|
||||
except:
|
||||
raise "failed to read"
|
||||
# Detect EOF
|
||||
if not len(s):
|
||||
break
|
||||
#print len(s), `s`
|
||||
# Strip the label: and separate the commas
|
||||
try:
|
||||
#print `s.strip()`
|
||||
free_ranges += s.split(': ', 1)[1].strip().split(', ')[:]
|
||||
except:
|
||||
print >> sys.stderr, `s`
|
||||
raise "Failed to parse free_ranges (' Free blocks:')"
|
||||
s = pipe.readline()
|
||||
#print `free_ranges`
|
||||
|
||||
# Turn the strings into integer lists of useful free blocks
|
||||
# 'blocks' contains each free blocks and get _very_ big
|
||||
# 'wipes' contains [offset, length] pairs
|
||||
record_blocks = False
|
||||
record_wipes = True
|
||||
blocks = []
|
||||
wipes = []
|
||||
free_block_count = 0
|
||||
|
||||
for egg in free_ranges:
|
||||
if len(egg) > 0:
|
||||
# Assuming this ext2 group has some spare space in it...
|
||||
try:
|
||||
# Find some ranges (Ranges are inclusive, eg. 172-184)
|
||||
if egg.find('-') > 0:
|
||||
#blocks += range(*map(int, egg.split('-')))
|
||||
a, b = egg.split('-')
|
||||
if record_blocks: blocks += range(int(a), int(b) + 1)
|
||||
if record_wipes: wipes.append([block_size * int(a), block_size * (int(b) - int(a) + 1)])
|
||||
free_block_count += int(b) - int(a) + 1
|
||||
# But some are singular (eg. '199') is just one free block on its own
|
||||
else:
|
||||
if record_blocks: blocks += [int(egg)]
|
||||
if record_wipes: wipes.append([block_size * int(egg), block_size])
|
||||
free_block_count += 1
|
||||
except:
|
||||
# since we're nearly at the point of writing to the disk,
|
||||
# it probably better to just safely roll over and die
|
||||
print "Bzzzz on trying to decode " + `egg`
|
||||
blocks.sort()
|
||||
#print len(blocks), `blocks`
|
||||
if verbose:
|
||||
print len(wipes), 'offset/length pairs', `wipes`
|
||||
if verbose or free_blocks != free_block_count:
|
||||
print "Free blocks; parsed: %d, decoded: %d" % (free_blocks, free_block_count)
|
||||
if free_blocks != free_block_count:
|
||||
raise 'Decoded Free blocks do not match count in filesystem!'
|
||||
perform_wipe(filesystem, wipes)
|
||||
|
||||
WRITE_SIZE = 2**18
|
||||
PADDING = '\0'
|
||||
|
||||
# fstream file-access [open/f.write/f.tell] seems to have some
|
||||
# grave funnyiness that causes the file to be randomly truncated.
|
||||
# Since I spent a good while tearing my hair out over this, I've
|
||||
# changed it to just use the normal POSIX os.open/os.write/close
|
||||
|
||||
# Here we take the offset/length pairs decoded above, open the
|
||||
# ext2 filesystem image and overwrite the unused areas.
|
||||
# it would be handy to truncate areas (make them sparse) so that they
|
||||
# don't actually take up space on disk to...
|
||||
|
||||
def perform_wipe(filename, wipes = [[0, 0]]):
|
||||
progress_counter = 0.0
|
||||
percentage = 100.0 / len(wipes)
|
||||
empty_space = PADDING * WRITE_SIZE
|
||||
|
||||
#f = open(filename, 'w')
|
||||
if dangerous:
|
||||
mode = os.O_WRONLY|os.EX_CANTCREAT
|
||||
else:
|
||||
mode = os.O_RDONLY|os.EX_CANTCREAT
|
||||
fd = os.open(filename, mode)
|
||||
|
||||
# Don't waste space on a tty, display a progress percentage instead.
|
||||
if sys.stdout.isatty():
|
||||
end = '\r'
|
||||
else:
|
||||
end = '\n'
|
||||
for offset, length in wipes:
|
||||
progress_counter += percentage
|
||||
sys.stdout.write("wiping position %16d for %16d bytes (%5.1f%%)%s" %
|
||||
(offset, length, progress_counter, end))
|
||||
#f.seek(offset)
|
||||
os.lseek(fd, offset, 0)
|
||||
#print 'currently at (before) ' + `f.tell()`
|
||||
#print 'currently at (before) ' + `os.tell(fd)`
|
||||
# only write 256kB at a time, since we can stick that in a buffer
|
||||
# and not have Python regenerate HUGE arrays each time
|
||||
if 1:
|
||||
while length >= WRITE_SIZE and length > 0:
|
||||
#f.write(empty_space)
|
||||
#length -= WRITE_SIZE
|
||||
if dangerous:
|
||||
length -= os.write(fd, empty_space)
|
||||
else:
|
||||
length -= WRITE_SIZE
|
||||
#f.write('\xaa' * length)
|
||||
#f.write('hello')
|
||||
if dangerous:
|
||||
os.write(fd, PADDING * length)
|
||||
#print 'currently at (after) ' + `f.tell()`
|
||||
#print 'currently at (after) ' + `os.tell(fd)`
|
||||
#f.close()
|
||||
os.close(fd)
|
||||
if sys.stdout.isatty():
|
||||
print
|
||||
if verbose:
|
||||
print 'All done! Hopefully your filesystem is not toast.'
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -1,15 +0,0 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from launchpadlib.launchpad import Launchpad
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
parser = OptionParser(usage="%prog OWNER/NAME")
|
||||
_, args = parser.parse_args()
|
||||
if not args:
|
||||
parser.error("must provide a PPA owner/name")
|
||||
owner_name, ppa_name = args[0].split("/", 1)
|
||||
lp = Launchpad.login_anonymously('livecd-rootfs', 'production', version='devel')
|
||||
print(lp.people(owner_name).getPPAByName(name=ppa_name).signing_key_fingerprint)
|
@ -1 +0,0 @@
|
||||
0xffffff
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read perfmon bpf checkpoint_restore
|
@ -1 +0,0 @@
|
||||
acquire send receive
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
1.2
|
@ -1 +0,0 @@
|
||||
create read write exec append mmap_exec link lock
|
@ -1 +0,0 @@
|
||||
sqpoll override_creds
|
@ -1 +0,0 @@
|
||||
create read write open delete setattr getattr
|
@ -1 +0,0 @@
|
||||
mount umount pivot_root
|
@ -1 +0,0 @@
|
||||
detached
|
@ -1 +0,0 @@
|
||||
userns_create
|
@ -1 +0,0 @@
|
||||
no
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
pciu&
|
@ -1 +0,0 @@
|
||||
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp mctp
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp mctp
|
@ -1 +0,0 @@
|
||||
file
|
@ -1 +0,0 @@
|
||||
0x000001
|
@ -1 +0,0 @@
|
||||
allow deny subtree cond kill complain prompt audit quiet hide xindex tag label
|
@ -1 +0,0 @@
|
||||
0x000003
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
0x000001
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
1
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
read trace
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
allow deny audit quiet
|
@ -1 +0,0 @@
|
||||
cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime
|
@ -1 +0,0 @@
|
||||
hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost
|
@ -1 +0,0 @@
|
||||
0xffffff
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read perfmon bpf checkpoint_restore
|
@ -1 +0,0 @@
|
||||
acquire send receive
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
1.2
|
@ -1 +0,0 @@
|
||||
create read write exec append mmap_exec link lock
|
@ -1 +0,0 @@
|
||||
sqpoll override_creds
|
@ -1 +0,0 @@
|
||||
create read write open delete setattr getattr
|
@ -1 +0,0 @@
|
||||
mount umount pivot_root
|
@ -1 +0,0 @@
|
||||
detached
|
@ -1 +0,0 @@
|
||||
userns_create
|
@ -1 +0,0 @@
|
||||
no
|
@ -1 +0,0 @@
|
||||
yes
|
@ -1 +0,0 @@
|
||||
pciu&
|
@ -1 +0,0 @@
|
||||
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp mctp
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user