1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../embutils/losetup.patch
5 # Copyright (C) 2005 - 2007 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
19 - Rene Rebe <rene@exactcode.de>
21 --- /dev/null 2005-06-19 08:33:32.285177368 +0200
22 +++ embutils-0.17/losetup.c 2005-06-19 13:44:28.000000000 +0200
27 + * Copyright (c) 2005, 2007 by Rene Rebe <rene@exactcode.de>
29 + * License: GPL, version 2
33 +#define _FILE_OFFSET_BITS 64
34 +#include <sys/types.h>
35 +#include <sys/stat.h>
37 +#include <sys/ioctl.h>
40 +#include <linux/posix_types.h>
41 +#include <linux/loop.h>
45 +void die(const char*msg) { __write2(msg); __write2("\n"); exit(1); }
47 +int main (int argc, char* argv[])
50 + struct loop_info loopinfo;
53 + die("usage: losetup [-d] loop_device\n losetup loop_device file");
56 + if (!strcmp(argv[1], "-d"))
58 + fd=open(argv[2], O_RDONLY);
60 + die(strerror(errno));
62 + if (ioctl(fd, LOOP_CLR_FD, ffd))
63 + die(strerror(errno));
69 + memset(&loopinfo, 0, sizeof(loopinfo));
70 + strncpy(loopinfo.lo_name, argv[2], LO_NAME_SIZE);
72 + ffd=open(argv[2], O_RDONLY);
74 + die(strerror(errno));
76 + fd=open(argv[1], O_RDONLY);
78 + die(strerror(errno));
80 + if (ioctl(fd, LOOP_SET_FD, ffd))
81 + die(strerror(errno));
82 + if (ioctl(fd, LOOP_SET_STATUS, &loopinfo))
83 + die(strerror(errno));
90 --- ./Makefile~ 2006-11-05 11:45:35.000000000 +0100
91 +++ ./Makefile 2006-11-05 11:45:39.000000000 +0100
93 sosrm soscp sosmv sosln soslns md5sum sleep2 allinone uniq tr mesg du \
94 uuencode uudecode nohup nice cmp mktemp truncate strings test date \
95 printenv chrootuid renice \