Took the __file parts from master. Signed-off-by: Nico Schottelius <nico@bento.schottelius.org> Conflicts: cdist/conf/type/__file/gencode-local cdist/conf/type/__file/gencode-remoteremotes/origin/4.0-pre-not-stable
commit
684ad56a80
@ -1,39 +0,0 @@ |
||||
#!/bin/sh |
||||
# |
||||
# 2011 Nico Schottelius (nico-cdist at schottelius.org) |
||||
# |
||||
# This file is part of cdist. |
||||
# |
||||
# cdist is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
# |
||||
# cdist 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 cdist. If not, see <http://www.gnu.org/licenses/>. |
||||
# |
||||
# |
||||
# Check whether file exists or not |
||||
# |
||||
|
||||
destination="/$__object_id" |
||||
os=$("$__explorer/os") |
||||
|
||||
case "$os" in |
||||
"freebsd") |
||||
cmd="stat -f %Su" |
||||
;; |
||||
*) |
||||
cmd="stat -c %U" |
||||
;; |
||||
esac |
||||
|
||||
if [ -e "$destination" ]; then |
||||
$cmd "$destination" |
||||
fi |
||||
|
@ -0,0 +1 @@ |
||||
present |
@ -0,0 +1 @@ |
||||
present |
@ -0,0 +1,46 @@ |
||||
#!/bin/sh |
||||
# |
||||
# 2013 Steven Armstrong (steven-cdist armstrong.cc) |
||||
# |
||||
# This file is part of cdist. |
||||
# |
||||
# cdist is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
# |
||||
# cdist 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 cdist. If not, see <http://www.gnu.org/licenses/>. |
||||
# |
||||
# |
||||
# Mostly a wrapper for ln |
||||
# |
||||
|
||||
destination="/$__object_id" |
||||
|
||||
if [ ! -e "$destination" ]; then |
||||
echo none |
||||
elif [ -h "$destination" ]; then |
||||
echo symlink |
||||
elif [ -f "$destination" ]; then |
||||
type="$(cat "$__object/parameter/type")" |
||||
case "$type" in |
||||
hard) |
||||
link_count=$(ls -l "$destination" | awk '{ print $2 }') |
||||
if [ $link_count -gt 1 ]; then |
||||
echo hardlink |
||||
exit 0 |
||||
fi |
||||
;; |
||||
esac |
||||
echo file |
||||
elif [ -d "$destination" ]; then |
||||
echo directory |
||||
else |
||||
echo unknown |
||||
fi |
@ -0,0 +1 @@ |
||||
present |
@ -0,0 +1,72 @@ |
||||
Todo for preos: |
||||
|
||||
get debian installer (?) |
||||
x86, amd64 |
||||
configure sshd |
||||
add authorized_keys |
||||
output files |
||||
tftp: cuni: curl -s "http://http.us.debian.org/debian/dists/$version/main/installer-$arch/current/images/netboot/netboot.tar.gz" | tar xz |
||||
iso |
||||
|
||||
|
||||
http://wiki.debian.org/DebianInstaller/ |
||||
-------------------------------------------------------------------------------- |
||||
debootstrap: |
||||
[19:33] brief:hack% sudo debootstrap squeeze ./debian-squeeze |
||||
[19:30] brief:hack# du -sh . |
||||
213M . |
||||
|
||||
install kernel |
||||
[19:35] brief:hack# chroot debian-squeeze/ apt-get -y install linux-image-amd64 |
||||
[19:37] brief:debian-squeeze# ls boot/initrd* |
||||
boot/initrd.img-2.6.32-5-amd64 |
||||
[19:37] brief:debian-squeeze# ls boot/vmlinuz* |
||||
boot/vmlinuz-2.6.32-5-amd64 |
||||
|
||||
install sshd |
||||
[19:37] brief:hack# chroot debian-squeeze/ apt-get -y --force-yes install openssh-server |
||||
|
||||
- connect back? |
||||
- generate sshd keys? |
||||
|
||||
-------------------------------------------------------------------------------- |
||||
initramfs: |
||||
find . -print0 | bsdcpio $( (( QUIET )) && echo '--quiet' ) -R 0:0 -0oH newc | $COMPRESSION $COMPRESSION_OPTIONS > "$IMGPATH" |
||||
|
||||
/init for booting |
||||
find . -print0 | cpio --null -ov --format=newc | gzip -9 > /boot/my-initramfs.cpio.gz |
||||
cpio -H newc -o |
||||
find . | cpio -H newc -o > ../initramfs.cpio # <-- this is the actual initramfs |
||||
|
||||
|
||||
[19:39] brief:debian-squeeze# find . | bsdcpio -H newc -o > ../initramfs.cpio |
||||
[19:43] brief:debian-squeeze# xz ../initramfs.cpio |
||||
|
||||
|
||||
-------------------------------------------------------------------------------- |
||||
cdrom: |
||||
http://tldp.org/HOWTO/Bootdisk-HOWTO/cd-roms.html |
||||
|
||||
-------------------------------------------------------------------------------- |
||||
|
||||
[19:34] brief:hack# chroot debian-squeeze/ apt-cache search kernel | grep linux-image |
||||
linux-image-2.6.32-5-amd64-dbg - Debugging infos for Linux 2.6.32-5-amd64 |
||||
linux-image-2.6.32-5-amd64 - Linux 2.6.32 for 64-bit PCs |
||||
linux-image-2.6.32-5-openvz-amd64-dbg - Debugging infos for Linux 2.6.32-5-openvz-amd64 |
||||
linux-image-2.6.32-5-openvz-amd64 - Linux 2.6.32 for 64-bit PCs, OpenVZ support |
||||
linux-image-2.6.32-5-vserver-amd64-dbg - Debugging infos for Linux 2.6.32-5-vserver-amd64 |
||||
linux-image-2.6.32-5-vserver-amd64 - Linux 2.6.32 for 64-bit PCs, Linux-VServer support |
||||
linux-image-2.6.32-5-xen-amd64-dbg - Debugging infos for Linux 2.6.32-5-xen-amd64 |
||||
linux-image-2.6.32-5-xen-amd64 - Linux 2.6.32 for 64-bit PCs, Xen dom0 support |
||||
linux-image-2.6-amd64 - Linux 2.6 for 64-bit PCs (meta-package) |
||||
linux-image-2.6-openvz-amd64 - Linux 2.6 for 64-bit PCs (meta-package), OpenVZ support |
||||
linux-image-2.6-vserver-amd64 - Linux 2.6 for 64-bit PCs (meta-package), Linux-VServer support |
||||
linux-image-2.6-xen-amd64 - Linux 2.6 for 64-bit PCs (meta-package), Xen dom0 support |
||||
linux-image-amd64 - Linux for 64-bit PCs (meta-package) |
||||
linux-image-openvz-amd64 - Linux for 64-bit PCs (meta-package), OpenVZ support |
||||
linux-image-vserver-amd64 - Linux for 64-bit PCs (meta-package), Linux-VServer support |
||||
linux-image-xen-amd64 - Linux for 64-bit PCs (meta-package), Xen dom0 support |
||||
[19:34] brief:hack# |
||||
|
||||
-------------------------------------------------------------------------------- |
||||
|
Loading…
Reference in new issue