aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/arch-chroot.adoc70
-rw-r--r--debian/changelog25
-rw-r--r--debian/compat1
-rw-r--r--debian/control20
-rw-r--r--debian/copyright27
-rw-r--r--debian/docs1
-rw-r--r--debian/gbp.conf3
-rw-r--r--debian/genfstab.adoc46
-rw-r--r--debian/manpages2
-rw-r--r--debian/patches/include_header.patch24
-rw-r--r--debian/patches/policy.d_no_autostart.patch46
-rw-r--r--debian/patches/series2
-rwxr-xr-xdebian/rules19
-rw-r--r--debian/source/format1
-rw-r--r--debian/upstream/signing-key.asc37
-rw-r--r--debian/watch3
16 files changed, 327 insertions, 0 deletions
diff --git a/debian/arch-chroot.adoc b/debian/arch-chroot.adoc
new file mode 100644
index 0000000..67a82d9
--- /dev/null
+++ b/debian/arch-chroot.adoc
@@ -0,0 +1,70 @@
+arch-chroot(1)
+==============
+:doctype: manpage
+
+NAME
+----
+arch-chroot - script to mount API filesystems like /proc and make /etc/resolv.conf available in a chroot
+
+
+SYNOPSIS
+--------
+*arch-chroot* ['option'] 'chroot-dir' ['command']
+
+
+OPTIONS
+-------
+*-h*::
+ Print the help message
+
+*-u* '<user>[:group]'::
+ Specify non-root user and optional group to use
+
+
+DESCRIPTION
+-----------
+Before *arch-chroot* runs */usr/bin/chroot*, the script mounts API filesystems
+like '/proc' and makes '/etc/resolv.conf' available in a chroot.
+
+The Debian version of this script also sets up '/usr/sbin/policy-rc.d' to
+disable autostart of daemons.
+
+If 'command' is unspecified, arch-chroot will launch */bin/bash*.
+
+Note that when using arch-chroot, the target chroot directory *should* be a
+mountpoint. This ensures that tools such as findmnt(8) have an accurate hierarchy
+of the mounted filesystems within the chroot.
+
+If your chroot target is not a mountpoint, you can bind mount the directory on
+itself to make it a mountpoint, i.e. 'mount --bind /your/chroot /your/chroot'.
+
+
+EXAMPLES
+--------
+=== Enter a chroot ===
+
+Run arch-chroot with the new root directory as first argument:
+
+```
+arch-chroot /location/of/new/root
+```
+
+To exit the chroot simply use:
+
+```
+exit
+```
+
+=== Run a single command and exit ===
+
+To run a command in the chroot and exit again, append the command to the end of the line:
+
+```
+arch-chroot /location/of/new/root command
+```
+
+For example, to run *dpkg-configure -a* for a chroot located at '/media/testing' do:
+
+```
+arch-chroot /media/testing dpkg-configure -a
+```
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..f22925a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,25 @@
+arch-install-scripts (20-1) unstable; urgency=medium
+
+ * New upstream version 20
+ - Refresh patches.
+ * d/arch-chroot.adoc, d/genfstab.adoc:
+ - Update manpages from updated help text.
+ * d/compat, d/control: Bump dh compat to 11.
+
+ -- Unit 193 <unit193@ubuntu.com> Tue, 23 Oct 2018 20:28:22 -0400
+
+arch-install-scripts (19-1) unstable; urgency=medium
+
+ * d/watch: Update location of tarballs, no longer includes *.sig.
+ * New upstream version 19
+ * d/arch-chroot.adoc, d/control, d/genfstab.adoc, d/manpages, d/rules:
+ - Write manpages for the scripts, use asciidoctor to generate final output.
+ * Update Standards-Version to 4.2.1.
+
+ -- Unit 193 <unit193@ubuntu.com> Tue, 28 Aug 2018 19:55:42 -0400
+
+arch-install-scripts (18-1) unstable; urgency=medium
+
+ * Initial release.
+
+ -- Unit 193 <unit193@ubuntu.com> Tue, 20 Mar 2018 22:39:36 -0400
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b4de394
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+11
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..448dee5
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,20 @@
+Source: arch-install-scripts
+Section: admin
+Priority: optional
+Maintainer: Unit 193 <unit193@ubuntu.com>
+Build-Depends: debhelper (>= 11), asciidoctor, m4
+Standards-Version: 4.2.1
+Homepage: https://projects.archlinux.org/arch-install-scripts.git
+
+Package: arch-install-scripts
+Architecture: all
+Depends: ${misc:Depends}
+Description: scripts aimed at automating some menial tasks when debootstrapping
+ A small suite of scripts aimed at automating some menial tasks when
+ installing Arch Linux.
+ .
+ These scripts can also aid when debootstrapping a Debian based system.
+ .
+ This package contains `genfstab` which assists with generating a fstab and
+ `arch-chroot` which assists with setting up bind mounts and disabling services
+ via policy.d.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..3da8add
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,27 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: arch-install-scripts
+Source: https://sources.archlinux.org/other/arch-install-scripts/
+
+Files: *
+Copyright: 2012-2018 Dave Reisner <dreisner@archlinux.org>
+License: GPL-2
+
+Files: debian/*
+Copyright: 2015-2018 Unit 193 <unit193@ubuntu.com>
+License: GPL-2
+
+License: GPL-2
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2 as published by
+ the Free Software Foundation.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ 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
+ along with this program. If not, see <https://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..b43bf86
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README.md
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..5474c60
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+pristine-tar = True
+sign-tags = True
diff --git a/debian/genfstab.adoc b/debian/genfstab.adoc
new file mode 100644
index 0000000..a8e38aa
--- /dev/null
+++ b/debian/genfstab.adoc
@@ -0,0 +1,46 @@
+genfstab(1)
+===========
+:doctype: manpage
+
+NAME
+----
+genfstab - script to generate an fstab file based on mounted partitions
+
+
+SYNOPSIS
+--------
+*genfstab* ['options'] 'root'
+
+
+OPTIONS
+-------
+*-f* 'FILTER'::
+ Restrict output to mountpoints matching the prefix FILTER
+*-L*::
+ Use labels for source identifiers (shortcut for '-t LABEL')
+*-p*::
+ Exclude pseudofs mounts (default behavior)
+*-P*::
+ Include pseudofs mounts
+*-t* 'TAG'::
+ Use TAG for source identifiers. Common options for TAG include: 'LABEL', 'UUID', 'PARTLABEL', 'PARTUUID'
+*-U*::
+ Use UUIDs for source identifiers (shortcut for '-t UUID')
+*-h*::
+ Print the help message
+
+
+DESCRIPTION
+-----------
+One can use genfstab to generate fstab entries for mounted partitions given a filesystem root.
+This can be useful when installing or chrooting into a broken installation.
+
+
+EXAMPLES
+--------
+
+To generate an fstab file using UUIDs as identifiers, run:
+
+```
+genfstab -U /media/testing >> /media/testing/etc/fstab
+```
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..cc0dedd
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1,2 @@
+debian/arch-chroot.1
+debian/genfstab.1
diff --git a/debian/patches/include_header.patch b/debian/patches/include_header.patch
new file mode 100644
index 0000000..abb62b8
--- /dev/null
+++ b/debian/patches/include_header.patch
@@ -0,0 +1,24 @@
+Description: Include some information in the header of fstab
+Author: Unit 193 <unit193@ubuntu.com>
+Last-Update: 2018-01-28
+
+Index: arch-install-scripts/genfstab.in
+===================================================================
+--- arch-install-scripts.orig/genfstab.in
++++ arch-install-scripts/genfstab.in
+@@ -138,6 +138,15 @@ if ! mountpoint -q "$root"; then
+ fi
+
+ # handle block devices
++cat <<EOF
++# /etc/fstab: static file system information.
++#
++# Use 'blkid' to print the universally unique identifier for a
++# device; this may be used with UUID= as a more robust way to name devices
++# that works even if disks are added and removed. See fstab(5).
++#
++EOF
++printf "%-15s %-15s %-7s %-15s %-7s %s\n" '# <file system>' '<mount point>' '<type>' '<options>' '<dump>' '<pass>'
+ findmnt -Recvruno SOURCE,TARGET,FSTYPE,OPTIONS,FSROOT "$root" |
+ while read -r src target fstype opts fsroot; do
+ if (( !pseudofs )) && fstype_is_pseudofs "$fstype"; then
diff --git a/debian/patches/policy.d_no_autostart.patch b/debian/patches/policy.d_no_autostart.patch
new file mode 100644
index 0000000..fb86606
--- /dev/null
+++ b/debian/patches/policy.d_no_autostart.patch
@@ -0,0 +1,46 @@
+Description: Setup and teardown policy.d, to not autostart applications in the chroot
+Author: Unit 193 <unit193@ubuntu.com>
+Origin: vendor
+Forwarded: not-needed
+Last-Update: 2018-01-28
+
+Index: arch-install-scripts/common
+===================================================================
+--- arch-install-scripts.orig/common
++++ arch-install-scripts/common
+@@ -75,10 +75,18 @@ chroot_maybe_add_mount() {
+ fi
+ }
+
++chroot_policyd() {
++ cat << EOF > "$1/usr/sbin/policy-rc.d"
++#!/bin/sh
++exit 101
++EOF
++ chmod +x "$1/usr/sbin/policy-rc.d"
++}
++
+ chroot_setup() {
+ CHROOT_ACTIVE_MOUNTS=()
+ [[ $(trap -p EXIT) ]] && die '(BUG): attempting to overwrite existing EXIT trap'
+- trap 'chroot_teardown' EXIT
++ trap "chroot_teardown $1" EXIT
+
+ chroot_add_mount proc "$1/proc" -t proc -o nosuid,noexec,nodev &&
+ chroot_add_mount sys "$1/sys" -t sysfs -o nosuid,noexec,nodev,ro &&
+@@ -89,6 +97,7 @@ chroot_setup() {
+ chroot_add_mount shm "$1/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev &&
+ chroot_add_mount run "$1/run" -t tmpfs -o nosuid,nodev,mode=0755 &&
+ chroot_add_mount tmp "$1/tmp" -t tmpfs -o mode=1777,strictatime,nodev,nosuid
++ chroot_policyd "$1"
+ }
+
+ chroot_teardown() {
+@@ -96,6 +105,7 @@ chroot_teardown() {
+ umount "${CHROOT_ACTIVE_MOUNTS[@]}"
+ fi
+ unset CHROOT_ACTIVE_MOUNTS
++ rm -f "$1/usr/sbin/policy-rc.d"
+ }
+
+ try_cast() (
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6b0b6f7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+include_header.patch
+policy.d_no_autostart.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..e146889
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#DH_VERBOSE = 1
+
+%:
+ dh $@
+
+override_dh_auto_install:
+ make PREFIX=/usr DESTDIR="$(CURDIR)/debian/arch-install-scripts" install
+ -rm debian/arch-install-scripts/usr/bin/pacstrap
+
+override_dh_installman:
+ asciidoctor --backend manpage debian/arch-chroot.adoc
+ asciidoctor --backend manpage debian/genfstab.adoc
+ dh_installman
+
+override_dh_clean:
+ dh_clean debian/arch-chroot.1 debian/genfstab.1
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc
new file mode 100644
index 0000000..abcdfc1
--- /dev/null
+++ b/debian/upstream/signing-key.asc
@@ -0,0 +1,37 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQENBE4GMa8BCADKNWK/JmB7qzU3Dfw+/9iDNvGlpNvIuUuNY20RKjrS+91rdSV2
+EtrDD/1Ad55a17BdzcNcaYf1PTAljfoB0KyTYjYuyE0S9YxW0m5Em3mcp/pS68w9
+I40dlimkeIcVcod4btf1r1deJlGuyKwEj/0eqB2kxlMnZbNJKr+V/3rPyI69xX6e
+Z/WIAbyNLJ31+odN08/dZRFZ3y2K8qUi4qYbPgOfE/sYEqNbdefy8YJ9NtJae4V7
+eSau90DPbwELv2WS+Ct0Gk4zm+vnmccG1A2UIdbc0zspzrHxXwlpN+wmMH79G7CZ
+RhA+Fupz5lI62lSOFHIPQVNx/BaTLR3RMemfABEBAAG0H0RhdmUgUmVpc25l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vKa67Mt9COG34ixXfIJ0y8ML337w75rk+XtcawdRiKaZJCZSRiX1wOD5uQf
+3VlnGQLo8hKsTm2xwIoIOV7GQpmdeC6sjuWUR/lBCR6dl8otYvO9EwVrJTpP8yDu
+44GCWZHEuFJpzxlvOCdsBYbrDI2EQKHqAzFTzqmF+nw66TMk8w+B7B5qRdWxhGdT
+6r72M3zcfYq0aDv0EDzpwZ/mLAc5Vc/CcTOwm8m72vxevJ95kuMORt0AEQEAAYkB
+HwQYAQIACQUCTgYxrwIbDAAKCRAesmOP9WwMU6n7CAC595OrXLWTLAOc5NmIuLd+
+lg1biDmyUQuiubXvTTjrmyAAQnUbx923gU5SxRfGfpGR8+iYOtOY9HowMgN9ct8J
+/jOYdG5mGT/zAybHWBycv6+iGizsxrGxF9p+qdd7sjj0q2f8JMoSastMwTGun2xN
+TgFEFjUJAPoIg3V46Pj2qPs/2KDRh89lMrN9G8MxjYyfGfh0oon2G1fsWezhG+PS
+vpMALZQugEPZiwb2MTfdpHiQhrxH64RbSApVcnlNl2zjxEzmsU0416A511BOhRzp
+Ww8ye1kcg4cF1Mg95G40DpH9KvuX+iNajk/dBa2k6s6/lZvWaIBmcYMYR/K5idID
+=i/qC
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..bdae3ba
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+# Compulsory line, this is a version 3 file
+version=3
+https://git.archlinux.org/arch-install-scripts.git/refs/ .*/arch-install-scripts-(.*)\.tar\.xz