Open main menu

Aram's Wiki β

Changes

Create Debian sysroots

41 bytes added, 14:08, 24 November 2019
no edit summary
[[Debian Linux Post Install Steps| Debian]] or [[Ubuntu Linux Post Install Steps | Ubuntu]] or any system that can run [https://wiki.debian.org/Debootstrap debootstrap].
Everything below runs on the '''debootstrap machine''' as root:
sudo -i
=== Install debootstrap ===
apt install -y debootstrap
=== Run debootstrap ===
<nowiki>mkdir -p /tmp/sysroots
for arch in $arches; do IFS=","; set $arch; debootstrap --arch $1 --variant=buildd stable $2 http://deb.debian.org/debian; unset IFS; done</nowiki>
=== Fix symlinks ===
Debootstrap will create absolute symlinks, fix absolute symlinks to refer to the sysroot dir by changing them into relative symlinks.
for arch in $arches; do IFS=","; set $arch; find "$2" -type l -lname '/*' -exec sh -c 'file="$0"; dir=$(dirname "$file"); target=$(readlink "$0"); prefix=$(dirname "$dir" | sed 's@[^/]*@\.\.@g'); newtarget="$prefix$target"; ln -snf $newtarget $file' {} \; ; unset IFS; done
=== See also ===
* [https://wiki.debian.org/Debootstrap debootstrap]