Ignore:
Timestamp:
Nov 6, 2007, 11:01:53 AM (16 years ago)
Author:
Bruno Cornec
Message:
  • Better output for mindi-busybox revision
  • Remove dummy file created on NFS - report from Arnaud Tiger <arnaud.tiger_at_hp.com>
  • strace useful for debug
  • fix new versions for pb (2.0.0 for mindi and 1.7.2 for mindi-busybox)
  • fix build process for mindi-busybox + options used in that version (dd for label-partitions-as-necessary)
  • fix typo in label-partitions-as-necessary which doesn't seem to work
  • Update to busybox 1.7.2
  • perl is now required at restore time to support uuid swap partitions (and will be used for many other thigs

in the future for sure)

  • next mindi version will be 2.0.0 due to all the changes made in it (udev may break working distros)
  • small optimization in mindi on keyboard handling (one single find instead of multiple)
  • better interaction for USB device when launching mindi manually
  • attempt to automatically guess block disk size for ramdisk
  • fix typos in bkphw
  • Fix the remaining problem with UUID support for swap partitions
  • Updates mondoarchive man page for USB support
  • Adds preliminary Hardware support to mindi (Proliant SSSTK)
  • Tries to add udev support also for rhel4
  • Fix UUID support which was still broken.
  • Be conservative in test for the start-nfs script
  • Update config file for mindi-busybox for 1.7.2 migration
  • Try to run around a busybox bug (1.2.2 pb on inexistant links)
  • Add build content for mindi-busybox in pb
  • Remove distributions content for mindi-busybox
  • Fix a warning on inexistant raidtab
  • Solve problem on tmpfs in restore init (Problem of inexistant symlink and busybox)
  • Create MONDO_CACHE and use it everywhere + creation at start
  • Really never try to eject a USB device
  • Fix a issue with &> usage (replaced with 1> and 2>)
  • Adds magic file to depllist in order to have file working + ldd which helps for debugging issues
  • tty modes correct to avoid sh error messages
  • Use ext3 normally and not ext2 instead
  • USB device should be corrected after reading (take 1st part)
  • Adds a mount_USB_here function derived from mount_CDROM_here
  • usb detection place before /dev detection in device name at restore time
  • Fix when restoring from USB: media is asked in interactive mode
  • Adds USB support for mondorestore
  • mount_cdrom => mount_media
  • elilo.efi is now searched throughout /boot/efi and not in a fixed place as there is no standard
  • untar-and-softlink => untar (+ interface change)
  • suppress useless softlinks creation/removal in boot process
  • avoids udevd messages on groups
  • Increase # of disks to 99 as in mindi at restore time (should be a conf file parameter)
  • skip existing big file creation
  • seems to work correctly for USB mindi boot
  • Adds group and tty link to udev conf
  • Always load usb-torage (even 2.6) to initiate USB bus discovery
  • Better printing of messages
  • Attempt to fix a bug in supporting OpenSusE 10.3 kernel for initramfs (mindi may now use multiple regex for kernel initrd detection)
  • Links were not correctly done as non relative for modules in mindi
  • exclusion of modules denied now works
  • Also create modules in their ordinary place, so that classical modprobe works + copy modules.dep
  • Fix bugs for DENY_MODS handling
  • Add device /dev/console for udev
  • ide-generic should now really be excluded
  • Fix a bug in major number for tty
  • If udev then adds modprobe/insmod to rootfs
  • tty0 is also cretaed with udev
  • ide-generic put rather in DENY_MODS
  • udevd remove from deplist s handled in mindi directly
  • better default for mindi when using --usb
  • Handles dynamically linked busybox (in case we want to use it soon ;-)
  • Adds fixed devices to create for udev
  • ide-generic should not be part of the initrd when using libata v2
  • support a dynamically linked udev (case on Ubuntu 7.10 and Mandriva 2008.0 so should be quite generic) This will give incitation to move to dyn. linked binaries in the initrd which will help for other tasks (ia6 4)
  • Improvement in udev support (do not use cl options not available in busybox)
  • Udev in mindi
    • auto creation of the right links at boot time with udev-links.conf(from Mandriva 2008.0)
    • rework startup of udev as current makes kernel crash (from Mandriva 2008.0)
    • add support for 64 bits udev
  • Try to render MyInsmod silent at boot time
  • Adds udev support (mandatory for newest distributions to avoid remapping of devices in a different way as on the original system)
  • We also need vaft format support for USB boot
  • Adds libusual support (Ubuntu 7.10 needs it for USB)
  • Improve Ubuntu/Debian keyboard detection and support
  • pbinit adapted to new pb (0.8.10). Filtering of docs done in it
  • Suppress some mondo warnings and errors on USB again
  • Tries to fix lack of files in deb mindi package
  • Verify should now work for USB devices
  • More log/mesages improvement for USB support
  • - Supress g_erase_tmpdir_and_scratchdir
  • Improve some log messages for USB support
  • Try to improve install in mindi to avoid issues with isolinux.cfg not installed vene if in the pkg :-(
  • Improve mindi-busybox build
  • In conformity with pb 0.8.9
  • Add support for Ubuntu 7.10 in build process
  • Add USB Key button to Menu UI (CD streamer removed)
  • Attempt to fix error messages on tmp/scratch files at the end by removing those dir at the latest possible.
  • Fix a bug linked to the size of the -E param which could be used (Arnaud Tiger/René Ribaud).
  • Integrate ~/.pbrc content into mondorescue.pb (required project-builder >= 0.8.7)
  • Put mondorescue in conformity with new pb filtering rules
  • Add USB support at restore time (no test done yet). New start-usb script PB varibale added where useful
  • Unmounting USB device before removal of temporary scratchdir
  • Stil refining USB copy back to mondo (one command was not executed)
  • No need to have the image subdor in the csratchdir when USB.
  • umount the USB partition before attempting to use it
  • Remove useless copy from mindi to mondo at end of USB handling

(risky merge, we are raising the limits of 2 diverging branches. The status of stable is not completely sure as such. Will need lots of tests, but it's not yet done :-()
(merge -r1692:1769 $SVN_M/branches/2.2.5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi-busybox/networking/libiproute/libnetlink.c

    r821 r1770  
     1/* vi: set sw=4 ts=4: */
    12/*
    23 * libnetlink.c RTnetlink service routines.
     
    1112 */
    1213
     14#include <sys/socket.h>
     15#include <sys/uio.h>
     16
    1317#include "libbb.h"
    14 #include <sys/socket.h>
    15 
    16 #include <errno.h>
    17 #include <string.h>
    18 #include <time.h>
    19 #include <unistd.h>
    20 
    21 #include <sys/uio.h>
    22 
    2318#include "libnetlink.h"
    2419
     
    2823}
    2924
    30 int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
     25int xrtnl_open(struct rtnl_handle *rth/*, unsigned subscriptions*/)
    3126{
    3227    socklen_t addr_len;
     
    3429    memset(rth, 0, sizeof(rth));
    3530
    36     rth->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
    37     if (rth->fd < 0) {
    38         bb_perror_msg("Cannot open netlink socket");
    39         return -1;
    40     }
     31    rth->fd = xsocket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
    4132
    4233    memset(&rth->local, 0, sizeof(rth->local));
    4334    rth->local.nl_family = AF_NETLINK;
    44     rth->local.nl_groups = subscriptions;
    45 
    46     if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
    47         bb_perror_msg("Cannot bind netlink socket");
    48         return -1;
    49     }
     35    /*rth->local.nl_groups = subscriptions;*/
     36
     37    xbind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local));
    5038    addr_len = sizeof(rth->local);
    51     if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
    52         bb_perror_msg("Cannot getsockname");
    53         return -1;
    54     }
    55     if (addr_len != sizeof(rth->local)) {
    56         bb_error_msg("Wrong address length %d", addr_len);
    57         return -1;
    58     }
    59     if (rth->local.nl_family != AF_NETLINK) {
    60         bb_error_msg("Wrong address family %d", rth->local.nl_family);
    61         return -1;
    62     }
     39    if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0)
     40        bb_perror_msg_and_die("cannot getsockname");
     41    if (addr_len != sizeof(rth->local))
     42        bb_error_msg_and_die("wrong address length %d", addr_len);
     43    if (rth->local.nl_family != AF_NETLINK)
     44        bb_error_msg_and_die("wrong address family %d", rth->local.nl_family);
    6345    rth->seq = time(NULL);
    6446    return 0;
    6547}
    6648
    67 int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
     49int xrtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
    6850{
    6951    struct {
     
    8365    req.g.rtgen_family = family;
    8466
    85     return sendto(rth->fd, (void*)&req, sizeof(req), 0, (struct sockaddr*)&nladdr, sizeof(nladdr));
     67    return xsendto(rth->fd, (void*)&req, sizeof(req),
     68                 (struct sockaddr*)&nladdr, sizeof(nladdr));
    8669}
    8770
     
    9376    nladdr.nl_family = AF_NETLINK;
    9477
    95     return sendto(rth->fd, buf, len, 0, (struct sockaddr*)&nladdr, sizeof(nladdr));
     78    return xsendto(rth->fd, buf, len, (struct sockaddr*)&nladdr, sizeof(nladdr));
    9679}
    9780
     
    120103}
    121104
    122 int rtnl_dump_filter(struct rtnl_handle *rth,
    123              int (*filter)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
    124              void *arg1,
    125              int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
    126              void *arg2)
    127 {
    128     char    buf[8192];
     105static int rtnl_dump_filter(struct rtnl_handle *rth,
     106        int (*filter)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
     107        void *arg1/*,
     108        int (*junk)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
     109        void *arg2*/)
     110{
     111    char buf[8192];
    129112    struct sockaddr_nl nladdr;
    130113    struct iovec iov = { buf, sizeof(buf) };
     
    164147                h->nlmsg_pid != rth->local.nl_pid ||
    165148                h->nlmsg_seq != rth->dump) {
    166                 if (junk) {
     149/*              if (junk) {
    167150                    err = junk(&nladdr, h, arg2);
    168                     if (err < 0) {
     151                    if (err < 0)
    169152                        return err;
    170                     }
    171                 }
     153                } */
    172154                goto skip_it;
    173155            }
     
    187169            }
    188170            err = filter(&nladdr, h, arg1);
    189             if (err < 0) {
     171            if (err < 0)
    190172                return err;
    191             }
    192173
    193174skip_it:
     
    195176        }
    196177        if (msg.msg_flags & MSG_TRUNC) {
    197             bb_error_msg("Message truncated");
     178            bb_error_msg("message truncated");
    198179            continue;
    199180        }
    200181        if (status) {
    201             bb_error_msg_and_die("!!!Remnant of size %d", status);
    202         }
    203     }
     182            bb_error_msg_and_die("remnant of size %d!", status);
     183        }
     184    }
     185}
     186
     187int xrtnl_dump_filter(struct rtnl_handle *rth,
     188        int (*filter)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
     189        void *arg1)
     190{
     191    int ret = rtnl_dump_filter(rth, filter, arg1/*, NULL, NULL*/);
     192    if (ret < 0)
     193        bb_error_msg_and_die("dump terminated");
     194    return ret;
    204195}
    205196
     
    234225
    235226    if (status < 0) {
    236         bb_perror_msg("Cannot talk to rtnetlink");
     227        bb_perror_msg("cannot talk to rtnetlink");
    237228        return -1;
    238229    }
     
    265256            if (l<0 || len>status) {
    266257                if (msg.msg_flags & MSG_TRUNC) {
    267                     bb_error_msg("Truncated message");
     258                    bb_error_msg("truncated message");
    268259                    return -1;
    269260                }
    270                 bb_error_msg_and_die("!!!malformed message: len=%d", len);
     261                bb_error_msg_and_die("malformed message: len=%d!", len);
    271262            }
    272263
     
    304295            }
    305296
    306             bb_error_msg("Unexpected reply!!!");
     297            bb_error_msg("unexpected reply!");
    307298
    308299            status -= NLMSG_ALIGN(len);
     
    310301        }
    311302        if (msg.msg_flags & MSG_TRUNC) {
    312             bb_error_msg("Message truncated");
     303            bb_error_msg("message truncated");
    313304            continue;
    314305        }
    315306        if (status) {
    316             bb_error_msg_and_die("!!!Remnant of size %d", status);
    317         }
    318     }
    319 }
    320 
    321 int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
     307            bb_error_msg_and_die("remnant of size %d!", status);
     308        }
     309    }
     310}
     311
     312int addattr32(struct nlmsghdr *n, int maxlen, int type, uint32_t data)
    322313{
    323314    int len = RTA_LENGTH(4);
     
    348339}
    349340
    350 int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data)
     341int rta_addattr32(struct rtattr *rta, int maxlen, int type, uint32_t data)
    351342{
    352343    int len = RTA_LENGTH(4);
     
    390381    }
    391382    if (len) {
    392         bb_error_msg("!!!Deficit %d, rta_len=%d", len, rta->rta_len);
    393     }
    394     return 0;
    395 }
     383        bb_error_msg("deficit %d, rta_len=%d!", len, rta->rta_len);
     384    }
     385    return 0;
     386}
Note: See TracChangeset for help on using the changeset viewer.