diff --git a/README.md b/README.md new file mode 100644 index 0000000..c130535 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# debootstrap + +debootstrap installs Debian base systems in a subdirectory of another, already installed system. diff --git a/files/patches/0001-arch-detect.patch b/files/patches/0001-arch-detect.patch new file mode 100644 index 0000000..c0d5184 --- /dev/null +++ b/files/patches/0001-arch-detect.patch @@ -0,0 +1,21 @@ +diff --git a/debootstrap b/debootstrap +index 43a7383..62c991f 100755 +--- a/debootstrap ++++ b/debootstrap +@@ -547,15 +547,7 @@ fi + + ########################################################################### + +-if in_path dpkg && \ +- dpkg --print-architecture >/dev/null 2>&1; then +- HOST_ARCH=$(/usr/bin/dpkg --print-architecture) +-elif in_path udpkg && \ +- udpkg --print-architecture >/dev/null 2>&1; then +- HOST_ARCH=$(/usr/bin/udpkg --print-architecture) +-elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then +- HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") +-fi ++HOST_ARCH=amd64 + HOST_OS="$HOST_ARCH" + # basic host OS guessing for non-Debian systems + if [ -z "$HOST_OS" ]; then diff --git a/files/patches/0002-def_components.patch b/files/patches/0002-def_components.patch new file mode 100644 index 0000000..d849b13 --- /dev/null +++ b/files/patches/0002-def_components.patch @@ -0,0 +1,15 @@ +diff --git a/functions b/functions +index c6752f4..7ee6619 100644 +--- a/functions ++++ b/functions +@@ -176,6 +176,10 @@ default_mirror () { + DEF_MIRROR="$1" + } + ++default_components () { ++ export USE_COMPONENTS="$1" ++} ++ + FINDDEBS_NEEDS_INDICES="false" + finddebs_style () { + case "$1" in diff --git a/files/scripts/1.8_x86-64 b/files/scripts/1.8_x86-64 new file mode 100644 index 0000000..05c867d --- /dev/null +++ b/files/scripts/1.8_x86-64 @@ -0,0 +1,29 @@ +case $SUITE in + 1.8_x86-64|4.8_arm|1.7_x86-64|4.7_arm|novorossiysk|sevastopol|smolensk|3.8_s390x|12.8_x86-64) +default_mirror $USER_MIRROR + ;; + orel) +default_mirror https://dl.astralinux.ru/astra/stable/2.12_x86-64/repository +;; +esac + +mirror_style release +download_style apt +finddebs_style from-indices +variants - buildd fakechroot minbase +keyring /usr/share/apt/astra-archive.gpg + +if [ -z $CUSTOM_COMPONENTS ]; then + default_components 'main|contrib|non-free|non-free-firmware' +fi + +# include common settings +if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then + . "$DEBOOTSTRAP_DIR/scripts/debian-common" +elif [ -e /debootstrap/debian-common ]; then + . /debootstrap/debian-common +elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then + . "$DEBOOTSTRAP_DIR/debian-common" +else + error 1 NOCOMMON "File not found: debian-common" +fi diff --git a/files/scripts/orel b/files/scripts/orel new file mode 100644 index 0000000..0729dbe --- /dev/null +++ b/files/scripts/orel @@ -0,0 +1,29 @@ +case $SUITE in + 1.8_x86-64|4.8_arm|1.7_x86-64|4.7_arm|novorossiysk|sevastopol|smolensk) +default_mirror $USER_MIRROR + ;; + orel) +default_mirror https://dl.astralinux.ru/astra/stable/2.12_x86-64/repository +;; +esac + +mirror_style release +download_style apt +finddebs_style from-indices +variants - buildd fakechroot minbase +keyring /usr/share/apt/astra-archive.gpg + +if [ -z $CUSTOM_COMPONENTS ]; then + default_components 'main|contrib|non-free' +fi + +# include common settings +if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then + . "$DEBOOTSTRAP_DIR/scripts/debian-common" +elif [ -e /debootstrap/debian-common ]; then + . /debootstrap/debian-common +elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then + . "$DEBOOTSTRAP_DIR/debian-common" +else + error 1 NOCOMMON "File not found: debian-common" +fi diff --git a/files/series b/files/series new file mode 100644 index 0000000..7714eae --- /dev/null +++ b/files/series @@ -0,0 +1,2 @@ +patches/0001-arch-detect.patch +patches/0002-def_components.patch diff --git a/package.yml b/package.yml new file mode 100644 index 0000000..8845152 --- /dev/null +++ b/package.yml @@ -0,0 +1,29 @@ +name : debootstrap +version : 1.0.141 +release : 1 +source : + - git|https://salsa.debian.org/installer-team/debootstrap.git : 8457f34b4c30a09e7acfabf5ab153146cc3470ed +homepage : https://salsa.debian.org/installer-team/debootstrap +license : MIT +component : programming.tools +summary : Bootstrap a basic Debian system +description: | + Bootstrap a basic Debian system +rundeps : + - binutils +build : | + %apply_patches +install : | + make DESTDIR="$installdir" install + + install -Dm00644 $pkgfiles/scripts/1.8_x86-64 $installdir/usr/share/debootstrap/scripts/1.8_x86-64 + install -Dm00644 $pkgfiles/scripts/orel $installdir/usr/share/debootstrap/scripts/orel + + ln -sf 1.8_x86-64 $installdir/usr/share/debootstrap/scripts/12.8_x86-64 + ln -sf 1.8_x86-64 $installdir/usr/share/debootstrap/scripts/3.8_s390x + ln -sf orel $installdir/usr/share/debootstrap/scripts/1.7_x86-64 + ln -sf orel $installdir/usr/share/debootstrap/scripts/4.7_arm + ln -sf orel $installdir/usr/share/debootstrap/scripts/4.8_arm + ln -sf orel $installdir/usr/share/debootstrap/scripts/novorossiysk + ln -sf orel $installdir/usr/share/debootstrap/scripts/sevastopol + ln -sf orel $installdir/usr/share/debootstrap/scripts/smolensk